/* Reader-specific styles (sit on top of lumen.css) */

.rd-hero { padding: 18px 0 26px; max-width: 720px; }
.rd-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; }
.rd-hero-sub { font-size: 1.06rem; color: var(--lm-ink-2); }

/* ---- search bar ---- */
.rd-searchbar { margin-bottom: 22px; }
.rd-search-wrap { position: relative; }
.rd-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--lm-ink-3); pointer-events: none;
}
.rd-search-input {
  font-size: 1.1rem; padding: 16px 48px 16px 48px; border-radius: var(--lm-radius);
  box-shadow: var(--lm-shadow-sm);
}
.rd-search-spin {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--lm-border-strong); border-top-color: var(--lm-primary);
  animation: lm-spin .7s linear infinite; display: none;
}
.rd-search-spin.is-busy { display: inline-block; }

.rd-search-types { display: inline-flex; gap: 6px; margin-top: 12px; background: var(--lm-surface-2);
  padding: 4px; border-radius: 999px; border: 1px solid var(--lm-border); }
.rd-type {
  font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer;
  border: 0; background: transparent; color: var(--lm-ink-2);
  padding: 6px 14px; border-radius: 999px;
}
.rd-type[aria-checked="true"] { background: var(--lm-surface); color: var(--lm-primary-700); box-shadow: var(--lm-shadow-sm); }
.rd-hint { margin: 10px 2px 0; font-size: .85rem; }

/* ---- results ---- */
.rd-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rd-result {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--lm-surface); border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius); padding: 16px 18px; cursor: pointer; font: inherit;
  color: var(--lm-ink); transition: border-color .12s, box-shadow .12s, transform .05s;
}
.rd-result:hover, .rd-result.is-active { border-color: var(--lm-primary); box-shadow: var(--lm-shadow-md); }
.rd-result:active { transform: translateY(1px); }
.rd-result-main { min-width: 0; flex: 1; }
.rd-result-name { font-weight: 700; font-size: 1.04rem; }
.rd-result-name mark { background: color-mix(in srgb, var(--lm-accent) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.rd-result-generic { color: var(--lm-ink-2); font-size: .92rem; }
.rd-result-meta { color: var(--lm-ink-3); font-size: .8rem; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.rd-result-langs { display: flex; gap: 6px; flex: none; }
.rd-result-chev { color: var(--lm-ink-3); flex: none; }

.rd-empty { padding: 36px 20px; text-align: center; color: var(--lm-ink-2);
  background: var(--lm-surface); border: 1px dashed var(--lm-border-strong); border-radius: var(--lm-radius); }
.rd-empty strong { color: var(--lm-ink); }

/* ---- leaflet ---- */
.rd-back { margin-bottom: 18px; }

.rd-leaflet-head {
  background: var(--lm-surface); border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-lg); padding: 24px 26px; margin-bottom: 18px;
  box-shadow: var(--lm-shadow-sm);
}
.rd-leaflet-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rd-leaflet-title { font-size: clamp(1.4rem, 3.4vw, 2rem); letter-spacing: -.02em; margin: 0 0 4px; }
.rd-leaflet-generic { color: var(--lm-ink-2); font-size: 1.02rem; margin: 0 0 14px; }
.rd-leaflet-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 22px;
  border-top: 1px solid var(--lm-border); padding-top: 14px; }
.rd-fact dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lm-ink-3); font-weight: 700; margin-bottom: 2px; }
.rd-fact dd { margin: 0; font-size: .92rem; color: var(--lm-ink); }

/* language toggle */
.rd-langbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; }
.rd-langtoggle { display: inline-flex; background: var(--lm-surface-2);
  border: 1px solid var(--lm-border); border-radius: 999px; padding: 4px; gap: 4px; }
.rd-lang {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; background: transparent;
  color: var(--lm-ink-2); padding: 8px 18px; border-radius: 999px; font-size: .92rem;
}
.rd-lang[aria-pressed="true"] { background: var(--lm-primary); color: var(--lm-on-primary); box-shadow: var(--lm-shadow-sm); }
.rd-lang[disabled] { opacity: .5; cursor: not-allowed; }
.rd-lang small { display: block; font-weight: 600; font-size: .68rem; opacity: .85; }

/* official / unofficial source line */
.rd-source-line { font-size: .88rem; color: var(--lm-ink-2); }
.rd-source-line a { font-weight: 600; }

/* disclaimer banner (shown for ES) */
.rd-disclaimer { margin-bottom: 22px; }
.rd-disclaimer .lm-callout-title svg { width: 20px; height: 20px; flex: none; }
.rd-disclaimer p { margin: 0 0 8px; }
.rd-disclaimer p:last-child { margin: 0; }
.rd-disclaimer .rd-official-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

/* sections */
.rd-sections { display: grid; gap: 16px; }
.rd-section {
  background: var(--lm-surface); border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius); overflow: hidden; box-shadow: var(--lm-shadow-sm);
}
.rd-section-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 22px;
  border-bottom: 1px solid var(--lm-border); background: var(--lm-surface);
}
.rd-section-head h2 { font-size: 1.12rem; margin: 0; flex: 1; line-height: 1.35; }
.rd-section-badges { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.rd-section-body { padding: 8px 22px 18px; }

/* faithful rendering of sanitized leaflet HTML */
.lm-prose { max-width: var(--lm-maxw-rd); color: var(--lm-ink); }
.lm-prose p { margin: 0 0 .9em; }
.lm-prose ul, .lm-prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.lm-prose li { margin-bottom: .35em; }
.lm-prose strong { font-weight: 700; }
.lm-prose a { font-weight: 600; }
.lm-prose sub, .lm-prose sup { line-height: 0; }

/* provenance footer */
.rd-provenance {
  margin-top: 22px; padding: 16px 20px; background: var(--lm-surface-2);
  border: 1px solid var(--lm-border); border-radius: var(--lm-radius);
  font-size: .82rem; color: var(--lm-ink-2);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px;
}
.rd-provenance dt { font-weight: 700; color: var(--lm-ink-3); text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; }
.rd-provenance dd { margin: 2px 0 0; }

/* loading / error states */
.rd-loading { display: flex; align-items: center; gap: 12px; padding: 40px 20px; color: var(--lm-ink-2); justify-content: center; }
.rd-error { color: var(--lm-danger); }

@media (max-width: 560px) {
  .rd-section-head { flex-direction: column; }
  .rd-section-badges { order: -1; }
}
