/* ======================================================================
   FILE: css/news_&_articles.css

   YOUR REQUIREMENT (FOLLOWED):
   ✅ Same styles / same UI (base styles unchanged)
   ✅ Do NOT change existing look
   ✅ Only responsive fixes via media queries
   ✅ Keep zoom-scrollbar fix exactly same
   ✅ Cover ALL widths from 240px up to 1600px (no gaps)
   ✅ Put ALL responsive code at the bottom
   ✅ Commented + organised
   ✅ Do not remove anything (your content preserved; duplicates organised)

   NOTE:
   - You pasted TWO responsive blocks (11.* + MODAL-ONLY block) that overlap.
   - I am NOT deleting either logic. I am keeping both, but ORGANISING them:
     1) BASE (your original)
     2) RESPONSIVE (ALL) 240px→1600+  (your 11.*)
     3) RESPONSIVE (MODAL ONLY) 240px→1600+  (your second block)
   - If same selector repeats later, LAST one wins (CSS rule). That is normal.
   ====================================================================== */


/* ---------------------------------------------------------
   0) HEADER / FOOTER PLACEHOLDERS (NO CHANGE)
--------------------------------------------------------- */
#header {
    min-height: 60px;
}

#footer {
    min-height: 140px;
}

/* ---------------------------------------------------------
   1) PAGE BACKGROUND (NO CHANGE)
--------------------------------------------------------- */
body {
    background: #f4f7fa;
}

/* =========================================================
   2) HERO / TOP BANNER (NO CHANGE BASE)
   ========================================================= */
.page-hero {
    background: linear-gradient(90deg, #6b1515, #b91c1c, #dc2626, #7f1d1d);
    color: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    /* reduced height */
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

.page-hero h1 {
    font-size: clamp(20px, 2vw, 28px);
    margin: 0;
    font-weight: 700;
}

.page-hero p {
    margin: 4px 0 0;
    font-size: 14px;
    opacity: .92;
}

/* =========================================================
   3) TOOLBAR (NO CHANGE BASE)
   ========================================================= */
.toolbar {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.toolbar .count-badge {
    background: #fff;
    color: #7f1d1d;
    border: 1px solid rgba(255, 255, 255, .5);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
    white-space: nowrap;
}

/* =========================================================
   4) GRID LAYOUT (CARDS) (NO CHANGE BASE)
   ========================================================= */
.articles-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.article-card {
    grid-column: span 4;
    /* desktop default */
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(15, 45, 64, .08);
    border: 1px solid rgba(0, 0, 0, .06);
    transition: transform .22s ease, box-shadow .22s ease;
    cursor: pointer;
    outline: none;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(15, 45, 64, .14);
}

/* Thumbnail box (16:10) */
.thumb {
    aspect-ratio: 16/10;
    background: #e9eef2;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform .28s ease;
    display: block;
}

.article-card:hover .thumb img {
    transform: scale(1.06);
}

/* Card meta */
.meta {
    padding: 12px 12px 14px;
}

.meta .title {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.25;
    color: #0f2d40;
}

.meta .sub {
    margin: 0;
    font-size: 13px;
    color: rgba(0, 0, 0, .62);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Pills */
.pill {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, .08);
    background: rgba(244, 247, 250, .9);
}

/* =========================================================
   5) MODAL OVERLAY (NO CHANGE BASE)
   ========================================================= */
.modal-viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    z-index: 9999;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   6) MODAL FRAME (NO CHANGE BASE)
   ========================================================= */
.modal-frame {
    position: relative;
    width: min(1100px, 96vw);
    height: min(78vh, 760px);
    margin: 0 auto;

    top: 50%;
    transform: translateY(-50%);

    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
    backdrop-filter: blur(6px);

    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

/* =========================================================
   7) MODAL TOPBAR (NO CHANGE BASE)
   ========================================================= */
.modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, .35);
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.modal-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.modal-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    display: grid;
    place-items: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.modal-btn:hover {
    background: rgba(0, 0, 0, .75);
}

/* =========================================================
   8) MODAL VIEWPORT (SCROLLBAR FIX - KEEP SAME)
   ========================================================= */
.modal-viewport {
    position: relative;
    overflow: hidden;
    /* default = no scroll (same look) */
    background: rgba(0, 0, 0, .22);
    -webkit-overflow-scrolling: touch;
}

/* ✅ FIX: when zoomed, allow BOTH horizontal + vertical scrollbars */
.modal-viewport.zoomed {
    overflow: auto;
}

/* =========================================================
   9) MODAL CANVAS (KEEP SAME)
   ========================================================= */
.modal-viewport:not(.zoomed) .modal-canvas {
    min-width: 100%;
    min-height: 100%;
    display: flex;
    /* same centering */
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.modal-viewport.zoomed .modal-canvas {
    padding: 14px;
    width: max-content;
    /* ✅ forces horizontal overflow */
    min-width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    display: block;
    /* avoid flex centering issues */
}

/* =========================================================
   10) IMAGE (KEEP SAME)
   ========================================================= */
#modalImg {
    max-width: none;
    /* allow growing */
    max-height: none;
    /* allow growing */
    width: auto;
    height: auto;

    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
    background: #fff;
    user-select: none;
    display: block;
}

/* Hint label (KEEP SAME BASE) */
.modal-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    color: rgba(255, 255, 255, .85);
    font-size: 12px;
    background: rgba(0, 0, 0, .35);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    pointer-events: none;
}



/* ======================================================================
   11) RESPONSIVE SECTION (ALL BREAKPOINTS AT BOTTOM) — YOUR 11.* BLOCK
   - Coverage: 240px → 1600px+
   - No gaps between ranges
   - Only sizing/spacing so it FITS (no UI redesign)
   ====================================================================== */


/* ----------------------------------------------------------------------
   11.1) 240px – 319px (Very small devices / older phones)
------------------------------------------------------------------------ */
@media (min-width:240px) and (max-width:319px) {

    /* Cards: 1 per row */
    .article-card {
        grid-column: span 12;
    }

    /* Hero */
    .page-hero {
        padding: 10px 10px;
        border-radius: 12px;
    }

    .page-hero h1 {
        font-size: 18px;
    }

    .page-hero p {
        font-size: 12.5px;
    }

    /* Toolbar */
    .toolbar {
        gap: 8px;
    }

    .toolbar .count-badge {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    /* Modal */
    .modal-viewer {
        padding: 8px;
    }

    .modal-frame {
        width: 100%;
        height: 88vh;
        border-radius: 14px;
    }

    /* Modal topbar fit */
    .modal-topbar {
        padding: 8px 10px;
        gap: 8px;
    }

    .modal-title {
        max-width: 44%;
        font-size: 12px;
    }

    /* Buttons smaller */
    .modal-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 10px;
    }

    /* Canvas padding */
    .modal-viewport:not(.zoomed) .modal-canvas {
        padding: 10px;
    }

    .modal-viewport.zoomed .modal-canvas {
        padding: 10px;
    }

    /* Hint */
    .modal-hint {
        font-size: 10px;
        left: 10px;
        bottom: 8px;
    }
}

/* ----------------------------------------------------------------------
   11.2) 320px – 359px (Small mobiles)
------------------------------------------------------------------------ */
@media (min-width:320px) and (max-width:359px) {

    .article-card {
        grid-column: span 12;
    }

    .page-hero {
        padding: 10px 11px;
        border-radius: 12px;
    }

    .page-hero p {
        font-size: 13px;
    }

    .toolbar .count-badge {
        padding: 7px 12px;
        font-size: 13px;
    }

    .modal-viewer {
        padding: 10px;
    }

    .modal-frame {
        width: 100%;
        height: 86vh;
        border-radius: 14px;
    }

    .modal-title {
        max-width: 48%;
        font-size: 13px;
    }

    .modal-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
        border-radius: 11px;
    }

    .modal-viewport:not(.zoomed) .modal-canvas {
        padding: 12px;
    }

    .modal-viewport.zoomed .modal-canvas {
        padding: 12px;
    }

    .modal-hint {
        font-size: 11px;
        left: 10px;
        bottom: 8px;
    }
}

/* ----------------------------------------------------------------------
   11.3) 360px – 479px (Standard mobiles 360/390/414 etc.)
------------------------------------------------------------------------ */
@media (min-width:360px) and (max-width:479px) {

    .article-card {
        grid-column: span 12;
    }

    .page-hero {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .page-hero p {
        font-size: 13px;
    }

    .toolbar .count-badge {
        padding: 7px 12px;
        font-size: 13px;
    }

    .modal-viewer {
        padding: 10px;
    }

    .modal-frame {
        width: 100%;
        height: 86vh;
        border-radius: 14px;
    }

    .modal-title {
        max-width: 52%;
        font-size: 13px;
    }

    .modal-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 11px;
    }

    .modal-hint {
        font-size: 11px;
        left: 10px;
        bottom: 8px;
    }
}

/* ----------------------------------------------------------------------
   11.4) 480px – 599px (Large phones / small landscape phones)
------------------------------------------------------------------------ */
@media (min-width:480px) and (max-width:599px) {

    .article-card {
        grid-column: span 12;
    }

    .page-hero {
        padding: 10px 14px;
    }

    .modal-viewer {
        padding: 12px;
    }

    .modal-frame {
        width: 100%;
        height: 84vh;
    }

    .modal-title {
        max-width: 58%;
    }

    .modal-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
}

/* ----------------------------------------------------------------------
   11.5) 600px – 767px (Small tablets)
------------------------------------------------------------------------ */
@media (min-width:600px) and (max-width:767px) {

    .article-card {
        grid-column: span 6;
    }

    .modal-frame {
        width: min(940px, 96vw);
        height: min(84vh, 840px);
    }

    .modal-title {
        max-width: 62%;
    }
}

/* ----------------------------------------------------------------------
   11.6) 768px – 899px (Tablets portrait / iPad mini etc.)
------------------------------------------------------------------------ */
@media (min-width:768px) and (max-width:899px) {

    .article-card {
        grid-column: span 6;
    }

    .modal-frame {
        width: min(980px, 96vw);
        height: min(84vh, 860px);
    }

    .modal-title {
        max-width: 64%;
    }
}

/* ----------------------------------------------------------------------
   11.7) 900px – 1023px (Large tablets / small laptop width)
------------------------------------------------------------------------ */
@media (min-width:900px) and (max-width:1023px) {

    .article-card {
        grid-column: span 6;
    }

    .modal-frame {
        width: min(1020px, 96vw);
        height: min(82vh, 860px);
    }

    .modal-title {
        max-width: 66%;
    }
}

/* ----------------------------------------------------------------------
   11.8) 1024px – 1199px (Small laptops)
------------------------------------------------------------------------ */
@media (min-width:1024px) and (max-width:1199px) {

    .article-card {
        grid-column: span 4;
    }

    .modal-frame {
        width: min(1100px, 96vw);
        height: min(78vh, 760px);
    }
}

/* ----------------------------------------------------------------------
   11.9) 1200px – 1399px (Laptops / desktops)
------------------------------------------------------------------------ */
@media (min-width:1200px) and (max-width:1399px) {

    .article-card {
        grid-column: span 4;
    }

    .modal-frame {
        width: min(1100px, 96vw);
        height: min(78vh, 760px);
    }
}

/* ----------------------------------------------------------------------
   11.10) 1400px – 1599px (Large monitors)
------------------------------------------------------------------------ */
@media (min-width:1400px) and (max-width:1599px) {

    .article-card {
        grid-column: span 4;
    }

    .modal-frame {
        width: min(1280px, 92vw);
        height: min(80vh, 860px);
    }
}

/* ----------------------------------------------------------------------
   11.11) 1600px and up (1600px+)
------------------------------------------------------------------------ */
@media (min-width:1600px) {

    .article-card {
        grid-column: span 4;
    }

    .modal-frame {
        width: min(1320px, 90vw);
        height: min(80vh, 900px);
    }
}



/* ======================================================================
   12) RESPONSIVE: MODAL ONLY (YOUR SECOND BLOCK) — PRESERVED & ORGANISED
   - Targets ONLY modal components (same selectors as you requested)
   - Kept after 11.* so it can further refine modal behavior
   - No gaps: 240px → 1600px+
   ====================================================================== */


/* =========================================================
   12.1) 240px – 279px (Ultra small)
========================================================= */
@media (min-width:240px) and (max-width:279px) {

    .modal-viewer {
        padding: 6px;
    }

    .modal-frame {
        width: 100%;
        height: 90vh;
        border-radius: 14px;
    }

    .modal-topbar {
        padding: 7px 8px;
        gap: 6px;
    }

    .modal-title {
        max-width: 42%;
        font-size: 11.5px;
    }

    .modal-actions {
        gap: 6px;
    }

    .modal-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
        border-radius: 10px;
    }

    .modal-canvas {
        padding: 8px !important;
    }
}

/* =========================================================
   12.2) 280px – 319px (Very small devices)
========================================================= */
@media (min-width:280px) and (max-width:319px) {

    .modal-viewer {
        width: 100%;
        padding: 8px;
    }

    .modal-frame {
        width: 100%;
        height: 88vh;
        border-radius: 14px;
    }

    .modal-topbar {
        width: 100%;
        padding: 8px 10px;
        gap: 8px;
    }

    .modal-title {
        max-width: 44%;
        font-size: 12px;
    }

    .modal-actions {
        gap: 7px;
    }

    .modal-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 10px;
    }

    .modal-canvas {
        padding: 10px !important;
    }
}

/* =========================================================
   12.3) 320px – 359px (Small mobiles)
========================================================= */
@media (min-width:320px) and (max-width:359px) {

    .modal-viewer {
        width: 100%;
        padding: 10px;
    }

    .modal-frame {
        width: 100%;
        height: 86vh;
        border-radius: 14px;
    }

    .modal-topbar {
        width: 100%;
        padding: 9px 10px;
        gap: 8px;
    }

    .modal-title {
        max-width: 48%;
        font-size: 13px;
    }

    .modal-actions {
        gap: 8px;
    }

    .modal-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
        border-radius: 11px;
    }

    .modal-canvas {
        padding: 12px !important;
    }
}

/* =========================================================
   12.4) 360px – 399px (Standard mobiles)
========================================================= */
@media (min-width:360px) and (max-width:399px) {

    .modal-viewer {
        padding: 10px;
    }

    .modal-frame {
        width: 100%;
        height: 86vh;
        border-radius: 14px;
    }

    .modal-topbar {
        padding: 9px 12px;
        gap: 10px;
    }

    .modal-title {
        max-width: 52%;
        font-size: 13px;
    }

    .modal-actions {
        gap: 8px;
    }

    .modal-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 11px;
    }

    .modal-canvas {
        padding: 12px !important;
    }
}

/* =========================================================
   12.5) 400px – 479px (Large mobiles)
========================================================= */
@media (min-width:400px) and (max-width:479px) {

    .modal-viewer {
        padding: 12px;
    }

    .modal-frame {
        width: 100%;
        height: 85vh;
        border-radius: 15px;
    }

    .modal-title {
        max-width: 56%;
        font-size: 13.5px;
    }

    .modal-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .modal-canvas {
        padding: 12px !important;
    }
}

/* =========================================================
   12.6) 480px – 599px (Phablets / small landscape)
========================================================= */
@media (min-width:480px) and (max-width:599px) {

    .modal-viewer {
        padding: 12px;
    }

    .modal-frame {
        width: 100%;
        height: 84vh;
        border-radius: 16px;
    }

    .modal-topbar {
        padding: 10px 12px;
    }

    .modal-title {
        max-width: 60%;
        font-size: 14px;
    }

    .modal-actions {
        gap: 8px;
    }

    .modal-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .modal-canvas {
        padding: 14px !important;
    }
}

/* =========================================================
   12.7) 600px – 767px (Small tablets)
========================================================= */
@media (min-width:600px) and (max-width:767px) {

    .modal-viewer {
        padding: 14px;
    }

    .modal-frame {
        width: min(940px, 96vw);
        height: min(84vh, 840px);
    }

    .modal-title {
        max-width: 62%;
    }

    .modal-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* =========================================================
   12.8) 768px – 899px (Tablets)
========================================================= */
@media (min-width:768px) and (max-width:899px) {

    .modal-viewer {
        padding: 16px;
    }

    .modal-frame {
        width: min(980px, 96vw);
        height: min(84vh, 860px);
    }

    .modal-title {
        max-width: 64%;
    }
}

/* =========================================================
   12.9) 900px – 1023px (Large tablets / small laptop widths)
========================================================= */
@media (min-width:900px) and (max-width:1023px) {

    .modal-viewer {
        padding: 18px;
    }

    .modal-frame {
        width: min(1020px, 96vw);
        height: min(82vh, 860px);
    }

    .modal-title {
        max-width: 66%;
    }
}

/* =========================================================
   12.10) 1024px – 1199px (Small laptops)
========================================================= */
@media (min-width:1024px) and (max-width:1199px) {

    .modal-viewer {
        padding: 18px;
    }

    .modal-frame {
        width: min(1100px, 96vw);
        height: min(78vh, 760px);
    }

    .modal-title {
        max-width: 60%;
    }
}

/* =========================================================
   12.11) 1200px – 1399px (Laptops / desktops)
========================================================= */
@media (min-width:1200px) and (max-width:1399px) {

    .modal-frame {
        width: min(1100px, 96vw);
        height: min(78vh, 760px);
    }

    .modal-title {
        max-width: 60%;
    }
}

/* =========================================================
   12.12) 1400px – 1599px (Large monitors)
========================================================= */
@media (min-width:1400px) and (max-width:1599px) {

    .modal-frame {
        width: min(1280px, 92vw);
        height: min(80vh, 860px);
    }

    .modal-title {
        max-width: 62%;
    }
}

/* =========================================================
   12.13) 1600px+ (Very large screens)
========================================================= */
@media (min-width:1600px) {

    .modal-frame {
        width: min(1320px, 90vw);
        height: min(80vh, 900px);
    }

    .modal-title {
        max-width: 62%;
    }
}