/*
 * Fi1m — Magazine layer
 * =====================
 * The shared part of the magazine treatment (from an unused Empire design): a condensed upper-case display face for
 * navigation, headings and numbers; the active nav item as a solid red block; section headings as red tabs on a heavy
 * rule; hard corners everywhere; black, white and one red. Loaded after styles.css, before the page's own file, and
 * scoped to body.mag so the rest of the site is untouched. Pages: film-v2.html, index-v2.html, films-v2.html.
 */

body.mag {
    --font-display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
    --radius: 0;
    --radius-lg: 0;
    --ink: var(--heading-color);
    --paper: var(--background);
}

/* Slabs: the two building blocks */
.mag-slab {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    padding: 7px 12px 6px;
    line-height: 1;
}

.mag-slab--red {
    background: var(--primary);
    color: #fff;
}

/* ------------------------------------------------------------------ 1. Header: brand and nav in the display face */
.mag .site-header {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* Brand, then the sections straight after it (not pushed right); search, theme and login cluster at the far end */
.mag .header-content {
    min-height: 60px;
    gap: 28px;
    justify-content: flex-start;
}

.mag .logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 40px;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    font-style: italic;
}

.mag .nav-links {
    gap: 0;
    align-self: stretch;
    margin-right: auto;
}

/* Films · TV · Discover | Collections · Join */
.mag .nav-divider {
    width: 1px;
    align-self: center;
    height: 22px;
    background: var(--border-color);
    margin: 0 10px;
}

.mag .nav-links a {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    display: flex;
    align-items: center;
    padding: 0 16px;
    min-height: 60px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mag .nav-links a:hover {
    color: var(--primary);
}

.mag .nav-links a[aria-current="page"] {
    background: var(--primary);
    color: #fff;
}

.mag .header-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: stretch;
}

.mag .header-icon,
.mag .header-tools .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: none;
    color: var(--ink);
    margin: 0;
}

.mag .header-icon svg,
.mag .header-tools .theme-toggle svg {
    width: 21px;
    height: 21px;
    color: var(--ink);
}

.mag .header-icon:hover,
.mag .header-tools .theme-toggle:hover {
    background: none;
    color: var(--primary);
}

.mag .header-icon:hover svg,
.mag .header-tools .theme-toggle:hover svg {
    color: var(--primary);
    transform: none;
}

.mag .header-login {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: stretch;
    padding: 0 4px 0 14px;
    margin-left: 6px;
    border-left: 1px solid var(--border-color);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}

.mag .header-login svg {
    width: 22px;
    height: 22px;
}

.mag .header-login:hover {
    color: var(--primary);
}

.mag .mobile-menu-toggle {
    margin-left: auto;
}

.mag .mobile-menu-links a {
    font-family: var(--font-display);
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ Full-screen search
   A near-black scrim over the page, one big outlined field with a red square button, and a row of popular searches
   as outlined slabs. Opened by the header's search icon; closed by the X, the scrim or Escape (site.js). */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 8, 8, 0.94);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.search-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    color: var(--primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-close:hover {
    background: var(--primary);
    color: #fff;
}

.search-close svg {
    width: 22px;
    height: 22px;
}

.search-panel {
    width: min(720px, 100%);
    text-align: center;
    transform: translateY(12px);
    transition: transform 0.3s ease;
}

.search-overlay.active .search-panel {
    transform: none;
}

.search-label,
.search-topics-label {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
}

.search-label {
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 14px;
}

.search-topics-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 34px 0 12px;
}

/* The field: the shared ask-bar, squared and outlined, with the send button a full-height red block */
.search-overlay .ask-bar {
    background: #000;
    border: 2px solid var(--primary);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0 20px;
    height: 72px;
}

.search-overlay .ask-bar:focus-within {
    background: #000;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.25);
}

.search-overlay .ask-input {
    font-size: 1.5rem;
    color: #fff;
    padding: 0;
    height: 100%;
}

.search-overlay .ask-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.search-overlay .ask-send {
    width: 72px;
    height: 100%;
    border-radius: 0;
    background: var(--primary);
    color: #fff;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.search-overlay .ask-send.active {
    opacity: 1;
}

.search-overlay .ask-send.active:hover {
    transform: none;
    background: var(--primary-dark);
}

.search-overlay .ask-send svg {
    width: 26px;
    height: 26px;
}

.search-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.mag .search-overlay .suggestion-chip {
    border-radius: 0;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.03em;
    padding: 7px 12px 6px;
    line-height: 1.2;
    max-height: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mag .search-overlay .suggestion-chip:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: none;
}

@media (max-width: 640px) {
    .search-overlay {
        align-items: flex-start;
        padding: 90px 16px 24px;
    }

    .search-close {
        top: 14px;
        right: 16px;
    }

    .search-overlay .ask-bar {
        height: 58px;
        padding-left: 14px;
    }

    .search-overlay .ask-input {
        font-size: 1.15rem;
    }

    .search-overlay .ask-send {
        width: 58px;
    }
}

/* ------------------------------------------------------------------ Section headings as red tabs sitting on a rule */
.mag .section-title {
    display: flex;
    align-items: flex-end;
    width: 100%;
    margin: 44px 0 26px;
    border-bottom: 3px solid var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
}

.mag .section-title::after {
    display: none;
}

.mag .section-title > span {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 8px 12px 7px;
    margin-bottom: -3px;
    border-bottom: 3px solid var(--primary);
}

.mag .section-title small {
    margin-left: auto;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--gray);
    padding-bottom: 8px;
}

/* A heading with a "view all" beside it: the rule moves to the header row so the tab and the link share it */
.mag .section-header {
    align-items: flex-end;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 26px;
}

.mag .section-header .section-title {
    width: auto;
    margin: 0;
    border-bottom: 0;
}

.mag .view-all {
    background: none;
    border-radius: 0;
    padding: 0 0 9px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}

.mag .view-all:hover {
    color: var(--primary);
    background: none;
}

/* ------------------------------------------------------------------ Editorial blocks */
.mag .content-block {
    background: none;
    padding: 0;
    margin: 36px 0;
    border-top: 3px solid var(--ink);
}

.mag .block-header {
    margin-bottom: 22px;
}

.mag .block-header h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    padding: 8px 12px 7px;
    gap: 8px;
}

.mag .block-header h3 .logo-text {
    color: #fff;
    background: var(--primary);
    margin: -8px 0 -7px -12px;
    padding: 8px 10px 7px 12px;
}

.mag .block-header .ai-badge {
    border-radius: 0;
    font-family: var(--font-main);
    letter-spacing: 0.02em;
}

.mag .content-highlight {
    background: none;
    border: 0;
    border-left: 6px solid var(--primary);
    padding: 4px 0 4px 22px;
    margin: 0 0 26px;
}

.mag .content-highlight .text-content p {
    font-size: 1.3rem;
    line-height: 1.4;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.005em;
    margin-bottom: 0.9em;    /* the consensus is two paragraphs: agreement, then dissent */
}

.mag .content-highlight .text-content p:last-child {
    margin-bottom: 0;
}

.mag .text-content {
    font-size: 1.08rem;
    line-height: 1.75;
}

.mag .text-content p {
    margin-bottom: 1.15rem;
}

.mag .byline {
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.mag .byline a {
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-main);
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------ Cards, tags and lists */
.mag .tag {
    border-radius: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
}

.mag .card,
.mag .card-media img,
.mag .media-card,
.mag .media-card-image,
.mag .media-object,
.mag .media-object img,
.mag .article-card,
.mag .article-image,
.mag .award-category,
.mag .score-badge {
    border-radius: 0;
}

.mag .score-badge {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
}

.mag .person-name,
.mag .person-name a,
.mag .media-card-title,
.mag .article-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.mag .article-title {
    font-size: 1.35rem;
    text-transform: uppercase;
}

.mag .article-source {
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.mag .award-organization {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 1.05rem;
}

.mag .award-item {
    border-radius: 0;
}

/* Wide sections beneath the spread keep the magazine measure */
.mag .section {
    padding: 2rem 0;
}


/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1024px) {
    .mag .nav-links a {
        padding: 0 11px;
        font-size: 1.05rem;
    }

    .mag .header-login span {
        display: none;               /* icon only when the row is tight */
    }

    .mag .header-login {
        padding: 0 8px;
    }
}

@media (max-width: 768px) {
    /* The primary nav folds into the menu; search and login stay in the bar beside the burger */
    .mag .header-tools {
        margin-left: auto;
    }

    .mag .header-tools .theme-toggle {
        display: none;               /* it lives in the mobile menu's footer */
    }

    .mag .mobile-menu-toggle {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .mag .header-content {
        min-height: 54px;
        gap: 12px;
    }

    .mag .logo {
        font-size: 32px;
    }
}
