/*
 * The essay band at the top of Book Tense. Everything else on the page is the
 * report's own inline <style>; these rules borrow its tokens (--surface, --line,
 * --present and so on) so the band follows it into light and dark mode.
 * Present-tense red is the accent, because that is what the essay is about.
 */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: 2.5rem 3rem;
  align-items: center;
}

.essay-note {
  margin-top: 1.4rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--present);
  color: var(--muted);
}

.essay-note a {
  color: var(--ink);
  font-style: italic;
  text-decoration-color: var(--present);
  text-underline-offset: 0.18em;
}

.essay-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.3rem;
  padding: 0.72rem 1.05rem;
  border-radius: 2px;
  background: var(--present);
  color: var(--paper);
  font: 700 0.74rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: filter 0.12s;
}

.essay-cta:hover,
.essay-cta:focus-visible {
  filter: brightness(1.1);
}

.essay-cta span {
  transition: transform 0.12s;
}

.essay-cta:hover span {
  transform: translateX(3px);
}

/*
 * The essay's card, drawn after the one Substack embeds: cover, title, subtitle,
 * byline, and an outlined orange button. Substack's own is an iframe whose
 * avatar and opening paragraph cannot be changed from here, so this is ours.
 * Like theirs it is white in both themes, and sits on the page as a card rather
 * than trying to match it. The whole card is one link.
 */
.post-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #363737;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none;
  box-shadow: 0 18px 40px -24px #000a;
  transition: transform 0.15s, box-shadow 0.15s;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px -22px #000b;
}

.post-card-cover {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid #0000000f;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.1rem;
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.post-card-sub {
  margin-top: 0.4rem;
  color: #77787a;
  font-size: 1.05rem;
  line-height: 1.4;
}

.post-card-byline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e6e6e6;
}

.post-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px #0000001a;
}

.post-card-pub,
.post-card-date {
  display: block;
}

.post-card-pub {
  font-size: 0.95rem;
  font-weight: 600;
}

.post-card-date {
  color: #77787a;
  font-size: 0.82rem;
}

.post-card-cta {
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  color: #ff6719;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
}

.post-card:hover .post-card-cta {
  background: #ff67190f;
}

/* Chart presets and the reset button, one group along the top of the chart
   panel. They borrow the report's .reset look; the preset matching the chart
   is marked. */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--present);
  box-shadow: inset 0 0 0 1px var(--present);
}

/* The written findings and method: static text, so search engines have
   something to read that the explorer otherwise only draws with script. */
.findings p,
.about p {
  max-width: 72ch;
}

.findings table caption {
  caption-side: top;
  padding: 0.7rem 0.72rem 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
}

.findings cite {
  font-style: italic;
}

/* The report sets no link color, so these fell back to the browser's blue.
   They take the color of the text around them and keep the underline. */
.about a,
footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.about a:hover,
footer a:hover {
  color: var(--ink);
}

/* Tightened on a phone so all three share one line. */
@media (max-width: 760px) {
  .presets {
    gap: 0.3rem;
  }

  .presets .reset {
    padding-inline: 0.5rem;
  }
}

@media (max-width: 960px) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .essay {
    max-width: 500px;
  }
}
