/* =====================================================
   NEWS (v2) — Coteccons
   Desktop max-width: 1440px, side-padding: 56px
   Mobile  side-padding: 16px
   Content column: 1328px
   =====================================================
   COLOR TOKENS (from Figma)
   - Blue 500     #264ABC  primary brand
   - Grey 100     #F7F6F5  card background
   - Grey Text    #333333  body text
   ===================================================== */

:root {
    --n-blue: #264ABC;
    --n-grey-100: #F7F6F5;
    --n-grey-text: #333333;
    --n-font: 'Lexend Deca', sans-serif;
    --n-side-px: 56px;
    --n-side-px-mb: 16px;
}

/* ─────────────────────────────────────────
   HERO SECTION
───────────────────────────────────────── */
.news-hero {
    background: #fff;
    padding: 80px var(--n-side-px) 40px;
}

.news-hero__inner {
    max-width: 1328px;
    margin: 0 auto;
}

.news-hero__header {
    margin-bottom: 40px;
}

.news-hero__title {
    font-family: var(--n-font);
    font-size: 64px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--n-blue);
    margin: 0;
}

/* ─────────────────────────────────────────
   FEATURED NEWS SLIDER
───────────────────────────────────────── */
.news-featured-swiper {
    position: relative;
}

    .news-featured-swiper .swiper-pagination {
        display: none;
    }

/* ─────────────────────────────────────────
   FEATURED NEWS CARD
───────────────────────────────────────── */
.news-featured {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-featured__img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.news-featured__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-featured:hover .news-featured__img {
    transform: scale(1.04);
}

.news-featured__body {
    background: var(--n-grey-100);
    padding: 40px;
}

.news-featured__meta {
    display: flex;
    align-items: center;
    gap: 80px;
    margin-bottom: 24px;
}

.news-featured__tag {
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--n-blue);
}

.news-featured__date {
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--n-grey-text);
}

.news-featured__title {
    font-family: var(--n-font);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--n-grey-text);
    text-transform: none;
    margin: 0;
    text-decoration: none;
    transition: text-decoration-color 0.2s ease;
    text-decoration-color: transparent;
}

.news-featured:hover .news-featured__title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ─────────────────────────────────────────
   MOBILE / TABLET  (< 1024px)
───────────────────────────────────────── */
@media (max-width: 1023px) {
    .news-hero {
        padding: 48px var(--n-side-px-mb) 24px;
    }

    .news-hero__header {
        margin-bottom: 24px;
    }

    .news-hero__title {
        font-size: 48px;
    }

    .news-featured__body {
        padding: 24px;
    }

    .news-featured__meta {
        justify-content: space-between;
    }

    .news-featured__date {
        font-size: 12px;
        font-weight: 300;
    }

    .news-featured__title {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════
   NEWS LISTING SECTION
═══════════════════════════════════════════════════ */
.news-listing {
    background: #fff;
    padding: 80px var(--n-side-px);
}

.news-listing__inner {
    max-width: 1328px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────
   FILTER TABS
───────────────────────────────────────── */
.news-filter {
    border-bottom: 2px solid #e4e2df;
    margin-bottom: 24px;
}

.news-filter__track {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.news-filter__tab {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    height: 56px;
    background: none;
    border: none;
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
    padding: 0;
    position: relative;
    margin-bottom: -2px; /* overlap parent 2px border so ::after aligns with it */
    transition: color 0.2s ease, font-weight 0.2s ease;
}

    /* Blue underline — expands from center, matching au-board__tab animation */
    .news-filter__tab::after {
        content: '';
        position: absolute;
        bottom: 0; /* within element bounds — never clipped by overflow */
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background: var(--n-blue);
        transition: width 0.4s ease;
    }

    .news-filter__tab.is-active {
        font-weight: 600;
        color: var(--n-blue);
    }

        .news-filter__tab.is-active::after {
            width: 100%;
        }

    .news-filter__tab:hover:not(.is-active) {
        color: var(--n-blue);
    }

        .news-filter__tab:hover:not(.is-active)::after {
            width: 50%;
        }

/* ─────────────────────────────────────────
   NEWS GRID  (3-column desktop)
───────────────────────────────────────── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 24px;
    row-gap: 80px;
    margin-bottom: 64px;
}

/* ─────────────────────────────────────────
   NEWS CARD
───────────────────────────────────────── */
.news-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.news-card__img-wrap {
    width: 100%;
    aspect-ratio: 427 / 327;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    max-width: 427px;
    max-height: 327px;
}

.news-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dark overlay — appears on hover */
.news-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.news-card:hover .news-card__overlay {
    opacity: 1;
}

/* Arrow icon — always visible, vertical slide on hover */
.news-card__arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--n-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
}

.news-card__arrow-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 16px;
    transform: translate(-50%, -50%) rotate(-45deg);
    transition: transform 0.35s ease;
    flex-shrink: 0;
}

.news-card:hover .news-card__arrow {
    opacity: 1;
}

/* icon--2 hides bottom-left by default */
.news-card__arrow-icon--2 {
    transform: translate(calc(-50% - 48px), calc(-50% + 48px)) rotate(-45deg);
}

/* On hover: icon--1 slides to top-right, icon--2 slides in from bottom-left */
.news-card__arrow:hover .news-card__arrow-icon:not(.news-card__arrow-icon--2) {
    transform: translate(calc(-50% + 48px), calc(-50% - 48px)) rotate(-45deg);
}

.news-card__arrow:hover .news-card__arrow-icon--2 {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Gallery badge (Thư viện cards) — bottom-right of image */
.news-card__gallery-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    background: #f7f6f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--n-blue);
    pointer-events: none;
}

.news-card__body {
    display: flex;
    flex-direction: column;
    padding-top: 24px;
}

.news-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.news-card__tag {
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--n-blue);
}

.news-card__date {
    font-family: var(--n-font);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--n-grey-text);
    white-space: nowrap;
}

.news-card__title {
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--n-grey-text);
    margin: 0;
}

/* ─────────────────────────────────────────
   PAGINATION
───────────────────────────────────────── */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.news-pagination__pages {
    display: flex;
    align-items: center;
    gap: 24px;
}

.news-pagination__btn {
    border: 1px solid var(--n-blue) !important;
}

.news-pagination__btn,
.news-pagination__page {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
    font-family: var(--n-font);
    font-size: 16px;
    font-weight: 500;
    color: var(--n-blue);
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    border: none;
}

    .news-pagination__btn:hover,
    .news-pagination__page:hover:not(.is-active) {
        background: var(--n-blue);
        color: #fff;
    }

    .news-pagination__page.is-active {
        background: var(--n-blue);
        color: #fff;
        pointer-events: none;
    }

/* ─────────────────────────────────────────
   LISTING · MOBILE / TABLET  (< 1024px)
───────────────────────────────────────── */
@media (max-width: 1023px) {
    .news-filter__tab::after {
        height: 3px;
    }

    .news-filter {
        border-bottom: 1px solid #e4e2df;
    }

    .news-listing {
        padding: 24px var(--n-side-px-mb) 40px;
    }

    /* Filter: horizontally scrollable, hide scrollbar */
    .news-filter {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .news-filter::-webkit-scrollbar {
            display: none;
        }

    .news-filter__track {
        gap: 40px;
    }

    .news-filter__tab {
        height: 48px;
    }

    /* Single-column grid */
    .news-grid {
        grid-template-columns: 1fr;
        row-gap: 40px;
        margin-bottom: 40px;
    }

    /* Slightly different image ratio on mobile */
    .news-card__img-wrap {
        aspect-ratio: 408 / 308;
        width: 100%;
    }

    .news-card__body {
        padding-top: 12px;
    }

    .news-card__meta {
        margin-bottom: 12px;
    }

    /* Pagination: smaller buttons to fit mobile viewport */
    .news-pagination {
        gap: 16px;
    }

    .news-pagination__pages {
        gap: 8px;
    }

    .news-pagination__btn,
    .news-pagination__page {
        width: 40px;
        height: 40px;
    }

        .news-pagination__btn svg {
            width: 16px;
            height: 12px;
        }
}

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX  (moved from library.css — used by news.html only)
   Desktop: 958px white dialog, 40px inner padding → 878px
   Mobile:  full-screen dark overlay
═══════════════════════════════════════════════════════════ */

/* ── Color tokens re-used by lightbox ── */
:root {
    --lib-blue: #264ABC;
    --lib-grey-100: #F7F6F5;
    --lib-border: #E4E2DF;
    --lib-font: 'Lexend Deca', sans-serif;
}

/* ── Animate.css speed override for dialog ── */
#libLightbox .lib-lightbox__dialog {
    --animate-duration: 0.35s;
}

/* Full-screen overlay */
.lib-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    overflow: hidden; /* prevent scrollbar flash during open/close animation */
    padding: 24px 16px;
}

    .lib-lightbox[hidden] {
        display: none !important;
    }

/* Invisible backdrop layer for click-outside-to-close */
.lib-lightbox__backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
}

/* Dialog panel */
.lib-lightbox__dialog {
    position: relative;
    width: 100%;
    max-width: 958px;
    background: #ffffff;
    flex-shrink: 0;
}

/* ─── Top action bar ─── */
.lib-lightbox__topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 40px 0;
    min-height: 80px;
    gap: 12px;
}

.lib-lightbox__btn-album {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 16px 24px;
    background: var(--lib-blue);
    border: 1px solid var(--lib-border);
    color: #fff;
    font-family: var(--lib-font);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

    .lib-lightbox__btn-album:hover {
        background: #1a3597;
    }

        .lib-lightbox__btn-album:hover span {
            text-decoration: underline;
        }

.lib-lightbox__topbar-right {
    display: flex;
    flex-shrink: 0;
}

.lib-lightbox__icon-btn {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lib-grey-100);
    border: 1px solid var(--lib-border);
    color: #000;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .lib-lightbox__icon-btn:hover {
        border-color: var(--lib-blue);
    }

/* Share icon hidden on desktop */
.lib-lightbox__btn-share {
    display: none;
}

/* ─── Info bar (desktop only) ─── */
.lib-lightbox__infobar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 40px 0;
}

.lib-lightbox__info-title {
    flex: 1;
    font-family: var(--lib-font);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.25;
    color: #333333;
    margin: 0;
    text-transform: unset;
}

.lib-lightbox__info-right {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    flex-shrink: 0;
}

.lib-lightbox__info-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lib-lightbox__info-label {
    font-family: var(--lib-font);
    font-size: 16px;
    font-weight: 400;
    color: #767676;
    line-height: 1.5;
}

.lib-lightbox__info-date {
    font-family: var(--lib-font);
    font-size: 16px;
    font-weight: 400;
    color: #333333;
    line-height: 1.5;
}

.lib-lightbox__socials {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lib-lightbox__social {
    display: inline-flex;
    align-items: center;
    color: var(--lib-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

    .lib-lightbox__social:hover {
        opacity: 0.7;
    }

/* Separator line */
.lib-lightbox__divider {
    height: 1px;
    background: var(--lib-border);
    margin: 18px 40px 0;
}

/* ─── Carousel stage ─── */
.lib-lightbox__stage {
    margin-top: 12px;
    padding: 0 40px;
}

/* Per-image download button */
.lib-lightbox__btn-dlimg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid var(--lib-border);
    color: #767676;
    font-family: var(--lib-font);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .lib-lightbox__btn-dlimg svg {
        color: var(--lib-blue);
        flex-shrink: 0;
    }

    .lib-lightbox__btn-dlimg:hover {
        /* background: var(--lib-grey-100); */
        border-color: var(--lib-blue);
    }

        .lib-lightbox__btn-dlimg:hover span {
            color: var(--lib-blue);
        }

/* Image carousel — max-height scales with viewport height on desktop */
.lib-lightbox__carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 878 / 659;
    max-height: 360px; /* viewport height ≤ 768 */
}

.lib-lightbox__topbar {
    padding: 16px 40px 0;
}

.lib-lightbox__info-title {
    font-size: 18px;
}

.lib-lightbox__info-col {
    gap: 8px;
}

@media (min-width: 1024px) and (min-height: 900px) {
    .lib-lightbox__stage {
        margin-top: 12px;
    }

    .lib-lightbox__carousel {
        max-height: 560px;
    }

    .lib-lightbox__topbar {
        padding: 24px 40px 0;
    }

    .lib-lightbox__info-title {
        font-size: 24px;
    }

    .lib-lightbox__info-col {
        gap: 12px;
    }
}

@media (min-width: 1024px) and (min-height: 1080px) {
    .lib-lightbox__carousel {
        max-height: 659px;
    }
}

/* Swiper wrapper fills the aspect-ratio / max-height container */
.lib-lightbox__carousel .swiper-wrapper {
    height: 100%;
}

.lib-lightbox__slide {
    height: 100%;
    overflow: hidden;
}

    .lib-lightbox__slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        user-select: none;
        -webkit-user-drag: none;
    }

/* Prev / Next navigation arrows */
.lib-lightbox__nav:hover {
    background: var(--lib-blue);
}

    .lib-lightbox__nav:hover svg path {
        stroke: #fff;
    }

.lib-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: var(--lib-blue);
    transition: background 0.2s ease;
    opacity: 0.6;
}

    .lib-lightbox__nav.swiper-button-disabled {
        opacity: 0.35;
        pointer-events: none;
        cursor: default;
    }

.lib-lightbox__nav--prev {
    left: 40px;
}

.lib-lightbox__nav--next {
    right: 40px;
}

/* ─── Slide indicators ─── */
.lib-lightbox__indicators {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 0 40px 24px;
    margin-top: 32px;
}

.lib-lightbox__indicator {
    flex: 1;
    max-width: 89px;
    height: 4px;
    background: #a2a09e;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .lib-lightbox__indicator.is-active {
        background: var(--lib-blue);
    }

/* ─── Mobile bottom info (hidden on desktop) ─── */
.lib-lightbox__mobile-info {
    display: none;
}

/* ─────────────────────────────────────────
   LIGHTBOX — MOBILE (≤ 1023px)
───────────────────────────────────────── */
@media (max-width: 1023px) {
    .lib-lightbox {
        padding: 0;
        align-items: flex-start;
        background: rgba(0, 0, 0, 0.95);
        overflow-y: hidden;
    }

    .lib-lightbox__dialog {
        max-width: 100%;
        height: 100svh;
        height: 100vh; /* fallback */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #000;
    }

    .lib-lightbox__topbar {
        padding: 12px 16px;
        min-height: 70px;
        justify-content: flex-end;
        gap: 12px;
        flex-shrink: 0;
    }

    .lib-lightbox__btn-album {
        font-size: 16px;
        font-weight: 600;
        height: 40px;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.15);
        border-color: #605f5e;
        color: #e4e2df;
    }

        .lib-lightbox__btn-album:hover {
            background: rgba(255, 255, 255, 0.25);
        }

    .lib-lightbox__topbar-right {
        gap: 12px;
    }

    .lib-lightbox__icon-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.15);
        border-color: #605f5e;
        color: #e4e2df;
    }

        .lib-lightbox__icon-btn:hover {
            background: rgba(255, 255, 255, 0.25);
        }

    .lib-lightbox__btn-share {
        display: inline-flex;
    }

    .lib-lightbox__infobar,
    .lib-lightbox__divider,
    .lib-lightbox__btn-dlimg {
        display: none;
    }

    .lib-lightbox__stage {
        margin-top: 0;
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .lib-lightbox__carousel {
        aspect-ratio: auto;
        flex: 1;
        min-height: 0;
        max-height: none;
    }

    .lib-lightbox__slide img {
        object-fit: contain;
    }

    .lib-lightbox__nav {
        display: none;
    }

    .lib-lightbox__indicators {
        gap: 12px;
        padding: 0 16px;
        padding-bottom: 0;
        margin-top: 12px;
        flex-shrink: 0;
    }

    .lib-lightbox__indicator {
        max-width: 40px;
    }

    .lib-lightbox__mobile-info {
        display: block;
        padding: 32px 16px 24px;
        flex-shrink: 0;
    }

    .lib-lightbox__mobile-date {
        font-family: var(--lib-font);
        font-size: 16px;
        font-weight: 400;
        color: #c0c0c0;
        margin: 0 0 6px;
        line-height: 1.5;
    }

    .lib-lightbox__mobile-title {
        font-family: var(--lib-font);
        font-size: 20px;
        font-weight: 500;
        line-height: 1.3;
        color: #c0c0c0;
        margin: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   END LIGHTBOX
═══════════════════════════════════════════════════════════ */
