/**
 * news-detail.css
 * Page-Specific styles for the News Article Detail.
 * Uses global IPS Design System from style.css.
 */

/* ═══════════════════════════════════════════════════════════════
   PAGE STRUCTURE
   ═══════════════════════════════════════════════════════════════ */
.news-content-section {
    padding: 140px 0 100px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%),
        radial-gradient(circle at 80% 20%, rgba(var(--ips-red-rgb), 0.04) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(var(--ips-red-rgb), 0.04) 0%, transparent 40%) !important;
    position: relative;
    overflow: hidden;
}

.content-outer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.news-detail-header {
    margin-bottom: 50px;
    text-align: center;
}

.news-detail-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 850;
    line-height: 1.05;
    color: var(--ips-text);
    letter-spacing: -0.05em;
    margin-top: 20px;
}

.news-detail-title span {
    color: var(--ips-red);
}

/* ═══════════════════════════════════════════════════════════════
   ARTICLE CONTENT GLASS CARD
   ═══════════════════════════════════════════════════════════════ */
.article-glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 32px;
    padding: 60px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    margin-top: 40px;
    opacity: 0;
    /* Handled by GSAP */
    transform: translateY(30px);
    /* Handled by GSAP */
}

.article-text {
    font-size: 1.2rem;
    line-height: 1.85;
    color: var(--ips-text);
    max-width: 850px;
    margin: 0 auto;
}

.article-text p {
    margin-bottom: 30px;
    opacity: 0.85;
}

.article-text h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ips-text);
    margin: 60px 0 30px;
    letter-spacing: -0.03em;
    position: relative;
    padding-left: 20px;
}

.article-text h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 6px;
    background: var(--ips-red);
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════════
   GALLERY ENGINE STYLES
   ═══════════════════════════════════════════════════════════════ */
.news-gallery-block {
    margin-bottom: 30px;
}

.section-header-mini {
    text-align: center;
    margin-bottom: 40px;
}

.section-header-mini h2 {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

.section-header-mini h2 span {
    color: var(--ips-red);
}

.gallery-grid {
    display: grid;
    /* Fixed 3-column logic for symmetry as requested */
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 24px;
    margin: 0 auto;
}

.gallery-grid.single-image,
.gallery-grid:has(> .gallery-item:only-child) {
    display: flex !important;
    justify-content: center !important;
    grid-template-columns: none !important;
    max-width: 100% !important;
}

.gallery-grid.single-image .gallery-item,
.gallery-grid:has(> .gallery-item:only-child) .gallery-item {
    width: 100% !important;
    max-width: 850px !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
    aspect-ratio: 16/10;
    /* Sleeker widescreen ratio */
    cursor: zoom-in;
    /* Indicate clickable full screen */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    /* Dynamically staggered by GSAP */
    transform: translateY(20px) scale(0.95);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
    border-color: var(--ips-red-border);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX CAROUSEL (Clean-Tech Scroll-Snap)
   ═══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    /* Deep slate glass */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-carousel {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.lightbox-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    padding: 60px;
}

.lightbox-slide img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    background: #000;
    /* Backdrop for transparent images if any */
}

/* CAROUSEL NAVIGATION ARROWS */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2002;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.lightbox-nav:hover {
    background: var(--ips-red);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2005;
    opacity: 0.7;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: var(--ips-red);
    opacity: 1;
}

@media (max-width: 768px) {
    .lightbox-nav {
        display: none;
    }

    /* Use native swipe on mobile */
    .lightbox-slide {
        padding: 20px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .article-glass-card {
        padding: 40px 30px;
    }

    .gallery-grid:not(.single-image) {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns for tablet */
    }
}

@media (max-width: 768px) {
    .news-content-section {
        padding-top: 100px;
    }

    .news-detail-title {
        font-size: 2.2rem;
    }

    .article-glass-card {
        border-radius: 20px;
        padding: 40px 24px;
    }

    .article-text {
        font-size: 1.1rem;
    }

    .gallery-grid:not(.single-image) {
        grid-template-columns: 1fr;
        /* 1 column for mobile */
    }

    .gallery-grid.single-image .gallery-item {
        max-width: 100% !important;
        border-radius: 16px !important;
    }
}