/* ==========================================================================
   Alexane & Jules, papeterie fine
   Parti pris : peu d'ornements, beaucoup d'air, un seul filet or.
   ========================================================================== */

:root {
  /* couleurs */
  --surround: #cfc3a8;
  --paper: #faf5ec;
  --paper-warm: #f4ecdd;
  --card: #fffdf9;
  --line: #e2d5bd;
  --line-soft: #eee5d5;
  --gold: #a8823f;
  --terracotta: #b45f3a;
  --terracotta-deep: #94492a;
  --olive: #6b7644;
  --ink: #33291f;
  --ink-mid: #6b5d4d;
  --ink-soft: #8a7a67;

  /* espacement (rythme de 8) */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 88px;

  --shadow-card: 0 1px 2px rgba(80, 55, 25, 0.04), 0 12px 28px -18px rgba(80, 55, 25, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: var(--s3) var(--s2);
  background-color: var(--surround);
  background-image: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255, 250, 238, 0.5), transparent 65%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Cadre : la carte d'invitation. Double filet interieur = letterpress.
   -------------------------------------------------------------------------- */
.frame {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  background-color: var(--paper);
  /* grain de papier tres fin, une seule couche */
  background-image: radial-gradient(rgba(120, 90, 45, 0.045) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  box-shadow: 0 40px 80px -40px rgba(50, 32, 12, 0.55), 0 2px 6px rgba(50, 32, 12, 0.08);
}
.frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 2;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  z-index: 2;
}

.page {
  padding: 0 var(--s4) var(--s6);
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */
h1, h2 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 500;
  margin: 0;
  color: var(--terracotta-deep);
}

.eyebrow {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
}

/* --------------------------------------------------------------------------
   Filet ornemental : le SEUL ornement repete du site
   -------------------------------------------------------------------------- */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 148px;
  margin: 0 auto;
  color: var(--gold);
}
.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}
.rule span {
  width: 5px;
  height: 5px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: var(--s7) 0 var(--s5);
}

.medallion {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto var(--s4);
  color: var(--gold);
}
.medallion svg { display: block; width: 100%; height: 100%; }
.medallion-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--terracotta-deep);
}
.medallion-text span {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.hero h1 {
  margin: var(--s3) 0 var(--s2);
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.hero h1 .amp {
  font-style: italic;
  font-weight: 400;
  font-size: 0.72em;
  color: var(--gold);
  padding: 0 0.06em;
}

.hero .place {
  margin: 0 0 var(--s5);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-mid);
}

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: clamp(var(--s3), 6vw, var(--s5));
  padding: var(--s3) 0;
  background: var(--paper);
}
/* fondu court sous la barre : le contenu ne transparait pas derriere les onglets */
.tabs::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 20px;
  background: linear-gradient(var(--paper), rgba(250, 245, 236, 0));
  pointer-events: none;
}
.tabs button {
  position: relative;
  padding: var(--s1) 2px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.25s ease;
}
.tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--terracotta);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.tabs button:hover { color: var(--ink-mid); }
.tabs button.active { color: var(--terracotta-deep); }
.tabs button.active::after { transform: scaleX(1); }

.tab { display: none; }
.tab.active { display: block; animation: fade-up 0.4s ease both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
  padding: var(--s5) clamp(var(--s3), 5vw, var(--s5));
}

.card h2 {
  margin-bottom: var(--s5);
  font-size: 1.3rem;
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.005em;
}

.lead {
  margin: calc(var(--s5) * -1 + var(--s3)) auto var(--s4);
  max-width: 42ch;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-mid);
}

/* --------------------------------------------------------------------------
   Programme
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  --tl-time: 62px;
  --tl-gap: var(--s2);
  --tl-marker: 20px;
}
/* fil continu, du premier au dernier moment */
.timeline::before {
  content: "";
  position: absolute;
  left: calc(var(--tl-time) + var(--tl-gap) + var(--tl-marker) / 2);
  top: var(--s3);
  bottom: var(--s3);
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: var(--tl-time) var(--tl-marker) 1fr;
  align-items: baseline;
  column-gap: var(--tl-gap);
  padding: var(--s3) 0;
}

.timeline-time {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--terracotta);
  text-align: right;
  white-space: nowrap;
}
.timeline-time span { font-size: 0.7em; opacity: 0.75; }

.timeline-marker {
  position: relative;
  align-self: start;
  height: 1em;
}
/* losange pose sur le fil, cerne de la couleur de la carte pour l'interrompre */
.timeline-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--card);
  transform: translate(-50%, -50%) rotate(45deg);
}

.timeline-body strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.map-link {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.map-link::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 6px;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.map-link:hover { color: var(--terracotta-deep); border-color: var(--terracotta); }

.note {
  margin: var(--s4) 0 0;
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
  color: var(--olive);
}

/* --------------------------------------------------------------------------
   Souvenirs
   -------------------------------------------------------------------------- */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 var(--s4);
  padding: 0;
  display: grid;
  gap: var(--s2);
  max-width: 32ch;
  margin-inline: auto;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: var(--s4);
  font-size: 0.9rem;
  color: var(--ink-mid);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--gold);
}
.steps strong { color: var(--ink); font-weight: 600; }

input[type="text"] {
  display: block;
  width: 100%;
  margin-bottom: var(--s2);
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: var(--paper-warm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
input[type="text"]::placeholder { color: var(--ink-soft); }
input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--card);
}

.dropzone {
  padding: var(--s5) var(--s3);
  border: 1px dashed var(--line);
  background: var(--paper-warm);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--terracotta-deep);
}
.dropzone span { font-size: 0.82rem; color: var(--ink-soft); }
.dropzone:hover,
.dropzone.drag { border-color: var(--gold); background: var(--card); }

.staging-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s3);
  font-size: 0.85rem;
  color: var(--ink-mid);
}
.staging-bar[hidden] { display: none; }

.staging-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s1);
  margin-top: var(--s2);
}
@media (min-width: 520px) {
  .staging-grid, .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.staging-item,
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-warm);
}
.staging-item img,
.gallery-item img,
.gallery-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staging-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--s1);
  padding: var(--s1);
  background: linear-gradient(to top, rgba(30, 20, 10, 0.6), transparent 60%);
}
.staging-actions button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.staging-actions button:hover { transform: scale(1.1); }
.staging-validate { background: var(--terracotta); color: #fff; }
.staging-remove { background: rgba(255, 255, 255, 0.9); color: var(--ink); }

.staging-item.uploading .staging-actions,
.staging-item.done .staging-actions { display: none; }
.staging-item.uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.staging-item.done::after {
  content: "\2713";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.7rem;
}
.staging-item.error::before {
  content: "Échec, réessayez";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 3px;
  background: rgba(150, 52, 40, 0.92);
  color: #fff;
  font-size: 0.6rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Galerie
   -------------------------------------------------------------------------- */
.gallery-item { cursor: pointer; }
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(80, 55, 25, 0.1);
  pointer-events: none;
}
.gallery-item .guest-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 6px 5px;
  background: linear-gradient(to top, rgba(30, 20, 10, 0.72), transparent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-item .video-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 1px 6px;
  background: rgba(30, 20, 10, 0.6);
  color: #fff;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}
.gallery-empty {
  margin: 0;
  padding: var(--s5) 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Visionneuse
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: rgba(24, 16, 8, 0.95);
}
.lightbox.open { display: flex; }
.lightbox #lightbox-content { text-align: center; }
.lightbox img,
.lightbox video { max-width: 100%; max-height: 84vh; }
.lightbox-caption {
  margin-top: var(--s2);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #efe4d2;
}
.lightbox .close {
  position: absolute;
  top: var(--s2);
  right: var(--s3);
  border: 0;
  background: none;
  color: #efe4d2;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  border: 1px solid var(--terracotta);
  background: var(--terracotta);
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--terracotta-deep); border-color: var(--terracotta-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-small { padding: 9px 18px; font-size: 0.66rem; }

/* --------------------------------------------------------------------------
   Pied
   -------------------------------------------------------------------------- */
.credit {
  padding-top: var(--s6);
  text-align: center;
}
.credit p {
  margin: var(--s3) 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.credit .signature {
  margin-top: var(--s2);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}
.credit .signature a {
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.credit .signature a:hover {
  color: var(--terracotta-deep);
  border-color: var(--terracotta);
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  body { padding: var(--s2) var(--s1); }
  .page { padding: 0 var(--s3) var(--s5); }
  .hero { padding: var(--s6) 0 var(--s4); }
  .card { padding: var(--s4) var(--s3); }
  .timeline { --tl-time: 52px; --tl-gap: var(--s1); --tl-marker: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
