/*
 * Reusable listing containers ("news containers") — owner ruling 2026-09-18,
 * docs/decisions-log.md. Rendered by the inclusion tags in
 * jineps/apps/articles/templatetags/article_block_tags.py.
 *
 * Deliberately a separate stylesheet from homepage.css: these containers are
 * meant to be composed onto section and topic pages too, and those pages must
 * not have to load the homepage's sheet to get them.
 *
 * Mobile-first per architecture §5d — the rules outside a media query ARE the
 * <640px layout, and both arrangements are the same stacked column there. The
 * --two-column / --lead-top split only exists from 900px up, where there is
 * room for it.
 *
 * No literal hex anywhere in this file; every colour is a token.
 */

.section-block {
    padding-top: var(--space-7);
}

/* Label, 2.5px rule, optional "tümü →" — the same header language as the
   homepage's own sections, restated here rather than shared, because
   .homepage-section-header lives in homepage.css and this file must stand
   alone. */
.section-block__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-5);
}

.section-block__label {
    margin: 0;
    font: 700 var(--text-kicker) / 1 var(--font-sans);
    letter-spacing: var(--tracking-kicker);
    text-transform: uppercase;
    color: var(--ink);
}

.section-block__label a {
    color: inherit;
    text-decoration: none;
}

.section-block__label a:hover {
    text-decoration: underline;
}

.section-block__rule {
    flex: 1;
    height: var(--rule-hairline);
    background: var(--ink);
}

.section-block__more {
    font: 400 var(--text-kicker) / 1 var(--font-sans);
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.section-block__more:hover {
    text-decoration: underline;
}

.section-block__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.section-block__lead-media,
.section-block__secondary-media {
    display: block;
}

.section-block__caption {
    margin: var(--space-1) 0 0;
    font: 400 var(--text-meta) / 1.4 var(--font-sans);
    color: var(--meta);
}

.section-block__flags {
    margin: var(--space-2) 0 0;
}

/* Colour is never the only signal — the badge is colour and text. */
.section-block__badge {
    display: inline-block;
    padding: 3px 7px;
    font: 700 var(--text-kicker-small) / 1 var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-ink);
    background: var(--ink);
}

.section-block__lead-title {
    margin: var(--space-2) 0 0;
    font-size: var(--text-h2);
    line-height: var(--leading-headline);
    letter-spacing: var(--tracking-headline);
}

.section-block__lead-title a,
.section-block__secondary-title a {
    color: var(--ink);
    text-decoration: none;
}

.section-block__lead-title a:hover,
.section-block__secondary-title a:hover {
    text-decoration: underline;
}

.section-block__lead-excerpt {
    margin: var(--space-3) 0 0;
    font: 400 var(--text-body) / var(--leading-body) var(--font-serif);
    color: var(--body);
}

.section-block__meta {
    margin: var(--space-2) 0 0;
    font: 400 var(--text-meta) / 1.4 var(--font-sans);
    color: var(--meta);
}

.section-block__secondaries {
    display: grid;
    /* auto-fit, not a fixed column count: the component renders however many
       secondaries the caller passed (owner ruling 2026-09-18 — no assumed item
       count), so two and five both have to lay out without a special case. */
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: var(--space-6);
    margin: 0;
    padding: 0;
    list-style: none;
}

.section-block__secondary-title {
    margin: var(--space-1) 0 0;
    font-size: var(--text-lead);
    line-height: var(--leading-h3);
    letter-spacing: var(--tracking-h3);
}

/* Headline-only container. Reuses .section-block__header / __label / __rule /
   __more / __badge above rather than restating them — the header language is
   shared by every container in this file, and duplicating it is how two
   containers end up with silently different rules. */
.headline-list {
    padding-top: var(--space-7);
}

.headline-list__items {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.headline-list__item {
    padding: var(--space-4) 0;
    border-top: var(--rule-hairline) solid var(--rule);
}

.headline-list__item:first-child {
    border-top: 0;
}

.headline-list__link {
    font-size: var(--text-lead);
    line-height: var(--leading-h3);
    letter-spacing: var(--tracking-h3);
    color: var(--ink);
    text-decoration: none;
}

.headline-list__link:hover {
    text-decoration: underline;
}

.headline-list__meta {
    margin: var(--space-1) 0 0;
    font: 400 var(--text-meta) / 1.4 var(--font-sans);
    color: var(--meta);
}

/* Image heights per slot. The leads are own-shape frames (articles.css): the
   frame follows the picture and these values are its maximum height
   (--frame-h); a scan, which is not own-shape, uses them as its fixed height.
   The secondaries are fixed boxes with the picture contained inside. */
.article-image--section-block-lead .article-image__mat {
    --frame-h: 280px;
    height: var(--frame-h);
}

.article-image--section-block-lead-wide .article-image__mat {
    --frame-h: 300px;
    height: var(--frame-h);
}

.article-image--section-block-secondary .article-image__mat {
    height: 128px;
}

@media (min-width: 640px) {
    .article-image--section-block-lead .article-image__mat {
        --frame-h: 340px;
        height: var(--frame-h);
    }

    .article-image--section-block-lead-wide .article-image__mat {
        --frame-h: 400px;
        height: var(--frame-h);
    }

    .article-image--section-block-secondary .article-image__mat {
        height: 160px;
    }

    .headline-list__items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-7);
    }

    /* Two columns means two items share the top row, so the single
       :first-child exemption above would leave the second column's first
       headline wearing a stray rule the first column's does not. */
    .headline-list__item:nth-child(-n + 2) {
        border-top: 0;
    }
}

/* 900px — the two arrangements diverge. Below this they are the same stacked
   column, which is why every rule above is shared. */
@media (min-width: 900px) {
    .section-block--two-column .section-block__body {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: var(--space-7);
        align-items: start;
    }

    /* In the two-column arrangement the secondaries stack in the narrow
       column, so the auto-fit grid above would try to sit them side by side in
       a column too narrow for it. One column, explicitly. */
    .section-block--two-column .section-block__secondaries {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-5);
    }

    .section-block--two-column .article-image--section-block-lead .article-image__mat {
        --frame-h: 380px;
        height: var(--frame-h);
    }

    /* Shorter than the 500px rendition on purpose: the block must not eat a
       whole screen, so a tall picture hits this cap and gets matted sides. */
    .section-block--lead-top .article-image--section-block-lead-wide .article-image__mat {
        --frame-h: 480px;
        height: var(--frame-h);
    }

    .section-block--lead-top .section-block__lead-title {
        font-size: var(--text-h1);
    }

    /* The lead's own text should not run the full 880px column — that is well
       past the 65-75 character measure. The image above it still does. */
    .section-block--lead-top .section-block__lead-excerpt {
        max-width: var(--measure);
    }
}

/* ---------------------------------------------------------------------------
   Hero carousel ({% hero_carousel %}) — owner ruling 2026-09-18.

   One slide visible at every breakpoint. The well becomes 3-up on desktop;
   this does not, because mixing those layouts is how an article-only
   retrofit would have happened by accident.
   --------------------------------------------------------------------------- */

.hero-carousel {
    padding: var(--space-7) 0 var(--space-6);
    border-bottom: var(--rule-hairline) solid var(--rule);
}

.hero-carousel__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hero-carousel__track::-webkit-scrollbar {
    display: none;
}

.hero-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
}

.hero-carousel__media {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.hero-carousel__caption {
    margin: var(--space-1) 0 0;
    font: 400 var(--text-meta) / 1.4 var(--font-sans);
    color: var(--meta);
}

.hero-carousel__kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: var(--space-4) 0 0;
    font: 600 var(--text-kicker) / 1 var(--font-sans);
    letter-spacing: var(--tracking-kicker);
    text-transform: uppercase;
    color: var(--accent);
}

.hero-carousel__badge {
    display: inline-block;
    padding: 3px 7px;
    font: 700 var(--text-kicker-small) / 1 var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-ink);
    background: var(--ink);
}

.hero-carousel__title {
    margin: var(--space-3) 0 0;
    font-family: var(--font-serif);
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: var(--leading-headline);
    color: var(--ink);
}

.hero-carousel__title a {
    color: inherit;
    text-decoration: none;
}

.hero-carousel__title a:hover,
.hero-carousel__title a:focus-visible {
    text-decoration: underline;
}

.hero-carousel__summary {
    margin: var(--space-3) 0 0;
    max-width: var(--measure);
    font-size: var(--text-lead);
    line-height: var(--leading-body);
    color: var(--body);
}

/* Same 44x44 hit area as the homepage well's dots, for the same reason and by
 * the same means (UX audit C7, 2026-09-19 — see homepage.css for the full
 * note): the button is the target, ::before is the 10px dot the design draws.
 * The radius belongs on the pseudo-element; on the button it would round a
 * transparent box and leave the dot square. */
/* The arrows sit either side of the dots on one row (plan 14). The margin that
 * used to lift the dots is on the row, so the arrows and dots stay level. */
.hero-carousel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-1);
}

.hero-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0;
}

.hero-carousel__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--target-min);
    height: var(--target-min);
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.hero-carousel__arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-carousel__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--target-min);
    height: var(--target-min);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hero-carousel__dot::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rule);
}

.hero-carousel__dot--active::before {
    background: var(--ink);
}

.article-image--hero-slide .article-image__mat {
    height: 200px;
}

@media (min-width: 640px) {
    .article-image--hero-slide .article-image__mat {
        height: 320px;
    }
}

@media (min-width: 900px) {
    .hero-carousel__title {
        font-size: 34px;
        line-height: 1.09;
    }

    .article-image--hero-slide .article-image__mat {
        height: 420px;
    }
}

/* Phone touch targets (design-principles section 6: hit targets at least 44px).
   Found under 44px by the 2026-11-02 UI audit at 390px; from 900px the old
   compact sizes stand (pointer, and the utility bar is fixed at 34px there). */
@media (max-width: 899px) {
    .section-block__more {
        display: inline-flex;
        align-items: center;
        min-height: var(--target-min);
    }
}
