/*
Theme Name: Untave
Description: Editorial theme for Untave.
Version: 0.1.0
Requires at least: 6.8
Requires PHP: 8.2
Text Domain: untave
*/

:root {
    color-scheme: light;
    --paper: #f7f5ee;
    --ink: #171a13;
    --muted: #555b50;
    --line: #d3d5ca;
    --accent: #e5f477;
    --night: #151812;
    --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --gutter: clamp(1.1rem, 3.5vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 1rem/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: .16em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}
img, video { max-width: 100%; height: auto; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - var(--gutter) * 2, 1280px); margin-inline: auto; }

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    z-index: 20;
    top: .75rem;
    left: .75rem;
    width: auto;
    height: auto;
    padding: .6rem 1rem;
    clip-path: none;
    background: var(--accent);
    color: var(--ink);
}

.masthead, .site-footer { color: var(--paper); background: var(--night); }
.masthead { border-block-end: 3px solid var(--accent); }
.masthead-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    min-height: 76px;
}
.masthead ul, .site-footer ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(.85rem, 2.45vw, 2.1rem);
    margin: 0;
    padding: 0;
    list-style: none;
}
.masthead a, .site-footer a { text-decoration: none; }
.masthead a:hover, .site-footer a:hover { color: var(--accent); }
.wordmark {
    display: inline-block;
    width: max-content;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.07em;
    padding-right: .075em;
}
.wordmark > span:first-child { color: var(--accent); }
.sections-menu { font-weight: 650; }
.masthead-tools { display: flex; align-items: center; gap: .8rem; }
.masthead .edition-menu ul { gap: .65rem; }
.edition-menu a { font-size: .79rem; white-space: nowrap; }
.edition-menu [aria-current] { color: var(--accent); }
.quick-search { position: relative; }
.quick-search summary {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    list-style: none;
    border: 1px solid #6c7267;
}
.quick-search summary::-webkit-details-marker { display: none; }
.quick-search[open] summary, .quick-search summary:hover { border-color: var(--accent); color: var(--accent); }
.search-icon {
    position: relative;
    width: 13px;
    height: 13px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}
.search-icon::after {
    position: absolute;
    content: "";
    width: 6px;
    height: 1.5px;
    top: 11px;
    left: 9px;
    background: currentColor;
    transform: rotate(45deg);
}
.search-form { display: flex; gap: .5rem; width: min(100%, 28rem); }
.search-field { display: block; min-width: 0; flex: 1; }
.search-form input, .search-form button { min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--ink); }
.search-form input { width: 100%; background: white; color: var(--ink); }
.search-form button { background: var(--accent); color: var(--ink); font-weight: 700; }
.quick-search .search-form {
    position: absolute;
    z-index: 5;
    inset: calc(100% + .6rem) 0 auto auto;
    padding: .65rem;
    width: min(82vw, 25rem);
    background: var(--night);
    border: 1px solid #727a63;
}

.home-content { padding-block-start: clamp(1.2rem, 3vw, 2.65rem); }
.story-card { min-width: 0; }
.story-art { display: block; background: #d7dbc9; overflow: hidden; }
.story-art img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.story-copy { padding-block: .9rem 0; }
.story-label {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem .7rem;
    margin: 0 0 .45rem;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.story-label a { text-decoration: none; }
.story-label a:hover { text-decoration: underline; }
.story-label a + a { color: var(--muted); }
.story-label a + a::before { content: "/"; margin-right: .65rem; opacity: .7; }
.story-title { text-wrap: pretty; margin: 0; line-height: 1.1; font-weight: 785; letter-spacing: -.037em; }
.story-title a { text-decoration: none; }
.story-title a:hover { text-decoration: underline; text-decoration-thickness: .055em; }
.story-title:not(h1) { font-size: clamp(1.13rem, 2.1vw, 1.73rem); }
.story-card time, .article-header time {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 550;
    margin-block-start: .65rem;
}
.story-lead {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    min-height: clamp(290px, 34vw, 455px);
    background: var(--accent);
}
.story-lead:not(.has-art) { grid-template-columns: minmax(0, 1fr); min-height: auto; }
.story-lead .story-art img { height: 100%; aspect-ratio: auto; }
.story-lead .story-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.4rem, 3vw, 3.5rem);
}
.story-lead .story-title { font-size: clamp(2.15rem, 4.1vw, 4.45rem); line-height: .98; letter-spacing: -.061em; }
.story-lead time, .story-lead .story-label a + a { color: #333a20; }
.story-summary { font-size: clamp(.98rem, 1.65vw, 1.18rem); line-height: 1.5; margin: 1rem 0 .3rem; }
.story-section { margin-block: clamp(2rem, 5vw, 4.3rem); }
.section-title {
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    letter-spacing: -.05em;
    line-height: 1;
    border-block-start: 2px solid var(--ink);
    margin: 0 0 1.3rem;
    padding-block-start: .75rem;
}
.section-title a { text-decoration: none; }
.section-title a:hover { text-decoration: underline; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.story-grid .story-card:not(.has-art) { border-block-start: 1px solid var(--line); }
.latest-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(1rem, 2.5vw, 2rem); }
.latest-feed .story-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
    gap: .9rem;
    padding-block: 1rem;
    border-block-end: 1px solid var(--line);
    align-items: start;
}
.latest-feed .story-card:not(.has-art) { grid-template-columns: minmax(0, 1fr); }
.latest-feed .story-copy { padding: 0; }
.latest-feed time { margin-block-start: .4rem; }
.latest-feed .story-title { font-size: clamp(1.13rem, 1.65vw, 1.5rem); }
.pagination { margin-block: 1.8rem; font-weight: 700; }
.nav-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.nav-links .page-numbers { padding: .35rem .55rem; }
.nav-links .current { background: var(--accent); }

.archive-content { padding-block: clamp(1.8rem, 5vw, 4.5rem); min-height: 50vh; }
.archive-title {
    margin: 0 0 1.5rem;
    letter-spacing: -.055em;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    line-height: 1.02;
}
.archive-grid { row-gap: 2rem; }
.article-header {
    max-width: 800px;
    padding-block: clamp(2rem, 7vw, 5rem) 1.6rem;
    margin-inline: auto;
}
.article-header h1 {
    font-size: clamp(2.3rem, 7vw, 5.85rem);
    letter-spacing: -.065em;
    line-height: .99;
    margin: .65rem 0 0;
    text-wrap: balance;
}
.article-deck { font-size: clamp(1.1rem, 2.2vw, 1.48rem); color: var(--muted); margin: 1rem 0; }
.article-cover { margin: 0 auto clamp(1.6rem, 4vw, 3.8rem); max-width: 1080px; }
.article-cover img { width: 100%; display: block; }
.article-cover figcaption { margin-top: .5rem; font-size: .78rem; color: var(--muted); }
.article-body { max-width: 720px; margin-inline: auto; padding-block-end: 2rem; overflow-wrap: break-word; }
.article-body p, .article-body li { font-family: var(--serif); font-size: clamp(1.12rem, 2.25vw, 1.29rem); line-height: 1.68; }
.article-body h2, .article-body h3 { margin: 1.6em 0 .45em; line-height: 1.18; letter-spacing: -.025em; }
.article-body :where(figure, iframe) { max-width: 100%; }
.preview-notice { display: inline-block; padding: .3rem .6rem; background: var(--accent); }
.article-contents { border-inline-start: 2px solid #778031; padding-inline-start: 1rem; margin-block-end: 1.5rem; }
.article-contents ol { margin-block: .4rem; }
.article-contents li { font: .95rem/1.6 var(--sans); }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    min-height: 120px;
    padding-block: 1.2rem;
    gap: 1rem 2rem;
    align-items: center;
}
.footer-inner .wordmark { font-size: 2.35rem; }
.feed-link { margin-inline-start: auto; font-size: .83rem; color: var(--accent); }

@media (max-width: 980px) {
    .masthead-inner { grid-template-columns: auto 1fr; gap: .55rem 1rem; padding-block: .85rem .75rem; }
    .masthead-tools { grid-column: 2; grid-row: 1; justify-self: end; }
    .sections-menu { grid-column: 1 / -1; padding-block-start: .6rem; border-block-start: 1px solid #52594c; }
}

@media (max-width: 700px) {
    .story-lead { grid-template-columns: 1fr; }
    .story-lead .story-art img { height: auto; aspect-ratio: 8 / 5; }
    .story-lead .story-copy { padding: 1.2rem 1.1rem 1.45rem; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-feed { grid-template-columns: 1fr; }
    .latest-feed .story-card { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    .story-card time { font-size: .75rem; }
}

@media (max-width: 360px) {
    .sections-menu { font-size: .88rem; }
    .masthead .sections-menu ul { gap: .55rem 1rem; }
    .story-grid { grid-template-columns: 1fr; }
}
