/* Board & Brewed menu board — the look.

   Everything is laid out on a literal 1920x1080 canvas and then scaled to fit
   whatever it is shown on. That is what makes the phone preview in the editor
   trustworthy: the TV and the preview run the same pixels through the same
   transform, so what Dave signs off is what goes on the wall. */

:root {
  color-scheme: light dark;   /* see the note below the block */
  --cream:      #faefe0;   /* page */
  --row:        #f5ead8;   /* item row */
  --row-alt:    #efe2cc;   /* every other item row */
  --ink:        #43291b;   /* headings and item names */
  --ink-soft:   #a8845e;   /* allergens, subtitles, note labels */
  --bar:        #3b2417;   /* footer strip */

  --orange:     #f2a968;
  --teal:       #34d5b2;
  --blue:       #8fcbf2;

  --pad:        64px;
  --gap:        56px;
  --radius:     14px;
  --pill:       30px;
}

/* The single font. Self-hosted rather than pulled from a CDN, because the
   whole point of these boards is that they survive the broadband dropping. */
@font-face {
  font-family: 'BoardSans';
  src: url('fonts/board-sans.woff2') format('woff2');
  font-weight: 200 1000;      /* one variable file covers every weight used */
  font-style: normal;
  font-display: swap;
}


/* The café TVs run Android WebView, which invents its own dark version of any
   page that does not ship one — it inverted the whole board, cream to black
   and the dark footer to pale. Declaring "light" alone is not enough: with the
   default strategy WebView only backs off if the page actually has a dark
   theme. So here is one, identical to the light theme. WebView then uses ours
   and leaves the board alone. This looks redundant. It is not. Do not remove.*/
@media (prefers-color-scheme: dark) {
  :root {
    --cream:    #faefe0;
    --row:      #f5ead8;
    --row-alt:  #efe2cc;
    --ink:      #43291b;
    --ink-soft: #a8845e;
    --bar:      #3b2417;
    --orange:   #f2a968;
    --teal:     #34d5b2;
    --blue:     #8fcbf2;
  }
  .panel.blue { background: #cfe8fb; }
  .step-n { color: #e08b3d; }
}

/* ---------- canvas ---------- */

#board {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  background: var(--cream);
  color: var(--ink);
  font-family: 'BoardSans', 'Nunito', 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-weight: 700;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  padding-top: 46px;
}

/* Three accent segments across the very top. */
#board::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: linear-gradient(
    to right,
    var(--orange) 0 33.34%,
    var(--teal)   33.34% 66.67%,
    var(--blue)   66.67% 100%
  );
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
  flex: 0 0 auto;
}

.eyebrow {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.board-title {
  font-size: 78px;
  font-weight: 1000;
  line-height: 0.98;
  letter-spacing: -0.005em;
}

/* Three overlapping circles, top right. */
.mark { display: flex; padding-top: 10px; }
.mark span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-left: -13px;
}
.mark span:first-child { margin-left: 0; background: var(--orange); }
.mark span:nth-child(2) { background: var(--teal); }
.mark span:nth-child(3) { background: var(--blue); }

/* ---------- columns ---------- */

.columns {
  display: grid;
  /* A fallback, not the layout. renderBoard() sets this from the data on every
     render — two columns for a short breakfast, four for an evening that has
     grown — and the three here is only what a stylesheet that arrived ahead of
     its board.js should draw. Three columns of the wrong width is a board;
     everything piled into one column is not. */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  flex: 1 1 0;          /* basis 0, so this is the space left over, not the content */
  min-height: 0;
  align-items: start;
  overflow: hidden;
}

.column { display: flex; flex-direction: column; min-height: 0; }
.section { margin-bottom: 22px; }
.section:last-child { margin-bottom: 0; }

/* ---------- section heading pill ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: var(--pill);
  padding: 10px 26px;
  margin-bottom: 9px;
}
.section-head.orange { background: var(--orange); }
.section-head.teal   { background: var(--teal); }
.section-head.blue   { background: var(--blue); }

.section-title { font-size: 30px; font-weight: 800; }
.section-price { font-size: 30px; font-weight: 1000; }
.section-note  { font-size: 21px; font-weight: 800; }

/* Size pills above a multi-price section. */
.size-row {
  display: flex;
  justify-content: flex-end;
  gap: 0;
  margin-bottom: 8px;
  padding-right: 20px;
}
.size-pill {
  width: 84px;
  text-align: center;
  border-radius: 20px;
  padding: 4px 0;
  font-size: 17px;
  font-weight: 800;
}
.size-pill:nth-child(1) { background: var(--blue); }
.size-pill:nth-child(2) { background: var(--orange); }
.size-pill:nth-child(3) { background: var(--teal); }

/* ---------- item rows ---------- */

.item {
  display: flex;
  flex-wrap: wrap;      /* lets a subtitle drop onto its own line */
  align-items: baseline;
  gap: 10px;
  background: var(--row);
  border-radius: var(--radius);
  padding: 7px 20px;
  margin-bottom: 4px;
  line-height: 1.12;
}
.item.alt { background: var(--row-alt); }

.item-name { font-size: 24px; font-weight: 800; }

.item-allergens {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.item-prices {
  margin-left: auto;
  display: flex;
  gap: 0;
  flex: 0 0 auto;
}
.item-price {
  font-size: 24px;
  font-weight: 1000;
  text-align: right;
  white-space: nowrap;
}
/* Multi-price sections align into fixed columns so the numbers stack up. */
.item.sized .item-price { width: 84px; }
.item.sized .item-prices { gap: 0; }

.item-subtitle {
  flex: 1 0 100%;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: -2px;
}

.item.sold-out .item-name,
.item.sold-out .item-price { text-decoration: line-through; }
.item.sold-out { opacity: 0.4; }
.item.sold-out .item-name::after {
  content: 'Sold out';
  text-decoration: none;
  display: inline-block;
  margin-left: 10px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- notes ---------- */

.note { padding: 6px 20px 2px; }
.note-label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.note-text {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.32;
  white-space: pre-line;
}
.note.strong .note-text { font-size: 22px; }

/* ---------- the acai builder panel ---------- */

.panel {
  border-radius: var(--radius);
  padding: 16px 22px 18px;
}
.panel.blue { background: #cfe8fb; }

.step { margin-bottom: 9px; }
.step:last-of-type { margin-bottom: 0; }
.step-label {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step-n { color: #e08b3d; margin-right: 4px; }
.step-text {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  white-space: pre-line;
}
.panel-footnote {
  font-size: 20px;
  font-weight: 800;
  margin-top: 12px;
}

/* ---------- the feature panel ---------- */

/* What a window puts at the bottom of one column. It is the answer to a short
   board: it takes the room the sections left over, so the space a two-column
   breakfast frees up becomes the promo the owner asked for instead of a dead
   band across the lower half.

   Nothing here needs adding to the dark-scheme mirror above — it is all accent
   variables, and those are mirrored already. */
.feature {
  flex: 1 1 auto;
  min-height: 0;        /* or a long panel refuses to shrink and pushes its column past the cell */
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius);
  padding: 26px 30px;
}
.feature.orange { background: var(--orange); }
.feature.teal   { background: var(--teal); }
.feature.blue   { background: var(--blue); }

.feature-title { font-size: 34px; font-weight: 1000; line-height: 1.08; }
.feature-text {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.34;
  white-space: pre-line;   /* the editor's text area keeps its line breaks */
  margin-top: 10px;
}
.feature-footnote { font-size: 19px; font-weight: 800; margin-top: 14px; }

/* Only the column carrying a panel fills its grid cell. The others go on
   sitting at the top, which is what align-items: start does for them and what
   every board has done up to now, so a board with no panel is untouched.

   The sections inside a stretched column are pinned to their own height: they
   are flex items, and a flex item shrinks by default. Without this a full
   column would squash its sections to fit instead of overflowing, and
   fitColumns() would measure the squashed height, see nothing to shrink, and
   report no overflow — the shrink pass and the "too much in column N" warning
   would both quietly stop working on any column with a panel in it. */
.column.has-feature { align-self: stretch; }
.column.has-feature > .section { flex: 0 0 auto; }

/* ---------- footer strip ---------- */

.footer {
  flex: 0 0 auto;
  margin-top: 22px;
  background: var(--bar);
  border-radius: var(--radius);
  padding: 13px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.footer-tagline {
  font-size: 23px;
  font-weight: 1000;
  color: var(--orange);
  white-space: nowrap;
}
.footer-allergens {
  font-size: 20px;
  font-weight: 800;
  color: var(--cream);
  text-align: right;
  line-height: 1.28;
  white-space: pre-line;
}
