/* Cucina — base: reset, type, controls, browser surfaces. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-variation-settings: 'wdth' var(--wdth-text);
  font-size: var(--t-md);
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--ink);
  accent-color: var(--ink);
}
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; font-variation-settings: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* Scrollbars in the palette */
* { scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--ash); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- type ---- */
.display {
  font-variation-settings: 'wdth' var(--wdth-display);
  font-weight: 800;
  font-size: var(--t-poster);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display-md { font-size: var(--t-3xl); line-height: 0.95; }
.display-sm { font-size: var(--t-2xl); line-height: 1; }
.label {
  display: block;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.lede { font-size: var(--t-lg); line-height: 1.4; max-width: 34ch; }
.num { font-variant-numeric: tabular-nums; }

/* ---- layout ---- */
.topbar {
  height: var(--topbar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--margin);
  border-bottom: var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 20;
}
.wordmark {
  font-variation-settings: 'wdth' 62;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.wordmark:hover { text-decoration: none; }
.topbar-nav { display: flex; gap: var(--gutter); }
.topbar-nav a {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.topbar-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.topbar-nav a:hover { text-decoration: none; color: var(--ink); }
.topbar-meta { justify-self: end; font-size: var(--t-xs); color: var(--ink-2); letter-spacing: 0.04em; }
@media (max-width: 899px) { .topbar-meta { display: none; } .topbar { grid-template-columns: auto 1fr; } .topbar-nav { justify-self: end; } }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--u) * 4) var(--margin);
  border-top: var(--rule);
  font-size: var(--t-xs);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); }

.view { min-height: calc(100vh - var(--topbar)); }
.view-errore { padding: calc(var(--u) * 8) var(--margin); }
.view-errore a { text-decoration: underline; text-underline-offset: 0.18em; }

/* ---- controls ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 0 24px;
  height: 56px;
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--dur) var(--ease), transform 120ms var(--ease);
}
.btn-primary:hover { background: #111; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { background: var(--ash); color: #585858; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border: var(--rule-ink);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* Swiss select: native picker, drawn chevron */
select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232e2e2e' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0 center;
  border: 0;
  border-bottom: var(--rule-ink);
  padding: 8px 20px 8px 0;
  font-size: var(--t-sm);
  font-weight: 600;
  min-width: 120px;
  border-radius: 0;
}
select:focus-visible { outline-offset: 4px; }

/* Seg control */
.seg { display: inline-flex; border: var(--rule-ink); }
.seg button {
  height: 36px;
  min-width: 48px;
  padding: 0 12px;
  font-size: var(--t-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-right: var(--rule-ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Photo placeholder: typographic, until the real plate arrives */
.foto {
  position: relative;
  background: var(--mist);
  overflow: hidden;
}
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 6%;
  font-variation-settings: 'wdth' 62;
  font-weight: 900;
  font-size: clamp(28px, 6cqw, 96px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ash);
  text-transform: uppercase;
  overflow: hidden;
}
.foto.has-img .foto-ph { display: none; }

/* Unico accento cromatico del sito: piatti tipici di Bragança/Portogallo. */
.badge-pt {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  padding: 3px 7px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #046a38 0 40%, #da291c 40% 100%);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
