/* ============================================================
   Narrative — LLM-authored attack story
   Two surfaces: Hero (in PackagePage) + Strip (in DetonationView)
   Tokens only. Append to det-view.css or load as narrative.css.
   ============================================================ */

/* A hair lighter than --bg-page (#F5F3EF) for the layered paper feel. */
:root {
  --narr-paper-raised: #FBF9F5;
}

/* ---------------- SURFACE A — HERO ---------------- */

.narr-hero {
  position: relative;
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: var(--space-5, 24px);
  margin: var(--space-6, 32px) 0 var(--space-7, 48px);
  padding: var(--space-2, 8px) 0 var(--space-2, 8px);
  /* sits ON the page, no card */
  background: transparent;
}

.narr-hero__rule {
  align-self: stretch;
  width: 3px;
  border-radius: 2px;
  background: var(--sev-neutral, #6B675C);
  /* Color-keyed by verdict — set on the data-verdict variants below */
  transition: background-color var(--dur-base, 180ms) var(--ease-standard, ease);
}

.narr-hero[data-verdict="clean"]      .narr-hero__rule { background: var(--sev-clean, #5C7A4E); }
.narr-hero[data-verdict="suspicious"] .narr-hero__rule { background: var(--sev-sus,   #C08A2E); }
.narr-hero[data-verdict="malicious"]  .narr-hero__rule { background: var(--sev-mal,   #C4473A); }

.narr-hero__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 24px);
  min-width: 0;
}

.narr-hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted, #6B675C);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.narr-hero__eyebrow .sep {
  width: 18px;
  height: 1px;
  background: var(--border-subtle, #E4E1D8);
}

.narr-hero__headline {
  margin: 0;
  font-family: var(--font-display);
  /* Editorial serif at scale — generous line-height, near-prose */
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--fg-primary, #1A1A1A);
  /* Cap at long-form prose width */
  max-width: 22ch;
  text-wrap: pretty;
}

.narr-hero__summary-wrap {
  /* Subtle paper layering — a hair lighter than the page, no border. */
  background: var(--narr-paper-raised);
  padding: var(--space-5, 24px) var(--space-6, 32px);
  border-radius: var(--radius-md, 8px);
  /* No box-shadow, no border. Just the tint difference. */
  max-width: 720px;
}

.narr-hero__summary {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--fg-secondary, #3D3A33);
  /* Anthropic prose-width cap */
  max-width: 64ch;
  text-wrap: pretty;
}

/* Mobile — narrower padding, no left rule shrink (still 3px), denser.
   Tones down the editorial serif: smaller headline, lighter weight,
   no paper card behind the summary (the card was visually noisy on
   small screens — the page already provides enough surface). */
@media (max-width: 700px) {
  .narr-hero {
    grid-template-columns: 2px 1fr;
    gap: 14px;
    margin: var(--space-4, 16px) 0 var(--space-5, 24px);
    padding: 2px 0;
  }
  .narr-hero__rule { width: 2px; }
  .narr-hero__body { gap: 12px; }
  .narr-hero__eyebrow { font-size: 10px; letter-spacing: 0.12em; }
  .narr-hero__eyebrow .sep { width: 12px; }
  .narr-hero__headline {
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 500;
    max-width: none;
  }
  .narr-hero__summary-wrap {
    background: transparent;
    padding: 0;
    border-radius: 0;
  }
  .narr-hero__summary { font-size: 14.5px; line-height: 1.6; color: var(--fg-secondary, #3D3A33); }
}

/* ---------------- SURFACE B — STRIP ---------------- */

.narr-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4, 16px);
  /* hairline rules above + below — section-divider feel */
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle, #E4E1D8);
  border-bottom: 1px solid var(--border-subtle, #E4E1D8);
  background: transparent; /* sits on the page, not a card */
  margin: var(--space-5, 24px) 0 var(--space-4, 16px);
}

/* Verdict glyph — small dot, single-accent only */
.narr-strip__glyph {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.narr-strip__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--sev-neutral, #6B675C);
  flex-shrink: 0;
  /* Tiny ring, no glow on cream */
  box-shadow: 0 0 0 3px rgba(0,0,0,0.02);
}
.narr-strip[data-verdict="clean"]      .narr-strip__dot { background: var(--sev-clean, #5C7A4E); }
.narr-strip[data-verdict="suspicious"] .narr-strip__dot { background: var(--sev-sus,   #C08A2E); }
.narr-strip[data-verdict="malicious"]  .narr-strip__dot { background: var(--sev-mal,   #C4473A); }

.narr-strip__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted, #6B675C);
  white-space: nowrap;
}
.narr-strip[data-verdict="clean"]      .narr-strip__label { color: var(--sev-clean-ink, #3E5534); }
.narr-strip[data-verdict="suspicious"] .narr-strip__label { color: var(--sev-sus-ink,   #7A5516); }
.narr-strip[data-verdict="malicious"]  .narr-strip__label { color: var(--sev-mal-ink,   #8A2E24); }

/* Headline — denser than hero, ellipsis if it overruns */
.narr-strip__headline {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--fg-primary, #1A1A1A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* "Read more" — text-affordance, never a button */
.narr-strip__more {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted, #6B675C);
  background: none;
  border: 0;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast, 120ms), border-color var(--dur-fast, 120ms);
}
.narr-strip__more:hover {
  color: var(--fg-primary, #1A1A1A);
  border-bottom-color: var(--fg-primary, #1A1A1A);
}
.narr-strip__more:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(196,71,58,.25));
  border-radius: 2px;
}
.narr-strip__more .caret {
  font-size: 11px;
  line-height: 1;
  transform: translateY(-1px);
  opacity: 0.7;
  transition: transform var(--dur-base, 180ms);
}
.narr-strip__more:hover .caret {
  transform: translateY(-3px);
  opacity: 1;
}

/* Mobile — keep it a strip, just denser. Drop the eyebrow label
   to free room for the headline; keep glyph + headline + caret. */
@media (max-width: 700px) {
  .narr-strip {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-3, 12px);
    padding: 11px 0;
    margin: var(--space-4, 16px) 0 var(--space-3, 12px);
  }
  .narr-strip__label { display: none; }
  .narr-strip__headline { font-size: 15px; line-height: 1.35; }
  .narr-strip__more {
    font-size: 0;
    padding: 4px 6px;
  }
  .narr-strip__more .caret { font-size: 13px; opacity: 0.9; }
}
