/* ─────────────────────────────────────────
   MARIGAUX POPUP – FRONT CSS
   Palette : noir profond · or · crème ivoire
   v1.1.0 – glow subtil animé
───────────────────────────────────────── */

:root {
  --mgx-black:   #0e0d0b;
  --mgx-gold:    #c9a84c;
  --mgx-gold-lt: #e2c578;
  --mgx-cream:   #f7f3ec;
  --mgx-grey:    #9a9488;
  --mgx-radius:  4px;
  --mgx-shadow:  0 32px 80px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.35), 0 0 60px rgba(201,168,76,.08), 0 0 120px rgba(201,168,76,.04);
  --mgx-blur:    12px;
}

/* ── Overlay ── */
.mgx-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.mgx-overlay[hidden] { display: none; }

/* ── Backdrop flouté ── */
.mgx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 7, .72);
  backdrop-filter: blur(var(--mgx-blur));
  -webkit-backdrop-filter: blur(var(--mgx-blur));
  animation: mgxFadeIn .45s ease both;
}

/* ── Popup card ── */
.mgx-popup {
  position: relative;
  background: var(--mgx-black);
  color: var(--mgx-cream);
  max-width: 580px;
  width: 100%;
  padding: 3rem 3rem 2.5rem;
  border: 1px solid rgba(201,168,76,.32);
  box-shadow: var(--mgx-shadow);
  animation: mgxSlideUp .5s cubic-bezier(.16,1,.3,1) .1s both, mgxGlowPulse 4s ease-in-out 0.6s infinite;
  overflow: visible;
}

/* ── Coins dorés ── */
.mgx-popup__deco {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--mgx-gold);
  border-style: solid;
  opacity: .7;
}
.mgx-popup__deco--tl { top: 14px;  left: 14px;  border-width: 1px 0 0 1px; }
.mgx-popup__deco--tr { top: 14px;  right: 14px; border-width: 1px 1px 0 0; }
.mgx-popup__deco--bl { bottom: 14px; left: 14px;  border-width: 0 0 1px 1px; }
.mgx-popup__deco--br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

/* ── Ornement ── */
.mgx-popup__ornament {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  color: var(--mgx-gold);
  letter-spacing: .3em;
  margin-bottom: 1.5rem;
  opacity: .85;
}

/* ── Contenu (TinyMCE output) ── */
.mgx-popup__content {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(247,243,236,.9);
}

.mgx-popup__content h1,
.mgx-popup__content h2,
.mgx-popup__content h3 {
  font-family: Georgia, serif;
  font-weight: normal;
  color: var(--mgx-gold-lt);
  letter-spacing: .04em;
  margin: 0 0 .75rem;
  line-height: 1.3;
}

.mgx-popup__content h2 { font-size: 1.5rem; }
.mgx-popup__content h3 { font-size: 1.2rem; }

.mgx-popup__content p  { margin: 0 0 .9rem; }
.mgx-popup__content p:last-child { margin-bottom: 0; }

.mgx-popup__content a {
  color: var(--mgx-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mgx-popup__content strong { color: var(--mgx-gold-lt); font-weight: 600; }

/* ── Bouton fermer ── */
.mgx-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(201,168,76,.3);
  background: #0e0d0b;
  color: var(--mgx-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
  padding: 0;
  z-index: 10;
}

.mgx-close:hover {
  background: rgba(201,168,76,.18);
  border-color: var(--mgx-gold);
  transform: rotate(90deg);
}

.mgx-close:focus-visible {
  outline: 2px solid var(--mgx-gold);
  outline-offset: 2px;
}

/* ── Timer circulaire ── */
.mgx-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
  gap: .5rem;
}

.mgx-timer__ring {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.mgx-timer__track {
  fill: none;
  stroke: rgba(201,168,76,.15);
  stroke-width: 2.5;
}

.mgx-timer__fill {
  fill: none;
  stroke: var(--mgx-gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 106.8;
  stroke-dashoffset: 0;
  animation: mgxTimerDrain var(--mgx-duration, 30s) linear forwards;
}

.mgx-timer__count {
  font-family: Georgia, serif;
  font-size: .8rem;
  color: var(--mgx-grey);
  letter-spacing: .05em;
  min-width: 1.4rem;
  text-align: right;
}

/* ── Fermeture (classe JS) ── */
.mgx-overlay.is-closing .mgx-popup  { animation: mgxSlideDown .35s ease forwards; }
.mgx-overlay.is-closing .mgx-backdrop { animation: mgxFadeOut .35s ease forwards; }

/* ── Keyframes ── */
@keyframes mgxGlowPulse {
  0%, 100% { box-shadow: var(--mgx-shadow); }
  50%       { box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.35), 0 0 80px rgba(201,168,76,.13), 0 0 160px rgba(201,168,76,.06); }
}

@keyframes mgxFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes mgxFadeOut { from { opacity: 1; } to { opacity: 0; } }

@keyframes mgxSlideUp {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}
@keyframes mgxSlideDown {
  from { opacity: 1; transform: translateY(0)   scale(1);   }
  to   { opacity: 0; transform: translateY(18px) scale(.97); }
}

@keyframes mgxTimerDrain {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 106.8; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .mgx-popup {
    padding: 2.25rem 1.5rem 2rem;
  }
  .mgx-popup__content h2 { font-size: 1.25rem; }
}
