/* Shared chrome for the Resources tools, built on golden.css tokens and
   mirroring the positioning.css idioms. Per-tool specifics live in
   res-<slug>.css; everything shared and scoped to .res-* lives here so the
   five tools read as one system. Golden Hour rules: honey/--teal is structural
   only (never text), --clay is the text-safe interactive accent, --brick is
   secondary emphasis, --amber is for fill/reward. No emoji. */

.res-wrap { max-width: 1000px; }

/* ---------- intro (mirrors .pos-intro) ---------- */
.res-page { padding-bottom: 88px; }
.res-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay);
}
.res-intro { padding: 64px 0 8px; }
.res-intro .res-eyebrow { margin-bottom: 18px; }
.res-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 20ch;
}
.res-lead {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.6;
  color: var(--muted);
  margin-top: 22px;
  max-width: 68ch;
}

/* ---------- sections ---------- */
.res-section { padding: 48px 0; border-top: 1px solid var(--hair); }
.res-section:first-of-type { border-top: 0; }
.res-section .res-eyebrow { margin-bottom: 10px; }
.res-section-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.res-section-sub {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 12px;
  max-width: 64ch;
}

/* ---------- segmented control (tabs / view toggle) ---------- */
.res-seg {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  max-width: 100%;
  flex-wrap: wrap;
}
.res-seg button {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, box-shadow 0.16s;
}
.res-seg button:hover { color: var(--ink); }
.res-seg button[aria-pressed="true"],
.res-seg button[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(22, 20, 18, 0.12);
}

/* ---------- detail panel ---------- */
.res-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
}
.res-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.res-panel-lead {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin-top: 10px;
}

/* fact grid used by several tools (what / how / best for …) */
.res-facts { display: grid; gap: 20px; margin-top: 22px; }
@media (min-width: 640px) { .res-facts.res-facts-2 { grid-template-columns: 1fr 1fr; } }
.res-fact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 6px;
}
.res-fact-body {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- chips / tags ---------- */
.res-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.res-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--clay);
  background: var(--label);
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.4;
}
.res-chip--muted { color: var(--muted); background: var(--paper-2); }

/* ---------- meter bar ---------- */
.res-meter { height: 6px; background: var(--hair); border-radius: 999px; overflow: hidden; }
.res-meter-fill {
  height: 100%;
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--clay), var(--amber));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.res-meter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- lists (look-for / red-flags / pros / cons) ---------- */
.res-ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.res-ul li {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 18px;
  position: relative;
}
.res-ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--honey);
}
.res-ul--con li::before { background: var(--brick); }

/* ---------- narrow-screen fallback list (charts collapse to this) ---------- */
.res-fallback-list { display: flex; flex-direction: column; gap: 4px; }

/* ---------- lightbox / dialog ---------- */
.res-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 20, 18, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.res-dialog-backdrop[hidden] { display: none; }
.res-dialog {
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  max-width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(22, 20, 18, 0.3);
  position: relative;
}
.res-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s, background 0.16s;
}
.res-dialog-close:hover { border-color: var(--ink); background: rgba(22, 20, 18, 0.04); }

/* ---------- footnote / source line ---------- */
.res-footnote {
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 20px;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .res-meter-fill { transition: none; }
}
