/* ============================================================
   LE MONTORGUEIL — La carte (menu digital multilingue)
   Réutilise la charte du site vitrine :
   crème #f4ead4 · rouge #a32920 · encre #2a211c
   DM Mono (texte) + Cormorant Garamond (titres) + Noto Sans (CJK)
   ============================================================ */

:root {
  --paper:      #f4ead4;
  --paper-deep: #ecdcb8;
  --card:       #f9f1de;
  --red:        #a32920;
  --red-deep:   #7d1c15;
  --ink:        #2a211c;
  --ink-dim:    rgba(42, 33, 28, 0.62);
  --ink-faint:  rgba(42, 33, 28, 0.34);
  --line:       rgba(163, 41, 32, 0.22);

  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-serif:"Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-cjk:  "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;

  --maxw: 760px;
  --pad:  clamp(1.1rem, 4vw, 2rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  background: var(--paper);
  background-image: radial-gradient(135% 80% at 50% 0%, #f8efda 0%, var(--paper) 42%, var(--paper-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* langue CJK : bascule sur la pile Noto */
body[data-lang="ja"], body[data-lang="ko"], body[data-lang="zh"] {
  --font-mono: var(--font-cjk);
}
body[data-lang="ja"] .item__name,
body[data-lang="ko"] .item__name,
body[data-lang="zh"] .item__name { letter-spacing: 0; }

/* ---------- Grain + cadre ---------- */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.frame {
  position: fixed; inset: clamp(0.6rem, 1.4vw, 1.2rem); z-index: 5; pointer-events: none;
  border: 1px solid rgba(163, 41, 32, 0.34);
  outline: 1px solid rgba(163, 41, 32, 0.14); outline-offset: 4px;
}
.tick { position: absolute; width: 9px; height: 9px; border: 1px solid var(--red); opacity: 0.8; }
.tick--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.tick--tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.tick--bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.tick--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ===================== EN-TÊTE ===================== */
.masthead {
  position: relative; z-index: 10;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 2.6rem) var(--pad) 0.6rem;
  text-align: center;
}
.masthead__tag {
  font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--red); font-weight: 500;
}
.wordmark { line-height: 0; margin: 0.7rem auto 0.5rem; width: clamp(210px, 60vw, 330px); }
.wordmark img { width: 100%; height: auto; display: block; }
.masthead__fresh {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.05rem, 3.6vw, 1.35rem); color: var(--ink-dim);
}

/* ---------- Sélecteur de langue ---------- */
.langbar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem;
  margin-top: clamp(1rem, 3vw, 1.4rem);
}
.lang {
  font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.08em;
  padding: 0.42rem 0.78rem; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--ink-dim);
  cursor: pointer; white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lang:hover { border-color: var(--red); color: var(--red); }
.lang.is-active { background: var(--red); color: var(--paper); border-color: var(--red); }

/* ===================== ONGLETS CARTE/BOISSONS ===================== */
.modebar {
  position: relative; z-index: 10;
  display: flex; justify-content: center; gap: 0.35rem;
  max-width: var(--maxw); margin: clamp(1.2rem, 4vw, 1.8rem) auto 0;
  padding: 0 var(--pad);
}
.modebar__btn {
  flex: 1; max-width: 220px;
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(1rem, 4vw, 1.5rem);
  white-space: nowrap;
  padding: 0.5rem 0.4rem 0.6rem; background: transparent; cursor: pointer;
  color: var(--ink-faint); border: 0; border-bottom: 2px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.modebar__btn.is-active { color: var(--red); border-bottom-color: var(--red); }

/* ===================== NAV CATÉGORIES ===================== */
.catnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.7rem var(--pad);
  margin-top: 0.8rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  scroll-padding: var(--pad);
}
.catnav::-webkit-scrollbar { display: none; }
.cat {
  font-family: var(--font-mono);
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap; padding: 0.4rem 0.72rem; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--ink-dim);
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cat:hover { border-color: var(--red); color: var(--red); }
.cat.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
body[data-lang="ja"] .cat, body[data-lang="ko"] .cat, body[data-lang="zh"] .cat {
  letter-spacing: 0.04em; text-transform: none;
}

/* ===================== CONTENU ===================== */
.menu {
  position: relative; z-index: 10;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(1.4rem, 5vw, 2.4rem) var(--pad) 1rem;
}

.section { margin-bottom: clamp(2.4rem, 7vw, 3.6rem); scroll-margin-top: 64px; }

.section__head {
  display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 1.1rem;
}
.section__head::before,
.section__head::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}
.section__head::after { background: linear-gradient(90deg, var(--line), transparent); }
.section__title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 2.05rem); color: var(--red);
  letter-spacing: 0.01em; text-align: center; white-space: nowrap;
}

.section__note {
  text-align: center; font-size: 0.72rem; color: var(--ink-dim);
  font-style: normal; margin: -0.3rem 0 1.1rem; line-height: 1.5;
}
.section__sub {
  text-align: center; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red); margin: -0.6rem 0 1rem; opacity: 0.85;
}

/* ---------- Item ---------- */
.item { padding: 0.55rem 0; border-bottom: 1px dotted var(--line); }
.item:last-child { border-bottom: 0; }
.item__row {
  display: flex; align-items: baseline; gap: 0.5rem;
}
.item__name {
  font-weight: 500; font-size: 0.92rem; color: var(--ink);
  letter-spacing: 0.005em; line-height: 1.35;
}
.item__lead {
  flex: 1; border-bottom: 1px dotted var(--ink-faint);
  transform: translateY(-3px); min-width: 12px;
}
.item__price {
  font-weight: 500; font-size: 0.92rem; color: var(--red);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.item__desc {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(0.95rem, 3.4vw, 1.05rem); line-height: 1.4;
  color: var(--ink-dim); margin-top: 0.18rem; max-width: 56ch;
}
body[data-lang="ja"] .item__desc,
body[data-lang="ko"] .item__desc,
body[data-lang="zh"] .item__desc {
  font-family: var(--font-cjk); font-style: normal; font-size: 0.82rem;
}

/* ---------- Vins / multi-prix ---------- */
.winegroup { margin-bottom: 1.6rem; }
.winegroup__name {
  font-family: var(--font-serif); font-style: italic; font-weight: 600;
  font-size: 1.25rem; color: var(--ink); margin-bottom: 0.4rem;
}
.wine-cols {
  display: grid; grid-template-columns: 1fr repeat(4, minmax(38px, auto));
  gap: 0.2rem 0.6rem; align-items: baseline;
  font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); padding-bottom: 0.4rem; margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}
.wine-cols span:not(:first-child) { text-align: right; }
.wine {
  display: grid; grid-template-columns: 1fr repeat(4, minmax(38px, auto));
  gap: 0.2rem 0.6rem; align-items: baseline;
  padding: 0.4rem 0; border-bottom: 1px dotted var(--line);
}
.wine:last-child { border-bottom: 0; }
.wine__name { font-size: 0.82rem; line-height: 1.3; }
.wine__p {
  text-align: right; font-size: 0.82rem; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.wine__p:empty::before { content: "·"; color: var(--ink-faint); }

/* ---------- Bières (2 formats) ---------- */
.beer-cols {
  display: grid; grid-template-columns: 1fr 56px 56px;
  gap: 0.5rem; font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); margin-bottom: 0.2rem;
}
.beer-cols span:not(:first-child) { text-align: right; }
.beer2 {
  display: grid; grid-template-columns: 1fr 56px 56px; gap: 0.5rem;
  align-items: baseline; padding: 0.45rem 0; border-bottom: 1px dotted var(--line);
}
.beer2__name { font-size: 0.88rem; }
.beer2__p { text-align: right; font-size: 0.88rem; color: var(--red); font-variant-numeric: tabular-nums; }

/* ===================== PIED ===================== */
.pagefoot {
  position: relative; z-index: 10; text-align: center;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.6rem var(--pad) 2.4rem; border-top: 1px solid var(--line);
}
.pagefoot__note {
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}
.pagefoot__meta { margin-top: 0.7rem; font-size: 0.74rem; }
.pagefoot__meta a { color: var(--ink); text-decoration: none; }
.pagefoot__meta a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.pagefoot__sep { color: var(--ink-faint); margin: 0 0.4rem; }

/* ---------- Bouton retour haut ---------- */
.totop {
  position: fixed; right: clamp(0.9rem, 3vw, 1.6rem); bottom: clamp(0.9rem, 3vw, 1.6rem);
  z-index: 40; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--red); background: var(--paper); color: var(--red);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
  box-shadow: 4px 4px 0 rgba(125,28,21,0.18);
  transition: background 0.25s, color 0.25s, transform 0.2s;
}
.totop:hover { background: var(--red); color: var(--paper); transform: translateY(-2px); }

/* ===================== ANIM ===================== */
.section { animation: fade 0.5s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .section { animation: none; } }

@media (min-width: 560px) {
  .item__name, .item__price { font-size: 0.98rem; }
}
