/*
  Shared look for every menu page: menu.html (landscape, both meals) and the
  portrait single-meal cards breakfast.html and lunch.html.

  Page size and anything page-specific stays in each page's own <style>.
  Colours, type and spacing live here so the cards cannot drift apart.
*/

/* Reset: this file stands alone, so nothing is inherited from a host page. */
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, p, ul, li, figure { margin: 0; padding: 0; }
  ul { list-style: none; }

  :root {
    --ink:        #1d2a20;
    --ink-soft:   #4a5a4e;
    --ink-faint:  #7d8c81;
    --ground:     #f7f4ec;
    --card:       #fffdf7;
    --rule:       #ddd6c4;
    --brass:      #9a6f21;
    --brass-soft: #c9a55e;

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --ink:        #ece6d6;
      --ink-soft:   #b3ae9d;
      --ink-faint:  #837f71;
      --ground:     #14180f;
      --card:       #1b2016;
      --rule:       #38402d;
      --brass:      #d7ab5b;
      --brass-soft: #8a6c2e;
    }
  }

  :root[data-theme="dark"] {
    --ink:        #ece6d6;
    --ink-soft:   #b3ae9d;
    --ink-faint:  #837f71;
    --ground:     #14180f;
    --card:       #1b2016;
    --rule:       #38402d;
    --brass:      #d7ab5b;
    --brass-soft: #8a6c2e;
  }

  :root[data-theme="light"] {
    --ink:        #1d2a20;
    --ink-soft:   #4a5a4e;
    --ink-faint:  #7d8c81;
    --ground:     #f7f4ec;
    --card:       #fffdf7;
    --rule:       #ddd6c4;
    --brass:      #9a6f21;
    --brass-soft: #c9a55e;
  }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--serif);
    line-height: 1.5;
    padding: clamp(1rem, 3vw, 2rem) 1rem;
  }

  .card {
    max-width: 62rem;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--brass);
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  /* ---- masthead ---- */
  .masthead {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: center;
    text-align: center;
  }

  .place {
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
  }

  .name {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    font-weight: 400;
    line-height: 1.05;
    text-wrap: balance;
  }

  .rule-orn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 14rem;
    color: var(--brass-soft);
    margin-top: 0.1rem;
  }
  .rule-orn::before,
  .rule-orn::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
  }
  .rule-orn span { font-size: 0.7rem; letter-spacing: 0.3em; }

  .tagline {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--ink-soft);
    text-wrap: balance;
  }

  /* ---- spread: two columns side by side on a landscape sheet ---- */
  .spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3.25rem;
    align-items: start;
  }

  .stack {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  @media (max-width: 46rem) {
    .spread { grid-template-columns: 1fr; row-gap: 1.75rem; }
  }

  /* ---- courses ---- */
  .course { display: block; }

  .course-head {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin-bottom: 1rem;
    break-after: avoid;
  }
  .course-head h2 {
    font-size: 1.3rem;
    font-weight: 400;
    white-space: nowrap;
  }
  .course-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
  }
  .course-head .hours {
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
    order: 3;
  }

  /* A group head sits where a course head would, but reads as a sub-section. */
  .group-head {
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--rule);
    break-after: avoid;
  }

  /* Dishes sit indented from their heading — deliberate, not a browser default. */
  .items {
    display: block;
    list-style: none;
    padding-left: 2.5rem;
  }

  .item {
    break-inside: avoid;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 1rem;
    row-gap: 0.15rem;
    align-items: baseline;
  }
  .item + .item { margin-top: 1.05rem; }

  .item .dish { font-size: 1.04rem; }

  .item .price {
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .item .desc {
    grid-column: 1 / 2;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.4;
    color: var(--ink-soft);
  }

  .item .note {
    grid-column: 1 / 2;
    font-family: var(--sans);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--ink-faint);
  }

  /* ---- home link ----
     Sits above the card, lined up with its left edge, and never prints. */
  .home-bar {
    max-width: 62rem;
    margin: 0 auto 0.9rem;
  }
  body.portrait .home-bar { max-width: 46rem; }

  .home-link {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brass);
    text-decoration: none;
  }
  .home-link:hover { text-decoration: underline; }
  .home-link:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

  @media print {
    .home-bar { display: none; }
  }

  /* ---- portrait single-meal cards (breakfast.html, lunch.html) ----
     One column down the page, run a little tighter than the landscape menu so a
     whole meal — dishes and footer — lands on one sheet. The page box itself is
     set by each page, since @page cannot be scoped to a class. */
  body.portrait .card {
    max-width: 46rem;
    gap: 1.2rem;
    padding: clamp(1.25rem, 3vw, 2rem);
  }
  body.portrait .masthead { gap: 0.35rem; }
  body.portrait .card > .stack { gap: 1.3rem; }
  body.portrait .course-head { margin-bottom: 0.85rem; }
  body.portrait .group-head { margin-bottom: 0.85rem; }
  body.portrait .item + .item { margin-top: 0.85rem; }
  body.portrait .footer { padding-top: 0.8rem; gap: 0.45rem; }

  @media print {
    body.portrait { padding: 7mm; }
  }

  /* ---- footer ---- */
  .footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-top: 1px solid var(--rule);
    padding-top: 1.1rem;
    font-family: var(--sans);
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--ink-faint);
  }
  .footer strong { color: var(--ink-soft); font-weight: 600; }


  @media print {
    /* Print the light palette whatever the screen was showing. */
    :root,
    :root[data-theme="dark"],
    :root[data-theme="light"] {
      --ink:        #1d2a20;
      --ink-soft:   #4a5a4e;
      --ink-faint:  #7d8c81;
      --ground:     #f7f4ec;
      --card:       #fffdf7;
      --rule:       #ddd6c4;
      --brass:      #9a6f21;
      --brass-soft: #c9a55e;
    }

    /* Keep the paper colour and brass rules instead of dropping to bare white. */
    * {
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    body { background: var(--ground); padding: 8mm; }
  }
