/* ============================================================================
   Mariage Achouak & Hatim — édition élégante v4 (lisibilité prioritaire)
   Body 18px, labels remontés à 14-16px, letter-spacing divisé par 2,
   italique réservé aux titres (pas au corps).
   ============================================================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  background-color: #FDFCF8;
  color: #1F1612;
  font-feature-settings: 'kern', 'liga', 'dlig';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 640px) {
  body { font-size: 17px; }
}

/* ---------------------------------------------------------------------------
   FAMILLES TYPO
   --------------------------------------------------------------------------- */
.font-script {
  font-family: 'Pinyon Script', 'Allura', cursive;
  font-weight: 400;
}
.font-display, .font-body {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
}
.font-arabic {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  line-height: 1.7;
}
.font-label {
  font-family: 'Cormorant Garamond', serif;
  font-variant: all-small-caps;
  letter-spacing: 0.16em;
  font-weight: 500;
}

[x-cloak] { display: none !important; }

/* ---------------------------------------------------------------------------
   VARIABLES
   --------------------------------------------------------------------------- */
:root {
  --ink:           #1F1612;
  --ink-soft:      #4A3A30;   /* assombri pour meilleur contraste */
  --ink-mute:      #6F5F55;   /* assombri */
  --paper:         #FDFCF8;
  --paper-warm:    #F5EFE0;
  --paper-deep:    #EDE3D0;
  --champagne:     #7A5F3D;   /* assombri (avant #947255) — meilleur contraste */
  --champagne-light: #947255;
  --sage:          #6A7860;   /* assombri */
  --olive:         #4F5538;   /* assombri pour les versets arabes */
}

/* ---------------------------------------------------------------------------
   ORNEMENTS
   --------------------------------------------------------------------------- */
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--champagne);
}
.flourish::before,
.flourish::after {
  content: "";
  flex: 0 1 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, currentColor, transparent);
}
.flourish-fine::before,
.flourish-fine::after { flex: 0 1 30px; }

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--paper);
}
.section-divider svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  color: var(--champagne);
  opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   BLOC VERSET CORANIQUE
   --------------------------------------------------------------------------- */
.verse-block {
  text-align: center;
  padding: 2.25rem 1.5rem;
  position: relative;
  background: var(--paper);
}
@media (min-width: 768px) {
  .verse-block { padding: 3rem 2rem; }
}
.verse-block.verse-on-warm { background: var(--paper-warm); }

.verse-arabic {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  line-height: 2;
  color: var(--olive);
  max-width: 42rem;
  margin: 0 auto 1.75rem;
  direction: rtl;
}
.verse-french {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 38rem;
  margin: 0 auto 1.25rem;
}
.verse-source {
  font-family: 'Cormorant Garamond', serif;
  font-variant: all-small-caps;
  letter-spacing: 0.16em;
  font-size: 0.95rem;
  color: var(--champagne);
  font-style: normal;
  display: block;
  font-weight: 500;
}
.verse-ornament {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  color: var(--champagne);
  margin-bottom: 1.75rem;
}
.verse-ornament::before,
.verse-ornament::after {
  content: "";
  flex: 0 1 40px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* ---------------------------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 1.2s cubic-bezier(.22, .61, .36, 1),
    transform 1.2s cubic-bezier(.22, .61, .36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }

@keyframes soft-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes draw-line {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.hero-in   { animation: soft-in 1.4s cubic-bezier(.22,.61,.36,1) both; }
.hero-in-1 { animation-delay: 0.15s; }
.hero-in-2 { animation-delay: 0.45s; }
.hero-in-3 { animation-delay: 0.80s; }
.hero-in-4 { animation-delay: 1.10s; }
.hero-in-5 { animation-delay: 1.40s; }
.hero-in-6 { animation-delay: 1.75s; }
.hero-in-7 { animation-delay: 2.05s; }
.hero-line {
  transform-origin: center;
  animation: draw-line 1.4s cubic-bezier(.7, 0, .3, 1) 0.9s both;
}

@keyframes drift-1 {
  0%,100% { transform: translateY(0)   rotate(0deg); }
  50%     { transform: translateY(-5px) rotate(1deg); }
}
@keyframes drift-2 {
  0%,100% { transform: translateY(0)   rotate(0deg); }
  50%     { transform: translateY(-7px) rotate(-1.2deg); }
}
.drift-1 { animation: drift-1 8s ease-in-out infinite; transform-origin: top center; }
.drift-2 { animation: drift-2 11s ease-in-out infinite; transform-origin: top center; }

@keyframes glow-pulse {
  0%,100% { opacity: 0.6; }
  50%     { opacity: 1; }
}
.glow-pulse { animation: glow-pulse 5s ease-in-out infinite; }

@keyframes ink-in {
  from { opacity: 0; filter: blur(3px); transform: translateY(8px); }
  to   { opacity: 1; filter: blur(0);   transform: translateY(0); }
}
.ink-in { animation: ink-in 1.8s cubic-bezier(.22,.61,.36,1) both; }

@keyframes slow-spin {
  to { transform: rotate(360deg); }
}
.spin-slow { animation: slow-spin 90s linear infinite; }

/* ---------------------------------------------------------------------------
   COUNTDOWN
   --------------------------------------------------------------------------- */
.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
}
.cd-label {
  font-family: 'Cormorant Garamond', serif;
  font-variant: all-small-caps;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--champagne);
  margin-top: 0.45rem;
}

/* ---------------------------------------------------------------------------
   CARTES
   --------------------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid rgba(31, 22, 18, 0.10);
  padding: 1.85rem 1.5rem;
  text-align: center;
  position: relative;
  transition:
    transform 0.5s cubic-bezier(.22,.61,.36,1),
    box-shadow 0.5s cubic-bezier(.22,.61,.36,1),
    border-color 0.5s ease;
  height: 100%;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 36px; height: 2px;
  background: var(--champagne);
  transform: translateX(-50%);
  opacity: 0.9;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -14px rgba(31, 22, 18, 0.22);
  border-color: rgba(122, 95, 61, 0.35);
}
.card-icon {
  width: 32px; height: 32px;
  color: var(--champagne);
  margin: 0 auto 1rem;
  display: block;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.card-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--champagne);
  margin-bottom: 0.4rem;
}
.card-text {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: normal;
}

/* Programme cards */
.programme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.programme-card .card-subtitle {
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
}
.programme-card .card-title {
  font-size: 1.55rem;
  margin-bottom: 0.6rem;
}

/* ---------------------------------------------------------------------------
   IMAGES
   --------------------------------------------------------------------------- */
.image-frame {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  box-shadow:
    0 1px 0 rgba(148, 114, 85, 0.15) inset,
    0 16px 40px -20px rgba(31, 22, 18, 0.25);
}
.image-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  pointer-events: none;
  z-index: 2;
}
.image-placeholder {
  background:
    linear-gradient(135deg, rgba(184, 145, 107, 0.10), rgba(122, 95, 61, 0.22)),
    radial-gradient(circle at 30% 30%, rgba(148, 114, 85, 0.18), transparent 60%),
    var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--champagne);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------------------
   INVITATION CARD
   --------------------------------------------------------------------------- */
.invitation-card {
  background: var(--paper);
  box-shadow:
    0 1px 0 rgba(148, 114, 85, 0.18) inset,
    0 30px 80px -30px rgba(31, 22, 18, 0.25),
    0 10px 25px -15px rgba(31, 22, 18, 0.12);
  border: 1px solid rgba(148, 114, 85, 0.25);
  position: relative;
}

/* ---------------------------------------------------------------------------
   BOUTONS
   --------------------------------------------------------------------------- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-variant: all-small-caps;
  letter-spacing: 0.16em;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
  border: 1px solid;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--champagne);
  border-color: var(--champagne);
  letter-spacing: 0.20em;
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: rgba(31, 22, 18, 0.30);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------------------------------------------------------------------------
   LINKS
   --------------------------------------------------------------------------- */
.link-fine {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.link-fine:hover {
  color: var(--champagne);
  border-bottom-color: var(--champagne);
}

/* ---------------------------------------------------------------------------
   PRINT
   --------------------------------------------------------------------------- */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .invitation-card { box-shadow: none; border: 1px solid var(--ink); }
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
