/**
 * Interstitial — "commercial break" ad-card surfaced between narrative beats.
 * Rendered by _includes/components/interstitial.njk, anchored via
 * collections.interstitialsByAnchor (see eleventy.config.js).
 *
 * Contrast contract: all text uses the --sf-text / --sf-bg pair (or an
 * inversion of it), which every era stylesheet guarantees legible. Accent
 * colors (--sf-neon, --sf-accent) are used for borders/rules only — never
 * for text — so the 8:1 minimum holds across all eras.
 */

.interstitial-break {
  margin: var(--sf-space-xl) 0;
  padding: var(--sf-space-md) 0;
  border-top: 3px double var(--sf-text);
  border-bottom: 3px double var(--sf-text);
}

/* Stack multiple interstitials anchored to the same node */
.interstitial-break > .interstitial + .interstitial {
  margin-top: var(--sf-space-lg);
  padding-top: var(--sf-space-lg);
  border-top: 1px dashed var(--sf-border);
}

.interstitial {
  position: relative;
  padding: var(--sf-space-lg);
  background: var(--sf-bg);
  border: 1px solid var(--sf-text);
  box-shadow: 6px 6px 0 0 var(--sf-text);
}

/* ── Eyebrow: tag · kind · date ── */
.interstitial-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sf-space-sm);
  margin-bottom: var(--sf-space-md);
  font-family: var(--sf-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interstitial-tag {
  /* Inverted chip — max contrast against any era background */
  background: var(--sf-text);
  color: var(--sf-bg);
  padding: 0.2rem 0.5rem;
  font-weight: 700;
}

.interstitial-kind {
  border: 1px solid var(--sf-text);
  color: var(--sf-text);
  padding: 0.2rem 0.5rem;
}

.interstitial-date {
  color: var(--sf-text);
  margin-left: auto;
}

/* ── Visual ── */
.interstitial-visual {
  display: block;
  margin-bottom: var(--sf-space-md);
  border: 1px solid var(--sf-text);
  line-height: 0;
}

.interstitial-visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Title + hook ── */
.interstitial-title {
  margin: 0 0 var(--sf-space-sm);
  font-size: 1.35rem;
  line-height: 1.2;
}

.interstitial-title a {
  color: var(--sf-text);
  text-decoration: none;
  border-bottom: 2px solid var(--sf-neon);
}

.interstitial-title a:hover,
.interstitial-title a:focus-visible {
  background: var(--sf-neon);
  color: var(--sf-bg);
}

.interstitial-hook {
  margin: 0 0 var(--sf-space-md);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--sf-text);
}

/* ── Call to action ── */
.interstitial-cta {
  display: inline-block;
  background: var(--sf-text);
  color: var(--sf-bg);
  font-family: var(--sf-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
  text-decoration: none;
  border: 1px solid var(--sf-text);
  transition: transform var(--sf-duration-fast) var(--sf-ease);
}

.interstitial-cta:hover,
.interstitial-cta:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 0 var(--sf-neon);
}

/* ── Resume cue ── */
.interstitial-resume {
  margin: var(--sf-space-md) 0 0;
  text-align: center;
  font-family: var(--sf-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--sf-text);
}

/* ── Era flavor ───────────────────────────────────────────────────────────
   Early eras: quiet, editorial. Later eras: louder, more invasive — the ad
   layer escalates alongside the intrusion system. */

/* 2024-2028 — clean, almost tasteful */
html.era-2024-2026 .interstitial,
html.era-2027-2028 .interstitial {
  box-shadow: 3px 3px 0 0 var(--sf-border);
}
html.era-2024-2026 .interstitial-break,
html.era-2027-2028 .interstitial-break {
  border-top-style: solid;
  border-bottom-style: solid;
  border-width: 1px;
}

/* 2029-2032 — brutalist, monospaced headline, hard shadow */
html.era-2029-2030 .interstitial-title,
html.era-2031-2032 .interstitial-title {
  font-family: var(--sf-font-mono);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
html.era-2031-2032 .interstitial {
  box-shadow: 8px 8px 0 0 var(--sf-neon);
}

/* 2033-2035 — frames glow, the ad layer is part of the environment */
html.era-2033-2034 .interstitial,
html.era-2035 .interstitial {
  border-color: var(--sf-neon);
  box-shadow: 0 0 12px color-mix(in srgb, var(--sf-neon) 35%, transparent);
}
html.era-2033-2034 .interstitial-tag,
html.era-2035 .interstitial-tag {
  background: var(--sf-neon);
  color: var(--sf-bg);
}

@media (max-width: 600px) {
  .interstitial { padding: var(--sf-space-md); }
  .interstitial-eyebrow .interstitial-date { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .interstitial-cta { transition: none; }
}
