/* ————— Style du site de mariage : sobre, type faire-part ————— */

:root {
  --ink: #363a36;
  --ink-light: #6d726c;
  --paper: #faf7f2;
  --paper-alt: #f1ebe2;
  --accent: #077a13;
  --accent-dark: #055f0e;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--accent);
}

a {
  color: var(--accent-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ————— Porte d'entrée ————— */

.gate-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--paper) 0%, var(--paper-alt) 100%);
  padding: 1.5rem;
}

.gate-card {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  background: #fff;
  border: 1px solid #e5ddd0;
  border-radius: 4px;
  padding: 3rem 2.5rem;
  box-shadow: 0 12px 40px rgba(54, 58, 54, 0.08);
}

.gate-ornament {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.gate-card h1 {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.gate-subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent-dark);
  margin-bottom: 1.5rem;
}

.gate-hint {
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

.gate-card input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  border: 1px solid #d8cfc0;
  border-radius: 4px;
  background: var(--paper);
}

.gate-card input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.gate-error {
  color: #a4442f;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.gate-card button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.gate-card button:hover {
  background: var(--accent-dark);
}

/* ————— Navigation ————— */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e5ddd0;
}

.site-nav nav {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  /* Hauteur fixe : le hero fait 100svh moins cette valeur (+ bordure) */
  height: calc(3.75rem - 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-light);
}

.nav-links a:hover {
  color: var(--accent-dark);
}

/* ————— Sections ————— */

main section {
  padding: 4.5rem 1.5rem;
}

main section>* {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.section-alt {
  background: var(--paper-alt);
}

section h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

section h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--accent);
  margin: 0.75rem auto 0;
}

.section-intro {
  text-align: center;
  color: var(--ink-light);
  margin-bottom: 2rem;
}

.programme-outro {
  text-align: center;
  color: var(--ink-light);
  margin-top: 2rem;
}

section p+p {
  margin-top: 1rem;
}

/* ————— Accueil / hero ————— */

.hero {
  position: relative;
  overflow: hidden;
  /* Toute la hauteur de l'écran, moins la barre de navigation sticky :
     le hero occupe exactement le premier écran. */
  height: calc(100vh - 3.75rem);
  height: calc(100svh - 3.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(160deg, var(--paper) 0%, var(--paper-alt) 100%);
  /* Bande vide entre le bord du hero et la photo (contain, ratio 791/462) :
     nulle quand la photo remplit la hauteur, sinon (hauteur hero − largeur/ratio) / 2 */
  --img-gap: max(0px, calc(50svh - 1.875rem - 29.2vw));
}

/* Écran étroit : la photo n'est qu'une bande au centre, on ignore l'écart
   pour ne pas écraser le contenu (le bouton se cale sur le bas du hero). */
@media (max-width: 48rem) {
  .hero {
    --img-gap: 0px;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  /* Échappe au max-width appliqué aux enfants de section :
     la photo couvre toute la largeur et la hauteur du hero. */
  max-width: none;
  /* contain : la photo est affichée entière, sans rognage */
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Voile beige au-dessus de la photo pour garder le titre lisible */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(250, 247, 242, 0.7);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Espace souple au-dessus du texte, symétrique de la zone du bouton :
   le bloc de texte reste centré verticalement. */
.hero-content::before {
  content: "";
  flex: 1 1 0;
  margin-top: var(--img-gap);
}

/* Occupe l'espace entre le compte à rebours et le bas de la photo ;
   le bouton est placé aux 2/3 de cette zone (2 parts au-dessus, 1 en dessous). */
.hero-rsvp-zone {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--img-gap);
}

.hero-rsvp-zone::before {
  content: "";
  flex: 2 1 0;
}

.hero-rsvp-zone::after {
  content: "";
  flex: 1 1 0;
}

.hero-welcome {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  margin-bottom: 1rem;
}

.hero-date {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--ink-light);
}

.hero-countdown {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--accent);
}

/* ————— Programme ————— */

.programme-layout {
  max-width: 54rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.timeline {
  list-style: none;
  border-left: 1px solid var(--accent);
  padding-left: 1.5rem;
}

.timeline li {
  position: relative;
  padding-bottom: 0.75rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 4.5px);
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s ease;
}

.timeline li.is-active::before {
  transform: scale(1.6);
  background: var(--accent-dark);
}

.timeline button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  /* Grossissement fluide dans les deux sens (sélection et désélection) */
  transform-origin: left center;
  transition: background-color 0.3s ease, transform 0.45s ease-in-out;
}

.timeline button:hover {
  background: rgba(7, 122, 19, 0.06);
}

.timeline li.is-active button {
  transform: scale(1.06);
}

.timeline-time {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--accent-dark);
}

.programme-photo {
  margin: 0;
  position: relative;
}

.programme-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #e5ddd0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(54, 58, 54, 0.08);
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Second calque superposé au premier pour le fondu enchaîné */
.programme-photo img+img {
  position: absolute;
  inset: 0;
  height: 100%;
}

.programme-photo img.is-visible {
  opacity: 1;
}

@media (max-width: 44rem) {
  .programme-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ————— Lieu, hébergement ————— */

.map-embed {
  margin-bottom: 2rem;
}

.map-embed iframe {
  width: 100%;
  height: 320px;
  border: 1px solid #d8cfc0;
  border-radius: 4px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
}

.info-grid h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--accent-dark);
}

.hebergement-photo {
  display: block;
  width: 100%;
  height: 11rem;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

/* ————— Liste de mariage ————— */

#liste {
  text-align: center;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 2rem;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.9rem;
  border-radius: 4px;
}

.button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.rib-link {
  font-size: 0.9rem;
  color: var(--ink-light);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.rib-link:hover {
  color: var(--accent-dark);
}

/* ————— Liste de mariage ————— */

.liste-photo {
  margin: 1.75rem auto;
  max-width: 460px;
}

.liste-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ————— FAQ ————— */

#faq details {
  background: #fff;
  border: 1px solid #e5ddd0;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

#faq summary {
  font-family: var(--serif);
  font-size: 1.1rem;
  cursor: pointer;
}

#faq details p {
  margin-top: 0.6rem;
  color: var(--ink-light);
}

/* Questions imbriquées : simple filet à gauche au lieu du style carte,
   sinon le padding cumulé rend les niveaux profonds illisibles */
#faq details details {
  background: none;
  border: none;
  border-left: 2px solid #e5ddd0;
  border-radius: 0;
  padding: 0 0 0 0.75rem;
  margin: 0.6rem 0 0;
}

#faq details details summary {
  font-size: 1rem;
}

#faq details img {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
  margin-top: 0.6rem;
  border-radius: 4px;
}

@media (max-width: 44rem) {
  #faq details details {
    padding-left: 0.35rem;
  }
}

/* ————— RSVP ————— */

.rsvp-success {
  text-align: center;
  color: var(--accent-dark);
  background: rgba(7, 122, 19, 0.08);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.rsvp-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

.rsvp-empty {
  text-align: center;
  color: var(--ink-light);
}

.rsvp-card {
  border: none;
  padding: 0;
  margin-bottom: 2.5rem;
}

.rsvp-card legend {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
  padding: 0;
  margin-bottom: 0.5rem;
}

.rsvp-question {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.6rem 0;
}

.rsvp-question+.rsvp-question {
  border-top: 1px solid #e5ddd0;
}

.rsvp-question--stack {
  flex-direction: column;
  align-items: stretch;
}

.rsvp-label {
  font-weight: 600;
}

.rsvp-choices {
  display: flex;
  gap: 1.5rem;
}

.rsvp-choices label {
  cursor: pointer;
}

/* Boutons radio personnalisés : cercle beige, point vert quand coché */
.rsvp-choices input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid #d8cfc0;
  border-radius: 50%;
  background: #fff;
  vertical-align: -0.25rem;
  margin-right: 0.4rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.rsvp-choices input[type="radio"]:hover {
  border-color: var(--accent);
}

.rsvp-choices input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.rsvp-choices input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rsvp-card select,
.rsvp-card input[type="text"] {
  font: inherit;
  color: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d8cfc0;
  border-radius: 4px;
  background: #fff;
}

/* Menu déroulant personnalisé : chevron vert dessiné en SVG */
.rsvp-card select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23055f0e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.7rem;
  cursor: pointer;
}

.rsvp-card select:hover:enabled {
  border-color: var(--accent);
}

.rsvp-card select:focus,
.rsvp-card input[type="text"]:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

/* Champs grisés : menu d'un invité absent, détail sans animaux */
.rsvp-card select:disabled,
.rsvp-card input[type="text"]:disabled {
  background-color: var(--paper-alt);
  color: var(--ink-light);
  border-color: #e5ddd0;
  cursor: not-allowed;
}

.rsvp-card select:disabled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236d726c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.rsvp-question.is-disabled .rsvp-label {
  color: var(--ink-light);
}

.rsvp-submit {
  display: block;
  margin: 2rem auto 0;
  padding: 0.8rem 2.5rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.rsvp-submit:hover {
  background: var(--accent-dark);
}

/* ————— Pied de page ————— */

.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid #e5ddd0;
  color: var(--ink-light);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--ink-light);
}