/* ================================================================
   Mariage — Save the date : papeterie de mariage
   Fond ivoire, couleurs douces, typographie élégante, mobile d'abord.
   Aucune ressource externe (pas de Google Fonts, pas de CDN).
   ================================================================ */

:root {
  --ivoire: #faf6f0;
  --ivoire-fonce: #f3ece1;
  --encre: #4a3f35;
  --encre-douce: #6f6156;
  --rose: #d8a7a0;
  --rose-fonce: #b97f77;
  --sauge: #9caf97;
  --sauge-fonce: #6d8268;
  --or: #c8a96a;
  --blanc-carte: #fffdf9;
  --erreur: #a94438;
  --info: #5a6e82;
  --succes: #55704f;
  --ombre: 0 2px 14px rgba(74, 63, 53, .09);
  --rayon: 14px;
}

* { box-sizing: border-box; }

html { font-size: 19px; }

body {
  margin: 0;
  background: var(--ivoire);
  background-image: radial-gradient(circle at 15% 10%, rgba(216,167,160,.10), transparent 45%),
                    radial-gradient(circle at 85% 90%, rgba(156,175,151,.10), transparent 45%);
  color: var(--encre);
  font-family: Georgia, "Times New Roman", "DejaVu Serif", serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

/* Sur grand écran, la page s'ouvre en pleine largeur pour que la
   photo d'accueil déborde de tout le conteneur ; le texte reste
   centré dans une colonne lisible. */
@media (min-width: 900px) {
  .page { max-width: none; }
}

/* ---------------- Cartes ---------------- */
.carte {
  background: var(--blanc-carte);
  border: 1px solid rgba(200, 169, 106, .25);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.6rem 1.4rem;
  margin: 1rem 0;
}
.carte-centree { text-align: center; max-width: 720px; margin-left: auto; margin-right: auto; }

/* ---------------- Titres ---------------- */
h1, h2 { font-weight: normal; letter-spacing: .01em; }
h1 { font-size: 1.7rem; margin: .3em 0 .6em; }
h2 { font-size: 1.35rem; margin-top: 1.4em; }

.sur-titre {
  font-variant: small-caps;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: .95rem;
  color: var(--rose-fonce);
  margin: 0 0 .4em;
}
.noms {
  font-size: 2.5rem;
  font-style: italic;
  color: var(--encre);
  margin: .1em 0 .3em;
}
.date-grande {
  font-size: 1.45rem;
  letter-spacing: .08em;
  color: var(--encre-douce);
  margin: .2em 0;
}
.lieu { color: var(--encre-douce); margin: .2em 0; }

/* ---------------- Page « Répondre » ----------------
   Sur-titre orange tiger (Pantone 16-1358 TCX ≈ #D2691E),
   date en noir, questions du formulaire en bleu (Pantone 2738C ≈ #2738A0). */
.carte-centree .sur-titre { color: #d2691e; }
.carte-centree .date-grande { color: #000; }
.carte-centree .formulaire legend { color: #2738a0; }
.periode { color: var(--sauge-fonce); margin: .4em 0; }

.texte-annonce { margin: .8em 0 .4em; }
.texte-prochainement {
  font-size: .9rem;
  color: var(--encre-douce);
  font-style: italic;
  border-left: 3px solid var(--rose);
  padding-left: .8em;
  margin: .8em 0;
  text-align: left;
}
.note-important {
  background: var(--ivoire-fonce);
  border-radius: 8px;
  padding: .7em .9em;
  font-size: 1.05rem;
}
.note { font-size: .95rem; color: var(--encre-douce); }
.note-champ { font-size: .9rem; color: var(--encre-douce); font-style: italic; }
.obligatoire { font-size: .88rem; color: var(--rose-fonce); }

/* ---------------- Formulaire ---------------- */
.formulaire { text-align: left; margin-top: 1rem; }
.bloc-invites {
  border: 1px solid rgba(156,175,151,.4);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: 1.2rem;
}
.bloc-invites legend { padding: 0 .5em; font-style: italic; color: var(--sauge-fonce); }

.ligne-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .9rem;
  padding: .55rem 0;
}
.ligne-invite + .ligne-invite { border-top: 1px dashed rgba(200,169,106,.3); }
.prenom { font-size: 1.05rem; min-width: 7em; }

.choix-radio { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.choix-radio label {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  cursor: pointer;
  padding: .45rem .6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.choix-radio label:hover { background: var(--ivoire-fonce); }
.radio-oui input:checked + span { color: var(--sauge-fonce); font-weight: bold; }
.radio-non input:checked + span { color: var(--rose-fonce); font-weight: bold; }
.radio-oui:has(input:checked) { border-color: var(--sauge); background: rgba(156,175,151,.12); }
.radio-non:has(input:checked) { border-color: var(--rose); background: rgba(216,167,160,.12); }

.choix-radio input[type="radio"] {
  width: 1.15rem; height: 1.15rem; margin-top: .25rem;
  accent-color: var(--sauge-fonce);
  flex-shrink: 0;
}

.bloc-champ { margin: 1rem 0; }
.bloc-champ label { display: block; margin-bottom: .3rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--encre);
  background: var(--ivoire);
  border: 1px solid rgba(200,169,106,.45);
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--rose);
  outline-offset: 1px;
}

.btn-principal, .btn-secondaires, .btn-danger, .btn-petit, .lien-pied {
  display: inline-block;
  font: inherit;
  border-radius: 999px;
  padding: .65rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s;
}
.btn-principal {
  background: var(--sauge-fonce);
  color: #fff;
  box-shadow: var(--ombre);
}
.btn-principal:hover { transform: translateY(-1px); }
.btn-secondaires {
  background: var(--blanc-carte);
  color: var(--encre);
  border-color: rgba(200,169,106,.5);
}
.btn-danger { background: transparent; color: var(--erreur); border-color: var(--erreur); }
.btn-petit { padding: .3rem .8rem; font-size: .85rem; background: var(--ivoire-fonce); color: var(--encre); }
a.btn-petit { text-decoration: none; }

/* ---------------- Messages ---------------- */
.flash { padding: .6rem .9rem; border-radius: 8px; margin: .5rem 0; font-size: .92rem; }
.flash-erreur { background: #f6e3df; color: var(--erreur); border: 1px solid #e0b4ac; }
.flash-info { background: #e5ebf1; color: var(--info); border: 1px solid #c3cfdc; }
.flash-succes { background: #e6eee3; color: var(--succes); border: 1px solid #c2d4bc; }

/* ---------------- Tableaux ---------------- */
.tableau-recap {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  text-align: left;
}
.tableau-recap th, .tableau-recap td {
  padding: .5rem .6rem;
  border-bottom: 1px solid rgba(200,169,106,.25);
}
.tableau-recap th { font-weight: normal; font-style: italic; color: var(--encre-douce); }

.tableau-admin { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau-admin th, .tableau-admin td {
  padding: .5rem .5rem;
  text-align: left;
  border-bottom: 1px solid rgba(200,169,106,.25);
}
.stat-oui { color: var(--sauge-fonce); }
.stat-non { color: var(--rose-fonce); }
.stat-sr { color: var(--info); }

/* ---------------- Admin ---------------- */
.admin { max-width: 100%; }
.admin-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.admin-nav a { margin-left: .8rem; color: var(--encre-douce); }
.stats { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0; }
.stat {
  flex: 1 1 90px;
  background: var(--ivoire-fonce);
  border-radius: 10px;
  text-align: center;
  padding: .6rem .4rem;
}
.stat-n { display: block; font-size: 1.4rem; }
.stat-l { font-size: .75rem; color: var(--encre-douce); }
.admin-actions { margin: .9rem 0; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.tableau-recherche { margin: 1rem 0; }
.mono { font-family: "DejaVu Sans Mono", monospace; font-size: .85rem; word-break: break-all; }
.lien-complet {
  background: var(--ivoire-fonce);
  padding: .7rem;
  border-radius: 8px;
  border: 1px dashed var(--or);
}
.separateur { border: none; border-top: 1px dashed rgba(200,169,106,.4); margin: 1.5rem 0; }
.inline-form { display: inline; }
.lien-pied {
  background: none; border: none; color: var(--encre-douce);
  text-decoration: underline; padding: 0; font: inherit; font-size: .8rem;
}

/* ---------------- Pied de page ---------------- */
.pied {
  text-align: center;
  font-size: .8rem;
  color: var(--encre-douce);
  padding: 1.5rem 0 .5rem;
}
.pied a { color: var(--encre-douce); }

.coeur-grande { font-size: 2.4rem; }

/* ---------------- Animations discrètes ---------------- */
.apparition { animation: apparait .6s ease-out both; }
@keyframes apparait {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- Mobile ---------------- */
@media (max-width: 560px) {
  html { font-size: 18px; }
  .noms { font-size: 2rem; }
  .carte { padding: 1.2rem 1rem; }
  .ligne-invite { flex-direction: column; align-items: stretch; }
  .prenom { min-width: 0; }
  .tableau-admin { display: block; overflow-x: auto; }
  .admin-nav a { margin: 0 .6rem 0 0; }
}

@media print {
  .flash-zones, .pied, .btn-principal, .btn-secondaires, .btn-danger { display: none; }
  body { background: #fff; }
  .carte { box-shadow: none; border: none; }
}

/* ================================================================
   Lien universel : formulaire, récapitulatif, admin réponses
   ================================================================ */

.annonce { font-size: 1.1rem; }
.annonce.second { color: var(--encre-douce); font-size: 1.05rem; }

.aide { font-size: .85rem; color: var(--encre-douce); margin: .2em 0 .5em; }

.info-modification {
  font-size: .9rem; color: var(--info);
  background: var(--ivoire-fonce); border-radius: var(--rayon); padding: .6em .9em;
}

.formulaire fieldset {
  border: 1px solid rgba(210, 105, 30, .38); border-radius: var(--rayon);
  margin: 1.2em 0; padding: .9em 1em;
}
.formulaire legend { padding: 0 .5em; color: #2738a0; font-style: italic; }
/* Champs du formulaire de réponse : contour assorti aux cadres */
.carte-centree .formulaire input:not([type=hidden]),
.carte-centree .formulaire textarea {
  border-color: rgba(210, 105, 30, .38);
}
.carte-centree .formulaire input:focus,
.carte-centree .formulaire textarea:focus {
  outline-color: rgba(210, 105, 30, .55);
}

.bouton-second { background: var(--ivoire-fonce); color: var(--encre); }

.recapitulatif { text-align: left; margin-top: 1.5em; }
.recapitulatif h2 { font-size: 1.05rem; color: var(--sauge-fonce); }
.recapitulatif dl { display: grid; grid-template-columns: auto 1fr; gap: .3em .9em; }
.recapitulatif dt { font-weight: 600; color: var(--encre-douce); font-size: .85rem; }
.recapitulatif dd { margin: 0; }
.recapitulatif dd.multiligne { white-space: pre-line; }

.filtres { display: flex; flex-wrap: wrap; gap: .5em; margin: 1em 0; }
.filtres input[type="search"] { flex: 1; min-width: 200px; }

.tableau-admin td.multiligne { white-space: pre-line; max-width: 220px; }

.formulaire-suppression { margin-top: 2em; border-top: 1px solid var(--ivoire-fonce); padding-top: 1em; }
.btn-supprimer {
  background: none; border: 1px solid var(--erreur); color: var(--erreur);
  border-radius: var(--rayon); padding: .45em 1em; cursor: pointer; font: inherit;
}
.btn-supprimer:hover { background: var(--erreur); color: #fff; }

/* ================================================================
   Page d'accueil : scène d'ouverture — la photo s'ouvre en très gros
   plan sur les têtes choquées ; le défilement dézoome la photo pour
   révéler tout le paysage, puis fait apparaître les textes, puis
   défile la scène vers le bas pendant que le carré de texte monte.
   Tout est piloté par le défilement, rien ne se déclenche seul
   (voir JS dans accueil.html).
   ================================================================ */

/* En grand, mais détachée des bords de la page : marges modestes et
   coins bien arrondis. */
.hero-scene {
  height: 86svh; min-height: 420px;
  width: calc(100% - 1.5rem);
  max-width: none; overflow: hidden;
  margin-left: auto; margin-right: auto;
  border-radius: 26px;
}
.hero-scene picture { display: block; height: 100%; }
.hero-scene .hero-photo {
  height: 100%; width: 100%;
  transform-origin: 50% 32%;      /* là où sont les têtes de choqué */
  object-position: 50% 32%;
  will-change: transform;
}
/* Scène ouverte par défaut : la photo pleine est déjà visible si le
   JS ne démarre pas (no-JS ou préférence « réduire les animations »). */

/* Phase 1 : très gros plan sur les têtes (en attente du défilement).
   Pas de specificity elevatee : le JS pilote le transform inline. */
html.hero-zoom-intro .hero-scene .hero-photo { transform: scale(2.15); }
/* Le JS prend la main : sa valeur inline (zoom de départ) l'emporte. */

/* La scène reste épinglée en haut de l'écran (position sticky) pendant
   toute la réserve de défilement : la photo occupe l'écran seule et le
   dézoom peut toujours aller jusqu'au bout. Une fois la photo entière,
   le texte sur la photo s'affiche ; puis, en continuant à descendre,
   le carré de texte arrive par-dessus la photo (z-index au-dessus).
   Le chemin inverse (remontée) reproduit exactement le même chemin. */
html.hero-zoom-intro .hero-enclos { position: relative; z-index: 0; }
html.hero-zoom-intro .hero-scene {
  position: sticky; top: 0; z-index: 0;
}
/* Le contenu de la page (carte, texte, bouton) passe au-dessus de la
   photo. */
.page main, .page .flash-zones, .page .pied { position: relative; z-index: 1; }

/* ---------------- Bouton « Présents ? » — dessin ovale ornemental ----------------
   L'image (PNG transparent, bleu nuit du site) remplace le texte et les
   accolades. Taille contenue : un peu plus large que le texte d'annonce,
   hauteur d'environ deux lignes. */
.bouton-repondre {
  display: inline-flex; align-items: center;
  background: transparent; border: none; box-shadow: none;
  text-decoration: none;
  padding: .2em;
}
.bouton-repondre .dessin-bouton {
  height: 4.6em; width: auto; display: block;
  transition: transform .35s cubic-bezier(.22, .8, .32, 1), opacity .35s ease;
}
.bouton-repondre:hover .dessin-bouton,
.bouton-repondre:focus-visible .dessin-bouton {
  transform: scale(1.06); opacity: .85;
}
.bouton-repondre:hover, .bouton-repondre:focus-visible { box-shadow: none; transform: none; }

/* ================================================================
   Page d'accueil : hero photo + animations douces (façon Apple)
   ================================================================ */

.hero {
  position: relative; overflow: hidden; border-radius: var(--rayon);
  margin: 0 auto 1.5rem; max-width: 680px;
  box-shadow: var(--ombre);
}
.hero-photo {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 4;
  object-fit: cover; object-position: 50% 22%;
}

.hero-voile {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(74,63,53,.55) 0%, rgba(74,63,53,.12) 38%, transparent 60%);
  pointer-events: none;
}
.hero-texte {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1.2rem 1.6rem;
  text-align: center; color: #fffdf9;
  overflow-wrap: break-word; hyphens: auto;
}
/* Sur très petits écrans, le sur-titre spaced ne doit pas déborder */
@media (max-width: 480px) {
  .hero-texte .sur-titre { letter-spacing: .14em; font-size: .9rem; }
  .hero-texte .noms { font-size: 2.3rem; }
  .hero-texte .date-grande, .hero-texte .lieu { font-size: 1.3rem; }
}
.hero-texte .noms { color: #fffdf9; text-shadow: 0 1px 12px rgba(0,0,0,.35); font-size: 3rem; }
.hero-texte .date-grande, .hero-texte .lieu { color: #fdf8f0; text-shadow: 0 1px 8px rgba(0,0,0,.3); font-size: 1.7rem; }
.hero-texte .sur-titre { color: #f6ead8; letter-spacing: .28em; font-size: 1.1rem; }

.hero-reveal { opacity: 0; animation: hero-apparait 1s cubic-bezier(.22,.8,.32,1) forwards; animation-delay: var(--d, .2s); }
/* Sans JS ou préférence « réduire les animations » : textes visibles. */
html.hero-textes-cache .hero-reveal { animation: none; }
html.hero-textes-cache.hero-textes-pres .hero-reveal { opacity: 1; }
@keyframes hero-apparait {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Apparition au défilement : déclenchée par IntersectionObserver (JS),
   fallback sans JS via apparition-deferement si pas de classe js. */
.carte-centree.apparition-deferement.js-attente { opacity: 0; transform: translateY(24px); }
.carte-centree.apparition-deferement.js-visible {
  opacity: 1; transform: none;
  transition: opacity .9s cubic-bezier(.22,.8,.32,1), transform .9s cubic-bezier(.22,.8,.32,1);
}

.cta-apparition { opacity: 0; animation: hero-apparait 1s ease forwards; animation-delay: 1.1s; }

.bouton-pulsation { transition: transform .35s cubic-bezier(.22,.8,.32,1), box-shadow .35s ease, background .3s ease; }
.bouton-pulsation:hover, .bouton-pulsation:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(185,127,119,.35);
}
.bouton-pulsation:active { transform: translateY(0) scale(.98); }

/* Micro-animations globales */
.carte { transition: box-shadow .4s ease; }
.carte:hover { box-shadow: 0 4px 22px rgba(74,63,53,.13); }
.bouton, .btn-principal { transition: transform .3s cubic-bezier(.22,.8,.32,1), box-shadow .3s ease; }
.bouton:hover, .btn-principal:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(185,127,119,.3); }

/* Préférence « réduire les animations » : tout reste lisible, sans mouvement */
@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; transform: none !important; transition: none !important; }
  .hero-scene { transition: none !important; }
  .hero-texte { transition: none !important; }
  .hero-reveal { animation: none !important; opacity: 1 !important; }
  .cta-apparition { animation: none; opacity: 1; }
  .carte-centree.apparition-deferement.js-attente { opacity: 1; transform: none; }
  .carte-centree.apparition-deferement.js-visible { transition: none; }
  .bouton-pulsation, .bouton, .btn-principal, .carte { transition: none; }
  .apparition { animation: none !important; opacity: 1 !important; }
}

@media (max-width: 560px) {
  /* Le hero hors scène redevient à raz bord (marges négatives) */
  .hero:not(.hero-scene) {
    border-radius: 0; margin-left: calc((100vw - 100%) / -2); margin-right: calc((100vw - 100%) / -2);
    max-width: none; width: 100vw;
  }
}

/* ================================================================
   Page d'accueil : photo adaptee a l'orientation
   ================================================================ */

/* Portrait par defaut (mobile a la verticale) : photo 3:4.
   La scene d'ouverture est epargnee : sa hauteur est le viewport. */
.hero:not(.hero-scene) { aspect-ratio: 3 / 4; }
.hero picture { display: block; height: 100%; }
.hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* Paysage (ordi ou mobile a l'horizontale) : photo 4:3 pleine, sans crop.
   La scene d'ouverture garde sa hauteur de viewport (regle specifique
   .hero.hero-scene plus bas). */
@media (orientation: landscape) {
  .hero:not(.hero-scene) { aspect-ratio: 4 / 3; }
  .hero-photo { object-position: center; }
}

/* Sur ordi (ecran large), la scène reste en grand mais conserve de
   modestes marges latérales et ses coins arrondis : elle est grande,
   pas à raz bord de la page. La spécificité .hero.hero-scene (.hero-scene)
   garantit de gagner sur la base .hero (max-width: 680px). */
@media (min-width: 900px) {
  .hero.hero-scene {
    height: 86svh;
    width: min(calc(100% - 4rem), 1400px);
    max-width: none;
    border-radius: 32px;
  }
  .hero-scene .hero-photo { aspect-ratio: auto; height: 100%; }
}

/* Petits écrans : la scène reste détachée des bords, arrondie aussi. */
@media (max-width: 560px) {
  .hero.hero-scene {
    width: calc(100% - 1rem); border-radius: 18px;
  }
}

