/* ---------- Archive page ---------- */

/* Widen the content column (and, via the shared --page-width mechanism in
   site.css, the footer) past the default reading width. */
body:has(.archive) {
    --page-width: 1000px;
}

/* Bottom margin lives on the wrap so the gap to the first result survives even
   when the year chips hide during a search. */
.archive-search-wrap {
    position: relative;
    margin: 0 auto 1em;
}

.archive-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.archive-search {
    display: block;
    width: 100%;
    padding: 12px 18px 12px 46px;
    border-radius: 999px;
    corner-shape: squircle;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.9em;
    margin: 0;
    text-overflow: ellipsis;
}

/* Text-colour focus ring, matching the Talks search. */
.archive-search:focus {
    outline: none;
    border-color: var(--text);
    color: var(--text);
}

/* Filtered-out rows / empty year sections (toggled by site.js). The no-results
   message styling is the shared .archive-empty/.talks-empty rule in site.css. */
.archive-row.hidden,
.archive-year.hidden {
    display: none;
}

/* Year row - big year + post count on the left, a flat post list on the right.
   A hairline divides consecutive years (not above the first). */
.archive-year {
    display: grid;
    grid-template-columns: 145px 1fr;
    column-gap: 2.5em;
    padding: 2em 0;
}

.archive-year + .archive-year {
    border-top: 1px solid var(--border);
}


.archive-year-aside h2 {
    font-size: 2.6em;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.1em;
}

.archive-year-count {
    display: block;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.5;
}

.archive-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: baseline;
    padding: 5px 0;
}

/* Archive post-title links sit a touch larger than the body to fill the wider
   column. */
.archive-row .text-link {
    font-size: 17pt;
}

.archive-date {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .archive-year {
        grid-template-columns: 1fr;
        row-gap: 1.2em;
    }
    .archive-year-aside h2 {
        font-size: 2.1em;
    }
}

/* Back-to-top sits just outside the Archive's (1000px) column on wide windows -
   the global rule is tuned for the 1650px collection pages. */
body:has(.archive) .back-to-top {
    right: max(24px, calc(50vw - 555px));
}
