/* ============================================================
   Mariage de Maya & Gabriel — thème Amalfi / citrons
   Chaux blanche, bleu majolique, jaune citron.
   ============================================================ */

:root {
  --cobalt:        #1F4E9C;
  --cobalt-fonce:  #163A75;
  --cobalt-clair:  #DCE6F5;
  --citron:        #F2C230;
  --citron-pale:   #FFF6CF;
  --feuille:       #5E8C3A;
  --creme:         #FBF7EE;
  --chaux:         #F4EEE3;
  --encre:         #1E2A44;

  --titre:  'Italianno', cursive;
  --corps:  'Cormorant Garamond', Georgia, serif;
  --sans:   'Jost', 'Helvetica Neue', Arial, sans-serif;
  --hebreu: 'Frank Ruhl Libre', 'David', serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--corps);
  font-size: 19px;
  line-height: 1.6;
  color: var(--encre);
  background: var(--creme);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.pas-de-scroll { overflow: hidden; height: 100vh; }

p { margin: 0; }

.bsd {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 5;
  font-family: var(--hebreu);
  font-size: 17px;
  color: var(--cobalt);
}

/* la frise de carreaux de majolique */
.frise {
  height: 60px;
  background: url('images/carreau.svg') 0 0 / 60px 60px repeat-x;
  border-top: 3px solid var(--cobalt);
  border-bottom: 3px solid var(--cobalt);
}
.frise--fine { height: 36px; background-size: 36px 36px; }


/* ============================================================
   1. LA PAGE DE GARDE : le mur blanc et les volets bleus
   ============================================================ */

.couverture {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* un mur passé à la chaux */
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, .8), transparent 50%),
    radial-gradient(ellipse at 80% 85%, rgba(214, 200, 176, .45), transparent 55%),
    radial-gradient(circle at 60% 40%, rgba(230, 220, 200, .35), transparent 30%),
    var(--chaux);
}

.couverture__contenu {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  text-align: center;
}

.couverture__haut {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.couverture__branche {
  position: relative;
  z-index: 3;
  width: min(330px, 86vw);
  margin: 14px 0 -36px;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .15));
}

/* ---------- La fenêtre ---------- */

.fenetre {
  --l: min(260px, 66vw);
  --h: min(340px, 42vh);
  position: relative;
  width: var(--l);
  height: var(--h);
  padding: 0;
  border: 12px solid #FFFDF8;
  border-radius: 4px;
  background: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 14px 26px rgba(80, 60, 30, .25), inset 0 0 0 1px rgba(0, 0, 0, .1);
  perspective: 1100px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fenetre:focus-visible { outline: 3px solid var(--citron); outline-offset: 6px; }

/* la vue sur Positano, derrière les volets */
.fenetre__vue {
  position: absolute;
  inset: 0;
  background: url('images/vue-fenetre.jpg') center / cover no-repeat, #8EC5E8;
  transition: transform 1.6s ease;
}

.volet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: var(--cobalt);
  box-shadow: inset 0 0 0 3px var(--cobalt-fonce), 0 4px 10px rgba(0, 0, 0, .2);
  transition: transform 1.5s cubic-bezier(.6, .05, .25, 1);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.volet--gauche { left: 0;  transform-origin: 0 50%; }
.volet--droite { right: 0; transform-origin: 100% 50%; }

/* les lames persiennes */
.volet__panneau {
  flex: 1;
  background: repeating-linear-gradient(180deg,
    #3366B5 0 7px,
    #24508F 7px 9px,
    #4677C2 9px 10px);
  box-shadow: inset 0 0 0 2px var(--cobalt-fonce);
}

/* l'espagnolette dorée sur le volet droit */
.volet--droite::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 34px;
  margin-top: -17px;
  border-radius: 3px;
  background: linear-gradient(90deg, #A9832C, #F4DA8A, #A9832C);
}

.couverture.ouverte .volet--gauche { transform: rotateY(-112deg); }
.couverture.ouverte .volet--droite { transform: rotateY(112deg); }
.couverture.ouverte .fenetre__vue  { transform: scale(1.08); }

/* l'appui de fenêtre en carreaux */
.fenetre__appui {
  display: block;
  width: calc(min(260px, 66vw) + 52px);
  height: 22px;
  background: url('images/carreau.svg') 0 0 / 22px 22px repeat-x;
  border-top: 3px solid var(--cobalt);
  border-bottom: 3px solid var(--cobalt);
  box-shadow: 0 8px 12px rgba(80, 60, 30, .2);
}

.couverture__noms {
  margin-top: 18px;
  font-family: var(--titre);
  font-size: clamp(56px, 16vw, 76px);
  line-height: 1;
  color: var(--cobalt);
}
.couverture__noms span { color: var(--citron); font-size: .8em; }

.couverture__appel {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--encre);
  animation: invite 2s ease-in-out infinite;
}

@keyframes invite {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* la page de garde s'efface une fois les volets ouverts */
.couverture.partie {
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}


/* ============================================================
   2. LE GRAND VISUEL
   ============================================================ */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  padding: 13vh 16px 0;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(15, 40, 85, .55) 0%, rgba(15, 40, 85, .42) 48%, rgba(15, 40, 85, 0) 68%, rgba(0, 0, 0, .3) 100%),
    url('images/positano.jpg') center / cover no-repeat;
}

.hero__sur {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .35em;
  text-transform: uppercase;
}

.hero__noms {
  margin: 6px 0 0;
  font-family: var(--titre);
  font-weight: 400;
  font-size: clamp(72px, 21vw, 130px);
  line-height: .95;
  text-shadow: 0 2px 18px rgba(10, 30, 70, .45);
}
.hero__noms span { color: var(--citron); font-size: .75em; }

.hero__hebreu {
  font-family: var(--hebreu);
  font-size: 26px;
  text-shadow: 0 2px 10px rgba(10, 30, 70, .5);
}

.hero__date {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 20px;
  letter-spacing: .25em;
  text-shadow: 0 2px 10px rgba(10, 30, 70, .5);
}

.hero__lieu {
  margin-top: 6px;
  font-style: italic;
  font-size: 19px;
  text-shadow: 0 2px 10px rgba(10, 30, 70, .5);
}

.hero__descendre {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  animation: descend 1.8s ease-in-out infinite;
}

@keyframes descend {
  50% { transform: translate(-50%, 8px); }
}


/* ============================================================
   3. LE FAIRE-PART
   ============================================================ */

.faire-part {
  max-width: 560px;
  margin: 0 auto;
  padding: 50px 22px 30px;
  text-align: center;
}

.branche {
  display: block;
  width: min(260px, 70vw);
  margin: 0 auto 26px;
}

.verset {
  font-family: var(--hebreu);
  font-size: 28px;
  color: var(--cobalt);
}

.verset-fr {
  margin-top: 4px;
  font-size: 16px;
  font-style: italic;
  color: #5A6378;
}

.familles {
  display: grid;
  gap: 18px;
  margin-top: 34px;
  font-size: 19px;
  line-height: 1.55;
}

.invite {
  margin-top: 22px;
  font-size: 20px;
  font-style: italic;
  text-wrap: balance;
}

.noms {
  margin-top: 12px;
  font-family: var(--titre);
  font-size: clamp(64px, 18vw, 96px);
  line-height: 1;
  color: var(--cobalt);
}
.noms span { color: var(--citron); font-size: .75em; }


/* ============================================================
   4. LE COMPTE À REBOURS EN CARREAUX
   ============================================================ */

.rebours {
  padding: 30px 16px 60px;
  text-align: center;
}

.petit-titre {
  margin-bottom: 18px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.compteur {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compteur__case {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* chaque chiffre est posé sur un carreau de majolique */
.compteur__chiffre {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  background: url('images/carreau.svg') center / cover;
  border: 3px solid var(--cobalt);
  font-family: var(--corps);
  font-weight: 600;
  font-size: 26px;
  color: var(--cobalt);
  isolation: isolate;
}
.compteur__chiffre::before {          /* la pastille crème sous le chiffre */
  content: '';
  position: absolute;
  inset: 11px;
  z-index: -1;
  border-radius: 50%;
  background: var(--creme);
  box-shadow: 0 0 0 2px var(--citron);
}

.compteur__libelle {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #5A6378;
}


/* ============================================================
   5. LE PROGRAMME
   ============================================================ */

.programme {
  padding: 60px 16px 80px;
  background: var(--cobalt-clair);
  background:
    linear-gradient(rgba(251, 247, 238, .9), rgba(251, 247, 238, .9)),
    url('images/carreau.svg') 0 0 / 90px 90px;
}

.titre {
  margin: 0 0 34px;
  font-family: var(--titre);
  font-weight: 400;
  font-size: clamp(56px, 15vw, 80px);
  line-height: 1;
  text-align: center;
  color: var(--cobalt);
}

.moments {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* une carte bordée de carreaux */
.moment {
  position: relative;
  width: min(370px, 100%);
  padding: 14px;
  text-align: center;
  background: url('images/carreau.svg') 0 0 / 28px 28px;
  box-shadow: 0 14px 30px rgba(31, 78, 156, .18);
}
.moment > * { position: relative; }
.moment::before {                       /* le fond crème au centre */
  content: '';
  position: absolute;
  inset: 14px;
  background: var(--creme);
  box-shadow: 0 0 0 3px var(--cobalt);
}

.moment__icone {
  display: block;
  width: 52px;
  height: 52px;
  margin: 26px auto 8px;
  color: var(--cobalt);
}

.moment__jour {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #5A6378;
}

.moment__titre {
  margin: 4px 0 0;
  font-family: var(--titre);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.05;
  padding: 0 18px;
  color: var(--cobalt);
}

.moment__hebreu {
  font-size: 16px;
  font-style: italic;
  color: #8A7340;
}

.moment__heure {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .08em;
}

.moment__lieu {
  margin-top: 12px;
  font-size: 19px;
  line-height: 1.4;
  padding: 0 14px;
}
.moment__lieu strong { font-weight: 600; color: var(--cobalt); }

.moment__note {
  margin-top: 8px;
  font-size: 17px;
  font-style: italic;
  color: #5A6378;
}

.moment--principal::before { background: var(--citron-pale); }

.bouton {
  display: inline-block;
  margin: 20px 0 28px;
  padding: 12px 26px;
  border-radius: 40px;
  background: var(--cobalt);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 78, 156, .3);
  transition: background-color .25s ease, transform .25s ease;
}
.bouton:hover { background: var(--cobalt-fonce); transform: translateY(-2px); }


/* ============================================================
   6. LA GALERIE
   ============================================================ */

.galerie {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 16px 60px;
}

.galerie__intro {
  margin: -20px 0 30px;
  font-style: italic;
  text-align: center;
  color: #5A6378;
}

.galerie__grille {
  columns: 2;
  column-gap: 10px;
}

.galerie__photo {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
  break-inside: avoid;
  cursor: zoom-in;
}
.galerie__photo img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .8s ease;
}
.galerie__photo:hover img { transform: scale(1.05); }

/* la photo en grand */
.visionneuse {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 30, 60, .92);
}
.visionneuse[hidden] { display: none; }
.visionneuse img { max-width: 100%; max-height: 90vh; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.visionneuse__fermer {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 42px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}


/* ============================================================
   7. LES INFOS PRATIQUES
   ============================================================ */

.infos {
  padding: 60px 16px 70px;
  background: var(--cobalt);
  color: #fff;
}
.infos .titre { color: #fff; }

.infos__grille {
  display: grid;
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.info {
  padding: 22px 22px 24px;
  border: 1px solid rgba(255, 255, 255, .35);
  text-align: center;
  font-size: 19px;
}
.info strong { color: var(--citron); font-weight: 600; }

.info__titre {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--citron);
}


/* ============================================================
   8. LE PIED DE PAGE
   ============================================================ */

.pied {
  padding-top: 60px;
  text-align: center;
  background: var(--creme);
}

.branche--pied { margin-bottom: 8px; }

.pied__merci {
  font-family: var(--titre);
  font-size: 70px;
  line-height: 1;
  color: var(--cobalt);
}

.pied__mot {
  margin: 8px 0 44px;
  padding: 0 20px;
  font-style: italic;
  font-size: 20px;
}

.barre-signature {
  padding: 14px 16px 70px;
  background: var(--cobalt-fonce);
}
.barre-signature p {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .7);
}


/* ---------- Apparition au défilement ---------- */

.js .apparait {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1s ease;
}
.js .apparait.visible { opacity: 1; transform: none; }


/* ============================================================
   LE BOUTON MUSIQUE (composant commun à tous les sites)
   ============================================================ */

.musique {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--cobalt);
  background: var(--cobalt);
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  transition: transform .2s ease, background-color .3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.musique.visible { display: flex; }

/* l'onde qui s'echappe du bouton pendant la lecture */
.musique::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--cobalt);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
}

.musique.joue { animation: musique-respire 2s infinite ease-in-out; }
.musique.joue::before { animation: musique-onde 1.5s infinite ease-out; }

@keyframes musique-respire {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@keyframes musique-onde {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: .8; }
  100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }
}

/* les quatre barres de l'egaliseur */
.musique__barres {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 16px;
}

.musique__barres span {
  width: 2.5px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

/* a l'arret les barres restent basses ; en lecture elles montent en vague */
.musique.joue .musique__barres span {
  animation: musique-vague .45s infinite ease-in-out alternate;
}

.musique.joue .musique__barres span:nth-child(1) { animation-delay: 0s; }
.musique.joue .musique__barres span:nth-child(2) { animation-delay: .15s; }
.musique.joue .musique__barres span:nth-child(3) { animation-delay: .3s; }
.musique.joue .musique__barres span:nth-child(4) { animation-delay: .1s; }

@keyframes musique-vague {
  from { height: 3px; }
  to   { height: 16px; }
}


/* ============================================================
   ÉCRANS PLUS LARGES
   ============================================================ */

@media (min-width: 768px) {
  .familles { grid-template-columns: 1fr 1fr; gap: 30px; }

  .moments {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
  }
  .moment { width: 330px; }
  .moment--principal { margin-top: -16px; margin-bottom: 16px; }

  .compteur { gap: 22px; }
  .compteur__chiffre { width: 96px; height: 96px; font-size: 32px; }
  .compteur__chiffre::before { inset: 22px; }

  .galerie__grille { columns: 3; column-gap: 14px; }
  .galerie__photo { margin-bottom: 14px; }

  .infos__grille { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) and (min-height: 800px) {
  .fenetre { --l: 300px; --h: 390px; }
  .fenetre__appui { width: 352px; }
}


/* Respecte les personnes qui ont désactivé les animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01s !important;
  }
  html { scroll-behavior: auto; }
}
