    :root {
      --accent: #0a66c2;
      --text: #333;
      --bg: #fff;
      --muted: #777;
      --radius: 8px;
      --shadow: 0 10px 25px rgba(0,0,0,0.15);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      transition: overflow 0.3s ease;
    }
    
    /* Блокировка скролла при открытом модальном окне */
    body.modal-open {
      overflow: hidden;
      height: 100vh;
    }
    
    header {
      border-bottom: 1px solid #eee;
      background: #fafafa;
      padding: 12px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
    }
    
    .logo-container {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: inherit;
      transition: all 0.2s ease;
      cursor: pointer;
    }
    
    .logo-container:hover {
      text-decoration: none;
      color: inherit;
    }
    
    .logo-container:visited {
      color: inherit;
      text-decoration: none;
    }
    .shapka_min {
      width: 36px;
      height: 36px;
}
    .logo {
      border-radius: 6px;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
	margin-right: 10px;
    }
    
    .logo:hover {
      transform: scale(1.05);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .headerH1 { 
      font-size: 20px; 
      color: var(--accent);
      margin: 0;
      transition: color 0.2s ease;
      display: inline-block;
      vertical-align: middle;
    }
    
    .logo-container:hover .headerH1 {
      color: #084c8d;
    }
    
    .logo-container:focus {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 4px;
    }
    
	a {
	color: #084c8d;
	text-decoration: none;
	font-weight: 500;
	}


    nav a {
      margin-left: 18px;
      color: var(--text);
      text-decoration: none;
      font-weight: 500;
    }
    nav a:hover { color: var(--accent); }



    main { max-width: 1000px; margin: 0 auto; padding: 30px 20px; }

    h2 { font-size: 24px; margin: 24px 0 10px; }
    p { margin-bottom: 12px; }

    .btn {
      display: inline-block;
      padding: 10px 18px;
      margin: 6px 8px 6px 0;
      background: var(--accent);
      color: #fff;
      border-radius: var(--radius);
      text-decoration: none;
      font-weight: 600;
      transition: background 0.2s, transform 0.1s;
    }
    .btn:hover { color: #FFF !important; background: #084c8d; transform: translateY(-1px); }

	


    .grid {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
    }
    .card {
      flex: 1 1 280px;
      border: 1px solid #eee;
      border-radius: var(--radius);
      background: #fafafa;
      padding: 16px;
      box-shadow: var(--shadow);
    }
    footer {
      margin-top: 40px;
      padding: 16px;
      text-align: center;
      font-size: 14px;
      color: var(--muted);
      border-top: 1px solid #eee;
    }
    footer a {
      color: var(--muted);
      text-decoration: none;
      font-weight: 400;
    }
    footer a:hover { color: var(--accent); }

/* ===== Модальные окна ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: fadeIn 0.3s ease;
    padding: 20px !important; /* Принудительно */
    backdrop-filter: blur(2px);
}
.modal-overlay.active { 
    display: flex !important; /* Принудительно */
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.25s ease;
    
    /* Принудительные минимальные размеры */
    min-width: 400px !important;
    width: auto !important;
}

.modal-body {
    width: 100% !important;
    height: 100% !important;
    overflow: auto;
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 20px !important;
    min-height: 200px;
    min-width: 350px !important;
}

/* Специальные стили для разных типов контента */

/* Изображения - адаптивные */
/* Специальные стили для изображений с !important */
.modal-body img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 200px !important;
    min-height: 150px !important;
}

.modal-body iframe {
    width: 100%;
    height: 80vh;
    min-height: 500px;
    border: none;
    border-radius: 5px;
}

.modal-body video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 5px;
}

/* Стили для HTML-контента */
.modal-body .modal-html-content {
    width: 100%;
    max-width: 800px; /* Увеличена максимальная ширина */
    min-width: 400px; /* Минимальная ширина */
    padding: 30px;
}

.modal-body .modal-html-content h3 {
    margin-bottom: 15px;
    color: var(--accent);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    text-align: center;
    line-height: 34px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    transform: scale(1.1);
}

/* Индикатор загрузки */
.modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 16px;
    color: var(--muted);
}

.modal-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Специальные классы для изображений */
.modal-image-overlay {
    padding: 20px !important;
    background: rgba(0,0,0,0.7) !important;
}

.modal-image-content {
    min-width: 400px !important;
    min-height: 300px !important;
    padding: 10px !important;
    background: #f8f9fa !important;
}

.modal-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}


@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Улучшенная адаптивность с !important */
@media (max-width: 768px) {
    .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 10px;
        min-width: 300px !important;
    }
    
    .modal-body {
        padding: 15px !important;
        min-width: 280px !important;
    }
}
    
    .modal-body iframe {
        height: 70vh;
        min-height: 400px;
    }
    
    .modal-body img {
        max-height: 70vh;
    }
    
    .modal-body .modal-html-content {
        max-width: 95vw;
        min-width: 280px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        min-width: 280px; /* Еще меньше на маленьких экранах */
    }
    
    .modal-body {
        min-width: 260px;
        padding: 10px;
    }
    
    .modal-body .modal-html-content {
        padding: 15px;
    }
    
    .modal-body img {
        min-width: 150px; /* Уменьшены минимальные размеры изображений */
        min-height: 100px;
    }
}
      .logo {
        width: 32px;
        height: 32px;
      }
      
      header h1 {
        font-size: 18px;
      }
      
      .logo-container {
        gap: 10px;
      }
    }

    @media (max-width: 600px) {
      header { 
        flex-direction: column; 
        align-items: flex-start;
        gap: 12px;
      }
      
      .logo {
        width: 28px;
        height: 28px;
      }
      
      header h1 {
        font-size: 16px;
      }
      
      .logo-container {
        gap: 8px;
      }
      
      nav a { margin-left: 0; margin-right: 12px; }
      h2 { font-size: 20px; }
      
      .modal-overlay {
        padding: 10px;
      }
      
      .modal-body iframe {
        height: 60vh;
        min-height: 350px;
      }
    }

    /* Стили для ошибок */
    .modal-error {
      text-align: center;
      padding: 40px 20px;
      color: #e74c3c;
    }

    .modal-error h3 {
      margin-bottom: 10px;
    }

/* Стили для блога */
.blog-intro {
    /*background: #f8f9fa;*/
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    /*border-left: 4px solid #0a2e63;*/
}

.blog-post {
    max-width: 100%;
    line-height: 1.7;
}

.blog-post h1 {
    color: #0a2e63;
    margin-bottom: 10px;
}

.post-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.post-excerpt {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    font-style: italic;
}

.post-tags {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
}

.blog-list article {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 25px;
}

.bloks {
	border: 1px solid #eee;
	border-radius: var(--radius);
	background: #fafafa;
	padding: 16px;
	box-shadow: var(--shadow);
	margin-bottom: 40px;
}
	.bloks article a:hover { transform: translateY(-1px); text-decoration: underline;}

.bloks article h2 {
    margin-top: 0;
}

.bloks article h2 a {
    color: #0a2e63;
    text-decoration: none;
}

.bloks article h2 a:hover {
    text-decoration: underline;
}

.post-content a:hover {  color: #084c8d; transform: translateY(-1px); text-decoration: underline;}

/* Адаптивные изображения в блоге */
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
}

/* Исключение для головастиков LiveJournal */
.post-content img.i-ljuser-userhead {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    display: inline-block !important;
    margin: 0 4px 0 0 !important;
    vertical-align: -2px !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    border: none !important;
}

/* Переопределяем фиксированные размеры для обычных изображений */
.post-content img[width],
.post-content img[height] {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .post-content img {
        margin: 15px auto;
        min-width: 150px;
    }
    
    .post-content img.i-ljuser-userhead {
        width: 16px !important; /* Сохраняем размер на мобильных */
        height: 16px !important;
    }
}

@media (max-width: 480px) {
    .post-content img {
        margin: 10px auto;
        min-width: 120px;
        border-radius: 6px;
    }
}
/* Стили для блока комментариев */
.post-comments {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.post-comments strong {
    color: #333;
    margin-right: 10px;
}

.post-comments-list {
    margin: 10px 0;
}

.post-comments-list small {
    color: #666;
}

.post-comments-list a {
    color: #0a2e63;
    text-decoration: none;
}

.post-comments-list a:hover {
    text-decoration: underline;
}
/* Стили для тегов */
.tags-cloud {
    margin: 20px 0;
    line-height: 2;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 4px 12px;
    margin: 2px 4px 2px 0;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.tag:hover {
    background: #084c8d;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Размеры тегов для облака */
.tag-size-1 { font-size: 0.8em; padding: 2px 8px; }
.tag-size-2 { font-size: 0.9em; }
.tag-size-3 { font-size: 1em; }
.tag-size-4 { font-size: 1.1em; }
.tag-size-5 { font-size: 1.2em; }

.all-tags .tag {
    margin: 5px;
}
/* Стили для тегов через запятую */
.post-tags-list,
.post-tags {
    margin: 15px 0;
    color: #666;
    font-size: 0.9em;
}

.post-tags-list .tag,
.post-tags .tag {
    display: inline;
    background: none;
    color: #0a2e63;
    padding: 0;
    margin: 0;
    text-decoration: underline;
    font-size: inherit;
    border: none;
    border-radius: 0;
}

.post-tags-list .tag:hover,
.post-tags .tag:hover {
    background: none;
    color: #084c8d;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

.post-tags-list strong,
.post-tags strong {
    color: #333;
    margin-right: 5px;
}

/* Стили для хлебных крошек */
.breadcrumbs {
    font-size: 0.9em;
    margin-bottom: 20px;
    padding: 10px 0;
    color: #666;
    border-bottom: 1px solid #eee;
}

.breadcrumbs a {
    color: #0a2e63;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #08306b;
    text-decoration: underline;
}

.breadcrumbs span {
    color: #333;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

/* Подсветка текущей страницы */
.breadcrumbs span:last-child {
    color: #0a2e63;
    font-weight: 600;
}

/* Адаптивность для крошек */
@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.8em;
        overflow-x: auto;
        white-space: nowrap;
        padding: 8px 0;
    }
    
    .breadcrumb-separator {
        margin: 0 6px;
    }
}