/*
Theme Name: DeVega Editorial
Theme URI: https://chaunceydevega.com
Author: Editorial Design System
Author URI: https://chaunceydevega.com
Description: Bespoke, typography-driven, accessible WordPress theme for American essayist & culture critic Chauncey DeVega. Contains all CSS for individual Custom HTML block pages, long-form essays, podcast archives, and reader support.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: devega-editorial
*/

:root {
  --bg: #FBF9F5;
  --surface: #F5F1EA;
  --surface-subtle: #EFE9E0;
  --text-main: #1C1917;
  --text-muted: #57534E;
  --text-faint: #78716C;
  --accent: #9A3412;
  --accent-hover: #7C2D12;
  --border: #E7E0D6;
  --border-dark: #D6CEBF;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Georgia, Cambria, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --measure: 680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); color: var(--text-main); }
body { font-family: var(--font-serif); font-size: 17px; line-height: 1.68; -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--text-main); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Utility & Accessibility */
.skip-link { position: absolute; top: -100px; left: 1rem; background: var(--text-main); color: #fff; padding: 0.5rem 1rem; z-index: 1000; font-family: var(--font-sans); font-size: 0.875rem; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.hairline-b { border-bottom: 1px solid var(--border); }
.hairline-t { border-top: 1px solid var(--border); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex-row { display: flex; align-items: center; gap: 0.75rem; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 1rem; }
.flex-center { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

/* WordPress Block Editor & Custom HTML Page Canvas */
.cd-page-canvas { width: 100%; }
.wp-block-html { margin: 0; max-width: none; }
.entry-content > .wp-block-html { width: 100%; }

/* Top Bar */
header.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 4.25rem; }
.site-brand { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text-main); text-decoration: none; white-space: nowrap; }
.site-brand span { font-weight: 400; color: var(--text-faint); font-size: 1rem; margin-left: 0.35rem; }

nav.site-nav { display: flex; align-items: center; gap: 1.75rem; }
nav.site-nav ul { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
nav.site-nav li { margin: 0; padding: 0; }
nav.site-nav a { font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; color: var(--text-muted); text-decoration: none; transition: color 0.15s; white-space: nowrap; }
nav.site-nav a:hover, nav.site-nav a.active, nav.site-nav .current-menu-item > a { color: var(--text-main); }
nav.site-nav a.active, nav.site-nav .current-menu-item > a { border-bottom: 2px solid var(--accent); padding-bottom: 0.25rem; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-search { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.4rem; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-search:hover { color: var(--text-main); }
.btn-theme-badge { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.75rem; background: var(--surface); border: 1px solid var(--border-dark); border-radius: 4px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); padding: 0.5rem; }

/* Reading Progress Bar */
#reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 100; transition: width 0.1s ease-out; }

/* Sections */
section, .section { padding: 3.5rem 0; }
.section-surface { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3.5rem 0; }
.section-head { margin-bottom: 2rem; }
.section-head-lg { margin-bottom: 3rem; }
.kicker { font-family: var(--font-sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--accent); margin-bottom: 0.5rem; display: block; }
.kicker-sm { font-size: 0.7rem; }
.section-title { font-size: 1.85rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.section-title-sm { font-size: 1.4rem; margin-bottom: 1.5rem; }
.page-title { font-size: 2.5rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.page-lead { margin-top: 0.5rem; max-width: 680px; color: var(--text-muted); font-size: 1.05rem; line-height: 1.7; }

/* Hero */
.hero { padding: 4.5rem 0 3.5rem; border-bottom: 1px solid var(--border); }
.hero-lead { font-size: 2.25rem; line-height: 1.25; font-weight: 400; max-width: 820px; letter-spacing: -0.02em; color: var(--text-main); text-wrap: balance; }
.hero-sub { margin-top: 1.25rem; font-family: var(--font-sans); font-size: 1.05rem; color: var(--text-muted); max-width: 680px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; padding: 0.6rem 1.25rem; border-radius: 4px; text-decoration: none; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; border: 1px solid transparent; }
.btn-sm { font-size: 0.8rem; padding: 0.4rem 0.9rem; }
.btn-xs { font-size: 0.75rem; padding: 0.3rem 0.65rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--text-main); color: #fff; }
.btn-primary:hover { background: #000; color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-dark); color: var(--text-main); }
.btn-outline:hover { background: var(--surface); color: var(--text-main); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.link-arrow { font-family: var(--font-sans); font-size: 0.9rem; text-decoration: none; font-weight: 600; color: var(--accent); }
.link-arrow:hover { color: var(--accent-hover); text-decoration: underline; }

/* Editorial Grid */
.editorial-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3.5rem; align-items: start; }
.featured-story img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 2px; margin-bottom: 1.25rem; background: var(--surface); display: block; }
.featured-title { font-size: 1.85rem; line-height: 1.25; margin-top: 0.5rem; margin-bottom: 0.75rem; text-wrap: balance; }
.featured-title a, .article-item a { color: inherit; text-decoration: none; }
.featured-title a:hover, .article-item a:hover { color: var(--accent); }
.meta-line { font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-faint); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.meta-line-center { justify-content: center; margin-top: 1rem; }
.meta-category { color: var(--accent); font-weight: 600; }
.article-excerpt { margin-top: 0.75rem; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.article-excerpt-sm { font-size: 0.92rem; }

.secondary-stream { display: flex; flex-direction: column; gap: 2rem; }
.stream-heading-wrap { border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; margin-bottom: 0.5rem; }
.stream-heading { font-size: 1.05rem; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 600; }
.article-stack { display: flex; flex-direction: column; gap: 2.5rem; }
.article-item { border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.article-item:last-child { border-bottom: none; padding-bottom: 0; }
.article-item h2 { font-size: 1.65rem; line-height: 1.28; margin: 0.5rem 0; font-weight: 600; }
.article-item h3 { font-size: 1.3rem; line-height: 1.3; margin: 0.25rem 0 0.5rem; font-weight: 600; }
.article-subtitle { color: var(--text-muted); font-style: italic; margin-bottom: 0.5rem; }
.topic-list { margin-top: 1rem; display: flex; gap: 0.65rem; flex-wrap: wrap; }
.topic-tag { font-family: var(--font-sans); font-size: 0.75rem; color: var(--text-faint); }

/* Writing Sidebar */
.topic-aside { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.75rem; position: sticky; top: 6rem; }
.aside-heading { font-family: var(--font-sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.85rem; color: var(--text-faint); font-weight: 600; }
.topic-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.aside-copy { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 1rem; }

/* Audio Player */
.platform-links { display: flex; gap: 0.75rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.podcast-list { display: flex; flex-direction: column; gap: 2.25rem; }
.player-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.75rem; margin-top: 1.5rem; }
.player-card-white { background: #fff; margin-top: 0; }
.player-header { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.25rem; }
.player-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; background: var(--surface-subtle); flex-shrink: 0; }
.player-title { font-size: 1.45rem; margin: 0.35rem 0; line-height: 1.25; }
.player-title a { color: inherit; text-decoration: none; }
.player-title a:hover { color: var(--accent); }
.player-guest { color: var(--text-muted); font-size: 0.92rem; }
.player-desc { color: var(--text-muted); font-size: 0.96rem; margin-bottom: 1.25rem; line-height: 1.65; }
.player-controls { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.btn-play { width: 44px; height: 44px; border-radius: 50%; background: var(--text-main); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-play:hover { background: var(--accent); }
.timeline-wrap { flex: 1; display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.timeline-bar { flex: 1; height: 6px; background: var(--border-dark); border-radius: 3px; position: relative; cursor: pointer; }
.timeline-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; pointer-events: none; }
.player-actions { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-sans); font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.75rem; }
.player-links { display: flex; gap: 0.75rem; align-items: center; }
.player-links a { color: var(--text-faint); text-decoration: none; }
.player-links a:hover { color: var(--accent); }
.player-footer-bar { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 1rem; flex-wrap: wrap; gap: 1rem; }
.speed-btn { background: none; border: 1px solid var(--border-dark); padding: 0.25rem 0.55rem; border-radius: 3px; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; color: var(--text-main); }
.show-notes-list { margin-left: 1.5rem; margin-bottom: 2rem; font-family: var(--font-sans); font-size: 0.95rem; color: var(--text-muted); line-height: 1.8; }
.transcript-box { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1.5rem; font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.episode-nav-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

/* Newsletter & Forms */
.newsletter-banner { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2.5rem; margin: 3rem 0; }
.newsletter-banner-center { text-align: center; margin-top: 2.5rem; }
.newsletter-title { font-size: 1.75rem; margin: 0.35rem 0 0.75rem; }
.newsletter-desc { color: var(--text-muted); max-width: 540px; font-size: 1rem; line-height: 1.65; }
.newsletter-form { display: flex; gap: 0.5rem; margin-top: 1.25rem; max-width: 540px; }
.newsletter-form input { flex: 1; font-family: var(--font-sans); font-size: 0.9rem; padding: 0.65rem 1rem; border: 1px solid var(--border-dark); border-radius: 4px; background: #fff; color: var(--text-main); }
.newsletter-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.newsletter-form-stack { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.newsletter-note { font-family: var(--font-sans); font-size: 0.75rem; color: var(--text-faint); margin-top: 0.75rem; }
.form-field { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.form-input, .form-select, .form-textarea { width: 100%; padding: 0.65rem 0.9rem; border: 1px solid var(--border-dark); border-radius: 4px; font-family: var(--font-sans); font-size: 0.95rem; background: #fff; color: var(--text-main); }

/* Single Essay Reading Canvas */
.essay-view { padding: 4rem 0; }
.essay-header { text-align: center; margin-bottom: 3rem; }
.essay-title { font-size: 2.75rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin: 0.75rem 0 1rem; text-wrap: balance; }
.essay-subtitle { font-size: 1.25rem; color: var(--text-muted); font-style: italic; margin-bottom: 1.5rem; }
.reading-toolbar { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.75rem 0; margin-bottom: 2.5rem; font-family: var(--font-sans); font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.75rem; }
.toolbar-group { display: flex; align-items: center; gap: 0.75rem; }
.toolbar-group a { color: var(--text-muted); text-decoration: none; }
.toolbar-group a:hover { color: var(--accent); }
.font-ctrl-btn { background: none; border: 1px solid var(--border-dark); padding: 0.2rem 0.55rem; border-radius: 3px; cursor: pointer; font-size: 0.75rem; font-weight: 600; color: var(--text-main); }
.share-link-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-family: var(--font-sans); font-size: 0.85rem; padding: 0; }
.share-link-btn:hover { color: var(--accent); }

.prose p { margin-bottom: 1.5rem; font-size: 1.125rem; line-height: 1.8; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; line-height: 1.25; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 0.75rem; line-height: 1.3; }
.prose.has-dropcap > p:first-of-type::first-letter { font-size: 3.8rem; float: left; line-height: 0.8; margin: 0.15rem 0.5rem 0 0; font-family: var(--font-serif); font-weight: bold; color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1.5rem; margin: 2rem 0; font-size: 1.3rem; line-height: 1.5; font-style: italic; color: var(--text-main); }
.prose figure { margin: 2.5rem 0; }
.prose figure img { width: 100%; border-radius: 4px; display: block; }
.prose figcaption { font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-faint); margin-top: 0.5rem; text-align: center; }

.essay-topics-footer { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.author-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.75rem; margin-top: 2.5rem; display: flex; gap: 1.5rem; align-items: center; }
.author-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-name { font-size: 1.15rem; margin-bottom: 0.25rem; }
.author-bio { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.related-writing { margin-top: 3.5rem; }
.related-list { display: flex; flex-direction: column; gap: 1.25rem; }
.related-item { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.related-item h4 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.related-item a { color: inherit; text-decoration: none; }
.related-item a:hover { color: var(--accent); }

/* Tabs & Archive */
.tab-bar { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 2rem; overflow-x: auto; }
.tab-item { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500; padding: 0.4rem 0.85rem; background: transparent; border: none; cursor: pointer; border-radius: 4px; color: var(--text-muted); white-space: nowrap; }
.tab-item.active { background: var(--surface-subtle); color: var(--text-main); font-weight: 600; }
.archive-list { display: flex; flex-direction: column; gap: 2.5rem; }
.archive-year-heading { font-size: 1.8rem; border-bottom: 2px solid var(--text-main); padding-bottom: 0.5rem; margin-bottom: 1.5rem; font-variant-numeric: tabular-nums; }
.archive-rows { display: flex; flex-direction: column; gap: 1.5rem; }
.archive-row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.archive-row-title { font-size: 1.25rem; }
.archive-row-title a { color: inherit; text-decoration: none; }
.archive-row-title a:hover { color: var(--accent); }

/* About & Contact */
.about-title { font-size: 2.6rem; line-height: 1.2; margin: 0.5rem 0 1.5rem; }
.about-prose p { font-size: 1.05rem; line-height: 1.75; margin-bottom: 1.25rem; }
.press-bio-box { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1.25rem; margin-top: 0.75rem; }
.press-bio-text { font-size: 0.95rem; margin-bottom: 0; line-height: 1.6; }
.contact-form { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.about-portrait { width: 100%; border-radius: 4px; margin-bottom: 1.5rem; background: var(--surface); display: block; }
.highlights-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; }
.highlights-box h4 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.highlights-list { font-family: var(--font-sans); font-size: 0.88rem; color: var(--text-muted); list-style: none; }
.highlights-list li { margin-bottom: 0.5rem; }

/* Support Cards */
.support-header { text-align: center; margin-bottom: 3rem; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; }
.support-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2rem; display: flex; flex-direction: column; justify-content: space-between; }
.support-box h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.support-copy { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.tier-pills { display: flex; gap: 0.5rem; margin: 1.25rem 0; flex-wrap: wrap; }
.tier-btn { font-family: var(--font-mono); font-size: 0.85rem; padding: 0.4rem 0.75rem; border: 1px solid var(--border-dark); background: #fff; border-radius: 4px; cursor: pointer; color: var(--text-main); }
.tier-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.ethics-box { margin-top: 3.5rem; text-align: center; padding: 2rem; background: var(--surface); border-radius: 6px; border: 1px solid var(--border); }
.ethics-box h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.ethics-box p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 540px; margin: 0 auto; }

/* 404 & Search */
.error-404-wrap { text-align: center; padding: 5rem 0; }
.search-results-stack { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.75rem; }

/* Code Inspector (WordPress Theme & Custom HTML Viewer) */
.inspector-toolbar { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.inspector-note { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.1rem 1.35rem; margin-bottom: 1.5rem; font-family: var(--font-sans); font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }
.wp-inspector { background: #1C1917; color: #E7E5E4; border-radius: 8px; overflow: hidden; margin-top: 1rem; }
.wp-header { background: #292524; padding: 0.75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #44403C; font-family: var(--font-sans); font-size: 0.85rem; flex-wrap: wrap; gap: 0.5rem; }
.wp-files-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 1.25rem; background: #292524; border-bottom: 1px solid #44403C; }
.wp-file-btn { background: none; border: none; color: #A8A29E; font-family: var(--font-mono); font-size: 0.78rem; padding: 0.3rem 0.6rem; cursor: pointer; border-radius: 3px; white-space: nowrap; }
.wp-file-btn.active { background: #44403C; color: #F5F5F4; font-weight: bold; }
.wp-code-area { padding: 1.25rem; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6; max-height: 520px; overflow: auto; white-space: pre; }

/* Footer */
footer.site-footer { border-top: 1px solid var(--border); padding: 4.5rem 0 3rem; background: var(--bg); margin-top: 5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem; }
.footer-col h4 { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 1.25rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { font-family: var(--font-sans); font-size: 0.875rem; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-brand { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.footer-desc { color: var(--text-muted); font-size: 0.95rem; max-width: 320px; line-height: 1.6; }
.footer-actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.footer-colophon { margin-top: 0.75rem; font-family: var(--font-sans); font-size: 0.8rem; color: var(--accent); font-weight: 500; }
.footer-bottom { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-faint); flex-wrap: wrap; gap: 1rem; }
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal a { color: var(--text-faint); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); }

/* Mobile modal / search modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-card { background: var(--bg); width: 100%; max-width: 620px; border-radius: 8px; border: 1px solid var(--border-dark); padding: 2rem; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-faint); }
.search-input { width: 100%; font-family: var(--font-sans); font-size: 1.1rem; padding: 0.75rem 1rem; border: 1px solid var(--border-dark); border-radius: 4px; margin-bottom: 1.25rem; background: #fff; color: var(--text-main); }
.search-results-box { display: flex; flex-direction: column; gap: 1rem; max-height: 380px; overflow-y: auto; }
.search-result-item { border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
.search-result-item h4 { font-size: 1.1rem; margin: 0.25rem 0; }
.search-result-item a { color: inherit; text-decoration: none; }
.search-result-item a:hover { color: var(--accent); }

/* Toast */
#toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--text-main); color: #fff; padding: 0.75rem 1.25rem; border-radius: 4px; font-family: var(--font-sans); font-size: 0.85rem; z-index: 500; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Responsive */
@media (max-width: 900px) {
  .editorial-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .support-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .hero-lead { font-size: 1.85rem; }
  .topic-aside { position: static; }
}
@media (max-width: 680px) {
  nav.site-nav { display: none; }
  nav.site-nav.open { display: flex; flex-direction: column; align-items: flex-start; position: absolute; top: 4.25rem; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1.5rem; gap: 1rem; z-index: 60; }
  nav.site-nav.open ul { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .mobile-menu-btn { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .essay-title { font-size: 2rem; }
  .page-title { font-size: 2rem; }
  .author-box { flex-direction: column; align-items: flex-start; }
}
