/*
 * Fi1m — Home, magazine edition
 * =============================
 * Loaded after styles.css, pages/home.css and pages/mag.css. The lead review is the cover: full-bleed art with the
 * title in a red slab hanging out of the picture. The ask bar becomes a black strip beneath it, the chips outlined
 * slabs. Then the shelves and the features grid in the shared magazine treatment.
 */

/* ------------------------------------------------------------------ 1. Cover */
.mag-cover {
    position: relative;
    display: block;
    height: clamp(380px, 64vh, 680px);
    background: #000;
    color: inherit;
}

.mag-cover:hover {
    color: inherit;
}

.mag-cover-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.mag-cover-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    transition: transform 0.6s ease;
}

.mag-cover:hover .mag-cover-media img {
    transform: scale(1.02);
}

.mag-cover-media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.mag-cover .container {
    position: relative;
    height: 100%;
}

.mag-cover-kicker {
    position: absolute;
    top: 28px;
    left: var(--container-pad);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 12px;
    backdrop-filter: blur(6px);
}

.mag-cover-kicker::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--primary);
}

.mag-cover-kicker b {
    font-weight: 800;
    color: var(--primary);
    margin-left: 4px;
}

.mag-cover-block {
    position: absolute;
    left: var(--container-pad);
    bottom: -58px;
    max-width: min(820px, 80%);
    z-index: 2;
    text-wrap: balance;                  /* see .mag-title-block in film-v2.css */
}

.mag-cover-title {
    display: inline;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.4rem, 5.6vw, 4.8rem);
    line-height: 1.2;                    /* stacked slabs just overlap, no gap; see film-v2.css */
    text-transform: uppercase;
    color: #fff;
    background: var(--primary);
    padding: 0.04em 0.28em 0.06em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.mag-cover-stand {
    display: block;
    margin-top: 10px;
}

.mag-cover-stand span {
    display: inline;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--paper);
    background: var(--ink);
    padding: 5px 10px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ------------------------------------------------------------------ 2. The ask strip */
.mag-ask {
    margin-top: 92px;
    padding: 28px 0 30px;
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--border-color);
}

.mag-ask--solo {
    margin-top: 0;
    border-top: 0;
}

.mag-ask-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.mag .hero-greeting h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: -0.005em;
    margin-bottom: 10px;
}

.mag .hero-greeting h1 em {
    font-style: normal;
    color: var(--primary);
}

.mag .hero-greeting p {
    font-size: 1rem;
    color: var(--text-color-muted);
    max-width: 520px;
    margin-bottom: 18px;
}

.mag .ask-bar--hero {
    margin: 0;
    border-radius: 0;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: none;
    padding: 4px 4px 4px 16px;
}

.mag .ask-bar--hero:focus-within {
    border-color: var(--primary);
    box-shadow: none;
}

.mag .ask-bar--hero .ask-input {
    font-size: 1.05rem;
    background: none;
}

.mag .ask-bar--hero .ask-send {
    border-radius: 0;
    width: 46px;
    height: 46px;
    background: var(--ink);
    color: var(--paper);
}

.mag .ask-bar--hero .ask-send.active {
    background: var(--primary);
    color: #fff;
}

/* Chips as outlined slabs, stacked to the right like a rail of headlines */
.mag .hero-suggestions {
    margin-top: 0;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

.mag .suggestion-chip {
    border-radius: 0;
    background: none;
    border: 2px solid var(--ink);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-align: left;
    padding: 0.5rem 0.9rem;
    white-space: nowrap;          /* site.js sizes the column from one chip, so they must all be one line tall */
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag .suggestion-chip:hover {
    background: var(--ink);
    color: var(--paper);
    transform: none;
}

.mag .suggestion-chip.is-entering,
.mag .suggestion-chip.is-leaving {
    margin-bottom: -6px;
    border-top-width: 0;
    border-bottom-width: 0;
}

/* ------------------------------------------------------------------ 3. Shelves and grids */
.mag .media-card-info {
    font-size: 0.82rem;
}

/* Latest reviews: the first card runs wide, the other two stack tightly beside it. A third, empty 1fr row takes the
   height the big card has over the pair, so the small ones sit at the top instead of being spread down the column. */
.mag .reviews-grid {
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 22px 36px;
}

.mag .reviews-grid .article-card:first-child {
    grid-row: 1 / 4;
}

.mag .reviews-grid .article-card:first-child .article-image {
    aspect-ratio: 16 / 10;
}

.mag .reviews-grid .article-card:first-child .article-title {
    font-size: 2rem;
}

.mag .reviews-grid .article-card:not(:first-child) {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 18px;
    align-items: start;
    padding-top: 0;
}

/* One hairline between the two small cards; nothing else */
.mag .reviews-grid .article-card:nth-child(3) {
    border-top: 1px solid var(--border-color);
    padding-top: 22px;
}

.mag .reviews-grid .article-card:not(:first-child) .article-content {
    padding-top: 0;
}

.mag .reviews-grid .article-card:not(:first-child) .article-image {
    aspect-ratio: 1 / 1;
}

.mag .reviews-grid .article-card:not(:first-child) .article-excerpt {
    display: none;
}

/* Cards carry no rules of their own: the section heading's rule is the only heavy line, the gaps do the rest */
.mag .article-card {
    background: none;
    border: 0;
}

.mag .article-card:hover {
    transform: none;
    box-shadow: none;
}

.mag .article-content {
    padding: 16px 0 0;
}

.mag .article-title {
    margin-bottom: 8px;
}

.mag .article-excerpt {
    margin-bottom: 12px;
}

.mag .article-source {
    margin-bottom: 8px;
}

.mag .article-source b {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 6px 1px;
    margin-left: 6px;
    font-weight: 800;
}

.mag .article-date {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Features: two large across the first row, three below; one hairline between the tiers */
.mag .article-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px 32px;
}

.mag .article-grid .article-card:nth-child(-n+2) {
    grid-column: span 1;
}

/* Tablets: two across. Phones: one column, the lead piece with its wide picture, the rest as rows with a square
   thumbnail beside the text, so it reads as a list rather than thin strips. */
@media (max-width: 900px) {
    .mag .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 24px;
    }
}

@media (max-width: 640px) {
    .mag .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mag .article-grid .article-card:first-child {
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .mag .article-grid .article-card:not(:first-child) {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 16px;
        align-items: start;
    }

    .mag .article-grid .article-card:not(:first-child) .article-image {
        aspect-ratio: 1 / 1;
    }

    .mag .article-grid .article-card:not(:first-child) .article-content {
        padding-top: 0;
    }

    .mag .article-grid .article-card:not(:first-child) .article-title {
        font-size: 1.15rem;
    }

    .mag .article-grid .article-card:not(:first-child) .article-excerpt {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
}

@media (min-width: 1025px) {
    .mag .article-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .mag .article-grid .article-card:nth-child(-n+2) {
        grid-column: span 3;
    }

    .mag .article-grid .article-card:nth-child(n+3) {
        grid-column: span 2;
    }

    .mag .article-grid .article-card:nth-child(-n+2) .article-title {
        font-size: 1.8rem;
    }

    .mag .article-grid .article-card:nth-child(n+3) {
        border-top: 1px solid var(--border-color);
        padding-top: 28px;
        margin-top: -8px;
    }
}

/* ------------------------------------------------------------------ 4. Responsive */
@media (max-width: 1024px) {
    .mag-ask-inner {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .mag .hero-suggestions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .mag .suggestion-chip.is-entering,
    .mag .suggestion-chip.is-leaving {
        margin-bottom: 0;
        margin-right: -6px;
        border-left-width: 0;
        border-right-width: 0;
        border-top-width: 2px;
        border-bottom-width: 2px;
    }

    .mag .reviews-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .mag .reviews-grid .article-card:first-child {
        grid-row: auto;
    }

    .mag .reviews-grid .article-card:not(:first-child) {
        border-top: 1px solid var(--border-color);
        padding-top: 22px;
    }
}

@media (max-width: 640px) {
    .mag-cover {
        height: 66vw;
        min-height: 320px;
    }

    .mag-cover-kicker {
        top: 16px;
        font-size: 0.8rem;
    }

    .mag-cover-block {
        right: var(--container-pad);
        max-width: none;
        bottom: -40px;
    }

    .mag-cover-title {
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    .mag-cover-stand span {
        font-size: 0.92rem;
    }

    .mag-ask {
        margin-top: 64px;
        padding: 22px 0 24px;
    }

    .mag .reviews-grid .article-card:not(:first-child) {
        grid-template-columns: 110px 1fr;
    }

    .mag .reviews-grid .article-card:first-child .article-title {
        font-size: 1.6rem;
    }
}
