/* ==========================================================================
   Panneaux — chaque entrée du menu s'ouvre en superposition
   <dialog> natif : focus piégé, Échap ferme, pas de JS à réécrire.
   ========================================================================== */

.panel {
  width: min(56rem, calc(100vw - 2 * var(--gutter)));
  max-height: min(88dvh, 60rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  color: var(--ink);
  overflow: hidden;
}

.panel::backdrop {
  background: rgba(90, 26, 16, 0.42);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

/* Entrée : le panneau monte et se dévoile. Sortie plus courte que l'entrée. */
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

.panel[open] {
  animation: panel-in var(--d-slow) var(--ease-out-expo);
}

.panel[open]::backdrop {
  animation: backdrop-in var(--d-base) var(--ease-out-quart);
}

.panel.is-closing {
  animation: panel-in var(--d-base) var(--ease-in-out) reverse;
}

.panel.is-closing::backdrop {
  animation: backdrop-in var(--d-fast) var(--ease-in-out) reverse;
}

@media (prefers-reduced-motion: reduce) {
  .panel[open],
  .panel[open]::backdrop,
  .panel.is-closing,
  .panel.is-closing::backdrop {
    animation: none;
  }
}

/* --- Structure ------------------------------------------------------------ */

.panel__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-6) clamp(1.25rem, 4vw, 2.5rem) var(--s-4);
  background: rgba(253, 250, 243, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.panel__heading {
  flex: 1;
  min-width: 0;
}

/* Une ligne de contexte, pas un intertitre décoratif : elle porte une
   information que le titre ne donne pas (la date, le lieu, l'échéance). */
.panel__eyebrow {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-soft);
}

.panel__title {
  margin-top: var(--s-1);
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 400;
  line-height: 1.1;
  color: var(--accent);
}

.panel__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  transition: background var(--d-fast) var(--ease-out-quart),
    transform var(--d-fast) var(--ease-out-quart);
}

.panel__close:hover {
  background: rgba(220, 68, 48, 0.1);
}

.panel__close:active {
  transform: scale(0.94);
}

.panel__close svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 1.75;
}

.panel__body {
  padding: var(--s-6) clamp(1.25rem, 4vw, 2.5rem) clamp(2rem, 5vh, 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: calc(min(88dvh, 60rem) - 7.5rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 68, 48, 0.3) transparent;
}

.panel__body::-webkit-scrollbar {
  width: 10px;
}

.panel__body::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background: rgba(220, 68, 48, 0.3);
  background-clip: content-box;
}

.panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 68, 48, 0.5);
  background-clip: content-box;
}

.panel__body > * + * {
  margin-top: var(--s-6);
}

.panel__body p {
  color: var(--ink-soft);
  max-width: var(--measure);
  text-wrap: pretty;
}

.panel__body h3 {
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: var(--s-2);
}

.panel__lede {
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--ink) !important;
}

/* --- Blocs de contenu ----------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-5);
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px var(--line);
}

.fact__label {
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.fact__value {
  margin-top: var(--s-1);
  color: var(--ink);
}

.fact__value a {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Programme : une vraie séquence horaire, donc numérotée par l'heure. */
.timeline {
  display: grid;
  gap: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-deep);
}

.timeline p {
  margin: var(--s-1) 0 0;
  font-size: var(--t-sm);
}

.timeline strong {
  font-weight: 600;
  color: var(--ink);
}

/* --- Carte ----------------------------------------------------------------
   Fond CARTO Positron, dessiné clair et presque sans couleur : c'est ce qui
   permet de le teinter proprement. Une tentative précédente filtrait le fond
   vert d'OpenStreetMap en sepia ; repeindre une carte conçue en vert donne
   une bouillie jaune, quel que soit le réglage.

   Douze tuiles posées en grille, pas de bibliothèque ni d'iframe : la carte
   ne se déplace pas, mais personne ne navigue dans une carte de faire-part,
   on clique sur « Itinéraire ». En prime, le marqueur est le nôtre, à la
   bonne couleur, au lieu du gros repère bleu par défaut.
   ------------------------------------------------------------------------ */

.map {
  height: clamp(13rem, 30vh, 17rem);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  background: var(--line-soft);
  z-index: 0; /* garde les tuiles sous l'en-tête collant du panneau */
}

/* Aucun filtre sur les tuiles : Positron est déjà clair et discret, et toutes
   les tentatives pour le réchauffer l'ont abîmé. La carte reste telle qu'elle
   a été dessinée ; c'est le marqueur qui porte la couleur de la charte. */

.map__marker svg {
  filter: drop-shadow(0 3px 5px rgba(90, 26, 16, 0.35));
}

/* Commandes Leaflet ramenées à la charte : angles droits, filets fins. */
.map .leaflet-bar a {
  border-radius: 0;
  color: var(--accent-deep);
  border-bottom-color: var(--line);
}

.map .leaflet-bar a:hover {
  background: rgba(220, 68, 48, 0.08);
}

.map .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.map .leaflet-control-attribution a {
  color: var(--accent-deep);
}

.map .leaflet-popup-content {
  font-weight: 600;
  color: var(--ink);
}

.map__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

/* Liste à puces sobre */
.bullets li {
  position: relative;
  padding-left: var(--s-5);
  color: var(--ink-soft);
}

.bullets li + li {
  margin-top: var(--s-3);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* État vide (Nos photos) */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: clamp(2rem, 6vh, 3.5rem) var(--s-5);
  text-align: center;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px var(--line);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--r-pill);
  background: rgba(220, 68, 48, 0.1);
  color: var(--accent);
}

.empty__icon svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke-width: 1.5;
}

.empty p {
  max-width: 42ch;
}

/* Placeholder à remplir plus tard, ou avertissement.
   Le bloc n'hérite pas de la largeur de lecture des paragraphes : il occupe
   toute la colonne et son texte est centré, pour se lire comme un encart et
   non comme la suite du propos. */
.draft {
  max-width: none !important;
  margin-inline: auto;
  text-align: center;
  padding: var(--s-5);
  border-radius: var(--r-sm);
  background: rgba(220, 68, 48, 0.06);
  box-shadow: inset 0 0 0 1px rgba(220, 68, 48, 0.16);
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.draft strong {
  color: var(--accent-deep);
}

/* ==========================================================================
   Formulaire RSVP
   ========================================================================== */

.form {
  display: grid;
  gap: var(--s-5);
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field__label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink);
}

.field__label .req {
  color: var(--accent);
  margin-left: 2px;
}

.field__hint {
  font-size: var(--t-xs);
  color: var(--ink-soft);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-size: max(1rem, var(--t-base)); /* ≥16px : pas de zoom auto iOS */
  transition: border-color var(--d-fast) var(--ease-out-quart),
    box-shadow var(--d-fast) var(--ease-out-quart),
    background var(--d-fast) var(--ease-out-quart);
}

.input::placeholder,
.textarea::placeholder {
  color: #6b625d; /* 4.6:1 sur le champ : lisible, pas décoratif */
}

.input:hover,
.textarea:hover,
.select:hover {
  background: rgba(255, 255, 255, 0.95);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 68, 48, 0.18);
  background: #ffffff;
}

.textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232b0d13' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
  padding-right: var(--s-7);
}

/* Choix de présence : deux options, donc deux boutons visibles, pas un menu */
.choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}

.choice__option {
  position: relative;
}

.choice__option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__box {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  color: var(--ink);
  transition: all var(--d-fast) var(--ease-out-quart);
}

.choice__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
}

.choice__mark svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke-width: 3;
}

.choice__option input:checked + .choice__box {
  border-color: var(--accent);
  background: rgba(220, 68, 48, 0.1);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.choice__option input:checked + .choice__box .choice__mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.choice__option input:focus-visible + .choice__box {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Erreurs et états ----------------------------------------------------- */

.field__error {
  display: none;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: 500;
  color: #8a1c12;
}

.field__error svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.field[data-invalid="true"] .field__error {
  display: flex;
}

.field[data-invalid="true"] .input,
.field[data-invalid="true"] .textarea {
  border-color: #8a1c12;
  box-shadow: 0 0 0 3px rgba(138, 28, 18, 0.14);
}

.form__status {
  display: none;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
}

.form__status[data-state="error"],
.form__status[data-state="info"] {
  display: flex;
}

.form__status[data-state="error"] {
  background: rgba(138, 28, 18, 0.1);
  box-shadow: inset 0 0 0 1px rgba(138, 28, 18, 0.3);
  color: #7a180f;
}

.form__status[data-state="info"] {
  background: rgba(36, 32, 30, 0.06);
  box-shadow: inset 0 0 0 1px rgba(36, 32, 30, 0.18);
  color: #4a4340;
}

.form__status svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  margin-top: 0.15em;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
}

.form__foot .btn {
  min-width: 14rem;
}

.form__note {
  font-size: var(--t-xs);
  color: var(--ink-soft);
  max-width: 32ch;
}

/* --- Hébergements ---------------------------------------------------------
   Soixante-cinq entrées : ni cartes ni encadrés, seulement des filets. Chaque
   entrée tient en quatre lignes de densité décroissante — nom et distance,
   adresse, capacité, contacts — pour qu'on puisse balayer la colonne des
   distances sans lire le reste.
   ------------------------------------------------------------------------ */

.stays__jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.stays__jump a {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  transition: background var(--d-fast) var(--ease-out-quart);
}

.stays__jump a:hover {
  background: rgba(220, 68, 48, 0.08);
}

.stays + .stays {
  margin-top: var(--s-7);
}

.stays h3 {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 0;
}

.stays__count {
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.stays__list {
  columns: 2;
  column-gap: var(--s-6);
}

.stay {
  break-inside: avoid;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}

.stay__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--ink) !important;
}

.stay__name {
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.3;
}

/* La distance est la colonne qu'on balaie : chiffres tabulaires, alignés à
   droite, jamais coupés. */
.stay__km {
  flex: none;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stay__where,
.stay__cap,
.stay__host {
  margin-top: var(--s-1);
  font-size: var(--t-xs);
  line-height: 1.45;
}

.stay__cap {
  color: var(--ink) !important;
}

.stay__host {
  color: var(--ink-soft);
  font-style: italic;
}

.stay__contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-2);
  font-size: var(--t-xs);
}

.stay__contact a {
  color: var(--accent-deep);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 48, 31, 0.3);
  overflow-wrap: anywhere;
}

.stay__contact a:hover {
  border-bottom-color: var(--accent-deep);
}

@media (max-width: 720px) {
  .stays__list {
    columns: 1;
  }
}

/* --- Adresses postales ---------------------------------------------------
   Trois entrées séparées par des filets, pas trois cartes. Le format reste
   celui d'une enveloppe : destinataire au-dessus, adresse en dessous.
   ------------------------------------------------------------------------ */

.addresses {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.addresses ul {
  margin-top: var(--s-5);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--s-5);
}

.addresses li {
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.addresses__who {
  color: var(--ink) !important;
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.35;
}

.addresses__where {
  margin-top: var(--s-2);
  font-size: var(--t-sm);
  line-height: 1.5;
}

/* Confirmation : remplace le formulaire, ne s'empile pas dessous. */
.done {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: clamp(2rem, 6vh, 3rem) var(--s-5);
  text-align: center;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
}

.done__seal {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(220, 68, 48, 0.35);
}

.done__seal svg {
  width: 1.75rem;
  height: 1.75rem;
  stroke-width: 2;
}

.done__title {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  color: var(--accent);
}

.done p {
  max-width: 40ch;
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .panel {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .panel__body {
    max-height: calc(100dvh - 7rem);
  }
  .choice {
    grid-template-columns: 1fr;
  }
  .timeline li {
    grid-template-columns: 4.5rem 1fr;
  }
  .form__foot .btn {
    width: 100%;
  }
}
