/* momos.food
   Palette borrows the loud signage red and mustard of a fast food counter,
   but the structural motif is the pleated crown of a momo, not a generic
   rounded card. Scalloped edges appear only on things that hold content,
   the way a pleat only appears where a wrapper is closed.               */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Instrument+Sans:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --chilli:  #E23028;
  --chilli-d:#B31D17;
  --mustard: #FFC233;
  --steam:   #FFF6EC;
  --paper:   #FFFFFF;
  --char:    #1C1512;
  --muted:   #7C6A60;
  --chutney: #1E7A4C;
  --maroon:  #6E1911;
  --line:    #EADCCE;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Instrument Sans', system-ui, sans-serif;
  --data:    'Space Grotesk', ui-monospace, monospace;

  --pleat: 9px;
  --r: 4px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--steam);
  color: var(--char);
  font: 400 16px/1.55 var(--body);
  text-rendering: optimizeLegibility;
}

a { color: var(--chilli-d); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------ pleat device */
/* A scalloped edge cut from the element itself. Used on the header base and
   on card tops, so content literally sits inside a crimped wrapper.        */

.pleat-b, .pleat-t { position: relative; }

.pleat-b::after, .pleat-t::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: var(--pleat);
  background-image: radial-gradient(circle at var(--pleat) 0,
                    transparent calc(var(--pleat) - 1px), var(--steam) var(--pleat));
  background-size: calc(var(--pleat) * 2) var(--pleat);
  background-repeat: repeat-x;
}
.pleat-b::after { bottom: -1px; }
.pleat-t::before {
  top: 0;
  transform: scaleY(-1);
  background-image: radial-gradient(circle at var(--pleat) 0,
                    transparent calc(var(--pleat) - 1px), var(--paper) var(--pleat));
}

/* ------------------------------------------------------------ header */

.masthead {
  background: var(--chilli);
  color: #fff;
  padding: 14px 0 22px;
}
.masthead a { color: #fff; text-decoration: none; }

.logo {
  font: 800 clamp(26px, 7vw, 34px)/1 var(--display);
  font-variation-settings: 'opsz' 40;
  letter-spacing: -0.02em;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.logo .dot { color: var(--mustard); }

.tag {
  font: 500 13px/1.4 var(--body);
  opacity: .92;
  margin: 4px 0 0;
}

.nav { display: flex; gap: 16px; margin-top: 10px; font: 600 14px var(--body); }
.nav a { border-bottom: 2px solid rgba(255,255,255,.35); padding-bottom: 1px; }
.nav a:hover { border-color: var(--mustard); }

/* ------------------------------------------------------------ headings */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
}
h1 { font-size: clamp(28px, 7vw, 42px); font-variation-settings: 'opsz' 48; }
h2 { font-size: clamp(20px, 5vw, 26px); }
h3 { font-size: 17px; font-weight: 700; }

.eyebrow {
  font: 700 11px/1 var(--data);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--maroon);
  display: block;
  margin-bottom: 6px;
}

/* ------------------------------------------------------------ map */

#map {
  height: 62vh;
  min-height: 320px;
  width: 100%;
  background: #E8DFD4;
  z-index: 0;
}
.map-shell { position: relative; }

.map-actions {
  position: absolute; z-index: 500;
  left: 12px; right: 12px; bottom: 34px;   /* clears Leaflet's attribution bar */
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Leaflet's own chrome, toned down to match the rest of the page */
.leaflet-control-attribution {
  font: 400 10px var(--body) !important;
  background: rgba(255,255,255,.82) !important;
  color: var(--muted) !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a {
  color: var(--char) !important;
  border-bottom-color: var(--line) !important;
}

/* A city page is a list with a map on it, not a map with a list underneath.
   Half height keeps the first listings above the fold on a phone. */
.map-shell.compact #map { height: 38vh; min-height: 240px; }

/* ------------------------------------------------------------ how it works */
.howto {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px; margin: 16px 0 4px;
}
.howto div {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 15px;
}
.howto b {
  display: block; font: 700 11px/1 var(--data);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--chilli-d); margin-bottom: 6px;
}
.howto p { margin: 0; font-size: 14px; line-height: 1.45; }

/* ------------------------------------------------------------ buttons */

.btn {
  font: 700 15px var(--body);
  border: 0; border-radius: var(--r);
  padding: 12px 16px;
  background: var(--char); color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn-primary { background: var(--chilli); }
.btn-mustard { background: var(--mustard); color: var(--char); }
.btn-ghost { background: var(--paper); color: var(--char); border: 1.5px solid var(--line); box-shadow: none; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------ add button */
/* Fixed rather than in the flow: on a map-led page the thing people need is
   "put my cart on this", and it should be reachable without hunting. */
.fab {
  position: fixed; z-index: 900;
  right: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--chilli); color: #fff;
  font: 700 15px var(--body);
  padding: 13px 19px 13px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(110, 25, 17, .34);
}
.fab svg { width: 21px; height: 21px; display: block; }
.fab:hover, .fab:focus-visible { background: var(--chilli-d); color: #fff; }
.fab:active { transform: translateY(1px); }

/* OpenStreetMap attribution is a licence condition, so it must never end up
   underneath the button. Leaflet right-aligns it, so reserve the space. */
.map-shell .leaflet-control-attribution { margin-right: 150px !important; }

@media (max-width: 420px) {
  .fab { font-size: 14px; padding: 12px 16px 12px 14px; right: 12px; bottom: 12px; }
  .map-shell .leaflet-control-attribution { margin-right: 132px !important; }
}

/* ------------------------------------------------------------ cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin: 0 0 12px;
}

.list { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }

.rank {
  font: 700 15px var(--data);
  color: var(--muted);
  padding-top: 2px;
}
.row-name { font: 600 16px var(--body); margin: 0; }
.row-name a { color: var(--char); text-decoration: none; }
.row-name a:hover { text-decoration: underline; }
.row-meta { font-size: 13px; color: var(--muted); margin: 2px 0 0; }

/* ------------------------------------------------------------ momo rating */
/* Signature element. Five momos, filled left to right, fractional fill on the
   last one. Reads instantly, and it is the site's own unit rather than a
   borrowed star.                                                          */

.momos { display: inline-flex; gap: 2px; vertical-align: -3px; }
.momos svg { display: block; }

/* Fill rules are global, not scoped to .momos - the rating picker uses the
   same glyph outside that container, and scoping them left it solid black. */
.shell { fill: #EFE2D6; }
.fill  { fill: var(--mustard); }
.pleat-line, .knob {
  fill: none; stroke: var(--maroon); stroke-width: 1.1;
  stroke-linecap: round; opacity: .4;
}

.score {
  font: 700 15px var(--data);
  color: var(--char);
}
.score .of { color: var(--muted); font-weight: 500; }
.count { font: 500 13px var(--data); color: var(--muted); }

.veg-dot, .nonveg-dot {
  display: inline-block; width: 11px; height: 11px;
  border: 1.5px solid var(--chutney); border-radius: 2px;
  position: relative; vertical-align: -1px;
}
.nonveg-dot { border-color: var(--chilli-d); }
.veg-dot::after, .nonveg-dot::after {
  content:''; position: absolute; inset: 2px;
  border-radius: 50%; background: var(--chutney);
}
.nonveg-dot::after { background: var(--chilli-d); }

/* Chain marker. Muted on purpose: it explains why an outlet sits lower in the
   list without turning into a badge of shame. */
.chainmark {
  display: inline-block;
  font: 600 10px/1 var(--data);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 7px; margin-left: 6px; vertical-align: 1px;
}

/* ------------------------------------------------------------ frozen state */
/* When a listing is frozen we say so plainly. Hiding it would be worse: the
   reader deserves to know the score is being held, and why.               */

.frozen-note {
  background: repeating-linear-gradient(
    -45deg, #FFF3D6, #FFF3D6 10px, #FFEBBE 10px, #FFEBBE 20px);
  border: 1.5px solid var(--mustard);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}
.frozen-note strong { font-family: var(--display); }

/* ------------------------------------------------------------ histogram */

.hist { display: grid; gap: 5px; margin: 12px 0; }
.hist-row { display: grid; grid-template-columns: 18px 1fr 34px; gap: 8px; align-items: center; font: 500 12px var(--data); }
.hist-bar { height: 9px; background: #F0E5D9; border-radius: 99px; overflow: hidden; }
.hist-bar i { display: block; height: 100%; background: var(--chilli); }

/* ------------------------------------------------------------ chips */

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.chip {
  font: 600 13px var(--body);
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 99px; padding: 6px 12px; color: var(--char);
  text-decoration: none;
}
.chip[aria-pressed="true"], .chip:hover { border-color: var(--chilli); }

/* ------------------------------------------------------------ forms */

label { display: block; font: 600 14px var(--body); margin: 14px 0 5px; }
.hint { font: 400 13px var(--body); color: var(--muted); margin: 4px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
  width: 100%; font: 400 16px var(--body);
  padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--char);
}
textarea { min-height: 96px; resize: vertical; }

/* Rating picker: five momos that fill up to the one you tap, the way a
   steamer fills. One glyph per button, so the row never overflows on a
   narrow phone. */
.starpick { display: flex; gap: 8px; align-items: center; }
.starpick button {
  border: 1.5px solid var(--line); background: var(--paper);
  border-radius: var(--r); padding: 8px; cursor: pointer; line-height: 0;
  transition: border-color .12s ease, background .12s ease;
}
.starpick button.on { border-color: var(--chilli); background: #FFF3E8; }
.starpick button.on .shell { fill: var(--mustard); }
.starpick button:hover { border-color: var(--chilli); }
.starpick .picked {
  font: 700 14px var(--data); color: var(--muted);
  margin-left: 6px; white-space: nowrap;
}

/* ------------------------------------------------------------ story page */
/* The history page runs on a maroon masthead instead of the chilli one, so it
   reads as a different room in the same building. The route device below is a
   dotted line with momo glyphs for stops - the dumpling's migration drawn as
   an actual journey rather than a list of paragraphs. */

.story-hero {
  background: var(--maroon);
  color: #F6E6DC;
  padding: 34px 0 44px;
}
.story-hero .eyebrow { color: var(--mustard); }
.story-hero h1 {
  color: #fff;
  font-size: clamp(32px, 8.5vw, 62px);
  font-variation-settings: 'opsz' 62;
  margin-bottom: 12px;
}
.story-hero .lede {
  font-size: clamp(16px, 2.3vw, 20px);
  line-height: 1.45;
  max-width: 48ch;
  margin: 0;
  opacity: .93;
}

.route { list-style: none; margin: 24px 0 8px; padding: 0; position: relative; }
.route::before {
  content: '';
  position: absolute; left: 15px; top: 10px; bottom: 14px; width: 2px;
  background: repeating-linear-gradient(to bottom,
              var(--line) 0 6px, transparent 6px 13px);
}
.stop { position: relative; padding: 0 0 24px 48px; }
.stop-dot { position: absolute; left: 3px; top: -2px; line-height: 0; }
.stop .when {
  font: 700 11px/1 var(--data);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--chilli-d); display: block; margin-bottom: 5px;
}
.stop h3 { font-size: 19px; margin: 0 0 5px; }
.stop p { margin: 0; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px; margin: 18px 0;
}
.fact {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px;
}
.fact b {
  display: block; font: 700 clamp(19px, 3.2vw, 28px)/1.05 var(--data);
  color: var(--chilli-d); margin-bottom: 6px;
}
.fact span { font-size: 13px; color: var(--muted); }

.kinds {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px; margin: 16px 0;
}
.kind {
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 14px;
}
.kind.hot { border-color: var(--chilli); }
.kind h4 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0; }
.kind .native { font: 500 12px var(--data); color: var(--chutney); }
.kind p { font-size: 13.5px; color: var(--muted); margin: 7px 0 0; }

.pull {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(19px, 3.4vw, 27px); line-height: 1.28;
  color: var(--maroon);
  border-left: 4px solid var(--mustard);
  padding-left: 16px; margin: 26px 0;
}

.sources { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.sources a { color: var(--muted); }

/* ------------------------------------------------------------ footer */

.foot {
  margin-top: 40px; padding: 22px 0 34px;
  background: var(--maroon); color: #F6E6DC;
  font-size: 14px;
}
.foot a { color: var(--mustard); }

/* ------------------------------------------------------------ admin */

.admin body { background: #F4F1EE; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { display: block; font: 700 26px var(--data); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

table.q { width: 100%; border-collapse: collapse; font-size: 14px; }
table.q th { text-align: left; font: 700 11px var(--data); letter-spacing: .1em;
             text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
table.q td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
code.flags { font: 500 12px var(--data); color: var(--maroon); word-break: break-all; }

.inline-form { display: inline; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (min-width: 720px) {
  .split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
}
