/* ===========================
   ESSAYS — Cinematic Layout
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Vollkorn:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap');

:root {
  --font-essay-body: 'Vollkorn', Georgia, serif;
}

/* ─── PROGRESS BAR ─── */
#essay-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--red);
  z-index: 150;
  transition: width 0.05s linear;
}

/* ─── HERO ─── */
.essay-hero {
  width: 100%;
  min-height: calc(100vh - 52px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6rem;
  overflow: hidden;
}

.essay-hero-bg {
  position: absolute;
  inset: 0;
  background-color: #2a2a26;
  background-size: cover;
  background-position: center top;
}

.essay-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,8,0.08) 0%,
    rgba(10,10,8,0.18) 40%,
    rgba(10,10,8,0.72) 75%,
    rgba(10,10,8,0.90) 100%
  );
}

.essay-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  padding: 0 2rem;
}

.essay-kicker {
  font-family: var(--font-essay-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 1.2rem;
}

.essay-hero-title {
  font-family: var(--font-essay-body);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.0;
  color: #fff;
  margin-bottom: 1.2rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.essay-hero-subtitle {
  font-family: var(--font-essay-body);
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  font-style: italic;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
  margin-bottom: 2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.essay-hero-byline {
  font-family: var(--font-essay-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.essay-hero-byline span {
  color: rgba(255,255,255,0.82);
}

.essay-scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-essay-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: essay-cue-pulse 2.8s ease-in-out infinite;
}

@keyframes essay-cue-pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.9; transform: translateX(-50%) translateY(4px); }
}

/* ─── FLOATING TOC DOTS ─── */
.essay-toc-float {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 99;
}

.essay-toc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  position: relative;
  border: none;
  padding: 0;
}

.essay-toc-dot:hover,
.essay-toc-dot.active {
  background: var(--red);
  transform: scale(1.5);
}

.essay-toc-dot::after {
  content: attr(data-label);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-essay-body);
  font-size: 10px;
  white-space: nowrap;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.essay-toc-dot:hover::after { opacity: 1; }

/* ─── ESSAY BODY ─── */
.essay-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

/* ─── LEDE ─── */
.essay-lede {
  font-family: var(--font-essay-body);
  font-size: 1.12em;
  font-style: italic;
  line-height: 1.72;
  color: #3a3a3a;
  border-top: 2px solid var(--red);
  border-bottom: 1px solid var(--border);
  padding: 1.6rem 0 1.8rem;
  margin-bottom: 3.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.essay-lede.revealed {
  opacity: 1;
  transform: none;
}

/* ─── SECTION HEADER ─── */
.essay-section-header {
  margin-bottom: 2rem;
  margin-top: 5rem;
}

.essay-section-number {
  font-family: var(--font-essay-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0.55;
  margin-bottom: 0.6rem;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.essay-section-title {
  font-family: var(--font-essay-body);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.2rem;
  transition: opacity 0.7s ease 0.16s,
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.16s,
              filter 0.6s ease 0.16s;
}

.essay-section-header.will-animate .essay-section-number {
  opacity: 0;
  transform: translateY(9px);
}

.essay-section-header.will-animate .essay-section-title {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(6px);
}

/* ─── BODY TEXT ─── */
.essay-body-text {
  font-family: var(--font-essay-body);
  font-size: 1rem;
  line-height: 1.92;
  color: #2a2a2a;
}

.essay-body-text p {
  margin-bottom: 1.5em;
}

.essay-body-text p:first-of-type::first-letter {
  font-family: var(--font-essay-body);
  font-size: 4.4em;
  font-weight: 900;
  line-height: 0.78;
  float: left;
  margin-right: 0.06em;
  margin-top: 0.05em;
  color: var(--red);
}

.essay-body-text a       { color: var(--red); }
.essay-body-text a:hover { text-decoration: underline; }

.essay-body-text blockquote {
  border-left: 2px solid var(--red);
  padding-left: 1.4rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
  opacity: 0.9;
}

.essay-body-text h3 {
  font-family: var(--font-essay-body);
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin: 2.5rem 0 0.8rem;
}

/* ─── PULL QUOTE ─── */
.essay-pull-quote {
  margin: 3rem -2rem;
  padding: 1.8rem 2.6rem;
  border-top: 2px solid var(--red);
  border-bottom: 1px solid var(--border);
  background: rgba(141,20,36,0.03);
}

.essay-pull-quote blockquote {
  font-family: var(--font-essay-body);
  font-size: 1.28em;
  font-style: italic;
  line-height: 1.55;
  color: #1a1a1a;
  margin-bottom: 0.8rem;
  border: none;
  padding: 0;
  opacity: 1;
}

.essay-pull-quote cite {
  font-family: var(--font-essay-body);
  font-size: 0.74em;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0.65;
}

/* ─── ESSAY IMAGE ─── */
.essay-figure {
  margin: 3.5rem -1.5rem;
}

.essay-figure img {
  width: 100%;
  display: block;
  min-height: 300px;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.032);
  transition: opacity 1.05s ease 0.06s,
              transform 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.06s;
}

.essay-figure.fb-expanded {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.essay-figure.fb-visible img {
  opacity: 1;
  transform: scale(1);
}

.essay-figure figcaption {
  font-family: var(--font-essay-body);
  font-size: 0.74em;
  color: #777;
  font-style: italic;
  margin-top: 0.6rem;
  padding: 0 0.5rem;
  line-height: 1.55;
  opacity: 0;
  transition: opacity 0.7s ease 0.85s;
}

.essay-figure.fb-visible figcaption { opacity: 1; }

.essay-figure.fb-expanded figcaption {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ─── PORTRAIT IMAGE VARIANT ─── */
.essay-figure--portrait {
  background: #0D0D0D;
}

.essay-figure--portrait img {
  object-fit: contain;
  min-height: 70vh;
  height: 70vh;
}

/* ─── ORNAMENT ─── */
.essay-ornament {
  text-align: center;
  margin: 3rem 0;
  color: var(--red);
  opacity: 0.35;
  font-size: 1.1em;
  letter-spacing: 0.45em;
  font-family: var(--font-essay-body);
}

/* ─── FOOTNOTES ─── */
.essay-footnotes {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--red);
}

.essay-footnotes h2 {
  font-family: var(--font-essay-body);
  font-size: 0.7em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--red);
  opacity: 0.55;
}

.essay-fn-list {
  list-style: none;
  counter-reset: fn-counter;
}

.essay-fn-list li {
  counter-increment: fn-counter;
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-essay-body);
  font-size: 0.82em;
  line-height: 1.65;
  color: #4a4a4a;
}

.essay-fn-list li::before {
  content: counter(fn-counter) ".";
  font-weight: bold;
  color: var(--red);
  opacity: 0.55;
  min-width: 1.4em;
  flex-shrink: 0;
}

/* ─── END MARK ─── */
.essay-end-mark {
  background: var(--red);
  padding: 4.5rem 2rem;
  text-align: center;
}

.essay-end-label {
  font-family: var(--font-essay-body);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1rem;
}

.essay-end-title {
  font-family: var(--font-essay-body);
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  font-weight: 900;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin-bottom: 2.2rem;
}

.essay-end-back {
  font-family: var(--font-essay-body);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.essay-end-back:hover {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
}

/* ─── ESSAYS LISTING PAGE ─── */
.essay-list-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.essay-list-item:first-child { border-top: 1px solid var(--border); }

.essay-list-thumb {
  width: 140px;
  height: 96px;
  object-fit: cover;
  display: block;
  background: rgba(141,20,36,0.06);
  flex-shrink: 0;
}

.essay-list-meta { min-width: 0; }

.essay-list-kicker {
  font-family: var(--font-essay-body);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0.55;
  margin-bottom: 8px;
}

.essay-list-title {
  font-family: var(--font-essay-body);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin-bottom: 10px;
  word-break: break-word;
  transition: color 0.2s;
}

.essay-list-item:hover .essay-list-title { color: var(--red); }

.essay-list-subtitle {
  font-family: var(--font-essay-body);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.7;
  color: #5a5a5a;
  margin-bottom: 14px;
}

.essay-list-read {
  font-family: var(--font-essay-body);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.essay-list-item:hover .essay-list-read { gap: 12px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .essay-hero-title { font-size: 2.6rem; }
  .essay-body { padding: 3rem 1.25rem 5rem; }
  .essay-pull-quote { margin: 2.5rem -1rem; padding: 1.5rem 1.5rem; }
  .essay-figure { margin: 2.5rem -0.5rem; }
  .essay-toc-float { display: none; }

  .essay-list-item {
    grid-template-columns: 1fr;
    gap: 16px 0;
    padding: 32px 0;
  }

  .essay-list-thumb {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .essay-hero-title { font-size: 2.2rem; }
  .essay-section-title { font-size: 1.6rem; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  .essay-figure img,
  .essay-figure figcaption,
  .essay-section-number,
  .essay-section-title,
  .essay-lede,
  .essay-scroll-cue {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
