/*
 * media.css — Styles for media.php (blog listing page)
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
        --navy:      #0d2d5e;
        --blue:      #1a6fc4;
        --blue-lt:   #e8f1fb;
        --orange:    #f89633;
        --white:     #ffffff;
        --bg:        #f4f6f9;
        --border:    #dde3ec;
        --text:      #1e2a3b;
        --muted:     #64748b;
        --light:     #94a3b8;
        --serif: 'DM Serif Text', Georgia, serif;
        --sans: 'Open Sans', Arial, sans-serif;
        --r:         4px;   /* sharp corners, small radius only */
    }

    body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.6; }

    /* ─── HERO ─────────────────────────────────────────────── */
    .hero {
        background: var(--navy);
        padding: 80px 0 0;
        position: relative;
        overflow: hidden;
    }
    .hero-grid {
        /* diagonal line pattern */
        position: absolute; inset: 0;
        background-image: repeating-linear-gradient(
            -45deg,
            rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px,
            transparent 1px, transparent 40px
        );
    }
    .hero-glow {
        position: absolute; top: -80px; right: -80px;
        width: 500px; height: 500px;
        background: radial-gradient(circle, rgba(26,111,196,.35) 0%, transparent 65%);
    }
    .hero-inner {
        position: relative;
        max-width: 1200px; margin: 0 auto; padding: 0 32px;
        text-align: center;
    }
    .hero-tag {
        display: inline-flex; align-items: center; gap: 6px;
        background: rgba(248,150,51,.15);
        border: 1px solid rgba(248,150,51,.35);
        color: var(--orange);
        font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
        padding: 5px 14px; margin-bottom: 20px;
    }
    .hero h1 {
        font-family: var(--serif);
        font-size: clamp(2rem, 4.5vw, 3.6rem);
        font-weight: 700; color: #fff;
        line-height: 1.1; margin-bottom: 16px;
    }
    .hero h1 span { color: var(--orange); }
    .hero p {
        color: rgba(255,255,255,.65); font-size: .95rem;
        max-width: 420px; margin: 0 auto 32px;
    }
    .hero-search {
        display: flex; max-width: 520px; margin: 0 auto 32px;
        border: 1.5px solid rgba(255,255,255,.2);
        background: rgba(255,255,255,.07);
        overflow: hidden;
    }
    .hero-search input {
        flex: 1; background: transparent; border: none; outline: none;
        padding: 14px 20px; color: #fff;
        font-size: .9rem; font-family: var(--sans);
    }
    .hero-search input::placeholder { color: rgba(255,255,255,.4); }
    .hero-search button {
        background: var(--blue); border: none; cursor: pointer;
        padding: 14px 22px; color: #fff;
        font-size: .85rem; font-weight: 600; font-family: var(--sans);
        display: flex; align-items: center; gap: 6px;
        transition: background .2s;
    }
    .hero-search button:hover { background: #145aa0; }
    .hero-crumb {
        display: flex; align-items: center; justify-content: center;
        gap: 6px; font-size: .78rem; color: rgba(255,255,255,.45);
        padding-bottom: 32px;
    }
    .hero-crumb a { color: rgba(255,255,255,.55); text-decoration: none; }
    .hero-crumb a:hover { color: #fff; }

    /* White shelf that bleeds under the cat bar */
    .hero-shelf {
        height: 24px;
        background: linear-gradient(to bottom, transparent, rgba(13,45,94,.5));
    }

    /* ─── CATEGORY STRIP ───────────────────────────────────── */
    .cat-strip {
        background: var(--white);
        border-bottom: 2px solid var(--border);
        position: sticky; top: 0; z-index: 100;
    }
    .cat-strip-inner {
        max-width: 1200px; margin: 0 auto; padding: 0 32px;
        display: flex; align-items: center; gap: 4px;
        overflow-x: auto; scrollbar-width: none;
    }
    .cat-strip-inner::-webkit-scrollbar { display: none; }
    .cat-pill {
        display: inline-flex; align-items: center; gap: 5px;
        padding: 10px 18px;
        font-size: .82rem; font-weight: 600;
        white-space: nowrap; text-decoration: none;
        border: none; background: transparent; cursor: pointer;
        color: var(--muted); font-family: var(--sans);
        border-bottom: 3px solid transparent;
        transition: color .15s, border-color .15s;
        flex-shrink: 0; position: relative; top: 2px;
    }
    .cat-pill:hover { color: var(--navy); }
    .cat-pill.active { color: var(--navy); border-bottom-color: var(--orange); }
    .cat-pill .n {
        background: var(--bg); color: var(--muted);
        font-size: .68rem; padding: 1px 6px;
        font-weight: 700;
    }
    .cat-pill.active .n { background: var(--navy); color: #fff; }

    /* ─── PAGE BODY ────────────────────────────────────────── */
    .page-body {
        max-width: 1200px; margin: 0 auto;
        padding: 40px 32px 80px;
    }

    /* ─── FEATURED ─────────────────────────────────────────── */
    .featured {
        display: grid; grid-template-columns: 55% 45%;
        background: var(--white);
        border: 1px solid var(--border);
        margin-bottom: 48px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(13,45,94,.08);
    }
    .featured:hover { box-shadow: 0 6px 28px rgba(13,45,94,.14); }
    .featured-img {
        position: relative; overflow: hidden;
        min-height: 380px;
        background: var(--navy);
    }
    .featured-img img {
        width: 100%; height: 100%; object-fit: cover;
        display: block;
        transition: transform .5s;
    }
    .featured:hover .featured-img img { transform: scale(1.04); }
    .featured-img-placeholder {
        width: 100%; height: 100%; min-height: 380px;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(135deg, #0d2d5e 0%, #1a6fc4 100%);
        color: rgba(255,255,255,.18); font-size: 5rem;
    }
    .feat-badge {
        position: absolute; top: 16px; left: 16px;
        background: var(--orange); color: #fff;
        font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
        padding: 5px 12px;
    }
    .featured-body {
        padding: 48px 44px;
        display: flex; flex-direction: column; justify-content: center;
    }
    .feat-cat {
        font-size: .72rem; font-weight: 700; letter-spacing: .1em;
        text-transform: uppercase; color: var(--blue);
        display: flex; align-items: center; gap: 6px;
        margin-bottom: 16px; text-decoration: none;
    }
    .feat-cat::before { content: ''; width: 20px; height: 2px; background: var(--blue); display: block; }
    .featured-title {
        font-family: var(--serif);
        font-size: clamp(1.4rem, 2.2vw, 2rem);
        line-height: 1.2; color: var(--navy);
        margin-bottom: 16px;
    }
    .featured-excerpt {
        color: var(--muted); font-size: .9rem; line-height: 1.75;
        margin-bottom: 24px;
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    }
    .feat-meta {
        display: flex; align-items: center; gap: 16px;
        font-size: .75rem; color: var(--light); margin-bottom: 28px;
    }
    .feat-meta span { display: flex; align-items: center; gap: 5px; }
    .feat-btn {
        display: inline-flex; align-items: center; gap: 8px;
        background: var(--navy); color: #fff;
        padding: 12px 24px; font-size: .85rem; font-weight: 600;
        text-decoration: none; width: fit-content;
        border: 2px solid var(--navy);
        transition: background .2s, color .2s;
    }
    .feat-btn:hover { background: transparent; color: var(--navy); }
    .feat-btn i { transition: transform .2s; }
    .feat-btn:hover i { transform: translateX(4px); }

    /* ─── SECTION HEADER ───────────────────────────────────── */
    .sec-head {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 24px; padding-bottom: 12px;
        border-bottom: 2px solid var(--border);
        flex-wrap: wrap; gap: 8px;
    }
    .sec-title {
        font-family: var(--serif); font-size: 1.5rem;
        color: var(--navy); display: flex; align-items: center; gap: 10px;
    }
    .sec-title::before {
        content: ''; display: block;
        width: 4px; height: 22px;
        background: var(--orange);
    }
    .sec-count {
        font-size: .78rem; color: var(--muted);
        border: 1px solid var(--border);
        background: var(--white); padding: 4px 12px;
        font-weight: 500;
    }

    /* ─── POSTS GRID ───────────────────────────────────────── */
    .posts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    /* ─── POST CARD ────────────────────────────────────────── */
    .post-card {
        background: var(--white);
        border: 1px solid var(--border);
        display: flex; flex-direction: column;
        transition: box-shadow .2s, transform .2s;
        overflow: hidden;
    }
    .post-card:hover { box-shadow: 0 6px 24px rgba(13,45,94,.12); transform: translateY(-3px); }
    .card-img {
        position: relative; height: 200px; overflow: hidden;
        background: var(--navy); flex-shrink: 0;
    }
    .card-img img {
        width: 100%; height: 100%; object-fit: cover; display: block;
        transition: transform .4s;
    }
    .post-card:hover .card-img img { transform: scale(1.06); }
    .card-img-placeholder {
        width: 100%; height: 100%;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(135deg, var(--navy) 0%, #1a6fc4 100%);
        color: rgba(255,255,255,.15); font-size: 3rem;
    }
    .card-tag {
        position: absolute; bottom: 0; left: 0;
        background: rgba(13,45,94,.88); color: #fff;
        font-size: .65rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
        padding: 5px 10px;
    }
    .card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
    .card-date { font-size: .72rem; color: var(--light); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
    .card-title {
        font-family: var(--serif); font-size: 1.05rem; line-height: 1.35;
        color: var(--navy); margin-bottom: 10px;
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
        flex: 1;
    }
    .card-excerpt {
        font-size: .8rem; color: var(--muted); line-height: 1.65; margin-bottom: 16px;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .card-footer {
        display: flex; align-items: center; justify-content: space-between;
        border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto;
    }
    .card-sub { font-size: .71rem; color: var(--light); display: flex; align-items: center; gap: 4px; }
    .card-link {
        font-size: .78rem; font-weight: 700; color: var(--blue);
        text-decoration: none; display: flex; align-items: center; gap: 5px;
        letter-spacing: .02em; text-transform: uppercase;
        transition: color .15s, gap .15s;
    }
    .card-link:hover { color: var(--navy); gap: 8px; }

    /* ─── EMPTY STATE ──────────────────────────────────────── */
    .empty {
        background: var(--white); border: 1px solid var(--border);
        padding: 80px 24px; text-align: center;
    }
    .empty-icon {
        width: 72px; height: 72px;
        background: var(--blue-lt); color: var(--blue);
        display: flex; align-items: center; justify-content: center;
        font-size: 1.6rem; margin: 0 auto 20px;
    }
    .empty h3 { font-family: var(--serif); font-size: 1.4rem; color: var(--navy); margin-bottom: 8px; }
    .empty p { color: var(--muted); font-size: .88rem; }
    .empty a { color: var(--blue); font-weight: 600; text-decoration: none; margin-top: 12px; display: inline-block; }

    /* ─── PAGINATION ───────────────────────────────────────── */
    .pager { display: flex; justify-content: center; gap: 4px; margin-top: 40px; flex-wrap: wrap; }
    .pager a {
        min-width: 38px; height: 38px; padding: 0 10px;
        display: inline-flex; align-items: center; justify-content: center;
        font-size: .82rem; font-weight: 600;
        text-decoration: none;
        border: 1.5px solid var(--border);
        background: var(--white); color: var(--muted);
        transition: all .15s;
    }
    .pager a:hover { background: var(--blue-lt); border-color: var(--blue); color: var(--blue); }
    .pager .cur { background: var(--navy); color: #fff; border-color: var(--navy); }
    .pager .dis { opacity: .3; pointer-events: none; }

    /* ─── RESPONSIVE ───────────────────────────────────────── */
    @media (max-width: 1024px) {
        .posts-grid { grid-template-columns: repeat(2, 1fr); }
        .featured { grid-template-columns: 50% 50%; }
    }
    @media (max-width: 768px) {
        .page-body { padding: 28px 20px 60px; }
        .hero-inner { padding: 0 20px; }
        .cat-strip-inner { padding: 0 20px; }
        .featured { grid-template-columns: 1fr; }
        .featured-img { min-height: 240px; }
        .featured-body { padding: 28px 24px; }
        .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
        .hero { padding: 60px 0 0; }
    }
    @media (max-width: 540px) {
        .posts-grid { grid-template-columns: 1fr; }
        .hero h1 { font-size: 1.9rem; }
        .featured-title { font-size: 1.3rem; }
    }

    /* ─── STAGGER ANIMATION ────────────────────────────────── */
    @keyframes up { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }
    .featured  { animation: up .45s ease both; }
    .post-card { animation: up .35s ease both; }
    <?php foreach(range(1,12) as $i): ?>
    .post-card:nth-child(<?=$i?>) { animation-delay: <?=($i-1)*.05?>s; }
    <?php endforeach; ?>

/* ── Subscribe Popup ─────────────────────────────────── */
/* ── Popup ──────────────────────────────────────────────────── */
.sub-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 9000; opacity: 0; pointer-events: none;
    transition: opacity .3s;
}
.sub-overlay.show { opacity: 1; pointer-events: all; }

.sub-popup {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -52%);
    width: min(820px, 95vw);
    background: #fff; z-index: 9001;
    display: grid; grid-template-columns: 1fr 1fr;
    opacity: 0; pointer-events: none;
    transition: opacity .3s, transform .3s;
    box-shadow: 0 24px 80px rgba(13,45,94,.25);
    max-height: 90vh; overflow-y: auto;
}
.sub-popup.show {
    opacity: 1; pointer-events: all;
    transform: translate(-50%, -50%);
}

/* Left panel */
.sub-left {
    background: #0d2d5e; color: #fff;
    padding: 48px 36px;
    display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.sub-left::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(26,111,196,.4), transparent 70%);
}
.sub-icon {
    width: 52px; height: 52px;
    background: rgba(248,150,51,.15);
    border: 1px solid rgba(248,150,51,.3);
    display: flex; align-items: center; justify-content: center;
    color: #f89633; font-size: 1.3rem; margin-bottom: 20px;
}
.sub-left h2 {
    font-family: 'DM Serif Text', Georgia, serif;
    font-size: 1.6rem; font-weight: 400;
    margin-bottom: 12px; line-height: 1.2;
}
.sub-left p {
    color: rgba(255,255,255,.65); font-size: .875rem; line-height: 1.7; margin-bottom: 24px;
}
.sub-perks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sub-perks li {
    display: flex; align-items: center; gap: 10px;
    font-size: .82rem; color: rgba(255,255,255,.8);
}
.sub-perks li i { color: #f89633; font-size: .75rem; flex-shrink: 0; }

/* Right panel */
.sub-right { padding: 48px 36px; display: flex; flex-direction: column; justify-content: center; }
.sub-right h3 {
    font-family: 'DM Serif Text', Georgia, serif;
    font-size: 1.3rem; color: #0d2d5e; margin-bottom: 6px;
}
.sub-sub { font-size: .82rem; color: #64748b; margin-bottom: 24px; }
.sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sub-field { margin-bottom: 14px; }
.sub-field label { font-size: .76rem; font-weight: 700; color: #374151; display: block; margin-bottom: 6px; letter-spacing: .03em; text-transform: uppercase; }
.sub-field input {
    width: 100%; padding: 11px 13px;
    border: 2px solid #dde3ec; outline: none;
    font-size: .875rem; font-family: 'Open Sans', Arial, sans-serif;
    color: #1e2a3b; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.sub-field input:focus { border-color: #1a6fc4; box-shadow: 0 0 0 3px rgba(26,111,196,.12); background: #fff; }
.sub-field input::placeholder { color: #a0aec0; font-size: .82rem; }
.sub-btn {
    width: 100%; padding: 13px;
    background: #0d2d5e; color: #fff; border: 2px solid #0d2d5e;
    font-size: .9rem; font-weight: 700; cursor: pointer;
    font-family: inherit; display: flex; align-items: center;
    justify-content: center; gap: 8px;
    transition: background .2s, color .2s;
    margin-top: 4px;
}
.sub-btn:hover { background: transparent; color: #0d2d5e; }
.sub-btn:disabled { opacity: .6; cursor: not-allowed; }
.sub-msg { font-size: .8rem; margin-top: 10px; min-height: 18px; }
.sub-msg.ok  { color: #059669; }
.sub-msg.err { color: #dc2626; }
.sub-privacy { font-size: .73rem; color: #94a3b8; margin-top: 12px; display: flex; align-items: center; gap: 5px; }

/* Close btn */
.sub-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; font-size: 1.4rem;
    cursor: pointer; color: #64748b; line-height: 1;
    z-index: 1; padding: 4px 8px;
    transition: color .15s;
}
.sub-close:hover { color: #0d2d5e; }

/* Mobile */
@media (max-width: 620px) {
    .sub-popup { grid-template-columns: 1fr; width: 95vw; }
    .sub-left { padding: 28px 24px; }
    .sub-left h2 { font-size: 1.3rem; }
    .sub-right { padding: 28px 24px; }
    .sub-row { grid-template-columns: 1fr; gap: 0; }
}