/* ---------- Talks page ----------
   Built on the shared collection structure (collection.css gives the container
   width, footer width, centered title/subtitle, grid columns, card + hero hover,
   the filter-pill capsule recipe, and the detail header/media surface; the
   empty state is shared in site.css). This file adds only the talk-specific
   pieces: the featured hero, the poster thumbnail, the search bar, filter
   button behaviour, card internals, and topic badges.
   Tokens only; squircle; 720px collapse. */

/* Poster thumbnail - shared by the hero, the cards, and the detail fallback.
   Rounding/clip + img fill come from the shared media-surface rules
   (collection.css). The duration badge sits bottom-right, over either the
   poster or (until one lands) the flat .is-empty surface. */
.talks-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
}

.talks-duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    corner-shape: squircle;
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 1);
    font-size: 0.78em;
    font-variant-numeric: tabular-nums;
}

/* ----- Featured hero (always pinned) -----
   Thumb capped at 700×400 (the largest thumbnail size); the thumb + text are a
   centered group, vertically centred so the layout stays balanced however the
   title wraps. The text block hugs its content (up to a readable max). */
.talks-featured {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5em;
    text-decoration: none;
    color: inherit;
    /* Generous gap below so the featured spotlight reads as separate from the
       search/filter row, which is pulled in close to the grid it controls. */
    margin: 1em 0 4em;
}

/* Whole-surface-link hover suppression is shared with .collection-card:hover
   (collection.css). */
.talks-featured .talks-thumb {
    flex: 0 1 700px;
    aspect-ratio: 7 / 4;
}

.talks-featured-text {
    flex: 0 1 auto;
    max-width: 440px;
}

.talks-eyebrow {
    display: block;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.8em;
}

.talks-featured-title {
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1.05;
    color: var(--heading);
    margin: 0 0 0.4em;
}

.talks-featured-meta {
    color: var(--text-secondary);
    margin: 0 0 1em;
}

/* ----- Controls: search + Topic/Year filters -----
   Stacked by default - search on its own line, the Topic and Year groups on the
   line below. At the wide tier they all inline onto one row (see the min-width
   rule below), the search box growing to fill the space beside the filters. */
.talks-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8em 2em;
    margin: 0 0 1.25em;
}

.talks-search-wrap {
    position: relative;
    flex: 1 1 100%;
}

/* Magnifying-glass icon, vertically centred at the left of the capsule. */
.talks-search-icon {
    position: absolute;
    left: 1.2em;
    top: 50%;
    transform: translateY(-50%);
    width: 1.05em;
    height: 1.05em;
    color: var(--text-tertiary);
    pointer-events: none;
}

.talks-search {
    width: 100%;
    padding: 0.85em 1.3em 0.85em 2.9em;
    font: inherit;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    corner-shape: squircle;
    /* A long query ends with an ellipsis when the field isn't focused. */
    text-overflow: ellipsis;
}

.talks-search::placeholder { color: var(--text-tertiary); }

/* Focus ring in the text colour (white in dark mode, black in light) - the
   red read as an error state. */
.talks-search:focus {
    outline: none;
    border-color: var(--text);
}

/* ----- Filter groups (Topic / Year) ----- */
/* Label is a fixed-width, right-aligned column; the pills live in their own
   wrapping column, so when stacked the labels line up (pills share a left edge)
   and pills that wrap stay inset under the first pill - never under the label. */
.talks-filter-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.talks-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.talks-filter-label {
    width: 3.5em;
    flex: 0 0 auto;
    text-align: right;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Capsule look + hover come from the shared .section-chip recipe
   (collection.css); these are <button>s, so reset the UA chrome. font: inherit
   wipes the shared rule's size/leading (this file loads later), so restate them. */
.talks-filter {
    background: transparent;
    font: inherit;
    font-size: 0.85em;
    line-height: 1.6;
    cursor: pointer;
}

.talks-filter.is-active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

/* Wide tier: search joins the filter line on the far left, growing to fill the
   space up to the Topic/Year groups. */
@media (min-width: 1650px) {
    .talks-search-wrap {
        flex: 1 1 280px;
    }
}

/* ----- Talk card internals (card shell + hover come from .collection-card) ----- */
.talks-card-body { padding: 14px 2px 0; }

.talks-card-title {
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.25;
    color: var(--heading);
    margin: 0 0 0.3em;
}

.talks-card-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0 0 0.7em;
}

/* ----- Topic badges ----- */
.talks-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.talks-tag {
    padding: 2px 9px;
    border-radius: 6px;
    corner-shape: squircle;
    background: var(--bg-secondary);
    font-size: 0.78em;
    color: var(--text-secondary);
}

/* ----- Filtered-out cards + empty state (toggled by site.js; .talks-empty
   styling is the shared rule in site.css) ----- */
.talks-card.hidden,
.talks-grid.hidden { display: none; }

/* The featured talk is already the hero, so its grid card stays hidden until a
   filter or search is active (site.js sets .is-filtering), when it should turn
   up in the results like any other match. */
.talks-grid:not(.is-filtering) .talks-card--featured { display: none; }

/* ----- Mobile ----- */
@media (max-width: 720px) {
    .talks-featured {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2em;
        /* Stacked on a phone, a hairline makes the split from the controls clear. */
        margin-bottom: 2em;
        padding-bottom: 2em;
        border-bottom: 1px solid var(--border);
    }
    .talks-featured .talks-thumb { flex-basis: auto; }
    .talks-featured-text { max-width: none; }
    .talks-featured-title { font-size: 1.9em; }
}
