/* ==========================================================================
   Discovery cluster — /explore/, /guides/…, /cities/… — plus the post-MetaRent
   panel. Colours, radii and elevation reference the design tokens only
   (--ds-*, seo/css/ds-tokens.css; see design-system/AI_RULES.md). Spacing sits
   on the 4px grid, radii are 8 / 12 / 16 / 20 / pill, and the one real
   breakpoint is desktop 813px (max-width: 812px below).
   ========================================================================== */
:root {
  --discovery-font-body: 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --discovery-font-display: 'Montserrat', 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --discovery-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page shell ---------------------------------------------------------------
   The warm white → peach wash is the CIS page background (home/errors/shell).
   It is applied to <body> only while a discovery page is on screen so no
   other Django surface changes. */
body:has(.discovery-page),
body:has(main.seo-page) {
  min-height: 100vh;
  background-color: var(--ds-bg);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--ds-brand) 10%, var(--ds-card)) 0, var(--ds-bg) 480px);
  background-repeat: no-repeat;
}
/* City hub pages (places/) keep their .seo-page layout but share the wash,
   header and breadcrumb placement of the cluster. */
main.seo-page { background: transparent; }
main.seo-page .seo-breadcrumbs { padding: 12px 0 0; }
/* The iOS/Android "Get the app" bar (home/includes/app_download_banner.html)
   is position: fixed at the top and only offsets the skip link, so push the
   page down by its height while it is open or it hides the header row. */
body.app-dl-banner-open .discovery-page,
body.app-dl-banner-open main.seo-page { padding-top: 68px; }
@media (max-width: 600px) {
  body.app-dl-banner-open .discovery-page,
  body.app-dl-banner-open main.seo-page { padding-top: 64px; }
}
.discovery-page {
  box-sizing: border-box; /* width + side padding must never exceed the viewport */
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 32px 64px;
  font-family: var(--discovery-font-body);
  color: var(--ds-ink);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.discovery-page--reading { width: min(880px, 100%); }
.discovery-page *,
.discovery-page *::before,
.discovery-page *::after { box-sizing: border-box; }
.discovery-page h1,
.discovery-page h2,
.discovery-page h3,
.discovery-page h4 { font-family: var(--discovery-font-display); color: var(--ds-ink); overflow-wrap: anywhere; }
.discovery-page a { color: inherit; text-decoration: none; }
.discovery-page a:focus-visible,
.discovery-page button:focus-visible,
.discovery-page summary:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 3px;
  border-radius: 8px;
}
.discovery-page img { max-width: 100%; }
.discovery-page .material-icons-outlined { flex: none; }
.discovery-page .seo-breadcrumbs { padding: 12px 0 0; }
.discovery-page .seo-breadcrumbs ol { gap: 4px; }

/* Header: logo lockup, section links, one action ---------------------------- */
.discovery-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ds-line);
}
.discovery-header__brand { display: flex; align-items: center; min-height: 44px; }
.discovery-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.discovery-header__nav::-webkit-scrollbar { display: none; }
.discovery-header__nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--ds-ink-soft);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 150ms var(--discovery-ease), background-color 150ms var(--discovery-ease);
}
.discovery-header__nav a:hover { color: var(--ds-ink); background: var(--ds-surface); }
/* Labels on a brand tint take the ink colour: --ds-link is AA on the card
   (5.0:1) but drops below 4.5:1 once the fill behind it is tinted. The
   aria-hidden icon keeps the brand accent. */
.discovery-header__nav a[aria-current="page"] {
  color: var(--ds-ink);
  background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
}
.discovery-header__nav a[aria-current="page"] .material-icons-outlined { color: var(--ds-link); }
.discovery-header__nav .material-icons-outlined { font-size: 20px; }
.discovery-header__cta { margin-left: auto; }

/* Buttons: secondary is the CIS "inverted" style (card fill, brand border,
   link-coloured label); primary is brand fill + the fixed dark label (AA). --- */
.discovery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--ds-brand);
  border-radius: 12px;
  background: var(--ds-card);
  color: var(--ds-link);
  font: 600 15px/20px var(--discovery-font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--discovery-ease), border-color 150ms var(--discovery-ease),
    color 150ms var(--discovery-ease);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.discovery-page a.discovery-button { color: var(--ds-link); }
/* Hover keeps the AA label colour on a tint light enough to hold 4.5:1
   (--ds-link-hover is ~3.2:1 here). */
.discovery-button:hover {
  background: color-mix(in srgb, var(--ds-brand) 6%, var(--ds-card));
  color: var(--ds-link);
}
/* Match the page's anchor reset so primary links retain the fixed dark label in dark mode. */
.discovery-button--primary,
.discovery-page a.discovery-button--primary { background: var(--ds-brand); border-color: var(--ds-brand); color: var(--ds-on-cta); }
.discovery-button--primary:hover,
.discovery-page a.discovery-button--primary:hover { background: var(--ds-brand-hover); border-color: var(--ds-brand-hover); color: var(--ds-on-cta); }
.discovery-button--ghost,
.discovery-page a.discovery-button--ghost { border-color: var(--ds-line); color: var(--ds-ink); }
.discovery-button--ghost:hover { border-color: var(--ds-brand); background: var(--ds-surface); color: var(--ds-ink); }
.discovery-button .material-icons-outlined { font-size: 20px; }

/* Eyebrows, tags, counts ---------------------------------------------------- */
.discovery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ds-link);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.discovery-eyebrow--pill {
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
  color: var(--ds-ink);
}
.discovery-eyebrow .material-icons-outlined { font-size: 16px; }
.discovery-eyebrow--pill .material-icons-outlined { color: var(--ds-link); }
.discovery-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-surface);
  color: var(--ds-ink-soft);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}
.discovery-tag--brand {
  border-color: transparent;
  background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
  color: var(--ds-ink);
}
a.discovery-tag--brand:hover { background: color-mix(in srgb, var(--ds-brand) 22%, var(--ds-card)); }
.discovery-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-card);
  color: var(--ds-ink-soft);
  font-family: var(--discovery-font-body);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Hero ---------------------------------------------------------------------- */
.discovery-hero { padding: 40px 0 32px; }
.discovery-hero h1 {
  max-width: 22ch;
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.discovery-hero h1 span { color: var(--ds-link); }
.discovery-hero__lead {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--ds-ink-soft);
  font-size: 17px;
  line-height: 26px;
}
.discovery-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.discovery-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-card);
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.discovery-facts strong { color: var(--ds-ink); font-weight: 600; }
.discovery-facts .material-icons-outlined { font-size: 18px; color: var(--ds-brand); }
.discovery-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Shortcut chips ------------------------------------------------------------ */
.discovery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0 0 24px;
  list-style: none;
  border-bottom: 1px solid var(--ds-line);
}
.discovery-chips a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-card);
  color: var(--ds-ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  transition: border-color 150ms var(--discovery-ease), background-color 150ms var(--discovery-ease);
}
.discovery-chips a:hover {
  border-color: var(--ds-brand);
  background: color-mix(in srgb, var(--ds-brand) 8%, var(--ds-card));
}
.discovery-chips .material-icons-outlined { font-size: 20px; color: var(--ds-brand); }

/* Sections ------------------------------------------------------------------ */
.discovery-section { padding-top: 40px; scroll-margin-top: 24px; }
.discovery-section__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.discovery-section__heading h2 { margin: 0 0 8px; font-size: 24px; line-height: 32px; font-weight: 600; }
.discovery-section__heading p:not(.discovery-eyebrow) { max-width: 62ch; margin: 0; color: var(--ds-ink-soft); }

/* Card grids ---------------------------------------------------------------- */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.discovery-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.discovery-grid > li { min-width: 0; }
.discovery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-card);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-card);
  transition: transform 250ms var(--discovery-ease), box-shadow 250ms var(--discovery-ease),
    border-color 250ms var(--discovery-ease);
}
.discovery-card:hover {
  transform: translateY(-2px);
  border-color: var(--ds-brand);
  box-shadow: var(--ds-shadow-elevated);
}

/* Memory card */
.memory-card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--ds-surface); }
.memory-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--discovery-ease);
}
.discovery-card:hover .memory-card__media img { transform: scale(1.03); }
.memory-card__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--ds-brand);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ds-brand) 18%, var(--ds-surface)), var(--ds-surface));
}
.memory-card__placeholder .material-icons-outlined { font-size: 48px; }
.memory-card__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.memory-card__place {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--ds-link);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.memory-card__place .material-icons-outlined { font-size: 16px; }
.memory-card__body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
}
.memory-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--ds-ink-soft);
  font-size: 13px;
  line-height: 18px;
}
.memory-card__author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.memory-card__author span:not(.memory-card__avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-card__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ds-brand) 18%, var(--ds-card));
  color: var(--ds-link);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.memory-card__read { flex: none; color: var(--ds-link); font-weight: 600; }

/* Topic / link cards (collections, cities, guide topics) */
.topic-card { gap: 12px; padding: 20px; }
.topic-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
  color: var(--ds-link);
}
.topic-card__icon .material-icons-outlined { font-size: 26px; }
.topic-card__label { color: var(--ds-ink-soft); font-size: 13px; line-height: 18px; font-weight: 600; }
.topic-card h3 { margin: -8px 0 0; padding-right: 32px; font-size: 18px; line-height: 24px; font-weight: 600; }
.topic-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow: hidden;
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.topic-card__arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--ds-ink-soft);
  transition: transform 250ms var(--discovery-ease), color 250ms var(--discovery-ease);
}
.discovery-card:hover .topic-card__arrow { transform: translateX(4px); color: var(--ds-link); }

/* Guide cards (guides index / topic index) */
.guide-card { gap: 8px; padding: 20px; }
.guide-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-card h3 { margin: 4px 0 0; font-size: 18px; line-height: 24px; font-weight: 600; }
.guide-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ds-ink-soft); font-size: 13px; line-height: 18px; }
.guide-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.guide-card__meta > span { min-width: 0; overflow-wrap: anywhere; }
.guide-card__meta .material-icons-outlined { font-size: 16px; color: var(--ds-brand); }
.guide-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow: hidden;
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.guide-card__cta { margin-top: auto; padding-top: 8px; color: var(--ds-link); font-size: 14px; line-height: 20px; font-weight: 600; }

/* Callout, pagination, empty state ------------------------------------------ */
.discovery-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--ds-card-border);
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ds-brand) 16%, var(--ds-card)) 0%, var(--ds-card) 70%);
  box-shadow: var(--ds-shadow-card);
}
.discovery-callout h2 { margin: 0 0 8px; font-size: 24px; line-height: 32px; font-weight: 600; }
.discovery-callout p { max-width: 56ch; margin: 0; color: var(--ds-ink-soft); }
.discovery-callout .discovery-button { flex: none; }
.discovery-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 0;
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.discovery-pagination a,
.discovery-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background: var(--ds-card);
  color: var(--ds-link);
  font-weight: 600;
  transition: border-color 150ms var(--discovery-ease);
}
.discovery-pagination a:hover { border-color: var(--ds-brand); color: var(--ds-link-hover); }
.discovery-pagination [aria-current="page"] { background: var(--ds-brand); border-color: var(--ds-brand); color: var(--ds-on-cta); }
.discovery-pagination .discovery-pagination__status { border: 0; background: transparent; color: var(--ds-ink-soft); font-weight: 500; }
.discovery-empty {
  padding: 40px 24px;
  border: 1px dashed var(--ds-input-border);
  border-radius: 16px;
  background: var(--ds-card);
  text-align: center;
}
.discovery-empty h2,
.discovery-empty h3 { margin: 0 0 8px; font-size: 20px; line-height: 28px; font-weight: 600; }
.discovery-empty p { max-width: 52ch; margin: 0 auto 20px; color: var(--ds-ink-soft); }
.discovery-empty p:last-child { margin-bottom: 0; }
.discovery-empty a:not(.discovery-button) { color: var(--ds-link); text-decoration: underline; text-underline-offset: 2px; }

/* Guide detail -------------------------------------------------------------- */
.guide-hero { padding: 32px 0 8px; }
.guide-hero__kicker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.guide-hero h1 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.guide-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.guide-hero__meta li { display: inline-flex; align-items: center; gap: 4px; }
.guide-hero__meta .material-icons-outlined { font-size: 18px; color: var(--ds-brand); }
.guide-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.guide-langs__label { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; color: var(--ds-ink-soft); font-size: 13px; line-height: 18px; }
.guide-langs__label .material-icons-outlined { font-size: 18px; color: var(--ds-brand); }
.guide-langs a,
.guide-langs span[aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-card);
  color: var(--ds-link);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  transition: border-color 150ms var(--discovery-ease);
}
.guide-langs a:hover { border-color: var(--ds-brand); color: var(--ds-link-hover); }
.guide-langs span[aria-current="true"] {
  border-color: var(--ds-brand);
  background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
  color: var(--ds-ink);
}

.guide-answer {
  margin: 16px 0 24px;
  padding: 20px 24px;
  border: 1px solid var(--ds-card-border);
  border-left: 4px solid var(--ds-brand);
  border-radius: 16px;
  background: var(--ds-card);
  box-shadow: var(--ds-shadow-card);
}
.guide-answer__label {
  display: block;
  margin: 0 0 4px;
  color: var(--ds-link);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.guide-answer p { margin: 0; font-size: 18px; line-height: 28px; font-weight: 600; color: var(--ds-ink); }
.guide-intro { max-width: 66ch; margin: 0 0 16px; font-size: 17px; line-height: 26px; color: var(--ds-ink); }
.guide-method {
  display: flex;
  gap: 12px;
  margin: 0 0 8px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ds-surface);
  color: var(--ds-ink-soft);
  font-size: 14px;
  line-height: 20px;
}
.guide-method .material-icons-outlined { font-size: 20px; color: var(--ds-brand); }
.guide-method p { margin: 0; }
.guide-method strong { color: var(--ds-ink); font-weight: 600; }

.guide-section { padding-top: 32px; scroll-margin-top: 24px; }
.guide-section > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}
.guide-section > p { margin: 0 0 12px; font-size: 16px; line-height: 24px; }
.guide-outro {
  margin: 0;
  padding: 20px 24px;
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-card);
  font-size: 16px;
  line-height: 24px;
}
.guide-outro p { margin: 0; }

/* Guide prose can be plain text or sanitized editorial HTML. */
.guide-prose { overflow-wrap: anywhere; }
.guide-prose p { margin: 0 0 16px; }
.guide-prose h2 { margin: 28px 0 12px; font-size: 24px; line-height: 32px; font-weight: 600; }
.guide-prose h3,
.guide-prose h4,
.guide-prose h5,
.guide-prose h6 { margin: 24px 0 12px; font-size: 20px; line-height: 28px; font-weight: 600; }
.guide-prose ul,
.guide-prose ol { margin: 0 0 16px; padding-left: 24px; }
.guide-prose ul { list-style: disc; }
.guide-prose ol { list-style: decimal; }
.guide-prose li + li { margin-top: 8px; }
.guide-prose a { color: var(--ds-link); text-decoration: underline; text-underline-offset: 3px; }
.guide-prose blockquote { margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--ds-brand); }
.guide-prose img { max-width: 100%; height: auto; }
.guide-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.guide-prose th,
.guide-prose td { padding: 8px; border: 1px solid var(--ds-card-border); }
.guide-prose pre { max-width: 100%; overflow-x: auto; }
.guide-prose > :first-child { margin-top: 0; }
.guide-prose > :last-child { margin-bottom: 0; }

/* Stops: the numbered list is the primary rendering (any map is an enhancement). */
.guide-stops { margin: 0; padding: 0; list-style: none; counter-reset: stop; }
.guide-stop {
  position: relative;
  margin: 0 0 16px;
  padding: 20px 20px 20px 76px;
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-card);
  box-shadow: var(--ds-shadow-card);
}
.guide-stop::before {
  counter-increment: stop;
  content: counter(stop);
  position: absolute;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--ds-brand);
  color: var(--ds-on-cta); /* fixed dark label on brand orange (AA) */
  font: 700 15px/36px var(--discovery-font-display);
  text-align: center;
}
.guide-stop:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 60px;
  bottom: -20px;
  left: 37px;
  width: 2px;
  background: var(--ds-line);
}
.guide-stop--pending { padding-left: 20px; color: var(--ds-ink-soft); }
.guide-stop--pending::before,
.guide-stop--pending::after { display: none; }
.guide-stop__group { margin-bottom: 8px; }
.guide-stop h3 { margin: 0 0 8px; font-size: 20px; line-height: 28px; font-weight: 600; }
.guide-stop__scene { margin: 0 0 16px; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.guide-stop__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px 24px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--ds-line);
}
.guide-stop__facts dt {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ds-ink-soft);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guide-stop__facts dt .material-icons-outlined { font-size: 18px; color: var(--ds-brand); }
.guide-stop__facts dd { margin: 4px 0 0; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.guide-stop__facts dd em { color: var(--ds-ink-soft); font-style: normal; }
.guide-stop__verified {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 0;
  color: var(--ds-ink-soft);
  font-size: 13px;
  line-height: 18px;
}
.guide-stop__verified span { display: inline-flex; align-items: center; gap: 4px; }
.guide-stop__verified .material-icons-outlined { font-size: 16px; color: var(--ds-success-text); }
.guide-stop__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guide-stop__memory { margin: 16px 0 0; }

.guide-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.guide-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-card);
  box-shadow: var(--ds-shadow-card);
}
.guide-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.guide-gallery figcaption { padding: 12px 16px; color: var(--ds-ink-soft); font-size: 13px; line-height: 18px; }

.guide-sources { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.guide-sources li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
  padding: 12px 16px;
  border: 1px solid var(--ds-card-border);
  border-radius: 12px;
  background: var(--ds-card);
  font-size: 14px;
  line-height: 20px;
}
.guide-sources .claim-status {
  display: inline-flex;
  flex: 0 1 auto;
  max-width: 100%;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-surface);
  color: var(--ds-ink-soft);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guide-sources .claim-status--officially_confirmed,
.guide-sources .claim-status--authoritatively_documented {
  border-color: transparent;
  background: color-mix(in srgb, var(--ds-success) 14%, var(--ds-card));
  color: var(--ds-success-text);
}
.guide-sources .claim-status--disputed {
  border-color: transparent;
  background: color-mix(in srgb, var(--ds-warning) 18%, var(--ds-card));
  color: var(--ds-warning-text);
}
.guide-sources__body { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.guide-sources a { color: var(--ds-link); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.guide-sources a:hover { color: var(--ds-link-hover); }
.guide-sources__claim { display: block; margin-top: 4px; color: var(--ds-ink-soft); }

.guide-provenance {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--ds-card-border);
  border-radius: 16px;
  background: var(--ds-surface);
}
.guide-provenance h2 { margin: 0 0 16px; font-size: 18px; line-height: 24px; font-weight: 600; }
.guide-provenance dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px 24px; margin: 0; }
.guide-provenance dt {
  color: var(--ds-ink-soft);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guide-provenance dd { margin: 4px 0 0; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.guide-provenance a { color: var(--ds-link); font-weight: 600; }
.guide-provenance a:hover { color: var(--ds-link-hover); text-decoration: underline; }
.guide-footer-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 812px) {
  .discovery-page { padding: 0 20px 48px; }
  .discovery-header { gap: 8px 12px; }
  .discovery-header__nav { order: 3; flex-basis: 100%; margin: 0 -20px; padding: 0 20px; }
  .discovery-hero { padding: 28px 0 24px; }
  .discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .discovery-callout { flex-direction: column; align-items: flex-start; padding: 24px; }
  .guide-hero { padding-top: 24px; }
  .guide-stop { padding: 20px 16px 20px 68px; }
  .guide-stop::before { left: 16px; width: 32px; height: 32px; line-height: 32px; font-size: 14px; }
  .guide-stop:not(:last-child)::after { left: 31px; top: 52px; }
}
@media (max-width: 540px) {
  .discovery-page { padding: 0 16px 40px; }
  .discovery-header__nav { margin: 0 -16px; padding: 0 16px; }
  .discovery-header__cta { padding: 8px 12px; }
  .discovery-hero h1 { font-size: 28px; line-height: 36px; }
  .discovery-hero__lead { font-size: 16px; line-height: 24px; }
  .discovery-hero__actions .discovery-button { flex: 1 1 100%; }
  .discovery-grid,
  .discovery-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .discovery-section { padding-top: 32px; }
  .discovery-section__heading h2 { font-size: 24px; line-height: 32px; }
  .discovery-pagination a,
  .discovery-pagination span { padding: 8px; }
  .guide-hero h1 { font-size: 28px; line-height: 36px; }
  .guide-answer { padding: 16px; }
  .guide-answer p { font-size: 17px; line-height: 26px; }
  .guide-stop { padding: 64px 16px 16px; }
  .guide-stop:not(:last-child)::after { display: none; }
  .guide-stop__facts { grid-template-columns: minmax(0, 1fr); }
  .guide-provenance { padding: 20px 16px; }
  .guide-footer-nav .discovery-button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .discovery-card,
  .discovery-card:hover,
  .memory-card__media img,
  .discovery-card:hover .memory-card__media img,
  .topic-card__arrow,
  .discovery-button,
  .discovery-header__nav a,
  .discovery-chips a { transition: none; transform: none; }
}

/* Post-MetaRent panel (address_transactions/metarent-interface.html) ------- */
.metarent-next {
  padding: 24px 20px;
  background: var(--ds-card);
  border-radius: 0 0 12px 12px;
  font-family: var(--discovery-font-body);
  color: var(--ds-ink);
  line-height: 1.5;
}
.metarent-next * { box-sizing: border-box; }
.metarent-next h2 { font-family: var(--discovery-font-display); }
.metarent-next a { text-decoration: none; }
.metarent-next a:focus-visible,
.metarent-next button:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 4px;
}
.metarent-next__status { display: flex; align-items: center; gap: 8px; }
.metarent-next__status > span { color: var(--ds-success-text); }
.metarent-next h2 { font-size: 18px; line-height: 1.4; font-weight: 600; margin: 0; }
.metarent-next p { margin: 12px 0 20px; color: var(--ds-ink-soft); font-size: 14px; }
.metarent-next .discovery-button { display: flex; width: 100%; margin-top: 12px; }
.metarent-next__close { display: block; min-height: 44px; width: 100%; margin-top: 8px; padding: 8px; border: 0; background: transparent; color: var(--ds-ink-soft); font: inherit; font-size: 14px; cursor: pointer; }
.metarent-error { margin: 12px; padding: 12px; border: 1px solid var(--ds-error-text); border-radius: 8px; background: var(--ds-card); color: var(--ds-error-text); font: 14px/1.5 var(--discovery-font-body); }
.metarent-error[hidden] { display: none; }
/* Keep completion actions reachable on short screens and at browser zoom. */
.metarent-interface .blox-storage-list:has(.metarent-next) { overflow-y: auto; }

/* Embedded guides use the same cards as the full guide in a compact shell. */
body.guide-embed-body { margin: 0; background: var(--ds-bg); }
.guide-embed { padding: 16px; }
.guide-embed__attribution { margin: 16px 0 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.guide-embed__attribution a { color: var(--ds-link); text-decoration: underline; }
