/*
Theme Name: William R. Waas
Theme URI: https://williamwaas.ai/
Author: William R. Waas
Description: Classic WordPress theme for williamwaas.ai — parchment, deep ink, and burnt red. Playfair Display headlines, DM Mono labels. Ported 1:1 from the approved static site.
Version: 1.1.1
Requires at least: 6.0
Requires PHP: 7.4
License: All Rights Reserved (site content); documents shared under CC BY-NC-ND 4.0
Text Domain: williamwaas
Tags: one-column, custom-menu
*/

/* ═══════════════════════════════════════════════════════════
   1. BASE — ported verbatim from site/index.html <style>
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink: #0e0e0e;
  --paper: #f5f0e8;
  --accent: #c8390a;
  --accent-dim: #8a2507;
  --mid: #5a5347;
  --rule: #d4cfc6;
  --white: #ffffff;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 3rem;
  background: rgba(245,240,232,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  background: var(--ink);
  z-index: 0;
}

.hero-left {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 4rem 5rem 3rem;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.35s forwards;
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--mid);
  max-width: 38ch;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.65s forwards;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  padding: 0.9rem 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: inline-block;
}

.btn-primary:hover { background: var(--accent-dim); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 0.9rem 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
  display: inline-block;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-right {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5rem 3rem;
}

.hero-photo-frame {
  width: 380px;
  height: 380px;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  animation: fadeIn 1s 0.8s forwards;
  margin-bottom: 20px;
  margin-right: 20px;
  flex-shrink: 0;
}

.hero-photo-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  border: 2px solid var(--accent);
  z-index: 2;
  pointer-events: none;
}

.hero-photo-frame img {
  position: relative;
  z-index: 1;
}

.photo-placeholder {
  text-align: center;
  color: #444;
}

.photo-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.photo-placeholder p {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
}

.hero-pull {
  margin-top: 2.5rem;
  max-width: 30ch;
  text-align: right;
  opacity: 0;
  animation: fadeUp 0.8s 1s forwards;
}

.hero-pull blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--rule);
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  text-align: left;
}

/* ── RULE BAR ── */
.rule-bar {
  background: var(--accent);
  color: var(--white);
  padding: 1rem 3rem;
  display: flex;
  gap: 4rem;
  overflow: hidden;
}

.rule-bar-inner {
  display: flex;
  gap: 6rem;
  animation: ticker 20s linear infinite;
  white-space: nowrap;
}

.rule-bar span {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.rule-bar span::before {
  content: '◆';
  margin-right: 0.8rem;
  opacity: 0.6;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── SECTION SHARED ── */
section { padding: 7rem 3rem; }

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  max-width: 20ch;
}

.section-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--mid);
  max-width: 55ch;
}

hr.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin-bottom: 4rem;
}

/* ── BOOKS ── */
#books { background: var(--ink); color: var(--paper); }

#books .section-title { color: var(--paper); }
#books .section-body { color: #9a9488; }

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px;
  margin-top: 4rem;
}

.book-card {
  background: #161616;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transition: background 0.25s;
  cursor: pointer;
}

.book-card:hover { background: #1e1e1e; }

.book-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.book-card:hover::after { transform: scaleX(1); }

.book-number {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.book-cover {
  width: 100%;
  height: 200px;
  background: #222;
  border: 1px solid #2a2a2a;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-cover-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #444;
  text-align: center;
  padding: 1rem;
  line-height: 1.3;
}

.book-cover-accent {
  position: absolute;
  bottom: 0; left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.4;
}

.book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.book-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.book-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #6a6460;
}

.book-status {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border: 1px solid;
}

.book-status.published { border-color: var(--accent); color: var(--accent); }
.book-status.forthcoming { border-color: #444; color: #555; }

.book-buy {
  display: block;
  margin-top: 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.book-buy:hover { opacity: 0.65; }

/* ── DECLARATION ── */
#declaration {
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.declaration-text {}

.declaration-doc {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 3rem 2.5rem;
  position: relative;
  box-shadow: 8px 8px 0 var(--accent);
}

.declaration-doc-header {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.declaration-doc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.declaration-doc-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

.declaration-principle {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mid);
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.declaration-principle:last-child { border-bottom: none; }

.principle-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent);
  padding-top: 0.15rem;
  flex-shrink: 0;
}

/* ── INDEX ── */
#index { background: #0a0a0a; color: var(--paper); }
#index .section-title { color: var(--paper); }
#index .section-body { color: #6a6460; }

.index-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 4rem 0;
}

.stat-block {
  background: #111;
  padding: 2.5rem 2rem;
  border-left: 2px solid transparent;
  transition: border-color 0.2s;
}

.stat-block:hover { border-color: var(--accent); }

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
}

.index-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: #6a6460;
  max-width: 65ch;
  margin-bottom: 2.5rem;
}

/* ── ABOUT ── */
#about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
  background: var(--paper);
}

.about-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 2rem;
  margin-bottom: 2rem;
}

.about-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

.about-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ── SUBSTACK ── */
#connect {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 6rem 3rem;
}

#connect .section-label { color: rgba(255,255,255,0.6); }

#connect .section-title {
  color: var(--white);
  margin: 0 auto 1.5rem;
  max-width: none;
}

#connect .section-body {
  color: rgba(255,255,255,0.75);
  margin: 0 auto 3rem;
  max-width: 55ch;
}

.connect-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-white {
  background: var(--white);
  color: var(--accent);
  padding: 0.9rem 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-block;
}

.btn-white:hover { opacity: 0.9; transform: translateY(-2px); }

.btn-white-ghost {
  background: transparent;
  color: var(--white);
  padding: 0.9rem 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.6);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: inline-block;
}

.btn-white-ghost:hover { border-color: var(--white); transform: translateY(-2px); }

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: #444;
  padding: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #444;
}

.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #333;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 1.2rem 1.5rem; }
  .nav-links { gap: 1.5rem; }

  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero::before { display: none; }
  .hero-right { background: var(--ink); padding: 3rem 1.5rem; }
  .hero-left { padding: 4rem 1.5rem 3rem; }
  .hero-pull blockquote { color: #888; }

  section { padding: 5rem 1.5rem; }

  #declaration { grid-template-columns: 1fr; gap: 3rem; }
  #about { grid-template-columns: 1fr; gap: 3rem; }

  .index-stats { grid-template-columns: repeat(2, 1fr); }

  .books-grid { grid-template-columns: 1fr; }

  footer { flex-direction: column; align-items: flex-start; }
}

/* ── DOC CARDS ── */
.doc-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.2s;
}

.doc-card:hover {
  box-shadow: 4px 4px 0 var(--accent);
  transform: translateY(-2px);
}

.doc-cat {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.doc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.doc-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--mid);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.doc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.doc-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: letter-spacing 0.2s;
}

.doc-link:hover { letter-spacing: 0.2em; }

.doc-cc {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: #bbb;
}

/* ═══════════════════════════════════════════════════════════
   2. DOCUMENT PAGES — ported verbatim from
      site/declaration-citizen.html <style>
      Applied on templates that use header-document.php
      (body gets the .doc-page class there).
      Only .doc-title needed scoping (it collides with the
      Reading Room card title above) — everything else is 1:1.
   ═══════════════════════════════════════════════════════════ */

body.doc-page {
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── TOP NAV ── */
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-nav a.back {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.doc-nav a.back:hover { color: var(--accent); }

.doc-nav .site-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.doc-nav .site-name:hover { color: var(--accent); }

/* ── READING PROGRESS BAR ── */
.progress-track {
  position: sticky;
  top: 57px;
  z-index: 99;
  height: 2px;
  background: transparent;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ── DOCUMENT HEADER ── */
.doc-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}

.doc-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.doc-page .doc-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.doc-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mid);
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  padding-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* ── DOCUMENT BODY ── */
.doc-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
  font-size: 1.12rem;
}

.doc-body .lead {
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.doc-body p {
  margin-bottom: 1.6rem;
  color: #25221c;
}

.doc-body h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.75rem;
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
}

/* Article blocks */
.article {
  margin: 2.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--rule);
  transition: border-color 0.3s;
}
.article:hover { border-left-color: var(--accent); }

.article .article-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.6rem;
}

.article p { margin-bottom: 0.9rem; }
.article ol { margin: 0.5rem 0 0 1.3rem; }
.article ol li { margin-bottom: 0.7rem; color: #25221c; }

/* Drop cap on preamble lead */
.doc-body .lead::first-letter {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 3.4rem;
  line-height: 0.8;
  float: left;
  margin: 0.1rem 0.6rem 0 0;
  color: var(--accent);
}

/* ── FOOTER / LICENSE ── */
.doc-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 4rem 2rem;
}
.doc-footer-inner {
  max-width: 680px;
  margin: 0 auto;
}
.doc-footer .license {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: #9a9488;
  text-transform: uppercase;
}
.doc-footer .back-home {
  display: inline-block;
  margin-top: 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid #2e2e2e;
  padding: 0.8rem 1.5rem;
  transition: all 0.2s;
}
.doc-footer .back-home:hover {
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .doc-nav { padding: 1rem 1.3rem; }
  .doc-header { padding: 3rem 1.4rem 2rem; }
  .doc-body { padding: 1rem 1.4rem 3rem; }
  .progress-track { top: 53px; }
}

/* ═══════════════════════════════════════════════════════════
   3. WORDPRESS ADDITIONS — new rules required by WP templates.
      Built strictly from the existing design tokens above;
      no visual changes to ported rules.
   ═══════════════════════════════════════════════════════════ */

/* Admin bar offsets for logged-in users */
body.admin-bar nav { top: 32px; }
body.admin-bar .doc-nav { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar nav { top: 46px; }
  body.admin-bar .doc-nav { top: 46px; }
}

/* Writings cards (front page): linked titles + date stamp */
.doc-card .doc-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.doc-card .doc-title a:hover { color: var(--accent); }

.doc-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
}

/* Post content niceties inside the reading column */
.doc-body img { max-width: 100%; height: auto; }
.doc-body blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin: 2rem 0;
  color: var(--mid);
}
.doc-body ul, .doc-body ol { margin: 0 0 1.6rem 1.3rem; }
.doc-body li { margin-bottom: 0.7rem; color: #25221c; }
.doc-body a { color: var(--accent); }

.alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; }

.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

/* Archive fallback list (index.php) */
.archive-entry { margin-bottom: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--rule); }
.archive-entry:last-of-type { border-bottom: none; }
.archive-entry .entry-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.archive-entry .entry-title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.archive-entry .entry-title a:hover { color: var(--accent); }
.archive-entry .doc-eyebrow { margin-bottom: 0.5rem; }

.posts-navigation .nav-links,
.comments-pagination .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}
.posts-navigation a,
.comments-pagination a,
.comment-navigation a {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

/* ── COMMENTS (parchment style) ── */
.comments-area {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.comments-title,
.comment-reply-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  margin-bottom: 1.5rem;
}

.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list ol.children { list-style: none; margin-left: 1.5rem; }

.comment-list .comment,
.comment-list .pingback {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}

.comment-author {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.comment-author .fn { font-style: normal; font-weight: 500; }
.comment-author a { color: inherit; text-decoration: none; }

.comment-metadata {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.comment-metadata a { color: var(--mid); text-decoration: none; }
.comment-metadata a:hover { color: var(--accent); }

.comment-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #25221c;
}
.comment-content p { margin-bottom: 0.9rem; }

.comment-awaiting-moderation {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.reply { margin-top: 0.6rem; }
.comment-reply-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.comment-reply-link:hover { letter-spacing: 0.18em; }

.no-comments,
.comment-notes,
.logged-in-as {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.2rem;
}
.logged-in-as a { color: var(--accent); }

.comment-form p { margin-bottom: 1.3rem; }

.comment-form label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.45rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 0.75rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form .form-submit { margin-top: 0.5rem; margin-bottom: 0; }

.comment-form .comment-form-cookies-consent {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.comment-form .comment-form-cookies-consent input { width: auto; }
.comment-form .comment-form-cookies-consent label {
  display: inline;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}

/* iOS: never auto-inflate fonts (v1.1.1) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ═══════════════════════════════════════════════════════════
   3. MOBILE PASS (≤640px) — v1.1.0
   The approved design only shipped a 900px tablet breakpoint;
   phones were rendering desktop logic scaled down. This block
   completes the responsive scale. Zero JS, cascade-appended so
   it wins over earlier rules at equal specificity.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* — Nav: fixed bar becomes in-flow and wraps into two rows — */
  nav {
    position: static;
    flex-wrap: wrap;
    row-gap: 0.75rem;
    padding: 1rem 1.25rem 0.9rem;
  }
  body.admin-bar nav { top: auto; }
  .nav-logo { white-space: nowrap; }
  .nav-links {
    flex-basis: 100%;
    width: auto;
    flex-wrap: wrap;
    gap: 0.7rem 1.15rem;
  }
  .nav-links a { font-size: 0.62rem; letter-spacing: 0.13em; }

  /* — Hero: tighter frame, phone-scale name, stacked CTAs — */
  .hero-left { padding: 2.6rem 1.25rem 2.4rem; }
  .hero-right { padding: 2.2rem 1.25rem; }
  .hero-photo-frame {
    width: min(100%, 340px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }
  .hero-pull { max-width: 100%; }
  .hero-name { font-size: clamp(2.6rem, 11.5vw, 3.1rem); }
  .hero-cta-group { flex-wrap: wrap; gap: 0.75rem; }
  .hero-cta-group a { flex: 1 1 100%; text-align: center; }

  /* — Rhythm: sections breathe less on small screens — */
  section { padding: 3.6rem 1.25rem; }
  .section-title { font-size: clamp(1.65rem, 7vw, 2rem); overflow-wrap: break-word; }

  /* — IIS stats: keep 2-up, scale the numerals — */
  .index-stats { gap: 1rem; }
  .stat-num { font-size: 2.2rem; }

  /* — Cards & footer — */
  .doc-card { padding: 1.5rem 1.25rem; }
  footer { padding: 2.5rem 1.25rem; }

  /* — Document pages (Declaration & Reading Room) — */
  .doc-nav { padding: 1rem 1.25rem; }
  body.admin-bar .doc-nav { top: 0; }
  .progress-track { top: 49px; }
  .doc-page .doc-title { font-size: clamp(1.9rem, 8.5vw, 2.4rem); }
  .doc-body .lead::first-letter { font-size: 2.6rem; }

  /* — Comments: full-width fields — */
  .comment-form input[type="text"],
  .comment-form input[type="email"],
  .comment-form input[type="url"],
  .comment-form textarea { width: 100%; }

  /* — Safety net: nothing may poke out the side — */
  img, video, iframe { max-width: 100%; height: auto; }
  html, body { overflow-x: hidden; }
}

/* Very small phones */
@media (max-width: 400px) {
  .hero-name { font-size: 2.3rem; }
  .index-stats { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 1.9rem; }
}
