/* NDP-Search country-page surface (A2 design).
 * Scoped to .ndp-v2 to coexist with existing styles.
 * 2026-07-02: the separate "Compare versions" tab was retired — comparison is
 * now the compare LENS on the NDP document list (ndp-compare.js), so this file
 * lost its change-table/cite-check blocks and gained the lens styles. */

.ndp-v2 {
  --ndp-bg: #f7f7f5;
  --ndp-card: #ffffff;
  --ndp-border: #e5e5e0;
  --ndp-border-strong: #d4d4cf;
  --ndp-text: #1a1a1a;
  --ndp-text-muted: #5a5a55;
  --ndp-text-faint: #8a8a85;
  --ndp-teal: #3a5a80;        /* now the shared ink-blue accent */
  --ndp-teal-dark: #2c4663;
  --ndp-teal-tint: #eaeff5;
  --ndp-teal-tint-strong: #d4dfe9;
  --ndp-amber: #a17a1f;
  --ndp-red: #9a3434;
  --ndp-green: #4a7a3a;
}

/* --- Sticky chrome (header + search + banner + tabs) --- */
.ndp-v2 .country-chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ndp-bg);
  box-shadow: 0 1px 0 var(--ndp-border);
  margin-bottom: 18px;
}

/* --- A2 banner ("Updated <date> — see what changed", links to ?compare=) --- */
.ndp-v2 .change-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbfdfc;
  border: 1px solid var(--ndp-teal-tint-strong);
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ndp-text);
  margin: 12px 0;
}
.ndp-v2 .change-banner:hover { background: var(--ndp-teal-tint); }
.ndp-v2 .change-banner__dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ndp-teal);
  margin-right: 8px; vertical-align: middle;
}
.ndp-v2 .change-banner__strong { font-weight: 600; color: var(--ndp-text); }
.ndp-v2 .change-banner__muted { color: var(--ndp-text-muted); }
.ndp-v2 .change-banner__cta { color: var(--ndp-teal); font-weight: 600; font-size: 12px; flex-shrink: 0; }

/* --- Pills --- */
.ndp-v2 .ndp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 500; line-height: 1.5;
}
.ndp-v2 .ndp-pill--teal { background: var(--ndp-teal-tint); color: var(--ndp-teal); }
.ndp-v2 .ndp-pill--neutral { background: rgba(0,0,0,0.04); color: var(--ndp-text-muted); }
.ndp-v2 .ndp-pill--amber { background: #faf2dd; color: var(--ndp-amber); }
.ndp-v2 .ndp-pill--red { background: #f7e5e5; color: var(--ndp-red); }
.ndp-v2 .ndp-pill--green { background: #e8f0e3; color: var(--ndp-green); }

.ndp-v2 .ndp-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* --- Per-doc change markers (server-rendered dots, vs immediately-prior
       version). Hidden while the compare lens is active so the lens is the
       single source of change truth on screen — otherwise a card can wear
       an amber "updated vs previous" dot beside a green "Added vs <older
       baseline>" pill (adversarial UX review 2026-07-10). --- */
.ndp-v2 .ndp-compare-active .doc-flag { display: none; }

/* --- Per-tab citation header ---
   Sizing/weight live in style.css (.ndp-version-title .tab-citation) —
   only the colour is set here so the prominent heading style wins. */
.ndp-v2 .tab-header { margin-bottom: 18px; }
.ndp-v2 .tab-citation {
  margin: 0;
  color: var(--ndp-text);
}

/* =====================================================================
   Compare lens — annotates the NDP document list against a chosen
   baseline edition (ndp-compare.js).
   ===================================================================== */

/* The "Compare with" control sits beside the Version control; both use the
   bold .ndp-version-select styling from style.css. */
.ndp-v2 .ndp-compare-control { margin-left: 14px; }

/* Status line under the version row + the changes-only chip.
   The [hidden] rule must come after display:flex — a bare `hidden` attribute
   only maps to the UA's display:none, which any authored display overrides. */
.ndp-v2 .ndp-compare-note {
  font-size: 12.5px; color: var(--ndp-text-muted);
  margin: 8px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ndp-v2 .ndp-compare-note[hidden] { display: none; }
.ndp-v2 .ndp-compare-chip {
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--ndp-teal); background: var(--ndp-card);
  border: 1px solid var(--ndp-teal-tint-strong); border-radius: 12px;
  padding: 2px 11px; cursor: pointer;
}
.ndp-v2 .ndp-compare-chip:hover { background: var(--ndp-teal-tint); }
.ndp-v2 .ndp-compare-chip.active {
  background: var(--ndp-teal); border-color: var(--ndp-teal); color: #fff;
}

/* Lens pills on changed cards. */
.ndp-v2 .ndp-lens-pill {
  display: inline-block; flex-shrink: 0;
  padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.ndp-v2 .ndp-lens-pill--added { background: #e8f0e3; color: var(--ndp-green); }
.ndp-v2 .ndp-lens-pill--updated { background: #faf2dd; color: var(--ndp-amber); }
.ndp-v2 .ndp-lens-pill--renumbered { background: var(--ndp-teal-tint); color: var(--ndp-teal); }
.ndp-v2 .ndp-lens-pill--removed { background: #f7e5e5; color: var(--ndp-red); }

/* Colour-coded left edge on changed cards — scannable down the list. */
.ndp-v2 .doc-card.lens-added { box-shadow: inset 3px 0 0 var(--ndp-green); }
.ndp-v2 .doc-card.lens-updated { box-shadow: inset 3px 0 0 var(--ndp-amber); }
.ndp-v2 .doc-card.lens-renumbered { box-shadow: inset 3px 0 0 var(--ndp-teal); }

/* Removed documents, inserted inline in their section: struck title, red edge,
   slightly faded — visibly "was here, is gone". */
.ndp-v2 .doc-card--removed { box-shadow: inset 3px 0 0 var(--ndp-red); opacity: 0.85; }
.ndp-v2 .doc-card--removed .doc-card-title {
  text-decoration: line-through; color: var(--ndp-text-muted); font-weight: 600;
}

/* =====================================================================
   Current NDP tab two-column layout (sticky TOC + content)
   ===================================================================== */
.ndp-v2 .docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.ndp-v2 .docs-sidebar {
  position: sticky;
  /* Stick below the sticky country chrome, not behind it, and never grow
     taller than the space under it. */
  top: calc(var(--chrome-offset, 0px) + 12px);
  max-height: calc(100vh - var(--chrome-offset, 0px) - 24px);
  overflow-y: auto;
  font-size: 13px;
}

/* Anchor jumps from the TOC land below the sticky chrome too. */
.ndp-v2 .doc-section-header {
  scroll-margin-top: calc(var(--chrome-offset, 0px) + 12px);
}
.ndp-v2 .docs-sidebar .doc-toc {
  border: 1px solid var(--ndp-border);
  border-radius: 6px;
  padding: 12px 8px;
  background: var(--ndp-card);
}
.ndp-v2 .docs-sidebar .doc-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ndp-v2 .docs-sidebar .doc-toc-list li {
  display: block;
}
.ndp-v2 .docs-sidebar .doc-toc-link {
  display: block;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--ndp-text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}
/* The section number is rendered in the markup (.doc-toc-num) from the items'
   real NDP prefix — NOT a positional counter — so a country that skips a
   section (e.g. Angola: 7 -> 9) shows the true numbers and the TOC matches the
   body section headers. */
.ndp-v2 .docs-sidebar .doc-toc-num {
  color: var(--ndp-text-faint);
  margin-right: 4px;
}
.ndp-v2 .docs-sidebar .doc-toc-link:hover {
  background: rgba(0,0,0,0.03);
}
/* Scrollspy: search.js toggles .active on the link for the section the
   reader is currently scrolled to. */
.ndp-v2 .docs-sidebar .doc-toc-link.active {
  background: var(--ndp-teal-tint);
  color: var(--ndp-teal);
  font-weight: 600;
}
.ndp-v2 .docs-sidebar .doc-toc-link.active .doc-toc-num {
  color: var(--ndp-teal);
}
.ndp-v2 .docs-content {
  min-width: 0;  /* allows grid child to shrink below content width */
}

/* When there's only one section, no sidebar — content takes full width */
.ndp-v2 .docs-layout:not(:has(.docs-sidebar)) {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  .ndp-v2 .docs-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ndp-v2 .docs-sidebar { position: static; }

  /* Version + Compare controls wrap under the citation on phones. */
  .ndp-v2 .ndp-compare-control { margin-left: 0; }
}

/* --- Claim Types regenerating notice --- */
.ndp-v2 .claim-regen-notice {
  display: flex; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--ndp-border); border-radius: 6px;
  background: var(--ndp-card); margin-bottom: 18px;
}
.ndp-v2 .claim-regen-notice__icon { color: var(--ndp-teal); flex-shrink: 0; font-size: 18px; }
.ndp-v2 .claim-regen-notice__body { font-size: 13px; line-height: 1.55; }
.ndp-v2 .claim-regen-notice__strong { font-weight: 600; color: var(--ndp-text); display: block; margin-bottom: 4px; }
.ndp-v2 .claim-regen-notice__muted { color: var(--ndp-text-muted); }

@keyframes ndp-shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.ndp-v2 .skeleton {
  background: linear-gradient(90deg, #f0f0eb 25%, #e5e5e0 50%, #f0f0eb 75%);
  background-size: 1000px 100%;
  animation: ndp-shimmer 2s infinite linear;
  border-radius: 4px;
}
.ndp-v2 .skeleton-card {
  height: 90px; margin-bottom: 12px; border-radius: 6px;
}
