/* Today's Dish: shared diner letterboard theme for every page */
:root {
  --bg: #F3E9D8;
  --ink: #2B1A12;
  --muted: #5E4A3C;
  --red: #A8261F;
  --btn: #A8261F;
  --btn-text: #FFFFFF;
  --card: #FFFBF3;
  --border: rgba(43, 26, 18, 0.14);
  --frame: #8A5A35;
  --felt: #1D1D1D;
  --felt-line: #262626;
  --letter: #F4F4F0;
  --gold: #F2C14E;
  --shadow: 0 8px 18px rgba(43, 26, 18, 0.18);
  /* Motion tokens */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: light;
}
body.dark {
  --bg: #17120E;
  --ink: #F3E9D8;
  --muted: #C9B8A6;
  --red: #F06A5F;
  --card: #221A14;
  --border: rgba(243, 233, 216, 0.14);
  --frame: #6B4529;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--ink); }
a:hover { color: var(--red); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.checker {
  height: 24px;
  background: repeating-conic-gradient(var(--btn) 0 25%, var(--bg) 0 50%) 0 0 / 24px 24px;
}

.wrap { max-width: 520px; margin: 0 auto; padding: 0 18px; }
.wrap.wide { max-width: 1100px; }

/* Header */
.site-header { text-align: center; padding: 18px 18px 0; }
.logo {
  font-family: "Pacifico", cursive;
  font-size: 36px;
  line-height: 1.25;
  color: var(--red);
  text-decoration: none;
}
.logo:hover { color: var(--red); }
.tagline {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Letterboard */
.board-frame {
  margin: 18px 0 0;
  padding: 10px;
  background: var(--frame);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.board {
  padding: 22px 14px;
  background-color: var(--felt);
  background-image: repeating-linear-gradient(180deg, var(--felt) 0 6px, var(--felt-line) 6px 8px);
  color: var(--letter);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 300px;
  justify-content: center;
}
.board-title { font-size: 21px; font-weight: 700; }
.board-date { font-size: 13px; }
.board-meal { margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--gold); }
.board-dish { font-size: 17px; line-height: 1.35; }
.board-foot { margin-top: 10px; font-size: 12px; }
.board-next { font-size: 13px; color: var(--gold); }

/* Photo tiles under the board */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.tile { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.tile-open {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
/* One-tap "I'm eating this" under each photo */
.tile-eat {
  min-height: 44px;
  padding: 0 6px;
  border: 2px solid var(--btn);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.tile-eat[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); }
.tile-eat:active { transform: scale(0.97); }
.tile-count { min-height: 1.2em; font-size: 13px; font-weight: 700; color: var(--red); }
.tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: var(--card);
  transition: transform 160ms var(--ease-out);
}
.tile-photo { position: relative; display: block; }
/* "You're eating this" badge on the photo */
.tile-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--btn);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.tile.eating .tile-check { opacity: 1; transform: scale(1); }
.tile.eating img { outline: 3px solid var(--btn); outline-offset: -3px; }
.tile-label { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.tile-time { margin-top: -6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tile-hint {
  font-size: 15px;
  font-weight: 500;
  color: var(--red);
}
@media (hover: hover) and (pointer: fine) { .tile-open:hover .tile-hint { text-decoration: underline; text-underline-offset: 3px; } }
@media (hover: hover) and (pointer: fine) { .tile-open:hover img { transform: translateY(-2px); } }
.tile-open:active img { transform: scale(0.97); }

/* Buttons and links */
.actions-col { display: flex; flex-direction: column; gap: 14px; align-items: center; margin: 30px 0 0; }
.btn-primary {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.btn-primary:active { transform: scale(0.97); }
/* A link styled as the main button keeps white text (plain links turn red on hover) */
a.btn-primary { display: flex; align-items: center; justify-content: center; text-decoration: none; }
a.btn-primary, a.btn-primary:hover { color: var(--btn-text); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.text-link { font-size: 15px; font-weight: 700; text-underline-offset: 3px; padding: 6px 0; }
.streak { margin: 22px 0 0; text-align: center; font-size: 15px; font-weight: 700; line-height: 1.4; }
.eat-btn {
  margin: 14px 0 4px;
  width: 100%;
  min-height: 50px;
  border: 2px solid var(--btn);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.eat-btn[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); }
.crowd { margin: 6px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--red); letter-spacing: 0.04em; }
.eat-count { margin: 4px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.eat-btn:active { transform: scale(0.97); }

/* Footer */
.site-footer {
  margin: 34px auto 0;
  padding: 18px 18px 28px;
  border-top: 1px solid var(--border);
  max-width: 520px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 18px;
  font-size: 14px;
  font-weight: 500;
}
.site-footer a { text-decoration: none; padding: 8px 0; color: var(--muted); }
.site-footer a:hover { color: var(--red); }
.site-footer a[aria-current="page"] { color: var(--red); }
.theme-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.footer-note { width: 100%; margin: 6px 0 0; text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); }

/* Section heading used on cook and about */
.page-title {
  margin: 22px 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
.page-sub { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }

/* Cards (cook results, about) */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; }
.card p { margin: 0 0 10px; line-height: 1.55; font-size: 16px; }
.card img { width: 100%; border-radius: 10px; margin: 10px 0 12px; display: block; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.04em;
}
.badge.accent { color: var(--red); border-color: var(--red); }
.badge.good { color: var(--ink); background: var(--gold); border-color: var(--gold); }
body.dark .badge.good { color: #2B1A12; }
.card h3, .sheet h3 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}
.card ul, .card ol, .sheet ul, .sheet ol { margin: 0 0 0 20px; padding: 0; line-height: 1.5; }
.card li, .sheet li { margin-bottom: 6px; }
hr.sep { border: none; border-top: 1px dashed var(--border); margin: 14px 0; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  z-index: 10002;
  /* Transitions (not keyframes) so a second copy mid-animation retargets smoothly */
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 100%);
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s linear 400ms;
}
.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s;
}

/* Overlays: share sheet and recipe sheet.
   Always laid out; visibility delays on close so the slide-down can finish. */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 8, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10001;
  visibility: hidden;
  opacity: 0;
  transition: opacity 500ms var(--ease-drawer), visibility 0s linear 500ms;
}
.overlay.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 500ms var(--ease-drawer), visibility 0s;
}
.sheet {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--ink);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 28px;
  box-shadow: var(--shadow);
  /* Phone: a drawer from the bottom edge, leaving the way it came */
  transform: translateY(100%);
  transition: transform 500ms var(--ease-drawer);
}
.overlay.open .sheet { transform: translateY(0); }
@media (min-width: 640px) {
  /* Wider screens: a centred modal, so it scales in place instead */
  .overlay { align-items: center; transition-duration: 250ms, 0s; transition-delay: 0s, 250ms; transition-timing-function: var(--ease-out), linear; }
  .overlay.open { transition-delay: 0s; }
  .sheet {
    border-radius: 18px;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
  }
  .overlay.open .sheet { opacity: 1; transform: scale(1); }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-title { font-size: 15px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.close-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.sheet-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; display: block; }
.sheet-meal { margin: 14px 0 0; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.sheet-name { margin: 4px 0 4px; font-size: 24px; line-height: 1.2; }
.sheet-meta { margin: 0; color: var(--muted); font-size: 14px; }

.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 4px; margin: 4px 0 16px; }
.share-icon {
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  /* Settles in a beat behind the sheet, one after another (delays below) */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), border-color 200ms ease, background-color 200ms ease;
}
.overlay.open .share-icon { opacity: 1; transform: translateY(0); }
.overlay.open .share-icon:nth-child(1) { transition-delay: 80ms, 80ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(2) { transition-delay: 120ms, 120ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(3) { transition-delay: 160ms, 160ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(4) { transition-delay: 200ms, 200ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(5) { transition-delay: 240ms, 240ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(6) { transition-delay: 280ms, 280ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(7) { transition-delay: 320ms, 320ms, 0s, 0s; }
.overlay.open .share-icon:nth-child(8) { transition-delay: 360ms, 360ms, 0s, 0s; }
.overlay.open .share-icon:active { transform: scale(0.97); transition-delay: 0s; transition-duration: 160ms; }
@media (hover: hover) and (pointer: fine) {
  .share-icon:hover { background-color: var(--bg); }
}
.share-dot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-dot svg { width: 26px; height: 26px; display: block; }
.share-logo { width: 52px; height: 52px; display: block; }

/* Hover (mouse only): the circle lifts on a transition so it retargets cleanly when the
   pointer leaves; the mark gives one small wiggle. Separate translate/scale/rotate
   properties so the wiggle doesn't cancel the lift. */
.share-dot, .share-logo { transition: translate 200ms var(--ease-out), scale 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .share-icon:hover .share-dot, .share-icon:hover .share-logo { translate: 0 -3px; scale: 1.06; }
  .share-icon:hover .share-dot svg, .share-icon:hover .share-logo { animation: share-wiggle 400ms var(--ease-in-out); }
}
@keyframes share-wiggle {
  0% { rotate: 0deg; }
  25% { rotate: -10deg; }
  50% { rotate: 8deg; }
  75% { rotate: -4deg; }
  100% { rotate: 0deg; }
}
/* Black marks (X, TikTok) need an edge to separate them from the dark sheet */
body.dark .share-dot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.copy-row { display: flex; gap: 10px; }
.copy-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.copy-btn {
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.copy-btn:active { transform: scale(0.97); }
.modal-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Reduced motion: keep the fades that explain what happened, drop the movement */
@media (prefers-reduced-motion: reduce) {
  .sheet, .overlay.open .sheet { transform: none; opacity: 0; transition: opacity 200ms ease; }
  .overlay.open .sheet { opacity: 1; }
  .share-icon, .overlay.open .share-icon { transform: none; transition: opacity 200ms ease; transition-delay: 0s; }
  .toast, .toast.show { transform: translate(-50%, 0); }
  .share-icon:hover .share-dot, .share-icon:hover .share-logo { translate: none; scale: none; }
  .share-icon:hover .share-dot svg, .share-icon:hover .share-logo { animation: none; }
  .tile img { transition: none; }
  .tile-open:hover img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-check { transform: none; }
}

/* Instagram links */
.ig-link { display: inline-flex; align-items: center; gap: 6px; }
.ig-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  text-decoration: none;
  padding: 8px 0;
  line-height: 1.3;
}
.ig-tag svg { flex-shrink: 0; color: var(--red); }
.ig-tag:hover span { text-decoration: underline; text-underline-offset: 3px; }
.ig-tag { width: 100%; margin-top: 6px; }
.ig-tag[hidden] { display: none; }

/* Instagram and Facebook together, on their own line under the footer links */
.footer-social { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; }
