/* Общие стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 80%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

/* Шапка */
.site-header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    border-bottom: #00D46E 3px solid;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.site-header .main-navigation a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}
.site-header .main-navigation a:hover {
    color: #00D46E;
}


/* Основной контент */
.site-content {
    padding: 20px 0;
}

/* Стили для статьи */
.news-article {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.article-title {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.article-subtitle {
    font-size: 1.4rem;
    color: #3756ef; /* Цвет из вашего PHP */
    margin-bottom: 1em;
    font-style: italic;
}

.article-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 1em;
}

.article-meta span {
    margin-right: 15px;
}

.article-lead-media {
    text-align: center; /* Центрируем содержимое */
}
.article-lead-media-block {
    /* display: inline-block; Позволяет блоку занимать только нужное место */
    text-align: left; /* Текст внутри блока выравнивается по левому краю */
    max-width: 100%; /* Ограничиваем ширину блока */
    margin-bottom: 1.5em; /* Отступ снизу для разделения с текстом */
}
.article-lead-media img,
.article-body img { /* общие стили для картинок в статье */
    max-width: 100%;
    height: auto;
    display: block;
    /* margin: 1em auto; Отступы сверху/снизу и центрирование */
    border-radius: 4px;
}
.article-lead-media div[style*="font-size: 13px"] { /* Подпись к картинке */
    text-align: center;
    font-size: 0.85em !important; /* Переопределяем инлайн стиль, если нужно */
    color: #555;
    /* margin-top: -0.5em; */
    margin-bottom: 1em;
}


.article-summary,
.article-lead-text {
    margin-bottom: 1.5em;
    font-size: 1.1em;
}

.article-body {
    font-size: 1.1em;
    line-height: 1.7;
}

.article-body p {
    margin-bottom: 1em;
}

.article-body h2, .article-body h3, .article_body h4 {
    color: #333;
    margin-top: 1.5em;
    margin-bottom: 0.7em;
}

.article-original-link {
    margin-top: 2em;
    text-align: right;
    font-size: 0.9em;
}
.article-original-link a {
    color: #007bff;
    text-decoration: none;
}
.article-original-link a:hover {
    text-decoration: underline;
}

.paywall-indicator, .article-voice {
    margin: 1em 0;
}

.content-embedded-articles {
    border: 1px solid #3b3e3f;
    border-radius: 16px;
    margin-bottom: 30px;
    margin-top: 30px;
    padding: 16px;
}


/* Стили для галереи, видео, аудио - как в PHP */
.pullout  {
    float: right;
    position: relative;
    max-width: 300px;
    padding: 15px; /* Немного изменил паддинги */
    padding-left: 25px;
    font-size: 1rem; /* Сделал поменьше, чтобы лучше вписывалось */
    font-weight: 600;
    text-align: left;
    color: #130640;
    background-color: #f2f2ec;
    margin-left: 20px; /* Отступ слева от основного текста */
    margin-bottom: 15px;
    border-left: 3px solid #00D46E; /* Декоративная линия */
}
.gallery { text-align: center; margin-bottom: 1.5em; }
.gallery:after { display: block; height: 1px; margin: 1em 0 1.5em; background-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(150,150,150,1) 50%, rgba(0,0,0,0) 100%); }
.gallery img { height: 100%; }
/* .gallery a { width: 180px; height: 135px; display: inline-block; overflow: hidden; margin: 4px; box-shadow: 0 0 5px rgba(0,0,0,0.2); border-radius: 3px; } */
.gallery a { display: inline-block; overflow: hidden; margin: 4px; box-shadow: 0 0 5px rgba(0,0,0,0.2); border-radius: 3px; }
.gallery a:hover { box-shadow: 0 0 8px rgba(0,0,0,0.4); }

/* .gallery-item {
  width: 200px;
  padding: 5px;
} */

.lightgallery-target-container { /* Класс для div, в котором лежат ссылки <a> */
    display: flex;
    flex-wrap: wrap; /* Позволяет миниатюрам переноситься */
    justify-content: flex-start; /* или center, space-between и т.д. */
    gap: 5px; /* Пространство между миниатюрами (современный способ) */
    /* border: 1px dashed blue; */ /* Для отладки */
    margin-bottom: 15px; /* Отступ после блока галереи */
}

.lightgallery-target-container > a {
    display: block; /* Чтобы ссылка занимала место как блок */
    /* margin: 3px; */ /* Если не используется gap */
    /* border: 1px dashed red; */ /* Для отладки */
    line-height: 0; /* Убирает возможные лишние отступы под картинкой, если она display: inline-block */
}

.lightgallery-target-container > a > img {
    display: block;
    /* Определите желаемый размер миниатюр на странице */
    width: 120px;  /* Пример ширины */
    height: 80px; /* Пример высоты */
    object-fit: cover; /* Масштабирует и обрезает изображение, чтобы оно заполнило размеры, сохраняя пропорции */
    border: 1px solid #ddd;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lightgallery-target-container > a:hover > img {
    opacity: 0.8; /* Эффект при наведении */
}

.lg-inline-gallery-container {
    max-width: 1160px;
    height: 830px;
    position: relative;
}

.media-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
    object-fit: contain;
    transition: max-height 0.3s ease;
}

.rotate-1 {
  transform: rotate(90deg); /* Поворот на 90 градусов по часовой стрелке */
}

.fragment-embed--youtube>iframe {
    height: 100%;
    width: 100%;
    max-width: 100% !important;
}

.video-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Соотношение сторон 16:9 (315/560*100) */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* Подвал */
.site-footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 2rem 0;
    margin-top: 20px;
    font-size: 0.9rem;
}
.site-footer a {
    color: #00D46E;
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}


/* Модальное окно */
/* Стиль модального фона */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.modal img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

/* Чтобы избежать скролла фоном при открытии */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}

/* Summarize */
.summary-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.summary-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    user-select: none;
    transition: background-color 0.3s ease;
}

.summary-header:hover {
    background-color: rgba(255,255,255,0.1);
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.summary-toggle {
    font-size: 24px;
    transition: transform 0.3s ease;
    color: rgba(255,255,255,0.8);
}

.summary-toggle.expanded {
    transform: rotate(180deg);
}

.summary-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    background: white;
}

.summary-content.expanded {
    max-height: 10000px;
    padding: 0 20px 20px 20px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.thesis-text-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.thesis-text-link:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Стили для переключателя коротко/подробно */
/* .summary-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
} */

.toggle-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #6c757d;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.toggle-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Стили для ссылок в тезисах */
.thesis-text-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 4px 0;
}

.thesis-text-link:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Адаптивность (очень базовый пример) */
@media(max-width: 768px) {
    .container {
        width: 95%;
        max-width: 1200px;
        margin: auto;
        overflow: hidden;
        padding: 0 5px;
    }
    .site-header .container {
        flex-direction: column;
    }
    .site-header .main-navigation {
        margin-top: 10px;
    }
    .pullout {
        float: none;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .article-title {
        font-size: 1.3rem;
        color: #333;
        margin-bottom: 0.5em;
        font-weight: 600;
    }

    .lg-inline-gallery-container {
        max-width: 750px;
        height: 535px;
        position: relative;
    }

    .summary-header {
        padding: 15px;
    }

    .summary-content.expanded {
        padding: 0 15px 15px 15px;
    }

    .summary-toggle {
        width: 100%;
        max-width: none;
        margin-bottom: 16px;
    }

    .toggle-btn {
        padding: 14px 12px;
        font-size: 16px;
        min-height: 48px;
    }
}
