/* Text-first, minimal CSS */

:root {
    --bg: #fff;
    --fg: #111;
    --muted: #555;
    --link: #0645ad;
    --link-visited: #0645ad;
    --border: #e6e6e6;
    --maxw: 42rem; /* readable line length */
  }
  
  *,
  *::before,
  *::after { box-sizing: border-box; }
  
  html { text-size-adjust: 100%; }
  
  body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 18px;
    line-height: 1.6;
  }
  
  /* Layout */
  header {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }

  /* Navbar: the brand sits left, the last link is pushed right by a rule down
     in Links, where every `a` selector has to live. */
  header nav {
    display: flex;
    gap: 1rem;
  }

  main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1rem;
  }

  /* Typography */
  h1, h2, h3 {
    line-height: 1.25;
    margin: 1rem 0 0.4rem;
    font-weight: 700;
  }
  
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }

  h3 {
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 600;
  }
  
  p { margin: 0.6rem 0; }
  
  small { color: var(--muted); }

  /* A long line scrolls inside its block rather than off the page. */
  pre { overflow-x: auto; }

  /* Lists */
  ul, ol {
    margin: 0.6rem 0 0.6rem 1.25rem;
    padding: 0;
  }

  li { margin: 0.25rem 0; }

  /* A dish's description sits on its own line under the name. */
  .description { display: block; }

  
  /* Links
     Ordered by ascending specificity, which stylelint's no-descending-specificity
     demands of every rule keyed on `a` — that is why the navbar's two link rules
     sit here instead of up under Layout. No two of these set the same property at
     equal specificity, so the order is a lint concern and changes nothing that
     renders; keep it ascending if you add to the group. */
  a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  header nav a {
    text-decoration: none;
    color: var(--fg);
    font-weight: 600;
  }

  a:visited { color: var(--link-visited); }

  a:hover, a:focus {
    text-decoration-thickness: 2px;
  }

  header nav a:last-of-type {
    margin-left: auto;
  }

  /* Sections on canteen page */
  section {
    padding: 0.15rem 0 0.4rem;
    margin-top: 0.25rem;
  }
  section:first-of-type { margin-top: 0.25rem; }
  section > h2 { margin: 0.8rem 0 0.2rem; }
  section > ul { margin: 0.3rem 0 0.4rem 1.25rem; }

  /* Slightly fade past days */
  section.past {
    opacity: 0.7;
  }
  
  /* Responsive: slightly larger text on wider screens */
  @media (width >= 768px) {
    body { font-size: 19px; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.35rem; }
  }

  /* Stats page */
  .stats {
    --series-1: #2a78d6;
    --series-1-hover: #1c5cab;
    --gridline: #e1e0d9;
    --axis: #c3c2b7;
    --axis-ink: #6f6d68;
  }

  .figures {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin: 0.8rem 0 1.2rem;
  }

  .figures dt {
    color: var(--muted);
    font-size: 0.9rem;
  }

  .figures dd {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.2;
  }

  .figures dd.note {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
  }

  .chart { margin: 0.4rem 0 1rem; }

  .chart svg {
    display: block;
    width: 100%;
    height: auto;
  }

  .chart .grid {
    stroke: var(--gridline);
    stroke-width: 1;
  }

  .chart .baseline {
    stroke: var(--axis);
    stroke-width: 1;
  }

  .chart .tick {
    fill: var(--axis-ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }

  .chart .value {
    fill: var(--fg);
    font-size: 13px;
    font-weight: 600;
  }
  .chart .bar { fill: var(--series-1); }
  .chart .hit { fill: transparent; }
  .chart .slot:hover .bar { fill: var(--series-1-hover); }

  table {
    border-collapse: collapse;
    margin: 0.4rem 0 1rem;
    font-size: 0.95rem;
  }

  th, td {
    padding: 0.2rem 0.8rem 0.2rem 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  th { font-weight: 600; }

  .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .scroll { overflow-x: auto; }
  details { margin: 0.4rem 0 1rem; }
  summary { cursor: pointer; }
