/* ============================================================
   Centralized VNR LP styles — 3 visual variants, one DOM, per-publisher accent.

   Architecture:
     .lp-vnr                           outer wrapper, owns base layout
     .lp-vnr--a / --b / --c            variant modifier (visual style)
     .lp-vnr[data-publisher="BEX"]     publisher accent via CSS vars

   Defensive isolation: every rule is scoped under `.lp-vnr` so it never
   leaks into publisher chrome. Reset `box-sizing` inside the scope
   (publisher themes may not set it globally — see memory
   feedback_centralized_lp_css_defensive_isolation).
   ============================================================ */

.lp-vnr,
.lp-vnr *,
.lp-vnr *::before,
.lp-vnr *::after {
  box-sizing: border-box;
}

/* ---------- per-publisher accent tokens ---------- */
.lp-vnr                              { --lp-accent: #0d5796; --lp-accent-soft: #e7f0f9; --lp-accent-ink: #ffffff; }
.lp-vnr[data-publisher="BEX"]        { --lp-accent: #f49a00; --lp-accent-soft: #fff4dd; --lp-accent-ink: #1a1300; }
.lp-vnr[data-publisher="BG"]         { --lp-accent: #006ba1; --lp-accent-soft: #e3f1f9; --lp-accent-ink: #ffffff; }
.lp-vnr[data-publisher="SW"]         { --lp-accent: #2c9f3a; --lp-accent-soft: #e6f5e8; --lp-accent-ink: #ffffff; }
.lp-vnr[data-publisher="TT"]         { --lp-accent: #1e8acb; --lp-accent-soft: #e4f1fa; --lp-accent-ink: #ffffff; }
.lp-vnr[data-publisher="KME"]        { --lp-accent: #0d5796; --lp-accent-soft: #e7f0f9; --lp-accent-ink: #ffffff; }
.lp-vnr[data-publisher="DNV"]        { --lp-accent: #c8102e; --lp-accent-soft: #fde7eb; --lp-accent-ink: #ffffff; }

/* ---------- semantic tokens (variants override these) ---------- */
.lp-vnr {
  --lp-ink:        #1a202c;
  --lp-ink-soft:   #4a5568;
  --lp-ink-muted:  #6b7280;
  --lp-ink-faint:  #9ca3af;
  --lp-surface:    #ffffff;
  --lp-surface-soft: #f7f8fa;
  --lp-rule:       #e5e7eb;
  --lp-radius:     12px;
  --lp-radius-sm:  6px;
  --lp-shadow:     0 10px 30px -12px rgba(15, 23, 42, 0.18), 0 4px 10px -4px rgba(15, 23, 42, 0.08);

  --lp-font-body:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lp-font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  font-family: var(--lp-font-body);
  color: var(--lp-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 32px);
}

/* ---------- shared layout primitives ---------- */
.lp-vnr__hero        { display: grid; gap: clamp(20px, 3vw, 32px); }
.lp-vnr__hero-text   { min-width: 0; }
.lp-vnr__eyebrow     { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--lp-accent); color: var(--lp-accent-ink); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.lp-vnr__byline      { margin-top: 14px; font-size: 13px; color: var(--lp-ink-muted); }
.lp-vnr__headline    { margin: 12px 0 8px; font-family: var(--lp-font-display); font-weight: 800; color: var(--lp-ink); }
.lp-vnr__subheadline { margin: 0 0 16px; color: var(--lp-ink-soft); font-weight: 400; }
.lp-vnr__lead        { margin: 0; color: var(--lp-ink-soft); }

.lp-vnr__image-frame { display: flex; align-items: center; justify-content: center; }
.lp-vnr__image-frame img { display: block; max-width: 100%; height: auto; }

.lp-vnr__checklist          { list-style: none; padding: 0; margin: 24px 0 8px; display: grid; gap: 12px; }
.lp-vnr__checklist li       { position: relative; padding-left: 36px; color: var(--lp-ink); font-size: 16px; line-height: 1.5; }
.lp-vnr__checklist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--lp-accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 8'/></svg>");
  background-size: 14px 14px; background-position: center; background-repeat: no-repeat;
}

.lp-vnr__form-section { margin: clamp(24px, 4vw, 36px) 0 0; }
.lp-vnr__form-head    { margin: 0 0 14px; font-family: var(--lp-font-display); color: var(--lp-ink); font-weight: 700; }
.lp-vnr__form-head em { font-style: normal; color: var(--lp-accent); }
.lp-vnr__nss          { background: var(--lp-surface); }
/* NSS iframe is fixed-content (~220px on desktop, ~280px when stacked on mobile).
   We size it tight to its content to avoid dead whitespace at the bottom of the
   form card. NSS form doesn't post-message its height, so this is a static value. */
.lp-vnr__nss iframe   { width: 100% !important; height: 240px; border: 0; display: block; }
@media (max-width: 520px) {
  .lp-vnr__nss iframe { height: 300px; }
}

.lp-vnr__legal {
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--lp-rule);
  font-size: 12px;
  line-height: 1.6;
  color: var(--lp-ink-faint);
}
.lp-vnr__legal p           { margin: 0 0 10px; }
.lp-vnr__legal p:last-child { margin-bottom: 0; }
.lp-vnr__legal-label       { display: block; font-weight: 700; color: var(--lp-ink-muted); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; font-size: 10px; }
.lp-vnr__legal a           { color: var(--lp-ink-muted); text-decoration: underline; }

.lp-vnr__publisher-line {
  margin: 8px 0 0; padding: 10px 14px; font-size: 13px; color: var(--lp-ink-muted);
  background: var(--lp-surface-soft); border-radius: var(--lp-radius-sm);
  border-left: 3px solid var(--lp-accent);
}

.lp-vnr .alert-danger {
  padding: 14px 18px; margin: 0 0 20px; border-radius: var(--lp-radius-sm);
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
}
.lp-vnr .alert-danger strong { display: block; margin-bottom: 6px; }

/* ============================================================
   Variant A — "Editorial Modern"
   Serif headline, generous whitespace, soft 3D book cover, hairline rules.
   ============================================================ */
.lp-vnr--a {
  --lp-font-display: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --lp-surface-soft: #fafaf7;
}
.lp-vnr--a .lp-vnr__headline    { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -0.015em; }
.lp-vnr--a .lp-vnr__subheadline { font-size: clamp(17px, 2vw, 20px); line-height: 1.4; font-style: italic; }
.lp-vnr--a .lp-vnr__lead        { font-size: 16px; line-height: 1.6; }
.lp-vnr--a .lp-vnr__image-frame img {
  max-width: 280px;
  box-shadow: 0 30px 60px -20px rgba(15,23,42,.35), 0 12px 20px -10px rgba(15,23,42,.18);
  transform: perspective(800px) rotateY(-7deg);
  border-radius: 2px;
}
.lp-vnr--a .lp-vnr__form-section {
  border-top: 4px solid var(--lp-accent);
  background: var(--lp-surface);
  padding: 24px clamp(16px, 3vw, 28px) 20px;
  border-radius: 0 0 var(--lp-radius) var(--lp-radius);
  box-shadow: var(--lp-shadow);
}
.lp-vnr--a .lp-vnr__form-head { font-size: clamp(18px, 2.2vw, 22px); font-weight: 600; letter-spacing: -0.005em; }
.lp-vnr--a .lp-vnr__hero { grid-template-columns: 1fr; }
/* Checklist lives in the text column for variant A (see body_fragment.html.j2),
   so it fills the height beside the cover instead of being pushed below it. */
.lp-vnr--a .lp-vnr__hero-text .lp-vnr__checklist { margin: 22px 0 0; }
@media (min-width: 720px) {
  .lp-vnr--a .lp-vnr__hero { grid-template-columns: 1fr 300px; align-items: start; }
  /* Square 1024×1024 cover (v6) needs more width to match the visual weight
     of the prior portrait 300×350 originals. max-height kept as a safety cap
     in case a future cover reverts to a tall portrait aspect. */
  .lp-vnr--a .lp-vnr__image-frame img { max-width: 300px; max-height: 420px; }
}

/* ============================================================
   Variant B — "Bold Card"
   High-contrast, dense headline, accent-tinted form card, chip checklist.
   ============================================================ */
.lp-vnr--b .lp-vnr__hero {
  background: linear-gradient(180deg, var(--lp-accent-soft) 0%, transparent 100%);
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-rule);
}
.lp-vnr--b .lp-vnr__headline {
  font-size: clamp(28px, 4.6vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 900;
}
.lp-vnr--b .lp-vnr__subheadline { font-size: clamp(16px, 2vw, 19px); line-height: 1.45; }
.lp-vnr--b .lp-vnr__image-frame img {
  max-width: 260px;
  border-radius: var(--lp-radius-sm);
  box-shadow: 0 20px 40px -16px rgba(15,23,42,.4);
  border: 6px solid var(--lp-surface);
}
.lp-vnr--b .lp-vnr__checklist          { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.lp-vnr--b .lp-vnr__checklist li       { padding: 10px 14px 10px 36px; background: var(--lp-surface); border: 1px solid var(--lp-rule); border-radius: 999px; font-size: 14px; line-height: 1.3; }
.lp-vnr--b .lp-vnr__checklist li::before { left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; background-size: 12px 12px; }
.lp-vnr--b .lp-vnr__form-section {
  margin-top: 24px;
  background: var(--lp-surface);
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-rule);
  box-shadow: 0 4px 16px -8px rgba(15,23,42,.12);
  position: relative;
}
.lp-vnr--b .lp-vnr__form-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--lp-accent); border-radius: var(--lp-radius) var(--lp-radius) 0 0;
}
.lp-vnr--b .lp-vnr__form-head { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; }
.lp-vnr--b .lp-vnr__hero { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .lp-vnr--b .lp-vnr__hero { grid-template-columns: 1fr 280px; gap: 28px; align-items: center; }
}

/* ============================================================
   Variant C — "Quiet Conversion"
   Narrow column, minimal chrome, NSS form is the centerpiece.
   ============================================================ */
.lp-vnr--c {
  max-width: 640px;
}
.lp-vnr--c .lp-vnr__hero { grid-template-columns: 1fr; text-align: left; }
.lp-vnr--c .lp-vnr__image-frame { justify-content: flex-start; margin-bottom: 4px; }
.lp-vnr--c .lp-vnr__image-frame img {
  max-width: 96px;
  border-radius: var(--lp-radius-sm);
  box-shadow: 0 6px 16px -6px rgba(15,23,42,.25);
}
.lp-vnr--c .lp-vnr__headline    { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
.lp-vnr--c .lp-vnr__subheadline { font-size: 16px; line-height: 1.5; }
.lp-vnr--c .lp-vnr__lead        { font-size: 15px; }
.lp-vnr--c .lp-vnr__checklist          { margin: 18px 0 4px; gap: 8px; }
.lp-vnr--c .lp-vnr__checklist li       { font-size: 15px; padding-left: 28px; }
.lp-vnr--c .lp-vnr__checklist li::before { width: 18px; height: 18px; background-size: 12px 12px; }
.lp-vnr--c .lp-vnr__form-section { background: transparent; padding: 16px 0 0; }
.lp-vnr--c .lp-vnr__form-head    { font-size: 18px; }
.lp-vnr--c .lp-vnr__legal        { font-size: 11px; }

/* small-screen tweaks + reduced motion */
@media (max-width: 480px) {
  .lp-vnr__image-frame img        { max-width: 200px !important; transform: none !important; }
  .lp-vnr--c .lp-vnr__image-frame img { max-width: 84px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-vnr--a .lp-vnr__image-frame img { transform: none; }
}

/* ============================================================
   /vnr/preview chrome — outside the .lp-vnr scope.
   ============================================================ */
.vnr-preview-page { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f3f4f6; margin: 0; padding: 0; }
.vnr-preview-page__topbar { position: sticky; top: 0; z-index: 100; background: #0f172a; color: #fff; padding: 14px 24px; box-shadow: 0 2px 12px rgba(0,0,0,.15); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.vnr-preview-page__topbar h1 { margin: 0; font-size: 16px; font-weight: 600; }
.vnr-preview-page__topbar .controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.vnr-preview-page__topbar select { padding: 6px 10px; border-radius: 6px; border: 1px solid #334155; background: #1e293b; color: #fff; font-size: 13px; }
.vnr-preview-page__topbar a { color: #93c5fd; font-size: 13px; text-decoration: none; }
.vnr-preview-page__grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 0 24px 48px; max-width: 980px; margin: 0 auto; }

.vnr-tabs { display: flex; gap: 4px; padding: 16px 24px 8px; max-width: 980px; margin: 0 auto; border-bottom: 1px solid #e5e7eb; }
.vnr-tab { flex: 1; padding: 12px 16px; background: transparent; border: 0; border-bottom: 3px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; color: #6b7280; transition: all 0.15s; font-family: inherit; }
.vnr-tab:hover { color: #0f172a; }
.vnr-tab--active { color: #0f172a; border-bottom-color: #0f172a; }
.vnr-tab-subtitles { padding: 8px 24px 16px; max-width: 980px; margin: 0 auto; }
.vnr-tab-subtitle { font-size: 13px; color: #6b7280; }
.vnr-preview-page__card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(15,23,42,.08); overflow: hidden; }
.vnr-preview-page__card-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 20px; border-bottom: 1px solid #e5e7eb; background: #f9fafb; }
.vnr-preview-page__card-head h2 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #0f172a; }
.vnr-preview-page__card-head .subtitle { font-size: 12px; color: #6b7280; }
.vnr-preview-page__card-body { padding: 0; }
.vnr-preview-page__publisher-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: #f3f4f6; border-bottom: 1px solid #e5e7eb; font-size: 12px; color: #6b7280; }
.vnr-preview-page__publisher-bar strong { color: #0f172a; }
