/* ChartsGraphsDiagrams.com — shared stylesheet (2026 rebuild) */

@import url("https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap");

:root {
  --ink: #1d2b33;
  --muted: #56666e;
  --accent: #1e6e5e;
  --accent-dark: #155246;
  --grid: #dceae5;
  --tint: #f1f7f5;
  --page: #ffffff;
  --note: #fff8e1;
  --note-edge: #e0b84c;
  --measure: 42rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Header: graph-paper band ---------- */

.site-header {
  border-bottom: 2px solid var(--accent);
  background-color: var(--tint);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(rgba(30,110,94,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,110,94,.06) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px;
  background-position: -1px -1px;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: .9rem;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  line-height: 1.2;
}
.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand-tag {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.site-nav { display: flex; gap: 1.25rem; font-weight: 600; }
.site-nav a { text-decoration: none; color: var(--ink); padding: .25rem 0; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Main ---------- */

main.wrap { padding-top: 2rem; padding-bottom: 3rem; }

.crumbs {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 .75rem;
}
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 .4rem; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 800; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 .5rem; }

.prose { max-width: var(--measure); }
.prose p, .prose ul { margin: 0 0 1rem; }
.prose ul { padding-left: 1.25rem; }

.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); margin: 0 0 1.25rem; }

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.hero-figure {
  margin: 0;
  border: 1px solid var(--grid);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 4 / 3;
}
.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 62%;
  display: block;
}
@media (min-width: 46rem) {
  .hero { grid-template-columns: 1.15fr 1fr; gap: 2.5rem; }
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: .7rem 1.2rem;
  border-radius: 6px;
}
.button:hover { background: var(--accent-dark); color: #fff; }
.button-quiet {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: calc(.7rem - 2px) calc(1.2rem - 2px);
}
.button-quiet:hover { background: var(--tint); color: var(--accent-dark); }

.topic-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.topic-list a { font-weight: 600; }
.topic-list span { display: block; color: var(--muted); font-size: .95rem; }

.other-sites {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grid);
  font-size: .95rem;
  color: var(--muted);
  max-width: var(--measure);
}
.other-sites h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--ink); }
.other-sites ul { margin: 0; padding-left: 1.1rem; }

/* ---------- Health chart index ---------- */

.link-groups {
  display: grid;
  gap: 0 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.link-groups ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.link-groups li { padding: .35rem 0; border-bottom: 1px solid var(--grid); }

.chart-table {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1rem;
  font-size: 1rem;
}
.chart-table caption {
  text-align: left;
  color: var(--muted);
  font-size: .95rem;
  padding-bottom: .5rem;
}
.chart-table th, .chart-table td {
  border: 1px solid var(--grid);
  padding: .65rem .75rem;
  text-align: left;
  vertical-align: top;
}
.chart-table thead th { background: var(--tint); font-weight: 700; }
.chart-table { table-layout: fixed; }
.chart-table thead th:first-child { width: 30%; }
.chart-table tbody th { font-weight: 700; }
.chart-table td a { margin-right: 1rem; font-weight: 600; white-space: nowrap; }
.chart-table .na { color: var(--muted); }

@media (max-width: 40rem) {
  .chart-table, .chart-table tbody, .chart-table tr, .chart-table th, .chart-table td { display: block; width: 100%; }
  .chart-table caption { display: block; width: 100%; }
  .chart-table td a { display: inline-block; padding: .2rem 0; }
  .chart-table thead { display: none; }
  .chart-table tr { margin-bottom: 1rem; border: 1px solid var(--grid); border-radius: 6px; overflow: hidden; }
  .chart-table th, .chart-table td { border: 0; border-top: 1px solid var(--grid); }
  .chart-table tbody th { background: var(--tint); border-top: 0; width: 100%; }
  .chart-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: .15rem;
  }
  .chart-table td.na-row { display: none; }
}

/* ---------- Chart page ---------- */

.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0 0 1.25rem;
}

.chart-figure {
  margin: 0 0 1rem;
  max-width: 46rem;
}
.chart-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--grid);
  border-radius: 4px;
  background: #fff;
}
.chart-figure figcaption {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .5rem;
}

.note {
  max-width: var(--measure);
  background: var(--note);
  border-left: 4px solid var(--note-edge);
  padding: .9rem 1.1rem;
  margin: 0 0 1.5rem;
  border-radius: 0 6px 6px 0;
}
.note p { margin: 0; }
.note p + p { margin-top: .5rem; }
.note strong { font-weight: 700; }

.example {
  background: var(--tint);
  border-radius: 6px;
  padding: .9rem 1.1rem;
}

.related { list-style: none; padding: 0 !important; }
.related li { padding: .35rem 0; border-bottom: 1px solid var(--grid); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--grid);
  color: var(--muted);
  font-size: .9rem;
  padding: 1.25rem 0 2rem;
}
.site-footer p { margin: 0 0 .35rem; }
.site-footer a { color: var(--muted); }

/* ---------- Print: just the chart ---------- */

@media print {
  .site-header, .site-footer, .crumbs, .chart-actions, .no-print { display: none !important; }
  body { font-size: 11pt; }
  .chart-figure { max-width: none; }
  .chart-figure img { border: 0; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Data tables and wide tables ---------- */

.data-table {
  border-collapse: collapse;
  margin: .5rem 0 1rem;
  font-size: 1rem;
}
.data-table th, .data-table td {
  border: 1px solid var(--grid);
  padding: .5rem .75rem;
  text-align: left;
  vertical-align: top;
}
.data-table thead th { background: var(--tint); }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: .5rem 0 1.25rem;
  max-width: 100%;
}
.table-scroll table { border-collapse: collapse; }
.table-scroll td, .table-scroll th { border-color: #c9d6d2; }
.scroll-hint { font-size: .9rem; color: var(--muted); margin: 0 0 .25rem; }
@media (min-width: 60rem) { .scroll-hint { display: none; } }

.page-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  font-size: .95rem;
}

.formula { font-family: "Public Sans", system-ui, sans-serif; white-space: pre-wrap; background: var(--tint); padding: .75rem 1rem; border-radius: 6px; font-size: .95rem; }

.letter-nav { font-size: 1.15rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .5rem 0 1.5rem; }
.chart-figure.wide { max-width: 52rem; }
.chart-figure + .chart-figure { margin-top: 1.5rem; }
.chart-figure img { width: auto; max-width: 100%; }
.chart-figure fieldset { border: 1px solid var(--grid); border-radius: 6px; margin-top: .5rem; font-size: .95rem; }
.chart-figure fieldset input { width: 4.5em; font: inherit; }
table.hi.data-grid { font-size: .78rem; }
table.hi.data-grid td, table.hi.data-grid th { padding: 2px 4px; }
.table-page tr[bgcolor] { background: var(--tint) !important; }
@media (hover: none) { .chart-figure fieldset { display: none !important; } }
@media (max-width: 40rem) {
  .food-table tr > :first-child { display: none; }
}
