/*
 * Le site vitrine de Midi Pile (ADR-040).
 *
 * La palette est celle de l'application salarié (`apps/employe/src/design/
 * palette.ts`, ADR-039), sans retouche : crème, bordeaux, or, abricot. Les
 * deux règles de la marque tiennent ici aussi :
 *
 * - le rouge ne sert qu'au danger, et le site n'en a pas l'usage ;
 * - l'or ne s'écrit jamais sur fond clair : `--or` est décoratif (filets,
 *   losanges, filets), un texte or s'écrit en `--or-encre`.
 *
 * Les polices sont servies par le core lui-même : aucune requête ne part
 * ailleurs pour dessiner la page.
 */

@font-face {
  font-family: "Playfair Display";
  font-weight: 600;
  font-display: swap;
  src: url("/site/polices/playfair-600.ttf") format("truetype");
}

@font-face {
  font-family: Jost;
  font-weight: 400;
  font-display: swap;
  src: url("/site/polices/jost-400.ttf") format("truetype");
}

@font-face {
  font-family: Jost;
  font-weight: 600;
  font-display: swap;
  src: url("/site/polices/jost-600.ttf") format("truetype");
}

:root {
  color-scheme: light dark;
  --fond: #fbf6ee;
  --carte: #fff;
  --encre: #2a1a20;
  --encre-2: #68525a;
  --attenue: #f4ece0;
  --pri: #5a1e33;
  --sur-pri: #f8eedc;
  --heros: #5a1e33;
  --heros-encre: #f3e6cc;
  --or: #c9a15a;
  --or-encre: #875f1b;
  --or-doux: #f5e7c8;
  --abricot: #f6e0c4;
  --sur-abricot: #4a1c30;
  --accueil: #f4e3cb;
  --accueil-encre: #4a1c30;
  --ok: #1f5a44;
  --ok-fond: #e3efe7;
  --trait: #eadfcf;
  --bord: #9c8a8f;
  --ombre: 0 1px 2px rgb(42 14 26 / 6%), 0 8px 24px rgb(42 14 26 / 7%);
  --titre: "Playfair Display", Georgia, "Times New Roman", serif;
  --texte: Jost, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --large: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1c1116;
    --carte: #2a1b22;
    --encre: #f3e8ea;
    --encre-2: #bca7af;
    --attenue: #251820;
    --pri: #e3c27e;
    --sur-pri: #2a0e1a;
    --heros: #3a1626;
    --heros-encre: #f3e6cc;
    --or: #d9b670;
    --or-encre: #e3c489;
    --or-doux: rgb(217 182 112 / 16%);
    --abricot: #3a2820;
    --sur-abricot: #f6e0c4;
    --accueil: #2a1520;
    --accueil-encre: #f3e6cc;
    --ok: #8fcbae;
    --ok-fond: rgb(143 203 174 / 13%);
    --trait: rgb(243 232 234 / 12%);
    --bord: #8e7886;
    --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 17px / 1.55 var(--texte);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.passer {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--pri);
  color: var(--sur-pri);
  border-radius: 999px;
  z-index: 1000;
}

.passer:focus {
  left: 1rem;
}

.cadre {
  max-width: var(--large);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- En-tête ------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 500;
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--trait);
}

.entete .cadre {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--titre);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--encre);
  white-space: nowrap;
}

.marque img {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
}

.entete nav {
  margin-left: auto;
}

.onglets {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onglets a {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--encre-2);
}

.onglets a:hover {
  color: var(--encre);
}

.onglets a[aria-current="page"] {
  color: var(--encre);
  box-shadow: inset 0 -2px 0 var(--or);
}

.entete .bouton {
  display: none;
}

@media (min-width: 52rem) {
  .entete .bouton {
    display: inline-flex;
  }
}

/* --- Boutons ------------------------------------------------------------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--pri);
  background: var(--pri);
  color: var(--sur-pri);
  font: 600 1rem / 1.2 var(--texte);
  text-decoration: none;
  cursor: pointer;
}

.bouton:hover {
  filter: brightness(1.08);
}

.bouton.second {
  background: transparent;
  color: var(--encre);
  border-color: var(--bord);
}

.bouton.second:hover {
  border-color: var(--encre);
  filter: none;
}

/* --- Ornements ----------------------------------------------------------- */

.ornement {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ornement::before,
.ornement::after {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--or);
}

.ornement span {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--or);
  transform: rotate(45deg);
}

.ornement.centre {
  justify-content: center;
}

.surtitre {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--or-encre);
}

h1,
h2,
.h2 {
  font-family: var(--titre);
  font-weight: 600;
  letter-spacing: -0.01em;
}

em.or {
  font-style: italic;
  color: var(--or-encre);
}

/* --- Accueil : le héros -------------------------------------------------- */

.heros {
  background: var(--accueil);
  color: var(--accueil-encre);
  overflow: hidden;
}

.heros .cadre {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 52rem) {
  .heros .cadre {
    grid-template-columns: 1.15fr 0.85fr;
    padding-top: 5rem;
    padding-bottom: 5.5rem;
  }
}

.heros h1 {
  margin: 0.9rem 0 1rem;
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  line-height: 1.02;
}

.heros .chapeau {
  max-width: 34rem;
  margin: 0 0 2rem;
  font-size: 1.18rem;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.heros .bouton.second {
  color: var(--accueil-encre);
}

.logo-heros {
  justify-self: center;
  width: min(22rem, 72vw);
  aspect-ratio: 1;
  position: relative;
}

/* Le cadran et la cuillère, superposés : la cuillère revient seule à midi.
   Le pivot est le centre du cadran, sous celui de l'image. */
.logo-heros > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.logo-heros > .cuillere {
  transform-origin: 50% 54.76%;
  animation: midi 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes midi {
  from {
    transform: rotate(-200deg);
  }

  to {
    transform: rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-heros > .cuillere {
    animation: none;
  }
}

/* Sous le cuilleron, pas dessus : c'est lui qui fait lire le logo. */
.ticket {
  position: absolute;
  right: -1.5rem;
  bottom: -3.5rem;
  max-width: 15rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: var(--carte);
  color: var(--encre);
  box-shadow: var(--ombre);
  font-size: 0.9rem;
  line-height: 1.35;
}

.ticket strong {
  display: block;
  font-family: var(--titre);
  font-size: 1.05rem;
}

.ticket .ok {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--ok-fond);
  color: var(--ok);
  font-weight: 600;
  font-size: 0.8rem;
}

/* --- Sections ------------------------------------------------------------ */

.section {
  padding: 4.5rem 0;
}

/* Deux sections claires qui se suivent ne doublent pas leur marge. */
.section:not(.attenuee) + .section:not(.attenuee) {
  padding-top: 0;
}

.section.attenuee {
  background: var(--attenue);
}

.section h2 {
  margin: 0.6rem 0 0.8rem;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
}

.section .intro {
  max-width: 40rem;
  margin: 0 0 2.5rem;
  color: var(--encre-2);
  font-size: 1.1rem;
}

.etapes {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: etape;
}

@media (min-width: 52rem) {
  .etapes {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.etapes li {
  counter-increment: etape;
  padding: 1.6rem 1.5rem 1.7rem;
  border-radius: 20px;
  background: var(--carte);
  border: 1px solid var(--trait);
}

.etapes li::before {
  content: counter(etape);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 1.5px solid var(--or);
  font-family: var(--titre);
  font-size: 1.15rem;
  color: var(--or-encre);
}

.etapes h3,
.public h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.etapes p,
.public li p {
  margin: 0;
  color: var(--encre-2);
}

.publics {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 52rem) {
  .publics {
    grid-template-columns: 1fr 1fr;
  }
}

.public {
  padding: 2rem 1.75rem;
  border-radius: 24px;
  background: var(--carte);
  border: 1px solid var(--trait);
}

.public.pro {
  background: var(--heros);
  color: var(--heros-encre);
  border-color: var(--heros);
}

.public.pro .surtitre {
  color: var(--or);
}

.public.pro li p {
  color: color-mix(in srgb, var(--heros-encre) 82%, transparent);
}

.section .public h2 {
  margin-top: 0.4rem;
  font-size: 1.9rem;
}

.public ul {
  display: grid;
  gap: 1.15rem;
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  list-style: none;
}

.public li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.6rem;
}

.public li::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin: 0.5rem 0 0 0.45rem;
  background: var(--or);
  transform: rotate(45deg);
}

.public.pro .bouton {
  background: var(--heros-encre);
  border-color: var(--heros-encre);
  color: var(--heros);
}

.promesses {
  display: grid;
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .promesses {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .promesses {
    grid-template-columns: repeat(4, 1fr);
  }
}

.promesses li {
  padding: 1.1rem 0 0;
  border-top: 2px solid var(--or);
}

.promesses strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--titre);
  font-size: 1.15rem;
}

.promesses span {
  color: var(--encre-2);
}

.appel {
  padding: 3rem 1.75rem;
  border-radius: 28px;
  background: var(--abricot);
  color: var(--sur-abricot);
  text-align: center;
}

.section .appel h2 {
  margin: 0.6rem auto 0.8rem;
  max-width: 36rem;
}

.appel p {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
}

.appel .actions {
  justify-content: center;
}

.appel .bouton {
  background: var(--sur-abricot);
  border-color: var(--sur-abricot);
  color: var(--abricot);
}

.appel .bouton.second {
  background: transparent;
  color: var(--sur-abricot);
}

/* --- Pied ---------------------------------------------------------------- */

.pied {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--trait);
  color: var(--encre-2);
  font-size: 0.92rem;
}

.pied .cadre {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.pied p {
  margin: 0;
}

.pied ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Annuaire ------------------------------------------------------------ */

.page-titre {
  padding-top: 2.75rem;
  padding-bottom: 1.5rem;
}

.page-titre h1 {
  margin: 0.5rem 0 0.4rem;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.page-titre p {
  margin: 0;
  color: var(--encre-2);
}

.page-titre .actions {
  margin-top: 1.5rem;
}

.annuaire {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 60rem) {
  .annuaire {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }

  .annuaire .carte-zone {
    position: sticky;
    top: 5rem;
    order: 2;
  }
}

.carte-zone {
  margin: 0;
}

.carte {
  width: 100%;
  height: 24rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--trait);
  background: var(--attenue);
}

@media (min-width: 60rem) {
  .annuaire .carte {
    height: calc(100vh - 7rem);
    max-height: 44rem;
  }
}

.carte-zone figcaption {
  margin: 0.6rem 0.25rem 0;
  color: var(--encre-2);
  font-size: 0.88rem;
}

.carte-repli {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  padding: 1.5rem;
  color: var(--encre-2);
  text-align: center;
}

.liste {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resto {
  position: relative;
  display: grid;
  gap: 0.3rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 18px;
  background: var(--carte);
  border: 1px solid var(--trait);
  transition: border-color 0.15s;
}

.resto:hover,
.resto.actif {
  border-color: var(--bord);
}

.resto h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
}

/* Toute la carte est cliquable, mais le lien reste le nom : un lecteur
   d'écran lit un lien, pas une carte entière. */
.resto h2 a {
  text-decoration: none;
}

.resto h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
}

.resto .adresse {
  margin: 0;
  color: var(--encre-2);
  font-size: 0.95rem;
}

.pastilles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.pastilles li {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--attenue);
  color: var(--encre-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.pastilles li.jour {
  background: var(--or-doux);
  color: var(--or-encre);
}

.vide {
  padding: 2rem 1.5rem;
  border-radius: 18px;
  border: 1px dashed var(--bord);
  color: var(--encre-2);
  text-align: center;
}

/* Les fenêtres de la carte, aux couleurs du site. */
.leaflet-container {
  font: 15px / 1.4 var(--texte);
  background: var(--attenue);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--carte);
  color: var(--encre);
  box-shadow: var(--ombre);
}

.leaflet-popup-content {
  margin: 0.8rem 1rem;
}

.leaflet-popup-content strong {
  display: block;
  font-family: var(--titre);
  font-size: 1.1rem;
}

.leaflet-popup-content a {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--encre);
}

.leaflet-container .leaflet-control-attribution {
  background: color-mix(in srgb, var(--carte) 85%, transparent);
  color: var(--encre-2);
}

.leaflet-container .leaflet-control-attribution a {
  color: var(--encre);
}

.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--carte);
  color: var(--encre);
  border-bottom-color: var(--trait);
}

@media (prefers-color-scheme: dark) {
  /* Le fond de carte n'existe qu'en clair : on l'assombrit plutôt que de
     poser un rectangle blanc au milieu d'une page sombre. */
  .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6);
  }
}

/* --- Fiche --------------------------------------------------------------- */

.retour {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--encre-2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.retour:hover {
  color: var(--encre);
}

.photos {
  display: flex;
  gap: 0.6rem;
  margin: 1.25rem 0 0;
  padding: 0 0 0.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
}

.photos li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.photos img {
  width: auto;
  height: 15rem;
  max-width: 85vw;
  border-radius: 18px;
  object-fit: cover;
  background: var(--attenue);
}

.fiche-entete {
  padding: 1.5rem 0 1.25rem;
}

.fiche-entete h1 {
  margin: 0.4rem 0 0.3rem;
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  line-height: 1.05;
}

.fiche-entete .adresse {
  margin: 0;
  color: var(--encre-2);
}

.fiche {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

@media (min-width: 60rem) {
  .fiche {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    gap: 2rem;
    align-items: start;
  }

  .fiche aside {
    position: sticky;
    top: 5rem;
  }
}

.bloc {
  padding: 1.5rem 1.5rem 1.6rem;
  border-radius: 22px;
  background: var(--carte);
  border: 1px solid var(--trait);
}

.bloc + .bloc {
  margin-top: 1.25rem;
}

.bloc > .h2 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.6rem;
  line-height: 1.15;
}

.description {
  margin: 0;
  white-space: pre-line;
  font-size: 1.08rem;
  line-height: 1.65;
}

.menu .date {
  margin: 0 0 0.25rem;
  font-family: var(--titre);
  font-style: italic;
  color: var(--or-encre);
}

/* Les rubriques de l'ardoise gardent leur `<h2>` nu : la page l'a toujours
   rendu ainsi, et ce sont elles que les robots d'aperçu lisent. */
.menu h2 {
  margin: 1.5rem 0 0.3rem;
  font-family: var(--texte);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--or-encre);
}

.ardoise {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ardoise li {
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--trait);
}

.ardoise li:last-child,
.ardoise li:has(+ li.ou) {
  border-bottom: 0;
}

.ardoise li.ou {
  padding: 0;
  border-bottom: 0;
  font-family: var(--titre);
  font-style: italic;
  color: var(--encre-2);
}

.ligne {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.plat {
  font-weight: 600;
  font-size: 1.08rem;
}

.prix {
  font-weight: 600;
  white-space: nowrap;
}

.allergenes {
  margin: 0.2rem 0 0;
  color: var(--encre-2);
  font-size: 0.92rem;
}

.note,
.menu .attente {
  margin: 1rem 0 0;
  color: var(--encre-2);
  font-size: 0.92rem;
}

.article + .article {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--trait);
}

.article img {
  width: 100%;
  height: 12rem;
  margin: 0.5rem 0 1rem;
  border-radius: 14px;
  object-fit: cover;
}

.article > h3 {
  margin: 0.5rem 0;
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.3rem;
}

.article .corps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.article .corps p,
.article .corps ul {
  margin: 0 0 0.7rem;
  color: var(--encre-2);
}

.infos {
  margin: 0.5rem 0 0;
}

.infos div {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--trait);
}

.infos div:last-child {
  border-bottom: 0;
}

.infos dt {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--encre-2);
}

.infos dd {
  margin: 0;
}

.infos dd p {
  margin: 0;
}

.gamme span {
  opacity: 0.3;
}

.gamme span.plein {
  opacity: 1;
}

.fiche .carte {
  height: 14rem;
  margin-top: 0.75rem;
}

.lien-plan {
  display: inline-block;
  margin-top: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.bloc.reserver {
  background: var(--heros);
  color: var(--heros-encre);
  border-color: var(--heros);
}

.reserver .surtitre {
  color: var(--or);
}

.reserver p {
  margin: 0.4rem 0 0;
  color: color-mix(in srgb, var(--heros-encre) 85%, transparent);
}
