/* reference-page.css — the page shell for generated gem and reference pages.
 *
 * EXTRACTED 2026-09-18 from the CSS template literal in
 * scripts/generate_reference_pages.js, where it was inlined into every page
 * that generator writes: 132 gem pages plus the reference hub and the RI and
 * SG charts. ~121 rules x 135 files, so the shell design could only be
 * changed by regenerating, and could not be changed at all without editing a
 * JS string.
 *
 * This is NOT inner-page.css. The two groups have deliberately different
 * looks — here .section is a card (surface, border, radius, padding) and main
 * is 1200px; in inner-page.css .section is a bare margin and main is 1100px.
 * Pointing these pages at inner-page.css would redesign them.
 *
 * Loaded AFTER /shared.css and BEFORE any per-page <style>, which is exactly
 * where the inline block used to sit — so the cascade is unchanged.
 * PAGE-STANDARD.md sec 1.
 */
/* Page-specific styles for generated reference/gem pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-light); }

/* MAIN CONTENT */
main { flex: 1; padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* PAGE HEADER */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; }
.page-header p { color: var(--muted); font-size: 1rem; max-width: 720px; }

/* BREADCRUMB */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center; font-size: 0.825rem; color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: 0.4; }

/* TABLES */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { position: sticky; top: 0; z-index: 10; }
th {
  background: var(--surface2); color: var(--muted);
  font-weight: 600; text-align: left;
  padding: 0.75rem 1rem; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.625rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
td a { color: var(--brand-light); font-weight: 500; }

/* Sticky first column */
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 5; }
th.sticky-col { background: var(--surface2); }
tr:hover td.sticky-col { background: var(--surface2); }

/* FILTER BAR */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.filter-bar h2 { font-size: 0.875rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.375rem; }
.filter-group label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.filter-group input[type="text"],
.filter-group input[type="number"] {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem; font-size: 0.875rem; width: 100%;
  min-width: 0;
}
.filter-group input:focus { border-color: var(--brand); }
.filter-range { display: flex; gap: 0.5rem; align-items: center; }
.filter-range input { width: 80px; }
.filter-range span { color: var(--muted); font-size: 0.8rem; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-pill {
  display: flex; align-items: center; gap: 0.375rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.75rem;
  font-size: 0.8rem; cursor: pointer; user-select: none;
  color: var(--muted); transition: border-color 0.15s, color 0.15s;
}
.checkbox-pill:has(input:checked) { border-color: var(--brand); color: var(--text); }
.checkbox-pill input { display: none; }
/* 44px touch targets on touch devices only — desktop rendering unchanged (audit P0, 2026-03-24/04-06) */
@media (pointer: coarse) {
  .checkbox-pill { min-height: 44px; padding: 0.6rem 1rem; }
}
.result-count { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
.result-count strong { color: var(--text); }
.filter-reset { font-size: 0.8rem; color: var(--brand-light); cursor: pointer; background: none; border: none; padding: 0; margin-left: auto; }
.filter-reset:hover { text-decoration: underline; }

/* PROPERTY CARD */
.prop-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.prop-card h2 { font-size: 1rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.04em; }
/* The refractometer sight. The SVG carries a viewBox and its own scoped CSS
   (svg[data-fig="<id>"], from scripts/lib/figure-style.js), so it scales to
   the column and cannot reach any other element on the page. Capped because
   at full column width on a desktop the eyepiece circle becomes a dinner
   plate; the figure is authored at 520px. */
.sight-art {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.sight-art svg { display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; }
.sight-note { margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }
.measured-with { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
/* Figures inlined by scripts/inject-figures.js at a <!-- fig: --> marker. The
   how-to guides get these rules from inner-page.css, which the reference charts
   do NOT load — without them a 960px-wide SVG sits unconstrained in a narrower
   column. Caught by rendering the page, not by reading the markup. */
/* .fig and .fig svg moved to shared.css 2026-10-01 — see the Generated figures block there. */
.prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.prop-item { display: flex; flex-direction: column; gap: 0.2rem; }
.prop-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.prop-value { font-size: 1rem; font-weight: 600; color: var(--text); }
.prop-note { grid-column: 1 / -1; font-size: 0.8rem; line-height: 1.45; color: var(--muted); background: var(--surface2, #f4f6f7); border-left: 3px solid #006a78; padding: 0.5rem 0.7rem; border-radius: 6px; }

/* SECTIONS — card treatment matching prop-card */
.section { margin-bottom: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.625rem; border-bottom: 1px solid var(--border); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.section ul { list-style: disc; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; }
.section li { color: var(--text); font-size: 0.9375rem; line-height: 1.65; }

/* CTA BOX */
.cta-box {
  background: var(--brand-dim); border: 1px solid var(--brand);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.cta-box p { flex: 1; color: var(--text); font-size: 0.9375rem; }
.cta-box a { white-space: nowrap; }

/* SEO COPY */
.seo-section { margin: 2rem 0; max-width: 760px; }
.seo-section p { color: var(--muted); font-size: 0.9375rem; margin-bottom: 1rem; line-height: 1.7; }

/* TAG PILLS */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.tag {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.2rem 0.65rem;
  font-size: 0.775rem; color: var(--muted);
}
.tag .swatch {
  display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%;
  margin-right: 0.4em; vertical-align: baseline;
  border: 1px solid rgba(0,0,0,0.35);
}
:root[data-theme="dark"] .tag .swatch { border-color: rgba(255,255,255,0.35); }
.swatch-green { background: #2e8b57; }
.swatch-red_pink { background: linear-gradient(135deg, #b3122f 50%, #e87ea1 50%); }
.swatch-yellow_orange { background: linear-gradient(135deg, #e8c22e 50%, #e07a1f 50%); }
.swatch-blue_violet { background: linear-gradient(135deg, #1e5bb0 50%, #7a4bc4 50%); }
.swatch-colorless { background: #fcfcfa; }
.swatch-brown { background: #7a4f28; }
.swatch-black { background: #23211f; }
.swatch-purple { background: #6d3591; }
.swatch-multi { background: conic-gradient(#b3122f, #e0a01f, #2e8b57, #1e5bb0, #6d3591, #b3122f); }
.swatch-color_change { background: linear-gradient(90deg, #2e8b57 50%, #a63a54 50%); }

/* BACK LINKS */
.back-links { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.875rem; margin-bottom: 1.5rem; }
.back-links a { color: var(--muted); }
.back-links a:hover { color: var(--text); }

/* PAGE ANCHORS */
.page-anchors {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  font-size: 0.8rem; color: var(--muted);
  margin-bottom: 1.5rem; padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.page-anchors a { color: var(--muted); }
.page-anchors a:hover { color: var(--brand-light); }

/* RELATED GEMS */
.related-gems { display: flex; flex-wrap: wrap; gap: 0.375rem 0; }
.related-gems a { color: var(--brand-light); }
.related-gems a + a::before { content: ' · '; color: var(--subtle); }

@media (max-width: 640px) {
  main { padding: 1.25rem 1rem; }
  .filter-range input { width: 70px; }
}
