/* ============================================================
   Political Judas — Dark Literary CSS
   ============================================================ */

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

html {
  overflow-x: clip;
}

/* ── Global link reset — no browser blue anywhere ── */
a {
  color: inherit;
  text-decoration: none;
}
a:visited {
  color: inherit;
}

/* Essay body prose links (rare — footnote text, etc.) */
.essay-body a:not(sup a) {
  text-decoration: underline;
  text-decoration-color: rgba(240, 235, 224, 0.25);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.essay-body a:not(sup a):hover {
  text-decoration-color: rgba(240, 235, 224, 0.6);
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: #0d0d0b;
  color: #f0ebe0;
  font-size: 19px;
  line-height: 1.8;
}

/* ── Hero ── */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center 30%;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,8,6,0.55) 0%,
    rgba(8,8,6,0.35) 40%,
    rgba(8,8,6,0.65) 80%,
    rgba(8,8,6,0.92) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.hero-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #c9a84c;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #f0ebe0;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-style: italic;
  color: #c4bfb4;
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
}

.hero-author {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a84c;
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(201, 168, 76, 0.6);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s;
}

.scroll-cue:hover {
  opacity: 1;
  color: rgba(201, 168, 76, 1);
}

/* ── Context Bar ── */
.context-bar {
  background: #080806;
  border-top: 1px solid #1e1c18;
  border-bottom: 1px solid #1e1c18;
  padding: 0.85rem 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: #8a8070;
}

.context-bar a {
  color: #c9a84c;
  text-decoration: none;
}

.context-bar a:hover {
  text-decoration: underline;
}

/* ── Essay Layout ── */
.essay-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 5rem 2rem 7rem;
  overflow-x: visible;
}

.essay-header {
  text-align: center;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid #2a2820;
  margin-bottom: 4rem;
}

.reading-time {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a84c;
  margin-bottom: 2.5rem;
}

.essay-title {
  font-size: 2.6rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.essay-subtitle {
  font-size: 1.05rem;
  font-style: italic;
  color: #8a8070;
  margin-bottom: 1.5rem;
}

.essay-byline {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8a8070;
}

.essay-byline span {
  color: #c9a84c;
}

/* ── Essay Body ── */
.essay-body p {
  font-size: 1.28rem;
  line-height: 1.85;
  margin-bottom: 1.5em;
  color: #ede8de;
}

.drop-cap {
  float: left;
  font-size: 5.2em;
  line-height: 0.78;
  margin: 0.05em 0.1em 0 0;
  color: #c9a84c;
  font-weight: 500;
}

/* ── Epigraph ── */
.epigraph {
  margin: 0 0 3.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(201, 168, 76, 0.3);
}

.epigraph p {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 0.5rem;
  color: #c4bfb4;
}

.epigraph cite {
  font-size: 0.82rem;
  color: #8a8070;
  font-style: normal;
}

/* ── Section Divider ── */
.section-divider {
  margin: 5rem 0 3rem;
  overflow: visible;
}

/* ── Image Placeholder ── */
.img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111109;
  border: 1px dashed rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.img-placeholder::before {
  content: attr(data-label);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.3);
}

/* ── Section Heading ── */
.section-heading {
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.15;
  color: #f0ebe0;
  margin-bottom: 0.25rem;
}

.section-heading span {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: #8a8070;
  font-size: 1.5rem;
}

/* ── Blockquote (Girard quotes) ── */
.essay-body blockquote {
  margin: 2rem 0;
  padding: 1rem 1.75rem;
  border-left: 2px solid #2a2820;
  font-style: italic;
  font-size: 1rem;
  color: #b8b3a8;
  line-height: 1.75;
}

/* ── Pull Quote ── */
.pull-quote {
  margin: 4rem 0;
  padding: 2.5rem 0;
  border-top: 1px solid #2a2820;
  border-bottom: 1px solid #2a2820;
  text-align: center;
}

.pull-quote blockquote {
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.55;
  color: #ddd6c6;
  border: none;
  padding: 0 1rem;
  margin: 0;
  position: relative;
}

.pull-quote blockquote::before {
  content: '\201C';
  font-size: 3.5rem;
  color: rgba(201, 168, 76, 0.3);
  line-height: 0;
  position: relative;
  top: 0.55rem;
  margin-right: 0.05em;
}

.pull-quote cite {
  display: block;
  font-size: 0.78rem;
  color: #6e6860;
  font-style: normal;
  margin-top: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Footnotes ── */
sup a {
  font-size: 0.6em;
  vertical-align: super;
  color: #c9a84c;
  text-decoration: none;
  margin-left: 0.05em;
}

sup a:hover {
  text-decoration: underline;
}

/* ── Audio Section ── */
.audio-section {
  background: #080806;
  border-top: 1px solid #1e1c18;
  padding: 5rem 2rem;
}

.audio-wrap {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #c9a84c;
  margin-bottom: 2rem;
  display: block;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #0f0f0d;
  border: 1px solid #2a2820;
  border-radius: 3px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1a1a17;
  border: 1px solid #2a2820;
  color: #c9a84c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: not-allowed;
  opacity: 0.6;
}

.audio-track {
  flex: 1;
}

.track-bar {
  height: 2px;
  background: #2a2820;
  border-radius: 1px;
  margin-bottom: 0.6rem;
}

.track-fill {
  width: 0;
  height: 100%;
  background: #c9a84c;
  border-radius: 1px;
}

.track-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #8a8070;
}

.audio-note {
  font-size: 0.85rem;
  color: #8a8070;
  font-style: italic;
}

/* ── About Section ── */
.about-section {
  padding: 5rem 2rem;
  border-top: 1px solid #1e1c18;
}

.about-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.author-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #1a1a17;
  border: 1px solid #2a2820;
  flex-shrink: 0;
}

.author-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #c4bfb4;
  margin-bottom: 0.9rem;
}

.author-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.author-links a {
  text-decoration: none;
  color: #c9a84c;
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.author-links a:hover {
  text-decoration: underline;
}

/* ── Footer ── */
.site-footer {
  background: #060605;
  border-top: 1px solid #1a1815;
  padding: 2.5rem 2rem;
}

.footer-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.footer-copy,
.footer-grant {
  font-size: 0.75rem;
  color: #8a8070;
}

.footer-grant a {
  color: #8a8070;
  text-decoration: underline;
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  text-decoration: none;
  color: #c9a84c;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .hero-title {
    font-size: 17vw;
  }

  .essay-wrap {
    padding: 3rem 1.25rem;
  }

  .pull-quote {
    margin: 3rem -1.25rem;
  }

  .about-wrap {
    flex-direction: column;
  }

  .footer-nav {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .drop-cap {
    font-size: 4.2em;
  }
}

/* ── Section figures (full-bleed via JS) ──── */
.section-figure {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 0;
  /* width and margin-left set by JS */
}

.section-figure img {
  width: 100%;
  display: block;
  border: none;
  max-height: 75vh;
  object-fit: cover;
  object-position: center;
}

.section-figure figcaption {
  margin-top: 0.5rem;
  padding: 0 2rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-style: italic;
  text-align: right;
}

/* ── Book promo banner ─────────────────────── */
.book-banner {
  background: #0f0f0c;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 3px;
  margin: 4rem 0;
  padding: 2.25rem 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.book-banner-text {
  flex: 1;
}

.book-banner-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.book-banner-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.book-banner-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.book-banner-btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.book-banner-btn:hover {
  background: var(--gold);
  color: #0d0d0b;
}

/* ── News hook box ─────────────────────────── */
.news-hook {
  border-left: 2px solid rgba(201,168,76,0.4);
  padding: 1.25rem 1.5rem;
  margin: 3rem 0;
  background: #111108;
}

.news-hook-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.news-hook p {
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  color: #c8c2b4 !important;
  margin-bottom: 0 !important;
}

@media (max-width: 680px) {
  .book-banner {
    flex-direction: column;
    padding: 1.5rem;
  }
}

/* ── Superscripts ──────────────────────────── */
sup a {
  font-size: 0.65em;
  vertical-align: super;
  line-height: 0;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  padding: 0 0.1em;
  cursor: pointer;
  transition: opacity 0.15s;
}
sup a:hover { opacity: 0.7; }

/* ── Endnotes section ──────────────────────── */
.endnotes-section {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid #2a2820;
}

.endnotes-heading {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.endnotes-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0 0 1rem;
  column-count: 1;
}

@media (min-width: 900px) {
  .endnotes-list {
    column-count: 2;
    column-gap: 2.5rem;
  }
}

.endnotes-list li {
  font-size: 0.65rem;
  line-height: 1.45;
  color: #646058;
  margin-bottom: 0.25rem;
  padding-left: 0.2rem;
  break-inside: avoid;
}

.endnotes-list li:target {
  color: #a09888;
  background: rgba(201,168,76,0.06);
  border-radius: 2px;
}

.fn-back {
  color: #a09888;
  text-decoration: none !important;
  margin-left: 0.4em;
  font-size: 0.8em;
  opacity: 0.5;
  font-style: normal;
  cursor: pointer;
}
.fn-back:hover { opacity: 1; color: #d4cec5; }

/* Endnote links within note text */
.endnotes-list a:not(.fn-back) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(138, 128, 112, 0.5);
  text-underline-offset: 2px;
}

/* Sup links — gold, no underline */
sup a {
  text-decoration: none !important;
}

.endnotes-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Sidenote sidebar ──────────────────────── */
.sidenote-sidebar {
  position: fixed;
  top: var(--top, 50%);
  right: 1.5rem;
  width: 300px;
  max-width: calc(100vw - 3rem);
  background: #141410;
  border: 1px solid #2a2820;
  border-left: 2px solid var(--gold);
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 0.2s, transform 0.2s;
  max-height: 60vh;
  overflow-y: auto;
}

.sidenote-sidebar.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.sidenote-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  font-size: 0.7rem;
  border-radius: 50%;
  margin-right: 0.5em;
  flex-shrink: 0;
  vertical-align: middle;
}

.sidenote-content {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #c0bab0;
}

.sidenote-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}
.sidenote-close:hover { color: var(--text); }

@media (max-width: 680px) {
  .sidenote-sidebar {
    top: auto !important;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(12px);
    border-left: none;
    border-top: 2px solid var(--gold);
  }
  .sidenote-sidebar.active {
    transform: translateY(0);
  }
}

/* ── Author book list ──────────────────────── */
.author-books {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.author-book {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.author-book a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: color 0.15s;
}

.author-book a:hover {
  color: var(--gold);
}

.book-pub {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.book-link-note {
  opacity: 0.5;
  font-style: italic;
}

/* ── Top audio CTA ─────────────────────────── */
.audio-top-cta {
  text-align: center;
  margin: 0 0 3rem;
}

.audio-top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold) !important;
  text-decoration: none !important;
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 0.55rem 1.2rem;
  transition: border-color 0.2s, background 0.2s;
}

.audio-top-link:hover {
  border-color: rgba(201, 168, 76, 0.7);
  background: rgba(201, 168, 76, 0.05);
}

.audio-top-link svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* ── Reading progress bar ──────────────────── */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: #c9a84c;
  z-index: 9999;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── Inline audio player (top of essay) ───── */
.audio-inline-player {
  margin: 0 0 3rem;
  padding: 1.25rem 1.5rem;
  background: #0f0f0c;
  border: 1px solid #2a2820;
}

.audio-inline-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

/* ── Font size toggle ──────────────────────── */
.font-size-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0;
  z-index: 500;
  background: #141410;
  border: 1px solid #2a2820;
}

.font-size-btn {
  background: none;
  border: none;
  color: #8a8070;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.font-size-btn:first-child {
  border-right: 1px solid #2a2820;
}
.font-size-btn:hover,
.font-size-btn.active {
  color: var(--gold);
  background: rgba(201,168,76,0.06);
}

@media (max-width: 680px) {
  .font-size-toggle { bottom: 1rem; right: 1rem; }
}
