/*
Theme Name: Hipavel
Description: Editorial theme built around an explorable wheel of the P.S. You Should Know archive.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: hipavel
*/

:root {
	--ink: #0a0c11;
	--ink-2: #14171f;
	--line-dark: #333945;
	--text: #edeae2;
	--muted: #b6bbc6;
	--paper: #f3efe6;
	--paper-line: #d6d0c2;
	--on-paper: #16171b;
	--on-paper-muted: #55534e;
	--gold: #f5c542;
	--serif: Newsreader, Georgia, serif;
	--sans: Geist, system-ui, sans-serif;
	--mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pad { padding-left: 48px; padding-right: 48px; }
.label { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.label-dark { color: var(--on-paper-muted); }
.label-ink { color: var(--ink); }
.label-gold { color: var(--gold); }

/* Masthead */
.masthead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; }
.brand { font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -.01em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.nav a, .footer-links a { text-decoration: none; }
.nav a:hover, .footer-links a:hover { color: #fff; }
.nav-cta { color: var(--gold); font-weight: 500; }
.top-bar { padding-top: 24px; padding-bottom: 24px; }

/* Homepage split */
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.explorer { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding-top: 28px; padding-bottom: 40px; }
.headline { margin: 12px 0 0; max-width: 13em; font-family: var(--serif); font-weight: 400; font-size: 60px; line-height: 1.02; letter-spacing: -.025em; }
.intro { margin: 0; max-width: 38em; font-size: 16px; line-height: 1.45; color: var(--muted); scroll-margin-top: 24px; }
.intro strong { color: var(--text); font-weight: 500; }

.search { display: flex; flex-direction: column; gap: 10px; }
.search input { width: 100%; height: 52px; padding: 0 18px; font: inherit; font-size: 17px; color: var(--text); background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 10px; }
.search input::placeholder { color: #8b93a3; }
.tries { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; font-size: 13px; color: var(--text); background: transparent; border: 1px solid var(--line-dark); border-radius: 999px; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: #8b93a3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.chips[data-subs] .chip { min-height: 36px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.chips .chip[aria-pressed="true"] { color: var(--ink); background: var(--c); border-color: var(--c); }
.chip-toggle { border-style: dashed !important; border-color: #4a5160 !important; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.count { font-family: var(--mono); font-size: 12px; opacity: .75; }

.wheel { position: relative; display: block; width: 100%; max-width: 860px; aspect-ratio: 1; margin: 0 auto; padding: 0; color: inherit; background: none; border: 0; border-radius: 50%; cursor: crosshair; container-type: inline-size; animation: arrive .9s cubic-bezier(.2, .7, .2, 1) both; }
.wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wheel-center { position: absolute; left: 50%; top: 50%; width: 30%; display: flex; flex-direction: column; align-items: center; gap: .3em; text-align: center; transform: translate(-50%, -50%); pointer-events: none; }
.wnum { font-family: var(--serif); font-size: 13cqw; line-height: .95; letter-spacing: -.03em; color: #fff; }
.wsub { font-size: max(11px, 2.1cqw); line-height: 1.25; }
.wlong { font-family: var(--mono); color: #9aa1af; }
.wyear { position: absolute; font-family: var(--mono); font-size: max(10px, 1.45cqw); color: #9aa1af; transform: translate(-50%, -50%); pointer-events: none; }
@keyframes arrive { from { opacity: 0; transform: rotate(-5deg) scale(.97); } to { opacity: 1; transform: none; } }
@container (max-width: 520px) { .wyear, .wlong { display: none; } }

.scrub, .legend { display: flex; flex-direction: column; width: 100%; max-width: 860px; margin: 0 auto; }
.scrub { gap: 6px; }
.scrub input { width: 100%; height: 32px; margin: 0; accent-color: var(--gold); }
.legend { gap: 12px; }

/* Reader */
.reader { display: flex; flex-direction: column; min-width: 0; padding-top: 28px; color: var(--on-paper); background: var(--paper); }
.reader-head { padding-bottom: 20px; border-bottom: 1px solid var(--on-paper); }
.reader-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; }
.reader-head h2 { margin: 10px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.05; letter-spacing: -.02em; }
.reader-head p { margin: 0; font-size: 15px; color: var(--on-paper-muted); }
.pager { display: flex; gap: 6px; }
.pager button { width: 44px; height: 44px; font-size: 18px; color: var(--on-paper); background: none; border: 1px solid var(--on-paper); border-radius: 50%; cursor: pointer; }
.pager button:disabled { opacity: .3; cursor: default; }
.btn-outline { margin-top: 12px; min-height: 36px; padding: 0 12px; font-size: 13px; color: var(--on-paper); background: none; border: 1px solid var(--on-paper); border-radius: 8px; cursor: pointer; }
.btn-solid { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 8px 16px; font-size: 15px; text-align: center; text-decoration: none; color: var(--paper); background: var(--on-paper); border: 0; border-radius: 10px; cursor: pointer; }
.list { flex: 1 1 0; height: 0; overflow-y: auto; padding-bottom: 32px; }
.list .btn-solid { margin: 24px 0; }
.empty { margin: 28px 0; font-family: var(--serif); font-size: 22px; line-height: 1.35; }

.item { padding: 24px 0; border-bottom: 1px solid var(--paper-line); }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--mono); font-size: 12px; color: var(--on-paper-muted); }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.item-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.14; letter-spacing: -.012em; }
.item-title a, .essay-card h3 a, .more-grid h3 a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .2s; }
.item-title a:hover, .essay-card h3 a:hover, .more-grid h3 a:hover { background-size: 100% 1px; }
.item p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.42; color: #2a2a2c; }

/* Bookshelf and essays */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 32px; margin-bottom: 36px; }
.section-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.05; letter-spacing: -.02em; }
.shelf-section { padding-top: 72px; padding-bottom: 80px; border-top: 1px solid #262b36; scroll-margin-top: 0; }
.shelf { display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 28px; }
.spine-slot { display: flex; align-items: flex-end; height: 252px; padding-right: 3px; border-bottom: 2px solid #4a5160; }
.spine { display: block; width: var(--w); height: var(--h); color: var(--ink); background: var(--c); border-radius: 3px 3px 0 0; text-decoration: none; transition: transform .15s, opacity .15s; }
.spine:hover { transform: translateY(-10px); }
.spine span { display: block; width: 100%; height: 100%; padding: 12px 0; font-family: var(--serif); font-size: 16px; font-weight: 500; line-height: var(--w); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; writing-mode: vertical-rl; }
.spine.dim { opacity: .14; }

.essays-section { padding-top: 72px; padding-bottom: 88px; color: var(--on-paper); background: var(--paper); }
.essays-section .section-head { margin-bottom: 0; padding-bottom: 24px; border-bottom: 1px solid var(--on-paper); }
.essays { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); column-gap: 64px; }
.essay-card { padding: 32px 0; border-bottom: 1px solid var(--paper-line); transition: opacity .15s; }
.essay-card.dim { opacity: .25; }
.essay-card .label { margin-bottom: 12px; }
.essay-card h3 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.08; letter-spacing: -.018em; }
.essay-card > p:last-child { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.42; color: #2a2a2c; }

/* Reading pages */
.hero { padding-top: 64px; padding-bottom: 72px; }
.hero-book { color: var(--ink); background: var(--c); }
.hero-essay { padding-top: 40px; }
.hero-essay .ptitle { color: #fff; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 48px; align-items: center; max-width: 1240px; margin: 0 auto; }
.hero .label { margin-bottom: 24px; font-size: 13px; }
.ptitle { margin: 0; font-family: var(--serif); font-weight: 400; line-height: .98; letter-spacing: -.03em; }
.hero-sub { margin: 20px 0 0; max-width: 24em; font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.2; }
.hero-author { margin: 28px 0 0; font-size: 18px; font-weight: 500; }
.hero-cover { display: block; width: 100%; max-width: 300px; margin: 0 auto; border-radius: 3px; box-shadow: 0 24px 48px rgba(10, 12, 17, .38); }
.mini { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mini-wheel { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1; }
.mini-wheel img, .mini-wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mini-link { font-family: var(--mono); font-size: 12px; text-align: center; color: var(--muted); text-underline-offset: 3px; }

.body { padding-top: 72px; padding-bottom: 96px; color: var(--on-paper); background: var(--paper); }
.body-link { padding-top: 56px; }
.measure, .prose { max-width: 680px; margin-left: auto; margin-right: auto; }
.measure .btn-solid { margin-top: 40px; }
.link-title { margin: 0 0 28px; font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1.04; letter-spacing: -.024em; }
.prose { font-family: var(--serif); font-size: 21px; line-height: 1.5; overflow-wrap: break-word; }
.prose p { margin: 0 0 24px; }
.prose p.has-background { background: none !important; padding: 0; }
.prose a { text-underline-offset: 3px; }
.prose h1, .prose h2 { margin: 48px 0 18px; font-weight: 400; font-size: 38px; line-height: 1.1; letter-spacing: -.018em; }
.prose h3, .prose h4, .prose h5 { margin: 36px 0 12px; font-family: var(--sans); font-weight: 600; font-size: 20px; line-height: 1.3; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 1.2em; }
.prose li { margin-bottom: 10px; }
.prose blockquote { margin: 36px 0; font-style: italic; font-size: 27px; line-height: 1.3; }
.prose blockquote p { margin: 0 0 12px; }
.prose img { display: block; margin: 32px auto 12px; border-radius: 4px; }
.prose figure { margin: 32px 0; max-width: 100%; }
.prose figcaption { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--on-paper-muted); }
.prose hr { width: 64px; margin: 44px auto; border: 0; border-top: 1px solid var(--on-paper); }
.prose iframe { max-width: 100%; }
.prose .alignright { float: right; max-width: 45%; margin: 0 0 16px 24px; }
.prose .alignleft { float: left; max-width: 45%; margin: 0 24px 16px 0; }
.prose-essay > p:first-of-type::first-letter { float: left; padding: .07em .09em 0 0; font-size: 4.3em; line-height: .82; }

.more-essays { padding-top: 64px; padding-bottom: 72px; }
.more-essays h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 40px; letter-spacing: -.02em; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); column-gap: 48px; }
.more-grid article { padding: 24px 0; border-bottom: 1px solid var(--line-dark); }
.more-grid .label { margin-bottom: 10px; }
.more-grid h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -.015em; }

.pagination { margin-top: 40px; font-family: var(--mono); font-size: 14px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.pagination .screen-reader-text, .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.comments { margin-top: 64px; font-size: 16px; }
.comments h2, .comment-reply-title { font-family: var(--serif); font-weight: 400; font-size: 30px; }
.comments input[type=text], .comments input[type=email], .comments input[type=url], .comments textarea { width: 100%; padding: 10px; font: inherit; background: #fff; border: 1px solid var(--paper-line); border-radius: 6px; }
.comments .submit { min-height: 44px; padding: 0 18px; font: inherit; color: var(--paper); background: var(--on-paper); border: 0; border-radius: 8px; cursor: pointer; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; padding-top: 32px; padding-bottom: 32px; font-size: 14px; color: var(--muted); }
.site-footer .brand { font-size: 20px; color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 1040px) {
	.split { grid-template-columns: minmax(0, 1fr); }
	.reader { padding-bottom: 8px; }
	.list { flex: none; height: auto; overflow: visible; }
}
@media (max-width: 860px) {
	.hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.pad { padding-left: 16px; padding-right: 16px; }
	.headline { font-size: 40px; }
	.ptitle { font-size: 48px !important; }
	.link-title { font-size: 40px; }
	.prose { font-size: 19px; }
	.prose .alignright, .prose .alignleft { float: none; max-width: 100%; margin: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.wheel { animation: none; }
}
