/* ===========================================
   Camille & Ludovic — Save the Date
   Palette : ivoire / noir / doré clair
   Parti pris : enveloppe uniforme doré clair,
               détails en lignes noires fines,
               ornements floraux en coins opposés.
   =========================================== */

:root {
  --paper: #ede4ce;
  --bg: #f2ece0;
  --envelope: #ece4cc;
  --envelope-shade: #d9cfb3;
  --envelope-deep: #c7bb98;
  --ink: #141414;
  --ink-soft: #3a3a3a;
  --muted: #8a7f68;
  --accent: #c9a227;
  --accent-dark: #8a6a12;
  --wax: #caa228;
  --wax-dark: #8a6a12;

  --serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --script: "Pinyon Script", "Brush Script MT", cursive;

  --ease: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

body.home {
  background-color: var(--bg);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Illustration du lieu — pseudo-élément pour pouvoir l'animer (background-image n'est pas animable) */
body.home::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: url("assets/chateau-de-pizay.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 1.2s var(--ease-out) 0.15s,
    transform 1.6s var(--ease-out) 0.1s;
  pointer-events: none;
}

body.home.opened::before {
  opacity: 1;
  transform: scale(1);
}

/* ===========================================
   Scène
   =========================================== */

.stage {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ===========================================
   Enveloppe — photo Midjourney en hero plein écran
   =========================================== */

.envelope-photo {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  transition:
    opacity 1.2s var(--ease-out),
    transform 1.4s var(--ease-out);
  will-change: transform, opacity;
}

.envelope-video {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Desktop : vidéo landscape */
@media (min-width: 769px) {
  .envelope-video--mobile { display: none; }
}

/* Mobile : vidéo portrait */
@media (max-width: 768px) {
  .envelope-video--desktop { display: none; }
}

.envelope-photo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -10px;
}

.envelope-video {
  transition: transform 0.7s var(--ease-out);
}

@media (hover: hover) {
  .envelope-photo:not(.open):not(.playing):hover .envelope-video {
    transform: scale(1.04);
  }
}

/* ===========================================
   Carte Save the Date (apparaît à l'ouverture)
   =========================================== */

/* Voile blanc pour transition cinématique vidéo → illustration */
.white-flash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #ffffff;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
  transition: opacity 1s ease;
}

.white-flash.fade-in {
  opacity: 1;
  transition: opacity 2.5s ease-in;
}

.white-flash.fade-out {
  opacity: 0;
  transition: opacity 2.5s ease-out;
}

/* Carte Save the Date — juste le panneau texte, l'illustration est en fond de page */
.save-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 88vw);
  padding: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
  z-index: 10;
  text-align: center;
}

/* Panneau texte — crème translucide, cadre doré intérieur, ornements aux coins */
.save-card-inner {
  position: relative;
  padding: 2.5rem 2rem 2.25rem;
  background: rgba(245, 238, 220, 0.93);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* coins légèrement asymétriques = papier plié à la main, pas imprimé industriel */
  border-radius: 9px 11px 10px 12px / 11px 9px 12px 10px;
  box-shadow:
    0 22px 55px -14px rgba(30, 20, 5, 0.4),
    0 8px 18px -4px rgba(30, 20, 5, 0.2),
    inset 0 0 0 1px rgba(30, 20, 5, 0.06);
  opacity: 0;
  transform: translateY(14px) scale(0.95);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

/* Cadre doré intérieur — double ligne classique des invitations mariage */
.save-card-inner::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  border: 1.5px solid rgba(182, 138, 60, 0.6);
  outline: 0.75px solid rgba(182, 138, 60, 0.3);
  outline-offset: -5px;
  border-radius: 5px 7px 6px 8px / 7px 5px 8px 6px;
  pointer-events: none;
}

/* Ornements de coins — crochets dorés à double trait + losange aux 4 angles */
.save-card-inner::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  left: 5px;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none'><path d='M5 28L5 5L28 5' stroke='rgba(176,124,40,0.7)' stroke-width='1.2' stroke-linecap='square'/><path d='M11 23L11 11L23 11' stroke='rgba(176,124,40,0.38)' stroke-width='0.8' stroke-linecap='square'/><path d='M5 2.5L7.5 5L5 7.5L2.5 5Z' fill='rgba(176,124,40,0.75)'/></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none'><path d='M55 28L55 5L32 5' stroke='rgba(176,124,40,0.7)' stroke-width='1.2' stroke-linecap='square'/><path d='M49 23L49 11L37 11' stroke='rgba(176,124,40,0.38)' stroke-width='0.8' stroke-linecap='square'/><path d='M55 2.5L57.5 5L55 7.5L52.5 5Z' fill='rgba(176,124,40,0.75)'/></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none'><path d='M5 32L5 55L28 55' stroke='rgba(176,124,40,0.7)' stroke-width='1.2' stroke-linecap='square'/><path d='M11 37L11 49L23 49' stroke='rgba(176,124,40,0.38)' stroke-width='0.8' stroke-linecap='square'/><path d='M5 52.5L7.5 55L5 57.5L2.5 55Z' fill='rgba(176,124,40,0.75)'/></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none'><path d='M55 32L55 55L32 55' stroke='rgba(176,124,40,0.7)' stroke-width='1.2' stroke-linecap='square'/><path d='M49 37L49 49L37 49' stroke='rgba(176,124,40,0.38)' stroke-width='0.8' stroke-linecap='square'/><path d='M55 52.5L57.5 55L55 57.5L52.5 55Z' fill='rgba(176,124,40,0.75)'/></svg>");
  background-size: 60px 60px;
  background-repeat: no-repeat;
  background-position: top left, top right, bottom left, bottom right;
}

body.opened .save-card {
  pointer-events: auto;
}

body.opened .save-card-inner {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* Délai depuis body.opened :
     0.7s pause sur le voile blanc + 2.5s de fade-out + 2.5s d'admiration de l'illustration */
  transition-delay: 5.7s;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.6rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  flex: 1;
  max-width: 26px;
  height: 1px;
  background: var(--accent-dark);
  opacity: 0.4;
}

.couple {
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.couple .script {
  font-family: var(--script);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  color: var(--ink);
  font-weight: 400;
  display: inline-block;
}

.couple .amp {
  font-family: var(--script);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--accent-dark);
  margin: 0 0.2em;
  vertical-align: 0.1em;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.6rem auto 0.8rem;
  max-width: 220px;
}

.divider span {
  flex: 1;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
}

.divider .diamond {
  flex: none;
  color: var(--accent-dark);
  font-size: 0.6rem;
  line-height: 1;
}

.date {
  font-size: clamp(1.1rem, 3.2vw, 1.4rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.location {
  margin: 0.5rem 0 1.1rem;
  line-height: 1.4;
}

.location-name {
  font-size: clamp(1rem, 2.7vw, 1.15rem);
  color: var(--ink);
  font-weight: 600;
  font-style: italic;
  margin-bottom: 0.2rem;
}

.location-address {
  font-size: clamp(0.85rem, 2.3vw, 0.95rem);
  color: var(--ink-soft);
  margin: 0;
}

.location-district {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.15rem;
}

.cta {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  letter-spacing: 0.05em;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.cta:hover,
.cta:focus {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* ===========================================
   État ouvert
   =========================================== */

.envelope-photo.open {
  transform: scale(1.08) translateY(-1vh);
  opacity: 0;
  pointer-events: none;
  filter: blur(2px);
  transition:
    opacity 1.2s var(--ease-out),
    transform 1.4s var(--ease-out),
    filter 1.2s var(--ease-out);
}

/* ===========================================
   Responsive mobile
   =========================================== */

@media (max-width: 768px) {
  /* Illustration portrait dédiée pour mobile */
  body.home::before {
    background-image: url("assets/chateau-de-pizay-mobile.jpg");
  }
  .save-card-inner {
    padding: 1.75rem 1.25rem 1.5rem;
  }
}

@media (max-width: 420px) {
  .save-card-inner {
    padding: 1.5rem 1rem 1.25rem;
  }
}

/* Accessibilité : reduced motion */
@media (prefers-reduced-motion: reduce) {
  .envelope-photo,
  .save-card,
  .save-card-inner,
  body.opened .save-card-inner,
  body.home::before,
  body.home.opened::before {
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
}

/* ===========================================
   Page Infos
   =========================================== */

body.infos {
  background: var(--bg);
  min-height: 100vh;
  padding: 0 1.25rem 4rem;
  line-height: 1.65;
}

.info-header {
  max-width: 720px;
  margin: 3rem auto 3rem;
  text-align: center;
  position: relative;
}

.back-link {
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.back-link:hover,
.back-link:focus {
  color: var(--accent-dark);
}

.monogram {
  margin-top: 3rem;
  line-height: 1.1;
}

.monogram .script {
  font-family: var(--script);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  color: var(--ink);
  display: inline-block;
}

.monogram .amp {
  font-family: var(--script);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--accent-dark);
  margin: 0 0.2em;
  vertical-align: 0.1em;
}

.info-date {
  margin-top: 0.5rem;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.info-header .divider {
  margin-top: 1.5rem;
}

.info-main {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.info-section {
  text-align: center;
}

.info-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--ink);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

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

.info-section p {
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  color: var(--ink-soft);
  margin: 0.15rem 0;
}

.info-section p strong {
  color: var(--ink);
  font-weight: 600;
}

.info-section .note {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.timeline {
  list-style: none;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: baseline;
  gap: 1rem;
  text-align: left;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed rgba(20, 20, 20, 0.12);
}

.timeline li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline .time {
  font-weight: 600;
  color: var(--accent-dark);
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

.timeline .event {
  color: var(--ink);
  font-size: 1rem;
}

.plain {
  list-style: none;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.plain li {
  color: var(--ink-soft);
  font-size: 1rem;
}

.rsvp-cta {
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 4px;
  padding: 2rem 1.25rem;
}

.rsvp-cta a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

/* ===========================================
   Photos séparateurs — page Infos
   =========================================== */

.info-photo {
  margin: 0 -1.25rem;
  width: calc(100% + 2.5rem);
}

.info-photo img {
  display: block;
  width: 100%;
  height: clamp(240px, 55vw, 480px);
  object-fit: cover;
  object-position: center;
}

.info-photo--hero img {
  height: clamp(260px, 60vw, 520px);
}

/* ===========================================
   Footer infos
   =========================================== */

.info-footer {
  max-width: 720px;
  margin: 4rem auto 2rem;
  text-align: center;
  color: var(--ink-soft);
}

.info-footer .script-small {
  font-family: var(--script);
  font-size: 1.8rem;
  color: var(--ink-soft);
  margin-top: 1.25rem;
}

.info-footer .signature {
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  color: var(--accent-dark);
  margin-top: 0.25rem;
}

@media (max-width: 480px) {
  body.infos { padding: 0 1rem 3rem; }
  .info-photo { margin: 0 -1rem; width: calc(100% + 2rem); }
  .monogram { margin-top: 0; }
  .timeline li {
    grid-template-columns: 70px 1fr;
    gap: 0.75rem;
  }
}
