/* ========================================================================
   The InBetween Café - stylesheet
   Modeled on the printed menu: black serif on white, bold section
   headings, italic descriptions, dotted price leaders, rounded boxes.
   Light by default. Dark applies when <html data-theme="dark"> (logo
   click, cafe.js) OR the OS prefers dark and no choice has been saved.
   ======================================================================== */

/* Fonts (self-hosted, Crimson Text, OFL) ------------------------------ */
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('CrimsonText-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('CrimsonText-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('CrimsonText-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('CrimsonText-Bold.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --ink: #1a1a1a;
  --ink-2: #444140;
  --ink-3: #6e6a66;
  --paper: #fbfaf7;
  --card: #ffffff;
  --rule: #2b2b2b;
  --leader: #9a958f;
}

/* Explicit dark choice from logo toggle */
html[data-theme="dark"] {
  --ink: #f1eee8;
  --ink-2: #cdc8c0;
  --ink-3: #9a958d;
  --paper: #161514;
  --card: #1e1d1b;
  --rule: #8d8881;
  --leader: #5e5a55;
}

/* Auto-dark when the visitor has not made an explicit choice */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --ink: #f1eee8;
    --ink-2: #cdc8c0;
    --ink-3: #9a958d;
    --paper: #161514;
    --card: #1e1d1b;
    --rule: #8d8881;
    --leader: #5e5a55;
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 0 16px;
}

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }

/* Masthead ------------------------------------------------------------ */
.masthead {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 0 1.25rem;
  text-align: center;
  border-bottom: 2px solid var(--rule);
}

.wordmark { line-height: 1; }
.wordmark span { display: block; }
.wordmark .the {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.wordmark .name {
  font-size: clamp(2.75rem, 10vw, 4.5rem);
  letter-spacing: -0.01em;
}
.wordmark .cafe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-top: 0.2rem;
}
.wordmark .cafe::before,
.wordmark .cafe::after {
  content: "";
  width: 3.5rem;
  border-top: 2px solid var(--ink);
}

.brand {
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  font-weight: 700;
}
.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
  border-radius: 4px;
}

.tagline {
  margin-top: 0.9rem;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-2);
}

.contact {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  color: var(--ink-2);
}
.contact .sep { margin: 0 0.4em; }
.contact a { white-space: nowrap; }

/* Hours --------------------------------------------------------------- */
.hours {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.25rem 0;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hours h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hours-main { font-size: 1.6rem; font-weight: 700; margin-top: 0.25rem; }
.hours-sub { font-size: 1.15rem; font-style: italic; color: var(--ink-2); }

/* Menu nav ------------------------------------------------------------ */
.menu-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Menus --------------------------------------------------------------- */
main { max-width: 64rem; margin: 0 auto; }

.menu { padding-top: 2rem; scroll-margin-top: 1rem; }

.menu-title {
  font-size: clamp(2.4rem, 7vw, 3.25rem);
  text-align: center;
  padding: 0.25rem 0;
  border-top: 2px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  margin-bottom: 1.5rem;
}

/* Two columns that pack uneven boxes like the printed sheet */
.grid { columns: 2 22rem; column-gap: 1.5rem; }

.box {
  break-inside: avoid;
  display: inline-block;   /* keeps Safari from splitting boxes */
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 18px;
}

.box h3 {
  font-size: 1.85rem;
  text-align: center;
  margin-bottom: 0.4rem;
}

.note {
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 0.9rem;
}

.items { list-style: none; margin: 0; padding: 0; }
.items > li + li { margin-top: 0.6rem; }
.items.compact > li + li { margin-top: 0.25rem; }

/* Name ........ $price */
.line {
  display: flex;
  align-items: baseline;
  font-weight: 600;
}
.line span { flex: 0 1 auto; }
.line::after {
  content: "";
  order: 1;
  flex: 1 0 1.5rem;
  margin: 0 0.35em;
  border-bottom: 2px dotted var(--leader);
  transform: translateY(-0.25em);
}
.line b {
  order: 2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.line.addon {
  font-weight: 400;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-2);
  padding-left: 1rem;
  margin-top: 0.1rem;
}
.line.addon b { font-weight: 600; font-style: normal; }
.box > .line.addon { margin-top: 0.8rem; justify-content: flex-end; }

.desc {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-2);
  padding-left: 1rem;
}

/* Multi-price tables (soup, grits, cold sandwiches) */
.prices {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.prices caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.2rem;
}
.prices thead th {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  text-align: right;
  font-size: 0.95rem;
}
.prices tbody th {
  text-align: left;
  font-weight: 600;
  padding: 0.2rem 0.5rem 0.2rem 0;
}
.prices td {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.2rem 0 0.2rem 0.75rem;
}
.prices tbody tr { border-bottom: 2px dotted var(--leader); }
.prices tr.addon th,
.prices tr.addon td {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* Footer -------------------------------------------------------------- */
.foot {
  max-width: 64rem;
  margin: 1rem auto 0;
  padding: 1.5rem 0 2.5rem;
  text-align: center;
  border-top: 2px solid var(--rule);
}
.foot p + p { margin-top: 0.4rem; }
.foot .fine { font-style: italic; color: var(--ink-3); font-size: 0.95rem; }
.foot .credit {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* Print: menu only, black on white ------------------------------------ */
@media print {
  :root, html[data-theme="dark"] { --ink: #000; --ink-2: #222; --ink-3: #444; --paper: #fff; --card: #fff; --rule: #000; --leader: #777; }
  body { font-size: 11pt; padding: 0; }
  .menu-nav { display: none; }
  #lunch { break-before: page; }
  a { text-decoration: none; }
}
