/* ==========================================================================
   components.css — rows, buttons, fields, chips, skeletons, states.
   Depth is paper, ink and hairline. No drop shadows faking elevation.
   ========================================================================== */

/* ---- rows: the workhorse ------------------------------------------------- */

.row-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  text-align: left;
  padding: var(--s-4) var(--gutter);
  border-bottom: 1px solid var(--hairline);
  min-height: var(--tap);
  background-image: none;
  color: inherit;
}

.row-item:first-of-type { border-top: 1px solid var(--hairline); }

.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-ord { display: block; }
.row-label { font-size: var(--t-body); }
.row-note { display: block; }
.row-trail { flex-shrink: 0; white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  a.row-item:hover, button.row-item:hover { background: var(--wash); }
}

/* The Home category index. Editorial, not a launcher. */
.index-row {
  align-items: flex-start;
  padding-block: var(--s-5);
}

.index-row .row-ord { margin-bottom: var(--s-2); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap-primary);
  padding: var(--s-3) var(--s-5);
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
  font-weight: var(--w-bold);
  background-image: none;
  border-radius: var(--radius);
  text-align: center;
}

/* Hairline rectangle, transparent fill. Never a pill, never a gradient. */
.btn-line {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
}

/* The single bottom-anchored primary action. One per screen. */
.btn-fill {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn-full { width: 100%; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
  .btn-line:hover { background: var(--wash); }
}

/* A standalone text action is still a tap target: 48px like everything else.
   An inline link inside running prose is exempt (WCAG 2.5.8) and stays inline
   so it does not blow the line-height apart. */
/* A painted background-underline cannot follow a line break — on a wrapped
   label it lands across the second line and reads as a strikethrough. Real
   text-decoration wraps correctly, so standalone text actions use that. */
.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  background-image: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--ink);
  padding: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .link-btn { transition: text-decoration-color var(--d-state) var(--ease-inout); }
}

@media (hover: hover) and (pointer: fine) {
  .link-btn:hover { text-decoration-color: var(--accent); }
}

p .link-btn,
.note .link-btn,
.menu-gloss .link-btn {
  display: inline;
  min-height: 0;
  background-position: 0 100%;
}

/* ---- fields -------------------------------------------------------------- */

.field { display: block; margin-bottom: var(--s-4); }
.field > .t-label { display: block; margin-bottom: var(--s-2); }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-3);
  border: 1px solid var(--hairline);
  background: var(--paper);
  font-size: var(--t-body);
}

.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--accent);
}

.field-error { border-color: var(--ink-alarm) !important; }
.field-msg { display: block; margin-top: var(--s-2); font-size: var(--t-small); color: var(--ink-muted); }
.field-msg.is-error { color: var(--ink-alarm); }

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

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--hairline);
  font-size: var(--t-small);
  background: transparent;
  border-radius: var(--radius);
}

.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip-remove { font-size: var(--t-label); }

/* Horizontal category strip, capped at six visible. */
.strip {
  display: flex;
  gap: var(--s-4);
  overflow-x: auto;
  padding: var(--s-3) var(--gutter);
  scrollbar-width: none;
  border-bottom: 1px solid var(--hairline);
}
.strip::-webkit-scrollbar { display: none; }
.strip a { white-space: nowrap; font-size: var(--t-label); text-transform: uppercase; letter-spacing: var(--tr-label); }
.strip a[aria-current] { background-size: 100% 1px; }

/* ---- menu list ----------------------------------------------------------- */
/* Semantic ul/li. No dot leaders, no right-aligned price column. */

.menu-list { border-top: 1px solid var(--hairline); }

.menu-item {
  padding: var(--s-4) var(--gutter);
  border-bottom: 1px solid var(--hairline);
  display: block;
  width: 100%;
  text-align: left;
  background-image: none;
}

.menu-item-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

.menu-name { font-size: var(--t-body); }

/* Price last, same weight as body text. */
.menu-item .price {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: var(--w-regular);
  flex-shrink: 0;
}

.menu-gloss {
  display: block;
  color: var(--ink-muted);
  font-size: var(--t-small);
  margin-top: 2px;
  max-width: 46ch;
}

.menu-flags { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.menu-flag { font-size: var(--t-label); letter-spacing: var(--tr-label); color: var(--ink-muted); }
.menu-item[data-out="true"] { opacity: 0.45; }
.menu-item[data-out="true"] .menu-name { text-decoration: line-through; }

/* One accent element per viewport — the section marker earns it. */
.section-head {
  padding: var(--s-6) var(--gutter) var(--s-3);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.section-head::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---- states -------------------------------------------------------------- */

.state { padding: var(--s-7) var(--gutter); }
.state p { color: var(--ink-muted); margin-bottom: var(--s-5); }
.state-error p { color: var(--ink); }
.preserved { border-left: 2px solid var(--hairline); padding-left: var(--s-4); margin-bottom: var(--s-5); }
.partial-note { padding: var(--s-4) var(--gutter); color: var(--ink-muted); font-size: var(--t-small); }

/* ---- skeletons ----------------------------------------------------------- */
/* Shaped like the content that is coming. Never a spinner. */

.skeleton { padding-block: var(--s-2); }
.sk-row { padding: var(--s-4) var(--gutter); border-bottom: 1px solid var(--hairline); }
.sk-card { padding: var(--s-4) var(--gutter); }

.sk-line, .sk-plate {
  display: block;
  height: 0.72em;
  margin-bottom: var(--s-2);
  background: var(--hairline);
}

.sk-strong { height: 0.95em; }
.sk-title { height: 1.6em; margin-bottom: var(--s-4); }
.sk-price { height: 0.72em; }
.sk-plate { aspect-ratio: 3 / 2; height: auto; margin-bottom: var(--s-3); }

@media (prefers-reduced-motion: no-preference) {
  .sk-line, .sk-plate { animation: sk-pulse 1.6s var(--ease-inout) infinite; }
  @keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
}

/* ---- misc ---------------------------------------------------------------- */

.heading { padding: var(--s-6) var(--gutter) var(--s-3); }
.note { padding: var(--s-4) var(--gutter); color: var(--ink-muted); font-size: var(--t-small); }
.prose { padding-inline: var(--gutter); }
.prose p + p { margin-top: var(--s-4); }
.prose p { max-width: var(--measure); }

.pill-count {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
}

.badge {
  display: inline-block;
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px var(--s-2);
}
