/* SEO chrome: breadcrumbs, trust badges, answer/provenance blocks, guides,
   explore. Colors/spacing reference design tokens only (--ds-*, 4px grid,
   fixed radii) per design-system/AI_RULES.md. */

/* Page header band (SEO-008/010/014): H1 + crawlable hub links.
   Hidden at every breakpoint (desktop included) — the overlay card is no
   longer shown over the map. The semantic content stays server-rendered in
   the DOM for crawlers; e2e/layout.spec.ts and e2e/breakpoints.spec.ts
   assert the hidden state. ------------------------------------------------ */
.seo-page-header {
  display: none;
  position: absolute;
  right: 16px;
  top: 82px;
  z-index: 2;
  max-width: 420px;
  background: var(--ds-card);
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  color: var(--ds-ink);
}
.seo-page-header h1 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.seo-page-header .seo-breadcrumbs {
  padding: 0 0 8px;
  font-size: 12px;
  line-height: 16px;
}

.seo-page-header .seo-answer-line {
  margin: 0 0 4px 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ds-ink-soft);
}
.seo-page-header .seo-provenance-line {
  margin: 4px 0 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ds-ink-faint);
}
.seo-page-header .seo-provenance-line a {
  color: var(--ds-link);
}
.seo-header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.seo-header-nav a {
  font-size: 13px;
  line-height: 18px;
  color: var(--ds-link);
  text-decoration: none;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  padding: 4px 12px;
}
.seo-header-nav a:hover,
.seo-header-nav a:focus-visible {
  color: var(--ds-link-hover);
  border-color: var(--ds-brand);
}
/* Card overlay links (SEO-005): the crawlable <a> stretches over the card;
   separate interactive controls sit above it. ------------------------------ */
.memory-element,
.memory-section-card,
.nearby-memory-card {
  position: relative;
}
.seo-card-overlay-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.seo-card-overlay-link:focus-visible {
  outline: 2px solid var(--ds-focus);
  outline-offset: 2px;
}
.memory-element .share-button,
.memory-element .save-memory-btn {
  position: relative;
  z-index: 2;
}

/* Breadcrumbs (SEO-006) ---------------------------------------------------- */
.seo-breadcrumbs {
  padding: 8px 16px;
  font-size: 14px;
  line-height: 20px;
}
.seo-breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.seo-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ds-ink-soft);
}
.seo-breadcrumbs li + li::before {
  content: "\203A"; /* › */
  color: var(--ds-ink-faint);
}
.seo-breadcrumbs a {
  color: var(--ds-link);
  text-decoration: none;
}
.seo-breadcrumbs a:hover {
  color: var(--ds-link-hover);
  text-decoration: underline;
}
.seo-breadcrumbs [aria-current="page"] {
  color: var(--ds-ink);
  font-weight: 500;
}

/* Trust badge (SEO-017) ---------------------------------------------------- */
.seo-trust-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  color: var(--ds-ink-soft);
  font-size: 13px;
  line-height: 18px;
}
.seo-trust-badge[data-label="Editorially verified"],
.seo-trust-badge[data-label="Verified partner contribution"] {
  border-color: var(--ds-brand);
  color: var(--ds-ink);
}

/* Answer + provenance blocks (SEO-010) ------------------------------------- */
.seo-answer-block {
  background: var(--ds-card);
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 24px 0;
  color: var(--ds-ink);
  font-size: 16px;
  line-height: 24px;
}
.seo-answer-block .seo-answer-lead {
  font-weight: 600;
}
.seo-provenance {
  border-top: 1px solid var(--ds-line);
  margin-top: 24px;
  padding: 16px 0 0 0;
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.seo-provenance dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}
.seo-provenance dt {
  color: var(--ds-ink-faint);
}
.seo-provenance dd {
  margin: 0;
  color: var(--ds-ink-soft);
}
.seo-provenance a {
  color: var(--ds-link);
}

/* Guide + explore pages (SEO-007 / SEO-015) -------------------------------- */
.seo-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px 16px;
  background: var(--ds-bg);
  color: var(--ds-ink);
}
.seo-page h1 {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  margin: 0 0 16px 0;
}
.seo-page h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  margin: 32px 0 12px 0;
}
.seo-page h3 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  margin: 24px 0 8px 0;
}
.seo-page p {
  margin: 0 0 12px 0;
  font-size: 16px;
  line-height: 24px;
}
.seo-page .seo-intro {
  color: var(--ds-ink-soft);
}

.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.seo-card {
  display: block;
  background: var(--ds-card);
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--ds-ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.seo-card:hover,
.seo-card:focus-visible {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  outline: 2px solid var(--ds-focus);
  outline-offset: 2px;
}
.seo-card .seo-card-title {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  display: block;
}
.seo-card .seo-card-meta {
  color: var(--ds-ink-faint);
  font-size: 13px;
  line-height: 18px;
}
.seo-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}

/* Guide stops list (map/list parity; list is the primary rendering) */
.guide-stops {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  counter-reset: stop;
}
.guide-stop {
  position: relative;
  background: var(--ds-card);
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  padding: 16px 16px 16px 48px;
  margin: 0 0 16px 0;
}
.guide-stop::before {
  counter-increment: stop;
  content: counter(stop);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--ds-brand);
  color: var(--ds-ink); /* dark label on brand orange (AA) */
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-stop h3 {
  margin: 0 0 8px 0;
}
.guide-stop .guide-stop-notes {
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.guide-stop .guide-stop-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Sources (SEO-015) */
.guide-sources li {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 20px;
}
.guide-sources .claim-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  color: var(--ds-ink-soft);
  font-size: 12px;
  line-height: 16px;
  margin-right: 8px;
}

/* Pagination (SEO-007): plain anchors, keyboard reachable */
.seo-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 24px 0 0 0;
  font-size: 14px;
}
.seo-pagination a,
.seo-pagination span {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--ds-line);
  color: var(--ds-link);
  text-decoration: none;
}
.seo-pagination span[aria-current="page"] {
  background: var(--ds-brand);
  color: var(--ds-ink);
  border-color: var(--ds-brand);
  font-weight: 600;
}

/* Language switcher (SEO-016) */
.seo-lang-switcher {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.seo-lang-switcher a,
.seo-lang-switcher span {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--ds-line);
  color: var(--ds-link);
  text-decoration: none;
  font-size: 13px;
}
.seo-lang-switcher span[aria-current="true"] {
  color: var(--ds-ink);
  border-color: var(--ds-brand);
  font-weight: 600;
}

/* Executive analytics ---------------------------------------------------- */
.exec-analytics {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
  color: var(--ds-ink);
}

.exec-analytics__header,
.exec-section-heading,
.exec-toolbar,
.exec-kpi__topline,
.exec-task__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.exec-analytics h1,
.exec-analytics h2,
.exec-analytics h3,
.exec-analytics h4,
.exec-analytics p {
  margin-top: 0;
}

.exec-analytics h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}

.exec-analytics h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.exec-analytics__lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ds-ink-soft);
  font-size: 18px;
  line-height: 1.5;
}

.exec-eyebrow {
  margin-bottom: 4px;
  color: var(--ds-brand-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.exec-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--ds-input-border);
  border-radius: 12px;
  background: var(--ds-card);
  color: var(--ds-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.exec-button:focus-visible,
.exec-analytics input:focus-visible,
.exec-analytics select:focus-visible,
.exec-analytics textarea:focus-visible,
.exec-create summary:focus-visible,
.exec-task summary:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}

.exec-button--primary {
  border-color: var(--ds-brand-strong);
  background: var(--ds-brand-strong);
  color: var(--ds-on-brand);
}

.exec-button--secondary:hover {
  border-color: var(--ds-brand);
  color: var(--ds-link);
}

.exec-messages,
.exec-alert {
  margin: 24px 0;
}

.exec-message,
.exec-alert {
  padding: 12px 16px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background: var(--ds-surface);
}

.exec-toolbar {
  margin: 32px 0 48px;
  padding: 16px;
  border: 1px solid var(--ds-line);
  border-radius: 16px;
  background: var(--ds-card);
}

.exec-toolbar p,
.exec-section-heading > p {
  margin-bottom: 0;
  color: var(--ds-ink-soft);
  font-size: 14px;
}

.exec-toolbar__form {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.exec-analytics input,
.exec-analytics select,
.exec-analytics textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ds-input-border);
  border-radius: 8px;
  background: var(--ds-card);
  color: var(--ds-ink);
  font: inherit;
}

.exec-analytics textarea {
  resize: vertical;
}

.exec-section-heading {
  margin-bottom: 20px;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.exec-kpi,
.exec-cohort-card,
.exec-source-note,
.exec-suggestion,
.exec-task,
.exec-empty {
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-card);
}

.exec-kpi {
  min-height: 260px;
  padding: 20px;
  border-top: 4px solid var(--ds-line);
}

.exec-kpi--on_track {
  border-top-color: var(--ds-success);
}

.exec-kpi--off_track {
  border-top-color: var(--ds-error);
}

.exec-kpi h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.exec-kpi__value,
.exec-cohort-card__value {
  margin: 24px 0 4px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.exec-kpi__comparison,
.exec-kpi__description,
.exec-cohort-card p,
.exec-source-note p,
.exec-suggestion p,
.exec-task p,
.exec-empty p {
  color: var(--ds-ink-soft);
  line-height: 1.5;
}

.exec-kpi__meta,
.exec-task dl {
  display: grid;
  gap: 8px;
  margin: 20px 0 12px;
}

.exec-kpi__meta div,
.exec-task dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.exec-kpi__meta dt,
.exec-task dt {
  color: var(--ds-ink-faint);
}

.exec-kpi__meta dd,
.exec-task dd {
  margin: 0;
  text-align: right;
}

.exec-trend,
.exec-priority,
.exec-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--ds-surface);
  color: var(--ds-ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.exec-trend--positive,
.exec-status--done {
  color: var(--ds-success-text);
}

.exec-trend--negative,
.exec-priority--critical,
.exec-kpi--off_track .exec-kpi__value {
  color: var(--ds-error-text);
}

.exec-priority--high,
.exec-status--in_progress,
.exec-status--measuring {
  color: var(--ds-warning-text);
}

.exec-cohorts,
.exec-actions {
  margin-top: 56px;
}

.exec-cohort-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.exec-cohort-card,
.exec-source-note {
  padding: 24px;
}

.exec-cohort-card__label {
  margin-bottom: 0;
  color: var(--ds-ink-soft);
  font-weight: 700;
}

.exec-source-note {
  background: var(--ds-surface);
}

.exec-create {
  position: relative;
}

.exec-create > summary {
  list-style: none;
}

.exec-create > summary::-webkit-details-marker {
  display: none;
}

.exec-create__form {
  position: absolute;
  z-index: 2;
  top: 52px;
  right: 0;
  display: grid;
  width: min(720px, calc(100vw - 32px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--ds-line);
  border-radius: 20px;
  background: var(--ds-elevated);
}

.exec-create__form label,
.exec-task__form label {
  display: grid;
  gap: 8px;
  color: var(--ds-ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.exec-field-wide {
  grid-column: 1 / -1;
}

.exec-suggestions {
  margin: 0 0 32px;
  padding: 20px;
  border: 1px solid var(--ds-line);
  border-radius: 16px;
  background: var(--ds-surface);
}

.exec-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.exec-suggestion {
  padding: 20px;
}

.exec-suggestion h4 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.exec-task-list {
  display: grid;
  gap: 16px;
}

.exec-task,
.exec-empty {
  padding: 24px;
}

.exec-task__summary > div:first-child {
  max-width: 760px;
}

.exec-task__summary h3 {
  margin: 12px 0 8px;
}

.exec-task__summary dl {
  min-width: 240px;
  margin-top: 0;
}

.exec-task details {
  margin-top: 16px;
  border-top: 1px solid var(--ds-line);
  padding-top: 16px;
}

.exec-task summary {
  color: var(--ds-link);
  cursor: pointer;
  font-weight: 700;
}

.exec-task__form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 1024px) {
  .exec-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exec-cohort-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exec-suggestion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 812px) {
  .exec-analytics {
    width: min(100% - 24px, 1280px);
    padding-top: 24px;
  }

  .exec-analytics__header,
  .exec-section-heading,
  .exec-toolbar,
  .exec-task__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .exec-kpi-grid,
  .exec-cohort-grid,
  .exec-create__form,
  .exec-task__form {
    grid-template-columns: 1fr;
  }

  .exec-field-wide {
    grid-column: auto;
  }

  .exec-create__form {
    position: fixed;
    inset: 16px;
    width: auto;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .exec-task__summary dl {
    min-width: 0;
  }
}
