/* Copains d'Abord — identité chaleureuse, rock, conviviale. Palette unique et assumée
   (ambiance bar en soirée), pas de bascule clair/sombre : un site vitrine de lieu physique
   gagne à avoir une seule identité forte plutôt qu'à s'adapter au thème du visiteur. */

:root {
  --bg: #17130f;
  --bg-raised: #1f1a14;
  --bg-card: #241e17;
  --ink: #f3ece0;
  --muted: #b8ab97;
  --faint: #8a7d6a;
  --border: #362d22;
  --accent: #e08a2c;
  --accent-ink: #17130f;
  --accent-deep: #a8571f;
  --accent-rgb: 224, 138, 44;
  --focus: #f4c563;
  --radius: 14px;
  --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --sans: 'Work Sans', -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 10px 30px -14px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-color: rgba(var(--accent-rgb), 0.4); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: 0.8rem 1.2rem; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { font-family: var(--display); letter-spacing: 0.02em; line-height: 1.05; margin: 0 0 0.5rem; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--accent); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
.eyebrow { font-family: var(--sans); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.6rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: 0.85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; min-height: 48px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--focus); }
.btn-ghost { border-color: var(--border); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Garde-fou absolu : tout élément `hidden` reste display:none quoi qu'il arrive, y compris
   si une règle plus spécifique ailleurs (actuelle ou future) tente de le rendre visible. Le
   navigateur applique déjà `display:none` à `[hidden]` par défaut, avant même le chargement de
   cette feuille de style — cette règle protège seulement contre une régression de spécificité
   CSS interne à ce fichier, elle n'est PAS ce qui garantit l'état fermé par défaut (voir le
   commentaire sur #mobile-nav-overlay dans base.njk). */
[hidden] { display: none !important; }

/* ---------- header (desktop nav only — le panneau mobile est un composant séparé,
   voir "mobile nav" plus bas, jamais imbriqué dans ce sous-arbre) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(23,19,15,0.98);
  border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.25rem; gap: 1rem; }
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { display: block; height: 40px; width: auto; }
.desktop-nav ul {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; align-items: center;
}
.desktop-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.desktop-nav a:hover { color: var(--accent); }
.nav-cta { background: var(--accent); color: var(--accent-ink) !important; padding: 0.5rem 1.1rem; border-radius: 999px; font-weight: 700 !important; }
#mobile-nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 0.6rem;
  cursor: pointer; flex-shrink: 0;
}
#mobile-nav-toggle span { width: 24px; height: 2px; background: var(--ink); display: block; }

/* Aucune largeur ne doit jamais afficher .desktop-nav et #mobile-nav-overlay en même temps :
   les deux media queries ci-dessous sont l'exact miroir l'une de l'autre sur le même seuil. */
@media (max-width: 780px) {
  .desktop-nav { display: none; }
  #mobile-nav-toggle { display: flex; }

  /* Hamburger → croix quand le menu est ouvert. */
  #mobile-nav-toggle span { transition: transform 0.15s ease, opacity 0.15s ease; transform-origin: center; }
  #mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  #mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (min-width: 781px) {
  .desktop-nav { display: flex; }
  #mobile-nav-toggle { display: none; }
  #mobile-nav-overlay { display: none !important; }
}

/* ---------- navigation mobile — composant isolé, enfant direct de <body> ----------
   Cause du bug "toujours cassé sur un vrai iPhone" (2026-08-24, deux tentatives) :
   (1) l'ancien panneau portait `transform` en permanence tout en étant `position:fixed`
   (artefact de compositing WebKit iOS connu), vivait imbriqué dans <header>
   (position:sticky, donc son propre stacking context), et se fermait par une transition
   d'opacité — jamais un vrai retrait de l'affichage, donc quelques frames à alpha partiel
   laissaient transparaître le contenu à travers le menu sur un vrai GPU (invisible à un test
   qui n'inspecte que l'état DOM final). (2) Une fois ce premier point corrigé et redéployé,
   le bug est réapparu identique sur le même iPhone : style.css est servi en
   cache-control:no-cache mais SANS ETag/Last-Modified — un exemplaire déjà en cache sur cet
   appareil depuis AVANT ce correctif (avec l'ancien cache-control:max-age=86400 d'un
   déploiement antérieur) n'est jamais revalidé, quoi que le serveur envoie sur des requêtes
   qu'il ne reçoit jamais ; contre du HTML neuf (toujours no-cache, donc à jour) mais un CSS
   sans aucune règle pour ce composant, #mobile-nav-overlay s'affichait comme un <div> banal,
   toujours visible, en plus de la nav desktop — exactement les "deux menus" rapportés.
   Double correctif structurel : (a) `hidden` posé directement dans le HTML de base.njk, dont
   l'état fermé ne dépend d'AUCUN CSS (feuille par défaut du navigateur) ; (b) `?v=` en
   cache-busting sur style.css/nav.js (voir site/src/_data/build.js), qui change à chaque
   déploiement et force donc toujours une vraie requête réseau, quel que soit ce qu'un
   appareil a déjà en cache. Aucun `transform` sur l'élément `position:fixed`, aucune
   transition d'ouverture/fermeture (rien à peindre à un état intermédiaire). */
#mobile-nav-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2147483647;
  background: var(--bg);
  overscroll-behavior: contain;
}
.mobile-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mobile-nav-brand { display: flex; align-items: center; text-decoration: none; }
.mobile-nav-brand img { display: block; height: 36px; width: auto; }
#mobile-nav-close {
  background: none; border: none; color: var(--ink); cursor: pointer;
  width: 48px; height: 48px; font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mobile-nav-list {
  list-style: none; margin: 0; padding: 0.5rem 1.25rem 1.5rem;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.mobile-nav-list li { width: 100%; }
.mobile-nav-list a {
  display: flex; align-items: center;
  min-height: 48px; padding: 0.4rem 0; font-size: 1.15rem; font-weight: 500;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--border);
}
.mobile-nav-cta {
  justify-content: center; margin-top: 0.9rem;
  background: var(--accent); color: var(--accent-ink) !important; font-weight: 700 !important;
  border-radius: 999px; border-bottom: none !important;
}

/* Verrouillage réel du scroll tactile pendant que le panneau mobile est ouvert :
   `overflow:hidden` seul ne bloque pas le scroll tactile sur Safari iOS (confirmé sur un vrai
   iPhone). `position:fixed` sur <body> retire réellement la page du scroll tactile — `top`
   négatif (posé par nav.js, à partir du défilement réel au moment du clic) compense pour que
   la page ne saute pas visuellement à l'ouverture ; `width:100%` évite que <body> ne
   rétrécisse à la largeur de son contenu une fois en position:fixed. */
body.nav-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }

/* ---------- hero ---------- */
.hero {
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(ellipse at top, rgba(var(--accent-rgb), 0.14), transparent 60%);
}
.hero-inner { display: grid; gap: 1.5rem; align-items: center; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1rem; }
.hero-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
}

/* ---------- sections ---------- */
section.block { padding: 3rem 0; }
section.block.alt { background: var(--bg-raised); }
.card-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem;
}

.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.hours-table td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- événements à venir ---------- */
.event-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.event-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease;
}
.event-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.event-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--bg-raised); }
.event-photo-fallback {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: var(--bg-raised); color: var(--accent); font-family: var(--sans); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 1rem;
}
.event-card-body { padding: 1.1rem 1.3rem; }
.event-badge {
  font-family: var(--sans); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.4rem;
}
.event-title { font-weight: 700; margin: 0 0 0.2rem; font-size: 1.05rem; }
.event-date { margin: 0; color: var(--ink); }
.event-venue { margin: 0.2rem 0 0; color: var(--faint); font-size: 0.82rem; }
.event-grid-empty { color: var(--muted); font-size: 0.92rem; }
.event-photo-fallback .icon { font-size: 2.4rem; line-height: 1; }

/* ---------- menu (précommande groupes, dynamique) ---------- */
.menu-list { display: grid; }
.menu-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.menu-row-label { flex: 1; min-width: 0; }
.menu-row-price { color: var(--accent); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- carte complète (source : PDF, page /menu/) ---------- */
section[id] { scroll-margin-top: 84px; }
.menu-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.menu-nav a { font-size: 0.86rem; color: var(--muted); text-decoration: none; padding: 0.3rem 0; }
.menu-nav a:hover { color: var(--accent); }
.carte-note { color: var(--muted); font-size: 0.88rem; }
.carte-list { display: grid; margin-top: 1rem; }
/* min-width:0 : sans ça, un enfant de grille garde par défaut min-width:auto (taille du
   contenu minimal) — avec la ligne de prix à 3 colonnes non-wrappables, ça pouvait dépasser
   silencieusement la largeur du conteneur sur mobile étroit (320px) au lieu de rétrécir. */
.carte-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); min-width: 0; }
.carte-list .carte-row:last-child { border-bottom: none; }
.carte-row-label { flex: 1; min-width: 0; }
.carte-row-name { display: block; font-weight: 600; }
.carte-row-desc { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 0.15rem; }
.carte-row-price { color: var(--accent); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.carte-row-cols { display: flex; gap: 0.6rem; flex-shrink: 0; }
.carte-row-col { color: var(--accent); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; font-size: 0.92rem; }
.carte-row-head { color: var(--faint); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding-bottom: 0.5rem; }
.carte-row-head .carte-row-col { color: var(--faint); }

/* ---------- duo de photos (pages Bar / Restaurant) ---------- */
.photo-duo { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.photo-duo figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-card); }
.photo-duo img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.photo-duo figcaption { padding: 0.9rem 1.1rem; color: var(--muted); font-size: 0.9rem; }
@media (min-width: 700px) { .photo-duo { grid-template-columns: repeat(2, 1fr); } }

/* ---------- gallery ---------- */
.gallery-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(2, 1fr); }
.gallery-grid img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- map ---------- */
.map-frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.map-frame iframe { width: 100%; height: 360px; border: 0; display: block; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 700px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.92rem; }
.field-hint { font-size: 0.82rem; color: var(--faint); margin-top: 0.25rem; }
.field-error { font-size: 0.85rem; color: #f2a99b; margin-top: 0.3rem; }
input, select, textarea {
  width: 100%; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink); padding: 0.75rem 0.9rem; font: inherit; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0; }
legend { padding: 0 0.5rem; font-weight: 700; color: var(--accent); }
.checkbox-list { display: grid; gap: 0.5rem; }
.checkbox-list label { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400; }
.checkbox-list input { width: auto; min-height: auto; margin-top: 0.2rem; }
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.preorder-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.preorder-row:last-child { border-bottom: none; }
.preorder-label { font-size: 0.92rem; }
.preorder-price { color: var(--faint); font-size: 0.82rem; }
.qty-control { display: flex; align-items: center; gap: 0.5rem; }
.qty-control button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raised);
  color: var(--ink); font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.qty-control input { width: 56px; min-height: 36px; text-align: center; padding: 0.3rem; }

.form-status { border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; }
.form-status.success { background: rgba(var(--accent-rgb), 0.14); border: 1px solid var(--accent); }
.form-status.error { background: rgba(242, 169, 155, 0.12); border: 1px solid #f2a99b; }
/* Recommandation précommande : légère par défaut (--bg-raised), davantage mise en avant
   (fond/bordure accent) uniquement pour les soirs vendredi/samedi — jamais une obligation
   dans les deux cas, seulement une différence de visibilité. */
.form-status.recommendation { background: var(--bg-raised); border: 1px solid var(--border); color: var(--muted); }
.form-status.recommendation.highlight { background: rgba(var(--accent-rgb), 0.14); border: 1px solid var(--accent); color: var(--ink); }

/* ---------- précommande : repliable, accessible (<details>/<summary> natifs) ---------- */
#preorder-details summary {
  cursor: pointer; font-weight: 700; color: var(--accent); padding: 0.6rem 0; list-style: none;
}
#preorder-details summary::-webkit-details-marker { display: none; }
#preorder-details summary::before { content: "▸ "; display: inline-block; transition: transform 0.15s ease; }
#preorder-details[open] summary::before { transform: rotate(90deg); }

/* Encadré propre pour la case "à rappeler" (précommande obligatoire, 16+) — le bug mobile
   corrigé ici : ce bloc n'était pas dans .checkbox-list, donc la case cochable héritait de
   la règle générale `input { width:100%; min-height:48px }` (pensée pour les champs texte)
   et s'affichait démesurée. .checkbox-list (déjà correcte ailleurs dans ce formulaire,
   voir "Je viens pour") règle ça : jamais une nouvelle règle CSS dupliquée, juste la même
   classe déjà éprouvée appliquée ici aussi. */
.callback-box {
  margin-top: 1rem; padding: 0.9rem 1rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
}
.callback-box .checkbox-list label { width: 100%; box-sizing: border-box; }
.callback-box .checkbox-list span { min-width: 0; word-break: break-word; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-raised); border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-brand { font-family: var(--display); font-size: 1.3rem; color: var(--accent); margin-bottom: 0.4rem; }
.footer-heading { font-weight: 700; margin-bottom: 0.6rem; }
.hours-list, .social-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.hours-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; font-size: 0.9rem; color: var(--muted); }
.social-list li { margin-bottom: 0.3rem; }
.footer-legal { font-size: 0.82rem; color: var(--faint); }
.footer-legal a { color: var(--faint); }

.legal-content, .prose-page { padding: 3rem 0; }
.legal-content h2 { margin-top: 2rem; }
.placeholder-note {
  background: rgba(var(--accent-rgb), 0.1); border: 1px dashed var(--accent-deep); border-radius: 10px;
  padding: 0.9rem 1.1rem; font-size: 0.9rem; color: var(--muted); margin: 1rem 0;
}

.error-page { padding: 5rem 0; text-align: center; }
