/*
 * Food To Go Near Me: tokens, base type and the chrome (header, footer) of every page. docs/DESIGN.md is the brief:
 * a white page, colour from food and from heat only, Figtree for everything, hairlines not shadows, minutes as the unit.
 * The homepage's own pieces are in home.css; every other page's (articles, lists, Foods, not found) in inner.css.
 */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground and ink */
  --white: #FFFFFF;
  --rice: #F5F2ED;        /* tool grounds, panels */
  --line: #E4DDD3;        /* hairlines, 1 px */
  --char: #1A1512;        /* text; the footer's and the night pieces' ground */
  --smoke: #4F453E;       /* second text */
  --ember: #D9481C;       /* the mark, "now", the live minute, you-are-here: shapes and figures 32 px+ only */
  --ember-deep: #8F2A0C;  /* ember words */
  --frost: #1F5F8B;       /* cold: shapes */
  --frost-deep: #174A6E;  /* cold: words */
  /* Thermal scale: temperature only, never decoration */
  --t0: #1B0C2E; --t1: #5B1A6E; --t2: #A52C60; --t3: #E4572E; --t4: #F99A2A; --t5: #FCE38A; --t6: #FFFBEA;

  /* Type: one family */
  --face: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: 20px;
  --h1: 38px;
  --h2: 28px;
  --label: 17px;

  /* Grid: 12 columns, 1240 px at most, 24 px gutters */
  --wrap: 1240px;
  --gutter: 24px;
  --edge: 20px;           /* the page's side margin on a phone */
  --raise: 0 1px 2px rgba(26, 21, 18, .25);   /* the one real, tight shadow: dragged and raised things only */
  --header: 60px;
}

@media (min-width: 700px) {
  :root { --edge: 32px; }
}
@media (min-width: 1024px) {
  :root { --body: 21px; --h1: 58px; --h2: 36px; --label: 18px; --header: 72px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--char);
  font-family: var(--face);
  font-size: var(--body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video { max-width: 100%; height: auto; }

figure { margin: 0; }

table { border-collapse: collapse; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--h1); line-height: 1.06; }
h2 { font-size: var(--h2); line-height: 1.15; }
h3 { font-size: 22px; line-height: 1.25; letter-spacing: 0; }
p { margin: 0; }
p + p { margin-top: .75em; }

a { color: var(--char); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

button,
input,
select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }

/* Figures that are times or counts: tabular on the figure only, never on running text. */
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

/* The skip link is hidden until it has the keyboard's focus. */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--edge); top: 8px; z-index: 100; background: var(--char); color: var(--white); padding: 10px 14px; border-radius: 6px; }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--edge)); margin-inline: auto; padding-inline: var(--edge); }

/* ---- Buttons and choices ------------------------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 6px; border: 2px solid var(--char);
  background: var(--char); color: var(--white); font-size: var(--label); font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #000; }
.btn-line { background: transparent; color: var(--char); }
.btn-line:hover { background: var(--rice); }
.btn .i { width: 22px; height: 22px; }

/* Icons from the sprite: one hand, 2 px at 24 px. */
.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* A choice of two or three: a segmented control with a sliding fill. */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative; border: 2px solid var(--char); border-radius: 6px; padding: 0; margin: 0; min-width: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; font-size: var(--label); font-weight: 600; cursor: pointer; z-index: 1; white-space: nowrap; transition: color .2s ease; }
.seg .fill { position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% / var(--n, 2)); background: var(--char); border-radius: 3px; transform: translateX(calc(100% * var(--at, 0))); transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
.seg input:checked + label { color: var(--white); }
.seg input:focus-visible + label { outline: 2px solid var(--ember-deep); outline-offset: -6px; }
.seg label .i { width: 22px; height: 22px; }
.no-js .seg input:checked + label { background: var(--char); }

/* ---- Header ------------------------------------------------------------------------------------------------------- */

.top { border-bottom: 1px solid var(--line); background: var(--white); position: relative; z-index: 20; }
.top-in { display: flex; align-items: center; flex-wrap: wrap; column-gap: 24px; min-height: var(--header); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--char); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.brand img, .brand svg { width: 34px; height: 34px; display: block; }
.brand-box { display: flex; flex-direction: column; justify-content: center; padding: 6px 0; }
.brand-box .brand { min-height: 36px; }
.top-line { margin: -4px 0 0 44px; font-size: 16px; line-height: 1.25; font-weight: 500; color: var(--smoke); white-space: nowrap; }
.top-clock { font-size: var(--label); font-weight: 600; color: var(--smoke); white-space: nowrap; font-feature-settings: "tnum"; }
.top-clock b { color: var(--char); font-weight: 700; }
.top-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 22px; flex-wrap: wrap; }
.top-nav a { font-size: var(--label); font-weight: 600; text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.top-nav a:hover, .top-nav a.is-here { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .3em; }
.menu-btn { display: none; margin-left: auto; min-height: 44px; padding: 0 2px; border: 0; background: none; font-size: var(--label); font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }

@media (max-width: 1023px) {
  .top-in { column-gap: 12px; }
  .brand { font-size: 19px; }
  .brand img, .brand svg { width: 32px; height: 32px; }
  .brand-box { flex: 1; min-width: 0; }
  .top-line { margin-left: 42px; white-space: normal; }
  .js .menu-btn { display: inline-flex; align-items: center; }
  .top-panel { flex-basis: 100%; padding: 0 0 16px; }
  .js .top-panel { display: none; }
  .js .top.open .top-panel { display: block; }
  .top-panel .top-clock { padding: 12px 0 0; }
  .top-nav ul { flex-direction: column; gap: 0; }
  .top-nav li { border-top: 1px solid var(--line); }
  .top-nav a { width: 100%; min-height: 48px; }
}
@media (max-width: 419px) {
  .top-line { margin: 0; } /* under the mark, so it stays on one line beside the Menu button */
}
@media (min-width: 1024px) {
  .top-in { flex-wrap: nowrap; }
  .top-panel { display: flex; align-items: center; flex: 1; gap: 24px; min-width: 0; }
  .top-nav { margin-left: auto; }
  .top-clock { padding-left: 22px; border-left: 1px solid var(--line); line-height: 28px; }
}

/* ---- Footer ------------------------------------------------------------------------------------------------------- */

.foot { background: var(--char); color: var(--white); margin-top: 96px; padding: 56px 0 40px; }
.foot a { color: var(--white); }
.foot-grid { display: grid; gap: 36px; }
.foot .brand { color: var(--white); margin-bottom: 12px; }
.foot p { font-size: var(--label); line-height: 1.5; max-width: 60ch; }
.foot h2 { font-size: var(--label); font-weight: 700; letter-spacing: 0; margin-bottom: 6px; }
.foot ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.foot li { font-size: var(--label); break-inside: avoid; }
.foot li a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot-data p + p { margin-top: 10px; }
.foot-base { margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .24); display: flex; flex-wrap: wrap; gap: 4px 32px; }
.foot-base p { margin: 0; }
@media (min-width: 1024px) {
  .foot-grid { grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); }
  .foot-about { grid-column: 1 / span 4; }
  .foot-pages { grid-column: 5 / span 3; padding-left: 12px; }
  .foot-secs { grid-column: 8 / span 2; }
  .foot-pages ul, .foot-secs ul { columns: 1; }
  .foot-data { grid-column: 10 / span 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
