/* Self-hosted fonts (Fredoka, Atkinson Hyperlegible; SIL Open Font License). Files in fonts/. */
/* ==========================================================================
   content.css — About & Sources pages (owned by the content session)
   Reuses tokens and components from base.css. Nothing here is used by the
   plate or planner pages.
   ========================================================================== */

/* Sections -------------------------------------------------------------- */
.content-section {
  padding-block: var(--s-6) var(--s-5);
  max-width: min(65ch, 38rem);
}
.content-section + .content-section {
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 2px dashed var(--line);
}
.content-section h2 { margin-bottom: var(--s-4); }
.content-section h3 { font-size: var(--step-0); margin-top: var(--s-6); margin-bottom: var(--s-2); }
.content-section p + p { margin-top: var(--s-3); }
.content-section p + h3,
.content-section ul + h3,
.content-section ol + h3,
.content-section .table-wrap + p,
.content-section .callout + h3 { margin-top: var(--s-6); }
.content-section ul,
.content-section ol {
  display: grid;
  gap: var(--s-2);
  padding-left: 1.25rem;
  margin-top: var(--s-3);
}
.content-section li::marker { color: var(--leaf); }
.content-section li strong { color: var(--ink); }
.content-section p em { font-style: italic; }

/* Callout (caveats) ----------------------------------------------------- */
.callout {
  margin-block: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--mustard-tint);
  box-shadow: inset 0 0 0 2px #E9C15C, var(--shadow-1);
}
.callout > * + * { margin-top: var(--s-3); }
.callout ul { margin-top: var(--s-3); }
.callout__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.callout ul { padding-left: 1.25rem; }

/* Call to action -------------------------------------------------------- */
.cta-card {
  margin-top: var(--s-5);
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-lg);
  background: var(--leaf-tint);
  box-shadow: var(--shadow-1);
  display: grid;
  gap: var(--s-4);
  max-width: min(65ch, 38rem);
}
.cta-card__text { margin: 0; font-size: var(--step-0); }

/* Tables ---------------------------------------------------------------- */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;               /* scroll inside the wrapper only */
  -webkit-overflow-scrolling: touch;
  margin-top: var(--s-4);
  border-radius: var(--r-md);
  background: var(--glaze);
  box-shadow: var(--shadow-1);
}
.table-wrap:focus-visible { box-shadow: var(--focus); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.data-table--wide { min-width: 46rem; }
.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:nth-child(even) { background: var(--paper); }
.data-table tbody tr:hover { background: var(--leaf-tint); }
.data-table thead th {
  background: var(--paper-deep);
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table thead th.num .sort { justify-content: flex-end; }
.data-table td a { color: var(--leaf-deep); }
.food-table__emoji { font-size: 1.2em; line-height: 1; vertical-align: -0.15em; }

.sort {
  background: none;
  border: 0;
  padding: 0;
  min-height: 2.75rem; /* ≥44px touch target */
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  text-align: inherit;
  border-radius: var(--r-sm);
}
.sort::after { content: "↕"; opacity: .4; font-size: .9em; }
th[aria-sort="ascending"] .sort::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .sort::after { content: "↓"; opacity: 1; }
.sort:focus-visible { box-shadow: var(--focus); }

/* Food table tools ------------------------------------------------------ */
.food-tools {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-4);
  max-width: min(65ch, 38rem);
}
@media (min-width: 40rem) {
  .food-tools { grid-template-columns: 1fr 16rem; align-items: end; }
}
[data-food-status] { margin-top: var(--s-3); }

/* Jump links ------------------------------------------------------------ */
.jump { margin-top: var(--s-4); }

/* Sources --------------------------------------------------------------- */
.source-group + .source-group { margin-top: var(--s-6); }
.source-group > h3 { margin-top: 0; }
.source-list {
  list-style: none;
  padding: 0;
  margin-top: var(--s-4);
  display: grid;
  gap: var(--s-4);
}
.source {
  scroll-margin-top: calc(var(--header-h, 4rem) + var(--s-4));
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--glaze);
  box-shadow: var(--shadow-1);
}
.source:target { box-shadow: inset 0 0 0 3px var(--mustard), var(--shadow-1); }
.source__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.3;
  margin: 0;
}
.source__title a { color: var(--ink); }
.source__meta {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-top: var(--s-1);
}
.source p:not(.source__meta) { font-size: var(--step--1); margin-top: var(--s-2); }

/* Details (dish recipes) ------------------------------------------------ */
.disclosure {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--paper-deep);
}
.disclosure summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: var(--r-sm);
}
.disclosure summary:focus-visible { box-shadow: var(--focus); }
.disclosure ul { margin-top: var(--s-3); font-size: var(--step--1); }

/* Diet bars (About) ----------------------------------------------------- */
.content-section .diet-bars {
  display: grid;
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  margin-top: var(--s-4);
}
.diet-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-1) var(--s-3);
  align-items: center;
  font-size: var(--step--1);
}
.diet-bar__label { font-weight: 600; color: var(--ink); }
.diet-bar__value { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.diet-bar__track {
  grid-column: 1 / -1;
  height: .9rem;
  border-radius: var(--r-sm);
  background: var(--paper-deep);
  overflow: hidden;
}
.diet-bar__fill {
  display: block;
  height: 100%;
  border-radius: var(--r-sm);
  background: var(--leaf);
}
@media (min-width: 40rem) {
  .diet-bar { grid-template-columns: minmax(11rem, 15rem) 1fr 8.5rem; }
  .diet-bar__track { grid-column: auto; }
}

/* Interactive bits are not selectable (text elsewhere on .prose stays selectable) */
.prose .sort,
.prose .jump .btn,
.prose .cta-card .btn,
.prose .disclosure summary {
  -webkit-user-select: none;
  user-select: none;
}

/* Small screens --------------------------------------------------------- */
@media (max-width: 40rem) {
  .content-section { padding-block: var(--s-5) var(--s-4); }
  .cta-card { padding: var(--s-4); }
  .cta-card .cluster .btn { flex: 1 1 10rem; }
  .source { padding: var(--s-4); }
}
