/* ============================================================================
   media.css — Launch Gallery (official Rockstar press-kit imagery)
   Black surfaces, white type, gold CTAs to match the rest of Daily Leonida.
   ========================================================================== */

.media-page {
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
    padding-bottom: 6rem;
}

/* ---------------------------------------------------------------- hero --- */
.media-hero {
    position: relative;
    margin-top: clamp(5rem, 9vw, 7rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}

.media-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(0, 212, 255, 0.18), transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(255, 107, 53, 0.16), transparent 55%);
    pointer-events: none;
}

.media-hero > * { position: relative; }

.media-kicker {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
}

.media-hero h1 {
    text-align: left;
    font-family: var(--font-headline);
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 0.9rem;
    text-transform: uppercase;
}

.media-hero p {
    max-width: 62ch;
    font-size: var(--text-fluid-base);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 1.4rem;
}

.media-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.75rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-subheadline);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.media-stats strong {
    display: block;
    font-family: var(--font-headline);
    font-size: 1.6rem;
    letter-spacing: 0;
    color: #fff;
}

.media-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* -------------------------------------------------------------- filters --- */
/* body{overflow-x:hidden} (set globally) turns <body> into a scroll container
   and silently disables position:sticky for its descendants. `clip` clips the
   same way without creating a scroll container, so the filter bar can stick.
   Scoped to this page because media.css only loads here. */
body { overflow-x: clip; }

.media-filters {
    position: sticky;
    top: calc(var(--nav-height, 72px) + 0.5rem);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #000 70%, rgba(0, 0, 0, 0.85));
}

.media-filter {
    font-family: var(--font-subheadline);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.media-filter:hover { color: #fff; border-color: var(--border-strong); }

.media-filter[aria-pressed="true"] {
    color: #000;
    background: linear-gradient(180deg, #FFE9B8 0%, #F5B544 55%, #FFD98A 100%);
    border-color: #F5B544;
    font-weight: 600;
}

.media-filter:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

/* ----------------------------------------------------------------- grid --- */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 30vw, 260px), 1fr));
    gap: clamp(0.6rem, 1.4vw, 1rem);
    align-items: start;
}

.media-tile {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    background: #0b0b10;
    cursor: zoom-in;
    text-align: left;
    color: #fff;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.media-tile:hover { transform: translateY(-2px); border-color: rgba(255, 213, 138, 0.55); }

.media-tile:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

.media-tile img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: var(--tile-ratio, 16 / 9);
}

.media-tile figcaption,
.media-tile .media-tile-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-family: var(--font-subheadline);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.85);
    background: #000;
    border-top: 1px solid var(--border-subtle);
}

.media-tile .media-tile-cat {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-primary);
    white-space: nowrap;
}

.media-tile[hidden] { display: none; }

/* the Videos filter swaps the grid for the video-link section */
.media-gallery[hidden],
.media-videos[hidden] { display: none !important; }

/* ------------------------------------------------------------ lightbox --- */
.media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(0.75rem, 3vw, 2rem);
    background: rgba(0, 0, 0, 0.94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.media-lightbox[hidden] { display: none; }

.media-lightbox img {
    max-width: min(1200px, 100%);
    max-height: 74vh;
    max-height: 74svh;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-medium);
    object-fit: contain;
}

.media-lightbox-cap {
    max-width: 70ch;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.media-lightbox-cap small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.media-lb-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
}

.media-lb-btn:hover { border-color: #F5B544; color: #FFD98A; }
.media-lb-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }

.media-lb-close { top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); }
.media-lb-prev { left: max(0.5rem, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.media-lb-next { right: max(0.5rem, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }

.media-lb-count {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.55);
}

/* ------------------------------------------------------------- footnote --- */
.media-credit {
    margin-top: clamp(2rem, 5vw, 3.5rem);
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.media-credit a { color: var(--accent-primary); }

.media-empty {
    padding: 3rem 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 560px) {
    .media-hero { padding: 1.35rem 1.1rem; border-radius: 16px; }
    .media-hero h1 { font-size: clamp(1.75rem, 9vw, 2.4rem); }
    .media-hero p { font-size: 1rem; margin-bottom: 1.1rem; }
    .media-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem 1.1rem;
        font-size: 0.72rem;
    }
    .media-stats strong { font-size: 1.35rem; }
    .media-hero-actions .btn { flex: 1 1 100%; justify-content: center; }
    .media-filters { top: calc(var(--nav-height, 65px)); }
    .media-tile figcaption { font-size: 0.72rem; padding: 0.45rem 0.55rem; }
    .media-lightbox img { max-height: 62vh; max-height: 62svh; }
    .media-lb-prev, .media-lb-next { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .media-tile { transition: none; }
    .media-tile:hover { transform: none; }
}


/* ============================================================================
   LIGHT MODE — the site's rule is white surfaces, black text (no grey panels).
   Everything above is authored for the dark default, so reverse it here.
   ========================================================================== */
html[data-theme="light"] .media-hero { background: #fff; }
html[data-theme="light"] .media-hero::before { opacity: 0.35; }
html[data-theme="light"] .media-hero h1,
html[data-theme="light"] .media-hero p,
html[data-theme="light"] .media-stats,
html[data-theme="light"] .media-stats strong { color: #000; }
html[data-theme="light"] .media-kicker { color: #0a6c8a; }
html[data-theme="light"] .media-filters { background: linear-gradient(180deg, #fff 72%, rgba(255, 255, 255, 0.9)); }
html[data-theme="light"] .media-filter { color: #000; border-color: rgba(0, 0, 0, 0.22); }
html[data-theme="light"] .media-filter[aria-pressed="true"] { color: #000; border-color: #F5B544; }
html[data-theme="light"] .media-tile { background: #f2f2f4; border-color: rgba(0, 0, 0, 0.12); }
html[data-theme="light"] .media-tile figcaption { background: #fff; color: #000; border-top-color: rgba(0, 0, 0, 0.12); }
html[data-theme="light"] .media-tile .media-tile-cat { color: #0a6c8a; }
html[data-theme="light"] .media-lightbox { background: rgba(255, 255, 255, 0.97); }
html[data-theme="light"] .media-lightbox-cap { color: #000; }
html[data-theme="light"] .media-lightbox-cap small,
html[data-theme="light"] .media-lb-count { color: rgba(0, 0, 0, 0.55); }
html[data-theme="light"] .media-lb-btn { background: #fff; color: #000; border-color: rgba(0, 0, 0, 0.25); }
html[data-theme="light"] .media-credit { color: rgba(0, 0, 0, 0.72); }
html[data-theme="light"] .media-credit a { color: #0a6c8a; }
html[data-theme="light"] .media-empty { color: rgba(0, 0, 0, 0.6); }


/* ============================================================================
   VIDEO LINKS — poster-led cards that open Rockstar's own media page.
   No <video>, no iframes: the poster is ours, the playback stays official.
   ========================================================================== */
.media-videos {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    border-top: 1px solid var(--border-subtle);
}

.media-videos-head h2 {
    text-align: left;
    font-family: var(--font-headline);
    font-size: clamp(1.5rem, 3.2vw, 2.35rem);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 0.6rem;
    color: #fff;
}

.media-videos-head p {
    max-width: 62ch;
    font-size: var(--text-fluid-base);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.5rem;
}

.media-videos-sub {
    text-align: left;
    font-family: var(--font-subheadline);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin: 2rem 0 0.9rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 32vw, 360px), 1fr));
    gap: clamp(0.75rem, 1.6vw, 1.15rem);
}

.video-grid--clips { grid-template-columns: repeat(auto-fill, minmax(clamp(170px, 24vw, 260px), 1fr)); }

.video-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    overflow: hidden;
    background: #0b0b10;
    color: #fff;
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.video-card:hover { transform: translateY(-2px); border-color: rgba(255, 213, 138, 0.6); }
.video-card:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }

.video-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.video-card-body { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.85rem 0.85rem; }

.video-card-title {
    font-family: var(--font-subheadline);
    font-size: 0.95rem;
    line-height: 1.25;
    color: #fff;
}

.video-card-meta {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.video-card-play {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
}

.media-videos-foot { margin-top: 1.75rem; }

html[data-theme="light"] .media-videos-head h2,
html[data-theme="light"] .media-videos-head p { color: #000; }
html[data-theme="light"] .media-videos-sub { color: rgba(0, 0, 0, 0.6); }
html[data-theme="light"] .video-card { background: #fff; color: #000; border-color: rgba(0, 0, 0, 0.14); }
html[data-theme="light"] .video-card-title { color: #000; }
html[data-theme="light"] .video-card-meta { color: rgba(0, 0, 0, 0.55); }
html[data-theme="light"] .video-card-play { background: rgba(255, 255, 255, 0.85); border-color: rgba(0, 0, 0, 0.3); color: #000; }

@media (max-width: 560px) {
    .video-grid, .video-grid--clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .video-card-title { font-size: 0.8rem; }
    .video-card-play { width: 28px; height: 28px; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .video-card { transition: none; }
    .video-card:hover { transform: none; }
}


/* ============================================================================
   CURATED CAPTIONS
   Tiles now carry written commentary (2-3 lines) plus a credit line, not a
   filename, so the caption stacks instead of sitting in a single row.
   ========================================================================== */
.media-gallery .media-tile figcaption {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem 0.65rem;
}

.media-gallery .media-tile .media-tile-cap {
    display: block;
    /* the legacy rule `.media-tile figcaption, .media-tile .media-tile-cap`
       paints background:#000 on the span too -> black-on-black captions */
    background: transparent;
    border-top: 0;
    padding: 0;
    font-family: var(--font-body, inherit);
    font-size: 0.76rem;
    line-height: 1.45;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.86);
}

.media-gallery .media-tile .media-tile-credit {
    display: block;
    font-family: var(--font-subheadline);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

html[data-theme="light"] .media-gallery .media-tile .media-tile-cap { color: rgba(0, 0, 0, 0.82); }
html[data-theme="light"] .media-gallery .media-tile .media-tile-credit { color: rgba(0, 0, 0, 0.5); }

/* Each tile states which article discusses it — the image is on the page because
   something is written about it, not because a press kit was mirrored. */
.media-gallery .media-tile .media-tile-link {
    display: block;
    margin-top: 0.35rem;
    font-family: var(--font-body, inherit);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.62);
}
.media-gallery .media-tile .media-tile-link a {
    color: var(--accent-primary, #5aa9ff);
    text-decoration: underline;
    text-underline-offset: 2px;
}
html[data-theme="light"] .media-gallery .media-tile .media-tile-link { color: rgba(0, 0, 0, 0.6); }
html[data-theme="light"] .media-gallery .media-tile .media-tile-link a { color: #0b62c9; }

@media (max-width: 560px) {
    .media-gallery .media-tile .media-tile-cap { font-size: 0.72rem; }
    .media-gallery .media-tile figcaption { padding: 0.5rem 0.55rem 0.55rem; }
}
