/* essay.css — long-form explainer pages. Loaded after site.css. */

.essay-hero {
  position: relative;
  min-height: 68vh;
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 3rem) 0 clamp(2.25rem, 5vw, 3.75rem);
  overflow: hidden;
}
.essay-hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%; opacity: .55; filter: grayscale(.3) contrast(1.05);
}
.essay-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5,5,5,.30) 0%, rgba(5,5,5,.62) 48%, rgba(5,5,5,.90) 82%, var(--ink) 100%);
}
.essay-hero__inner { position: relative; z-index: 1; }
.essay-hero h1 { display: inline-block; font-size: clamp(2.4rem, 6vw, 4.25rem); }
.essay-hero .lede { margin-top: .9rem; font-size: 1.15rem; max-width: 56ch; color: #c4c4c4; }
.essay-kicker { color: var(--dim); font-size: .9rem; margin-bottom: .5rem; }

/* text sits in a 68ch column aligned with the hero; figures span wider */
/* personal preface between hero and essay */
.preface {
  display: grid;
  grid-template-columns: [text-start] min(62ch, 100%) [text-end] minmax(0, 1fr);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.preface > * { grid-column: text-start / text-end; }
.preface > p:last-of-type {
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.preface__head {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  margin-bottom: 1rem;
  color: var(--text);
}
.preface p {
  margin: 0 0 1.1rem;
  font-size: 1.08rem;
  line-height: 1.72;
  color: #cfcfcf;
}
.preface p:last-child { margin-bottom: 0; color: var(--muted); }

.essay {
  display: grid;
  grid-template-columns: [text-start] min(68ch, 100%) [text-end] minmax(0, 1fr);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}
.essay > * { grid-column: text-start / text-end; }
.essay > .figure,
.essay > .band { grid-column: text-start / -1; }
.essay p { margin: 0 0 1.35rem; font-size: 1.05rem; line-height: 1.75; color: #d4d4d4; }
.essay p strong { color: var(--text); font-weight: 600; }
.essay h2 {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 1.1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.essay-standfirst {
  font-size: 1.3rem !important; line-height: 1.55 !important; color: var(--text) !important;
  margin-bottom: 2rem !important;
}
.essay-list { margin: 0 0 1.6rem; padding-left: 1.1rem; }
.essay-list li { margin-bottom: .85rem; color: #d4d4d4; line-height: 1.7; }
.essay-list li strong { color: var(--text); }

.pullquote {
  font-size: 1.35rem !important; line-height: 1.5 !important; color: var(--text) !important;
  border-left: 2px solid; border-image: var(--grad) 1;
  padding-left: 1.4rem; margin: 2.25rem 0 2.25rem !important;
}

/* figures break out wider than the text column */
.figure { width: min(100%, 1080px); margin: 2.5rem 0 2.75rem; }
.figure svg { width: 100%; height: auto; display: block; }
.figure__cap {
  font-size: .88rem !important; color: var(--dim) !important; margin: .9rem 0 0 !important;
  max-width: 66ch; line-height: 1.6 !important;
}

.essay-sources {
  margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.essay-sources h2 { font-size: 1.15rem; border: 0; padding: 0; margin: 0 0 1rem; }
.essay-sources ul { margin: 0; padding-left: 1.1rem; }
.essay-sources li { font-size: .92rem; color: var(--muted); margin-bottom: .6rem; line-height: 1.65; }
.essay-sources a { color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(96,165,250,.3); }
.essay-sources a:hover { border-bottom-color: var(--blue); }
.essay-note { font-size: .85rem !important; color: var(--dim) !important; margin-top: 1.5rem !important; font-style: italic; }

@media (max-width: 860px) {
  .figure, .band { width: 100%; }
  .essay-hero { min-height: 56vh; }
  .band img { aspect-ratio: 3/2; }
  /* wide diagrams get a horizontal scroll rather than illegible shrinkage */
  .figure svg { min-width: 620px; }
  .figure { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* full-width image band inside an essay */
.band { width: min(100%, 1080px); margin: 2.75rem 0; }
.band img {
  width: 100%; aspect-ratio: 21/9; height: auto; object-fit: cover;
  object-position: 50% 45%; border-radius: 4px;
  filter: grayscale(.15) contrast(1.03);
}
.band figcaption {
  font-size: .88rem; color: var(--dim); margin-top: .9rem; max-width: 66ch; line-height: 1.6;
}
