/* ─────────────────────────────────────────────────────────────
   UwP Archive — "Deep Water" theme
   Dark-first reading environment. Design tokens ported from the
   Lovable design exploration (direction 02 of 3). Dark mode is
   the design here, not an inverted light theme — see rationale
   in HANDOFF.md.
   ───────────────────────────────────────────────────────────── */
:root {
	--abyss: #06161d;
	--deep: #0a1f28;
	--deep-2: #10303c;
	--deep-3: #1a4553;
	--cream: #f2ead3;
	--cream-2: #d9d0b6;
	--cream-3: #8a8571;
	--brass: #c9a24a;
	--coral: #e35a3a;
	--line: rgba(242, 234, 211, 0.12);
	--line-soft: rgba(242, 234, 211, 0.08);

	--serif-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
	--sans: "Inter", ui-sans-serif, system-ui, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
	--radius: 2px;
	color-scheme: dark;
}

/* Light theme — plain black-on-white reading mode, user-toggleable (see
   Layout.astro's theme-toggle button/script). Same token names as the
   default "Deep Water" dark theme above, just repointed, so every rule
   elsewhere in this file that references a --token works unchanged. */
:root[data-theme="light"] {
	--abyss: #ffffff;
	--deep: #ffffff;
	--deep-2: #f4f3ef;
	--deep-3: #e7e4da;
	--cream: #111111;
	--cream-2: #333333;
	--cream-3: #63625a;
	--brass: #8a6a1f;
	--coral: #a83a22;
	--line: rgba(0, 0, 0, 0.14);
	--line-soft: rgba(0, 0, 0, 0.08);
	color-scheme: light;
}
:root[data-theme="light"] body {
	background-image: none;
}
/* The dark theme's card/pill/search-box surfaces use a subtle white-alpha
   tint that only reads against a dark page background -- swap for a
   var(--deep-2)-based tint so they stay visible (not white-on-white). */
:root[data-theme="light"] .search-box,
:root[data-theme="light"] #search .pagefind-ui__result,
:root[data-theme="light"] .pill,
:root[data-theme="light"] .card {
	background: var(--deep-2);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--deep);
	color: var(--cream);
	font-family: var(--serif-display);
	line-height: 1.5;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background-image: radial-gradient(ellipse at 50% 0%, rgba(50, 100, 120, 0.22), transparent 60%);
	background-attachment: fixed;
}

.wrap {
	max-width: 980px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

h1, h2, h3, h4 {
	font-family: var(--serif-display);
	font-weight: 300;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
	color: var(--cream);
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.7rem; font-weight: 300; }
h3 { font-size: 1.2rem; font-weight: 400; }
h1 em, h2 em { color: var(--brass); font-style: italic; }

p { margin: 0 0 1em; color: var(--cream-2); }

a {
	color: var(--cream-2);
	text-decoration: none;
}
a:hover { color: var(--brass); }

.site-header {
	background: transparent;
	border-bottom: 1px solid var(--line);
}
.site-header .wrap {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding-top: 1.75rem;
	padding-bottom: 1.75rem;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.brand {
	font-family: var(--serif-display);
	font-size: 1.35rem;
	font-style: italic;
	color: var(--cream);
	letter-spacing: -0.01em;
	line-height: 1.2;
}
.brand:hover { color: var(--cream); opacity: 0.85; }
.brand-logo { display: block; }
.brand-logo svg { display: block; height: 2.25rem; width: auto; }
.brand small {
	display: block;
	font-family: var(--mono);
	font-style: normal;
	font-size: 0.6rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--brass);
	margin-top: 0.3em;
}
.site-header nav { display: flex; gap: 1.4rem; font-size: 0.82rem; flex-wrap: wrap; }
.site-header nav a {
	color: var(--cream-2);
	font-family: var(--sans);
	letter-spacing: 0.04em;
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
}
.site-header nav a:hover { color: var(--brass); border-bottom-color: var(--brass); }

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	padding: 0;
	margin: -0.3rem 0;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--cream-2);
	cursor: pointer;
	transition: all 150ms;
}
.theme-toggle:hover { color: var(--brass); border-color: var(--brass); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

main.wrap {
	flex: 1;
	padding-top: 3rem;
	padding-bottom: 4rem;
}

.site-footer {
	background: transparent;
	border-top: 1px solid var(--line);
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.03em;
	color: var(--cream-3);
	padding: 1.75rem 0;
}

.ui, nav, button, input, .meta, .tag, .card-meta {
	font-family: var(--sans);
}

.search-box {
	width: 100%;
	font-size: 1.05rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: rgba(255, 255, 255, 0.03);
	color: var(--cream);
	font-family: var(--serif-display);
}
.search-box::placeholder { color: var(--cream-3); font-style: italic; }
.search-box:focus { outline: none; border-color: var(--brass); }

/* Pagefind default UI reskin — see https://pagefind.app/docs/ui/#customising-the-colors */
#search {
	--pagefind-ui-primary: var(--brass);
	--pagefind-ui-text: var(--cream-2);
	--pagefind-ui-background: var(--deep-2);
	--pagefind-ui-border: var(--line);
	--pagefind-ui-tag: var(--deep-3);
	--pagefind-ui-border-width: 1px;
	--pagefind-ui-border-radius: 2px;
	--pagefind-ui-font: var(--sans);
}
#search .pagefind-ui__search-input { font-family: var(--serif-display); font-size: 1.15rem; }
#search .pagefind-ui__result { background: rgba(255, 255, 255, 0.02); }
#search .pagefind-ui__result-link { font-family: var(--serif-display); color: var(--cream); }
#search .pagefind-ui__result-link:hover { color: var(--brass); }

.pill {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	padding: 0.35em 0.85em;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--cream-2);
	border: 1px solid var(--line);
	transition: all 150ms;
}
.pill:hover { color: var(--deep); background: var(--brass); border-color: var(--brass); }
a.pill { text-decoration: none; }
button.pill { cursor: pointer; font-family: var(--sans); }
.pill.on { color: var(--deep); background: var(--brass); border-color: var(--brass); }
:root[data-theme="light"] .pill.on { color: var(--deep); background: var(--brass); border-color: var(--brass); }

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.1rem;
	margin: 1.5rem 0;
}

.card {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.1rem 1.25rem;
	position: relative;
	overflow: hidden;
	transition: all 200ms;
}
.card::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 32px;
	height: 32px;
	background: linear-gradient(225deg, var(--brass) 50%, transparent 50%);
	opacity: 0.35;
}
.card:hover { border-color: var(--brass); background: rgba(201, 162, 74, 0.05); }
.card h3 { margin-bottom: 0.3em; }
.link-logo {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: 8px;
	margin-bottom: 0.85rem;
}
.card-meta {
	font-size: 0.8rem;
	font-family: var(--mono);
	letter-spacing: 0.03em;
	color: var(--cream-3);
	margin-bottom: 0.5em;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--sans);
	font-size: 0.92rem;
	margin: 1.5rem 0;
}
th, td {
	text-align: left;
	padding: 0.6rem 0.7rem;
	border-bottom: 1px solid var(--line);
	color: var(--cream-2);
}
th {
	color: var(--brass);
	font-weight: 500;
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-bottom: 1px solid var(--brass);
}
tr:hover td { background: rgba(201, 162, 74, 0.06); }

.rank { color: var(--cream-3); font-variant-numeric: tabular-nums; width: 2.5em; font-family: var(--mono); }

.toc-list { list-style: none; padding: 0; margin: 1rem 0; }
.toc-list li {
	display: flex;
	gap: 0.9rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--line-soft);
	align-items: baseline;
}
.toc-list li a { color: var(--cream); font-family: var(--serif-display); font-size: 1.05rem; }
.toc-list li a:hover { color: var(--brass); }
.toc-list .page-num {
	font-family: var(--mono);
	color: var(--brass);
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	min-width: 2.6em;
}

.breadcrumb {
	font-family: var(--mono);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cream-3);
	margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--cream-2); }
.breadcrumb a:hover { color: var(--brass); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.85rem 0 1.4rem; align-items: center; }

.stat-row {
	display: flex;
	gap: 2.5rem;
	margin: 1.75rem 0 2.25rem;
	font-family: var(--mono);
}
.stat .num {
	font-size: 2.1rem;
	font-family: var(--serif-display);
	font-style: italic;
	font-weight: 300;
	color: var(--cream);
	display: block;
	letter-spacing: -0.01em;
}
.stat .label {
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cream-3);
}

.excerpt-link {
	display: inline-block;
	margin-top: 1rem;
	padding: 0.65rem 1.2rem;
	background: var(--brass);
	color: var(--deep);
	border-radius: var(--radius);
	font-family: var(--mono);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 500;
}
.excerpt-link:hover { background: #ddb968; color: var(--deep); }

.more-section {
	margin-top: 2.75rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--line);
}
.more-section h2 { font-size: 1.15rem; }

/* Article body copy: drop cap on the opening preview paragraph */
.article-preview:first-letter {
	font-family: var(--serif-display);
	font-style: italic;
	font-weight: 300;
	font-size: 3.6rem;
	float: left;
	line-height: 0.85;
	padding: 0.1em 0.12em 0 0;
	color: var(--brass);
}
.article-preview {
	font-size: 1.15rem;
	line-height: 1.65;
	color: var(--cream-2);
}

/* Homepage hero */
.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); max-width: 900px; margin: 0 auto 0.5em; }
.hero .sub {
	font-family: var(--serif-display);
	font-style: italic;
	font-size: 1.1rem;
	color: var(--cream-2);
	max-width: 620px;
	margin: 0 auto 1.5rem;
	line-height: 1.5;
}
.hero .stat-row { justify-content: center; }
.hero .search-wrap { max-width: 680px; margin: 1.75rem auto 0; }
.hero .tag-row { justify-content: center; margin-top: 1.75rem; }

/* Featured spotlight (homepage "this month" section) */
.featured {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.5rem;
	align-items: center;
	padding: 0.5rem 0 1rem;
}
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } }
.featured .spot-card {
	background: linear-gradient(135deg, var(--deep-2), var(--deep));
	border: 1px solid rgba(201, 162, 74, 0.3);
	padding: 1.75rem 2rem;
	border-radius: var(--radius);
	position: relative;
}
.featured .spot-card::before {
	content: "❦";
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	color: var(--brass);
	font-size: 1.1rem;
}
.featured .spot-card .num {
	font-family: var(--mono);
	font-size: 0.68rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--brass);
}
.featured .spot-card h3 { font-size: 1.55rem; margin: 0.5rem 0; line-height: 1.2; }
.featured .spot-card .by {
	font-family: var(--serif-display);
	font-style: italic;
	color: var(--cream-2);
	font-size: 0.95rem;
	margin-bottom: 0.9rem;
}
.featured .spot-card p { font-size: 0.95rem; line-height: 1.55; color: var(--cream-2); margin: 0 0 1.1rem; }
.featured .spot-card a.readmore {
	font-family: var(--mono);
	font-size: 0.68rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--brass);
	border-bottom: 1px solid var(--brass);
	padding-bottom: 2px;
}
.featured blockquote {
	font-family: var(--serif-display);
	font-style: italic;
	font-size: 1.55rem;
	line-height: 1.35;
	color: var(--cream);
	border-left: 3px solid var(--brass);
	padding-left: 1.2rem;
	margin: 0;
}
.featured blockquote cite {
	display: block;
	font-size: 0.72rem;
	color: var(--cream-3);
	font-style: normal;
	margin-top: 0.9rem;
	font-family: var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.sec-label {
	font-family: var(--mono);
	font-size: 0.65rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--brass);
}
.sec-rule {
	height: 1px;
	background: linear-gradient(90deg, var(--brass), transparent);
	margin: 0.6rem 0 1.6rem;
	max-width: 200px;
}

/* Homepage cover filmstrip -- breaks out of the centered .wrap column so it
   can sit in a real grid with the "recent issues" content instead of being
   squeezed into 980px. Only wraps the lower homepage sections, not the hero. */
.cover-break {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}
.cover-grid {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1.5rem;
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 3rem;
	align-items: start;
}
.cover-rail {
	position: sticky;
	top: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.cover-rail-item {
	position: relative;
	display: block;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
	transition: transform 200ms, box-shadow 200ms;
}
.cover-rail-item:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--brass); }
.cover-rail-item img { display: block; width: 100%; height: auto; }
.cover-rail-item .meta {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 0.7rem 0.8rem;
	background: linear-gradient(to top, rgba(6, 22, 29, 0.92) 0%, rgba(6, 22, 29, 0.45) 55%, transparent 100%);
	opacity: 0;
	transition: opacity 180ms;
}
.cover-rail-item:hover .meta { opacity: 1; }
.cover-rail-item .meta .n {
	font-family: var(--mono);
	font-size: 0.65rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--brass);
}
.cover-rail-item .meta .d {
	font-family: var(--serif-display);
	font-style: italic;
	font-size: 0.82rem;
	color: var(--cream);
	margin-top: 0.1em;
}
:root[data-theme="light"] .cover-rail-item .meta {
	background: linear-gradient(to top, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.5) 55%, transparent 100%);
}
@media (max-width: 1100px) {
	.cover-grid { grid-template-columns: 1fr; }
	.cover-rail { display: none; }
}
