/* =========================================================
   Singapore Asian Fusion — stylesheet
   Palette grounded in Chinese lacquerware: rice-paper cream,
   ink black, lacquer red, brushed brass. One serif (Fraunces)
   carries the voice of the brand; Lato (already used across
   the site) carries the UI and body copy.
   ========================================================= */

:root {
  --paper:      #F6F1E4;
  --paper-deep: #ECE3CC;
  --ink:        #1C1A16;
  --ink-soft:   #4A4335;
  --red:        #A3252A;
  --red-deep:   #7C1C20;
  --gold:       #B4893F;
  --jade:       #3F6B4A;
  --line:       rgba(28, 26, 22, 0.14);
  --shadow:     0 10px 24px rgba(28, 26, 22, 0.10);

  --font-display: 'Fraunces', 'Lato', serif;
  --font-body: 'Lato', -apple-system, sans-serif;

  --header-h: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- header ---------------- */
.header-logo {
  height: 50px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(246, 241, 228, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-seal { width: 44px; height: 44px; flex-shrink: 0; }

.brand-name {
  font-family: var(--font-display);
  line-height: 1.05;
}

.brand-name strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 600;
}

.brand-name span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 4px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn .flag { font-size: 1rem; }

.lang-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.mode-switch {
  display: inline-flex;
  gap: 4px;
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 4px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn:hover { color: var(--ink); }

.mode-btn.is-active {
  background: var(--red);
  color: var(--paper);
}

/* in the hero the switch is shown only on small screens (on desktop it lives in the header) */
.hero .mode-switch {
  display: none;
  background: rgba(246, 241, 228, 0.16);
}

.hero .mode-btn { color: rgba(246, 241, 228, 0.85); }

.hero .mode-btn.is-active {
  background: var(--paper);
  color: var(--ink);
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  background: url("../images/hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  ;
  color: var(--paper);
  overflow: hidden;
  padding: 56px 28px 64px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.hero-seal {
  position: absolute;
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.15;
  margin: 0;
  max-width: 16ch;
}

.hero p {
  margin: 0;
  max-width: 46ch;
  color: rgba(246, 241, 228, 0.82);
  font-size: 1.05rem;
}

/* ---------------- menu layout ---------------- */

.menu-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.menu-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.menu-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.menu-sidebar h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.menu-sidebar-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.category-list {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-btn:hover { background: var(--paper-deep); }

.category-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.category-btn-icon { font-size: 1.05rem; }

.category-btn-label { flex: 1; }

.category-btn-count {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.65;
}

.allergen-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--paper-deep);
}

.allergen-box h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.allergen-box p {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------------- dish grid ---------------- */

.menu-content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 8px;
}

#category-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin: 0;
}

#category-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

#category-note {
  margin: 10px 0 20px;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  transition: opacity 0.15s ease;
}

.dish-grid.is-fading { opacity: 0; }

/* subcategory title inside a category (e.g. "Piatti freddi", "Poke") */
.dish-subhead {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 -4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--red);
}

.dish-subhead:first-child { margin-top: 4px; }

.dish-subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* drinks: compact list without photos */
.dish-grid.is-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

.dish-card--plain { box-shadow: none; }

.dish-card--plain .dish-body { padding: 12px 16px; }

.dish-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dish-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper-deep);
}

.dish-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-photo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gold);
  background: linear-gradient(160deg, var(--paper-deep), var(--paper));
}

.dish-photo-fallback svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.dish-photo-fallback span { font-size: 0.72rem; color: var(--ink-soft); font-weight: 600; }

.dish-photo.is-placeholder img { display: none; }

.dish-photo.is-placeholder .dish-photo-fallback { display: flex; }

.dish-number {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.dish-body { padding: 14px 16px 16px; }

.dish-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.dish-heading h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.dish-portion {
  display: block;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.dish-price {
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  font-size: 0.95rem;
}

.dish-desc {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.dish-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--paper-deep);
}

.tag-veggie { background: rgba(63, 107, 74, 0.12); }

.tag-spicy { background: rgba(163, 37, 42, 0.12); }

/* ---------------- menu fisso page ---------------- */

.fisso-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.fisso-intro h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.fisso-intro p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.fisso-choose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.fisso-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.fisso-card:hover { transform: translateY(-2px); border-color: var(--ink); }

.fisso-card.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* photo mosaic: collapses to 0 height once a menu is selected */
.fisso-card-photos {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.45s ease;
}

.fisso-card-photos-inner { min-height: 0; overflow: hidden; }

.fisso-mosaic {
  height: clamp(240px, 30vw, 360px);
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: var(--paper-deep);
}

.fisso-photo {
  display: block;
  overflow: hidden;
  background: linear-gradient(160deg, var(--paper-deep), var(--paper));
}

.fisso-photo:first-child { grid-row: 1 / span 2; }

.fisso-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fisso-card-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  transition: padding 0.4s ease;
}

.fisso-card-icon { font-size: 2.4rem; line-height: 1; transition: font-size 0.4s ease; }

.fisso-card-body { flex: 1; min-width: 0; }

.fisso-card-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  transition: font-size 0.4s ease;
}

.fisso-card-rule {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  opacity: 0.75;
  transition: font-size 0.4s ease;
}

.fisso-card-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
  transition: font-size 0.4s ease;
}

.fisso-card.is-active .fisso-card-price { color: var(--gold); }

.fisso-select {
  flex: 1 1 100%;
  padding: 13px 20px;
  border: 1.5px solid var(--red);
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fisso-select:hover { background: var(--red-deep); border-color: var(--red-deep); }

.fisso-card.is-active .fisso-select {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.fisso-choose.is-compact .fisso-select {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 0.82rem;
}

/* compact state (after a menu has been chosen) */
.fisso-choose.is-compact { gap: 14px; }

.fisso-choose.is-compact .fisso-card-photos { grid-template-rows: 0fr; }

.fisso-choose.is-compact .fisso-card-main { padding: 14px 20px; gap: 14px; }

.fisso-choose.is-compact .fisso-card-icon { font-size: 1.7rem; }

.fisso-choose.is-compact .fisso-card-name { font-size: 1.15rem; }

.fisso-choose.is-compact .fisso-card-rule { font-size: 0.82rem; margin-top: 2px; }

.fisso-choose.is-compact .fisso-card-price { font-size: 1.2rem; }

.fisso-choose { gap: 24px; transition: gap 0.4s ease; scroll-margin-top: calc(var(--header-h) + 16px); }

.fisso-content { margin-top: 44px; scroll-margin-top: calc(var(--header-h) + 16px); }

.fisso-content[hidden] { display: none; }

.fisso-legend { max-width: 420px; margin-top: 48px; }

/* ---------------- footer ---------------- */

.site-footer {
  background: var(--ink);
  color: rgba(246, 241, 228, 0.86);
  padding: 56px 28px 28px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(246, 241, 228, 0.16);
}

.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.footer-brand .brand-seal { width: 38px; height: 38px; }

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--paper);
}

.footer-col h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 12px;
}

.footer-col p, .footer-col a {
  margin: 0 0 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
  display: block;
}

.footer-col a:hover { color: var(--paper); }

.social-row { display: flex; gap: 10px; margin-top: 4px; }

.social-row a {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(246, 241, 228, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-row svg { width: 16px; height: 16px; fill: currentColor; }

.social-row a:hover { background: var(--red); border-color: var(--red); }

.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(246, 241, 228, 0.55);
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .header-inner { padding: 0 18px; gap: 12px; }
  .brand-name strong { font-size: 1.05rem; }
  .header-actions .mode-switch { display: none; }
  .hero .mode-switch { display: inline-flex; }
  .hero { padding: 40px 18px 48px; }
  .menu-section { padding: 32px 18px 64px; }
  .fisso-section { padding: 32px 18px 64px; }

  .menu-layout {
    grid-template-columns: 1fr;
  }

  .menu-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  .category-list {
    grid-column: 1 / -1;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 18px;
  }

  .category-btn { flex-shrink: 0; }
  .category-btn-count { display: none; }

  .allergen-box { grid-column: 1 / -1; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .header-actions { gap: 10px; }
  .lang-btn .code { display: none; }
  .dish-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .fisso-choose { grid-template-columns: 1fr; }
  .fisso-mosaic { height: 200px; }
  .fisso-card-main { padding: 18px; gap: 14px; }
  .fisso-card-icon { font-size: 1.8rem; }
  .fisso-card-name { font-size: 1.3rem; }
  .fisso-card-rule { font-size: 0.9rem; }
  .fisso-card-price { font-size: 1.4rem; }
  .fisso-choose.is-compact .fisso-card-main { padding: 12px 16px; }
  .fisso-choose.is-compact .fisso-card-name { font-size: 1.05rem; }
  .fisso-choose.is-compact .fisso-card-price { font-size: 1.1rem; }
  .fisso-choose.is-compact .fisso-select { flex: 1 1 100%; }
}