/* news_detail.css - Стили для страницы детального просмотра новости */
/* Версия: 2.0 */

/* ===== Variables (наследуем из новостей) ===== */
:root {
    --news-primary: #032D43;
    --news-primary-light: rgba(3, 45, 67, 0.08);
    --news-primary-dark: #021F2E;
    --news-text-dark: #1A1A1A;
    --news-text-gray: #6B7280;
    --news-text-light: #9CA3AF;
    --news-bg-light: #F9FAFB;
    --news-bg-white: #FFFFFF;
    --news-border: rgba(3, 45, 67, 0.1);
    --news-border-light: rgba(3, 45, 67, 0.05);
    --news-border-dark: rgba(3, 45, 67, 0.2);
    --news-shadow-sm: 0 1px 2px rgba(3, 45, 67, 0.05);
    --news-shadow-md: 0 2px 4px rgba(3, 45, 67, 0.1);
    --news-shadow-lg: 0 4px 8px rgba(3, 45, 67, 0.1);
    --news-shadow-xl: 0 8px 16px rgba(3, 45, 67, 0.1);
    --news-radius-sm: 8px;
    --news-radius-md: 12px;
    --news-radius-lg: 16px;
    --news-radius-full: 999px;
}

/* ===== Base Styles ===== */
.news-detail-page {
    font-family: 'Manrope', sans-serif;
    color: var(--news-text-dark);
    background-color: var(--news-bg-light);
    min-height: 100vh;
    margin-top: 0;
}

.news-detail-page .container {
    max-width: 1650px;
    margin: 0 auto;
    padding: 0 120px;
}

@media (max-width: 1400px) {
    .news-detail-page .container {
        padding: 0 80px;
    }
}

@media (max-width: 1200px) {
    .news-detail-page .container {
        padding: 0 60px;
    }
}

@media (max-width: 992px) {
    .news-detail-page .container {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .news-detail-page .container {
        padding: 0 24px;
    }
}

/* ===== Breadcrumbs ===== */
.news-detail-breadcrumbs {
    background: var(--news-bg-white);
    border-bottom: 1px solid var(--news-border);
    padding: 16px 0;
    margin-bottom: 0;
}

.breadcrumbs-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--news-text-gray);
}

.breadcrumb-link {
    color: var(--news-text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--news-primary);
}

.breadcrumb-separator {
    font-size: 12px;
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--news-primary);
    font-weight: 500;
}

/* ===== Header Section ===== */
.news-detail-main-section {
    padding: 32px 0;
}

/* Кнопка назад наверх */
.news-detail-back-top {
    margin-bottom: 20px;
}

.news-detail-back-top .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--news-bg-white);
    color: var(--news-primary);
    border: 1px solid var(--news-border);
    border-radius: var(--news-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--news-shadow-sm);
}

.news-detail-back-top .back-link:hover {
    background: var(--news-primary);
    color: white;
    border-color: var(--news-primary);
    transform: translateX(-4px);
    box-shadow: var(--news-shadow-md);
}

.news-detail-back-top .back-link i {
    font-size: 14px;
}

/* Заголовок */
.news-detail-title {
    color: var(--news-primary);
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .news-detail-title {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
}

/* Мета-строка */
.news-detail-meta-line {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--news-radius-sm);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--news-shadow-sm);
    border: none;
}

.news-detail-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--news-text-gray);
}

.news-detail-date i {
    color: var(--news-primary);
}

/* Компактная строка с информацией */
.news-detail-info-compact {
    background: var(--news-bg-white);
    border-radius: var(--news-radius-md);
    padding: 12px 20px;
    margin-bottom: 24px;
    border: 1px solid var(--news-border);
    box-shadow: var(--news-shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.info-compact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--news-text-gray);
}

.info-compact-item i {
    color: var(--news-primary);
    width: 16px;
    font-size: 14px;
}

.info-compact-divider {
    color: var(--news-border-dark);
    font-size: 12px;
    opacity: 0.5;
}

@media (max-width: 992px) {
    .news-detail-info-compact {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .news-detail-info-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .info-compact-divider {
        display: none;
    }
}

/* Краткое описание */
.news-detail-short {
    font-size: 16px;
    line-height: 1.6;
    color: var(--news-text-gray);
    margin: 0 0 24px 0;
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--news-border-light);
}

/* Подробное описание */
.news-detail-description {
    background: var(--news-bg-white);
    border-radius: var(--news-radius-md);
    box-shadow: var(--news-shadow-md);
    padding: 24px;
    border: 1px solid var(--news-border);
    margin-bottom: 32px;
}

.news-detail-description h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--news-primary);
    margin: 0 0 16px 0;
}

.news-detail-description p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--news-text-gray);
    margin: 0 0 16px 0;
}

.news-detail-description p:last-child {
    margin-bottom: 0;
}

/* Секция галереи */
.news-detail-gallery-section {
    margin-bottom: 32px;
}

.gallery-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--news-primary);
    margin: 0 0 16px 0;
}

/* Сетка фото - максимум 3 в ряд */
.news-detail-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.news-detail-photos-grid[data-photos-count="1"] {
    grid-template-columns: minmax(300px, 500px);
}

.news-detail-photos-grid[data-photos-count="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
}

@media (max-width: 768px) {
    .news-detail-photos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .news-detail-photos-grid {
        grid-template-columns: 1fr !important;
    }
}

.photo-grid-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--news-radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--news-shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--news-border);
}

.photo-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--news-shadow-md);
    border-color: var(--news-primary);
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-grid-item:hover img {
    transform: scale(1.05);
}

/* Удалить старую кнопку внизу */
.news-detail-back {
    display: none;
}

/* ===== Модальное окно (исправленное) ===== */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    z-index: 1001;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    background: transparent;
    border-radius: var(--news-radius-lg);
    overflow: hidden;
    box-shadow: var(--news-shadow-xl);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--news-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--news-primary);
    transition: all 0.3s ease;
    z-index: 1003;
    box-shadow: var(--news-shadow-md);
    border: none;
}

.modal-close:hover {
    background: var(--news-primary);
    color: white;
    transform: scale(1.1) rotate(90deg);
}

.modal-close i {
    font-size: 20px;
}

#modalImage {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: var(--news-radius-md);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .news-detail-main-section {
        padding: 24px 0;
    }

    .news-detail-back-top {
        margin-bottom: 16px;
    }

    .news-detail-back-top .back-link {
        width: 100%;
        justify-content: center;
    }

    .news-detail-description {
        padding: 20px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .modal-close i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    #modalImage {
        max-width: 95vw;
        max-height: 95vh;
    }
}