/*
 * /teme: the theme directory. A hero with the search, the biggest themes as tiles, every theme A–Ž by its first letter,
 * and a side column with ads. Square corners and strong rules, like /stats.
 */

.themes-shell {
    display: grid;
    gap: 1.5rem;
    padding-top: 1.25rem;
    padding-bottom: 1rem;
}

.themes-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.5rem 2.5rem;
    align-items: end;
    padding: 1.75rem 2rem;
    background: var(--panel);
    border: 1px solid var(--news-rule);
    border-left: 6px solid var(--news-accent);
}

.themes-hero-copy {
    display: grid;
    justify-items: start;
    gap: 0.85rem;
}

.themes-kicker {
    margin: 0;
    padding: 0.2rem 0.55rem;
    color: #fff;
    background: var(--news-accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.themes-hero h1 {
    margin: 0;
    color: var(--news-ink);
    font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem);
    font-weight: 900;
    line-height: 1.05;
}

.themes-lead {
    max-width: 40rem;
    margin: 0;
    color: var(--news-soft-ink);
    font-size: 1.05rem;
    line-height: 1.55;
}

.themes-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: min(100%, 34rem);
    margin-top: 0.25rem;
    background: #fff;
    border: 2px solid var(--news-ink);
}

.themes-search i {
    padding-left: 0.85rem;
    color: var(--muted);
}

.themes-search input {
    min-width: 0;
    min-height: 2.9rem;
    padding: 0.4rem 0.75rem;
    border: 0;
    outline: none;
    font: inherit;
    font-weight: 600;
}

.themes-search button {
    align-self: stretch;
    padding: 0 1.2rem;
    color: #fff;
    background: var(--news-ink);
    border: 0;
    font-weight: 900;
    cursor: pointer;
}

.themes-search button:hover,
.themes-search button:focus-visible {
    background: var(--news-accent);
}

.themes-search:focus-within {
    outline: 3px solid color-mix(in srgb, var(--news-accent) 35%, transparent);
    outline-offset: 2px;
}

.themes-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border-top: 3px solid var(--news-ink);
}

.themes-figures > div {
    padding: 0.85rem 1rem 0.85rem 0;
}

.themes-figures > div + div {
    padding-left: 1rem;
    border-left: 1px solid var(--news-rule);
}

.themes-figures dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.themes-figures dd {
    margin: 0.2rem 0 0;
    color: var(--news-ink);
    font-family: var(--news-font-head);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem);
    font-weight: 900;
    line-height: 1.1;
}

.themes-figures > div:first-child dd {
    color: var(--news-accent);
}

.themes-figures > div + div dd {
    font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
}

/* The page and its side column. */
.themes-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 336px);
    gap: 1.5rem;
    align-items: start;
}

.themes-main {
    display: grid;
    gap: 1.75rem;
    min-width: 0;
}

.themes-aside {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-width: 0;
}

.themes-block-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 3px solid var(--news-ink);
}

.themes-block-title h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: var(--news-ink);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.themes-block-title i {
    color: var(--news-accent);
}

.themes-link {
    color: var(--news-ink);
    font-weight: 900;
    text-decoration: underline;
    text-decoration-color: var(--news-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* The biggest themes (or a search's matches) as tiles. */
.themes-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.themes-tile {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    height: 100%;
    padding: 1rem 1.05rem;
    color: inherit;
    background: var(--panel);
    border: 1px solid var(--news-rule);
    border-top: 4px solid var(--news-ink);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.themes-tiles li:first-child .themes-tile {
    border-top-color: var(--news-accent);
}

.themes-tile strong {
    color: var(--news-ink);
    font-family: var(--news-font-head);
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.2;
}

.themes-tile span {
    color: var(--news-soft-ink);
    font-size: 0.86rem;
    font-weight: 700;
}

.themes-tile time {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.themes-tile:hover,
.themes-tile:focus-visible {
    border-color: var(--news-ink);
}

.themes-tile:hover strong,
.themes-tile:focus-visible strong {
    color: var(--news-accent);
    text-decoration: underline;
}

/* Every theme A–Ž: a row of letters to jump, then the letters in columns. */
.themes-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.themes-letters a {
    display: inline-grid;
    place-items: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.4rem;
    color: var(--news-ink);
    background: var(--panel);
    border: 1px solid var(--news-rule);
    font-family: var(--news-font-head);
    font-weight: 900;
    text-decoration: none;
}

.themes-letters a:hover,
.themes-letters a:focus-visible {
    color: #fff;
    background: var(--news-ink);
    border-color: var(--news-ink);
}

.themes-index {
    columns: 3 14rem;
    column-gap: 1.25rem;
    padding: 1.1rem 1.25rem;
    background: var(--panel);
    border: 1px solid var(--news-rule);
}

.themes-letter {
    break-inside: avoid;
    margin-bottom: 1rem;
    scroll-margin-top: 1rem;
}

.themes-letter h3 {
    margin: 0 0 0.35rem;
    padding-bottom: 0.2rem;
    color: var(--news-accent);
    border-bottom: 2px solid var(--news-ink);
    font-size: 1.15rem;
    font-weight: 900;
}

.themes-letter ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.themes-letter li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.28rem 0;
    border-bottom: 1px solid var(--news-rule);
    font-size: 0.92rem;
}

.themes-letter li:last-child {
    border-bottom: 0;
}

.themes-letter a {
    min-width: 0;
    color: var(--news-ink);
    font-weight: 700;
    text-decoration: none;
}

.themes-letter a:hover,
.themes-letter a:focus-visible {
    color: var(--news-accent);
    text-decoration: underline;
}

.themes-letter li span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.themes-empty {
    display: grid;
    justify-items: start;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--panel);
    border: 1px solid var(--news-rule);
}

.themes-empty h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
}

.themes-empty p {
    margin: 0;
    color: var(--news-soft-ink);
}

@media (max-width: 1199.98px) {
    .themes-hero {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 991.98px) {
    .themes-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .themes-shell {
        gap: 1.25rem;
    }

    .themes-hero {
        padding: 1.25rem 1.1rem;
        border-left-width: 4px;
    }

    .themes-search button {
        padding: 0 0.85rem;
    }

    .themes-index {
        padding: 0.9rem 1rem;
    }
}
