/* ============================================================
   Pizzeria Helena — site styles
   Ember (#E86A1E) is the page's only accent and is reserved for
   the call action. On light surfaces the call pill carries a
   1.5px ink stroke (non-text 3:1 contrast boundary).
   ============================================================ */

:root {
  /* color tokens */
  --color-surface-hero: #2B1A10;
  --color-surface-raised-dark: #3D2817;
  --color-surface-light: #F7E8D4;
  --color-surface-light-raised: #FFF9F0;
  --color-text-on-dark: #F7E8D4;
  --color-text-on-dark-secondary: #CBB49A;
  --color-text-on-light: #332214;
  --color-text-on-light-secondary: #6E5B49;
  --color-action-primary: #E86A1E;
  --color-action-primary-hover: #F07E36;
  --color-action-on-primary: #2B1A10;
  --color-focus: #C05A16;

  /* type tokens — system font stacks, no external requests */
  --font-display: Fraunces, 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', 'Helvetica Neue', Arial, system-ui, sans-serif;

  /* mobile-first sizes (desktop overrides at 900px) */
  --fs-display: 40px; --lh-display: 1.05; --ls-display: -0.01em;
  --fs-h2: 28px;      --lh-h2: 1.15;
  --fs-h3: 19px;      --lh-h3: 1.3;
  --fs-dish: 22px;    --lh-dish: 1.2;
  --fs-body: 17px;    --lh-body: 1.6;
  --fs-label: 13px;   --lh-label: 1.4;
  --fs-tel: 26px;     --lh-tel: 1.2;

  /* space tokens (8px base) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --space-9: 96px;

  /* radius tokens — arch geometry */
  --radius-control: 10px;
  --radius-card-top: 28px;
  --radius-card-bottom: 8px;
  --radius-arch: 160px;
  --radius-pill: 999px;
}

@media (min-width: 900px) {
  :root {
    --fs-display: 68px;
    --fs-h2: 40px;
    --fs-h3: 22px;
    --fs-dish: 26px;
    --fs-body: 18px;
    --fs-label: 14px;
    --fs-tel: 32px;
  }
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--color-surface-light);
  color: var(--color-text-on-light);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, ul, ol, figure, address, dl { margin: 0; }

address { font-style: normal; }

ul.plain, ol.plain { list-style: none; padding: 0; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px;
  z-index: 30;
  background: var(--color-surface-light-raised);
  color: var(--color-text-on-light);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-control);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ---------- surfaces ---------- */

.s-dark { background: var(--color-surface-hero); color: var(--color-text-on-dark); }
.s-light { background: var(--color-surface-light); color: var(--color-text-on-light); }

.s-dark a { color: var(--color-text-on-dark); }
.s-light a { color: var(--color-text-on-light); }

/* ember glow — static background plate, bottom-anchored;
   the upper section area stays flat and text-safe */
.glow {
  background-color: var(--color-surface-hero);
  background-image: url('pozadina-zar-svod-640w.jpg');
  background-image: image-set(
    url('pozadina-zar-svod-640w.webp') type('image/webp'),
    url('pozadina-zar-svod-640w.jpg') type('image/jpeg'));
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
}
@media (min-width: 640px) {
  .glow {
    background-image: url('pozadina-zar-svod-1024w.jpg');
    background-image: image-set(
      url('pozadina-zar-svod-1024w.webp') type('image/webp'),
      url('pozadina-zar-svod-1024w.jpg') type('image/jpeg'));
  }
}
@media (min-width: 1024px) {
  .glow {
    background-image: url('pozadina-zar-svod-1920w.jpg');
    background-image: image-set(
      url('pozadina-zar-svod-1920w.webp') type('image/webp'),
      url('pozadina-zar-svod-1920w.jpg') type('image/jpeg'));
  }
}

/* ---------- type roles ---------- */

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

h3 {
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

.eyebrow {
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.s-dark .eyebrow { color: var(--color-text-on-dark-secondary); }
.s-light .eyebrow { color: var(--color-text-on-light-secondary); }

.dish-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-dish);
  line-height: var(--lh-dish);
}

.tel-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-tel);
  line-height: var(--lh-tel);
  letter-spacing: 0.01em;
}
/* ember as text: permitted ONLY on dark surfaces, only for the phone */
.s-dark a.tel-display { color: var(--color-action-primary); text-decoration-thickness: 2px; }

.muted { color: var(--color-text-on-light-secondary); }
.s-dark .muted { color: var(--color-text-on-dark-secondary); }

/* ---------- buttons (pill = the complete arch) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-decoration: none;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--color-action-primary);
  color: var(--color-action-on-primary);
}
.btn-primary:hover,
.btn-primary:active {
  background: var(--color-action-primary-hover);
}
/* mandatory ink boundary when the ember pill sits on a light surface
   (ember vs crust is 2.68:1 — below the 3:1 non-text minimum) */
.s-light .btn-primary { border-color: var(--color-text-on-light); }

/* the pill label keeps its token on every surface — the generic
   `.s-dark a` / `.s-light a` colour rules must never win here */
.s-dark .btn-primary,
.s-light .btn-primary { color: var(--color-action-on-primary); }

.btn-secondary { background: transparent; }
.s-dark .btn-secondary { border-color: var(--color-text-on-dark); color: var(--color-text-on-dark); }
.s-light .btn-secondary { border-color: var(--color-text-on-light); color: var(--color-text-on-light); }

.cta-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: stretch;
}
@media (min-width: 640px) {
  .cta-row { flex-direction: row; align-items: center; justify-content: center; }
}

/* ============================================================
   Header + navigation
   Adapted from 21st.dev component 18258 "Header Navbar" by
   karthikmudunuri (MIT) — https://21st.dev/@karthikmudunuri/components/header-02
   Disclosure structure kept; Headless UI/heroicons/motion replaced by
   vanilla CSS/JS; retokened to the Helena system; a11y hardened
   (dynamic label, Escape + focus return, reduced-motion gating).
   ============================================================ */

.preview-bar {
  background: var(--color-surface-raised-dark);
  color: var(--color-text-on-dark-secondary);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  padding: var(--space-2) var(--space-4);
  text-align: center;
}

.site-header {
  background: var(--color-surface-hero);
  color: var(--color-text-on-dark);
  padding-block: var(--space-4);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  color: var(--color-text-on-dark);
  text-decoration: none;
}

.site-nav { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--color-text-on-dark);
  border-radius: var(--radius-control);
  color: var(--color-text-on-dark);
  cursor: pointer;
}
.nav-toggle svg { display: block; }
.nav-toggle .bar { transform-origin: center; }

.nav-list {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-on-dark);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-control);
}
.nav-list a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-list a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--color-text-on-dark-secondary);
  text-underline-offset: 6px;
}

.header-call { flex-shrink: 0; }

/* mobile: disclosure pattern.
   .site-nav must span the full header row — .nav-list resolves its width
   against it, so a shrink-to-fit nav would collapse the open menu into a
   narrow strip (found in critique; fixed by making the nav a full-width
   wrapping flex row: toggle right-aligned, list on its own full line). */
@media (max-width: 799.98px) {
  .nav-toggle { display: inline-flex; flex-shrink: 0; }

  .site-nav {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-list {
    /* no-JS fallback: list renders open; JS collapses it */
    flex-direction: column;
    gap: 0;
    flex: 1 1 100%;
    width: 100%;
  }
  .js .nav-list { display: none; }
  .js .nav-list.is-open { display: flex; margin-top: var(--space-3); }

  .brand { flex: 1 1 auto; min-width: 0; }
  .site-header .header-row { row-gap: var(--space-3); }

  .nav-list a {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-3);
    border-top: 1px solid var(--color-surface-raised-dark);
  }
}

@media (min-width: 800px) {
  .nav-toggle { display: none !important; }
  .js .nav-list { display: flex; }
}

/* ---------- sections ---------- */

.section { padding-block: var(--space-8); }
@media (min-width: 900px) { .section { padding-block: var(--space-9); } }

.section-head { max-width: 640px; }
.section-head.centered { margin-inline: auto; text-align: center; }

.stack > * + * { margin-top: var(--space-5); }
.stack-tight > * + * { margin-top: var(--space-3); }

.hero { text-align: center; }
.hero .hero-inner > * + * { margin-top: var(--space-5); }
.hero .lead { max-width: 620px; margin-inline: auto; }
.hero h1 { max-width: 800px; margin-inline: auto; }
.hero .cta-row { margin-top: var(--space-6); }

.page-head { text-align: center; }
.page-head .lead { max-width: 640px; margin-inline: auto; margin-top: var(--space-5); }

/* ---------- arch figures ---------- */

.arch-figure { margin-top: var(--space-7); }
.arch-figure img {
  width: 100%;
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-card-bottom) var(--radius-card-bottom);
}
.arch-figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.s-dark .arch-figure figcaption { color: var(--color-text-on-dark-secondary); }
.s-light .arch-figure figcaption { color: var(--color-text-on-light-secondary); }

.arch-figure.small img {
  border-radius: var(--radius-card-top) var(--radius-card-top) var(--radius-card-bottom) var(--radius-card-bottom);
}

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

.dish-grid {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  /* cards size to their content — the image card must not stretch
     text-first cards into tall empty frames (critique P1) */
  align-items: start;
}
@media (min-width: 600px) { .dish-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .dish-grid { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  background: var(--color-surface-light-raised);
  color: var(--color-text-on-light);
  border-radius: var(--radius-card-top) var(--radius-card-top) var(--radius-card-bottom) var(--radius-card-bottom);
  padding: var(--space-5);
  overflow: hidden;
}

.dish-card { display: flex; flex-direction: column; gap: var(--space-3); }
.dish-card .card-figure {
  margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-2);
}
.dish-card .card-figure img { width: 100%; }
.dish-card .dish-note { color: var(--color-text-on-light-secondary); }

/* dark-surface card */
.s-dark .card-dark {
  background: var(--color-surface-raised-dark);
  color: var(--color-text-on-dark);
}

/* ---------- service list ---------- */

.service-grid {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .service-grid { grid-template-columns: 1fr 1fr 1fr; } }
.service-grid p { color: var(--color-text-on-light-secondary); margin-top: var(--space-2); }

/* ---------- links ---------- */

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---------- visit block ---------- */

.visit-card {
  text-align: center;
  padding: var(--space-7) var(--space-5);
}
.visit-card .cta-row { margin-top: var(--space-6); }
.visit-card address { margin-top: var(--space-4); }

/* ---------- FAQ ---------- */

.faq { margin-top: var(--space-6); display: grid; gap: var(--space-5); }
.faq > div { border-top: 1px solid var(--color-text-on-light-secondary); padding-top: var(--space-5); }
.faq h3 { margin-bottom: var(--space-2); }

/* ---------- credits page ---------- */

.credits-list { margin: var(--space-5) 0 0; padding-left: 1.2em; }
.credits-list li + li { margin-top: var(--space-3); }

.pexels-callout {
  margin-top: var(--space-5);
  padding: var(--space-5);
  font-weight: 600;
}

/* ---------- footer (inverted vault: arch shoulders close the page) ---------- */

.site-footer {
  position: relative;
  background: var(--color-surface-hero);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-card-top) var(--radius-card-top) 0 0;
  padding-block: var(--space-8) var(--space-7);
  margin-top: calc(-1 * var(--radius-card-top));
  text-align: center;
}
.site-footer .wrap > * + * { margin-top: var(--space-4); }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
}
.site-footer a { color: var(--color-text-on-dark); }
.stock-note {
  max-width: 640px;
  margin-inline: auto;
  font-size: 15px;
  color: var(--color-text-on-dark-secondary);
  margin-top: var(--space-6);
}
.stock-note a { color: var(--color-text-on-dark-secondary); }

/* light section directly above the footer provides the crust the
   footer arch cuts into */
.pre-footer { padding-bottom: calc(var(--space-8) + var(--radius-card-top)); }

/* ---------- two-column media sections ---------- */

.media-split { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) {
  .media-split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .media-split .arch-figure { margin-top: 0; }
}

/* touch devices: text links (footer, tel, external) get a >=44px hit area
   via padding + negative margin, so visual rhythm is unchanged */
@media (pointer: coarse) {
  .site-footer a,
  main a[href^="tel:"],
  main a[href^="https://"] {
    display: inline-block;
    padding-block: 0.75em;
    margin-block: -0.75em;
  }
}

/* ---------- toggle end-state (always applies; only the motion is gated) ---------- */

.nav-toggle[aria-expanded="true"] .bar-top { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-bottom { transform: translateY(-5px) rotate(-45deg); }

/* ---------- motion (entirely gated) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 160ms ease, border-color 160ms ease; }
  .nav-toggle .bar { transition: transform 200ms ease, opacity 200ms ease; }

  @keyframes nav-item-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .js .nav-list.is-open > li { animation: nav-item-in 220ms ease both; }
  .js .nav-list.is-open > li:nth-child(2) { animation-delay: 40ms; }
  .js .nav-list.is-open > li:nth-child(3) { animation-delay: 80ms; }
  .js .nav-list.is-open > li:nth-child(4) { animation-delay: 120ms; }
}
