/* PN_MAGAZINE_DESKTOP_v1 — Page magazine desktop, livre ouvert 2 pages */

/* S'active uniquement sur >=768px et sur /agences/{slug}/ via JS qui ajoute .mdx-active */
@media (min-width: 768px) {

body.mdx-active { background: #0A0A0A; margin: 0; padding: 0; overflow-x: hidden; font-family: 'Barlow', -apple-system, sans-serif; }
body.mdx-active > *:not(.mdx-root):not(script) { display: none !important; }

.mdx-root { color: #fff; min-height: 100vh; position: relative; }

.mdx-hero {
  min-height: 100vh;
  position: relative;
  background: radial-gradient(ellipse at 50% 50%, #1F1410 0%, #0A0A0A 75%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mdx-topbar {
  padding: 22px 48px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 10;
}
.mdx-topbar .mdx-logo {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none;
}
.mdx-topbar .mdx-logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: #E08A30;
  display: flex; align-items: center; justify-content: center; color: #1A1A1A;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 15px;
}
.mdx-topbar .mdx-logo-text {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
}
.mdx-topbar .mdx-back {
  font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.mdx-topbar .mdx-back:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.mdx-topbar .mdx-actions { display: flex; gap: 10px; }
.mdx-topbar .mdx-actions a {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; text-decoration: none;
  transition: all 0.2s;
}
.mdx-topbar .mdx-actions a:hover { background: #E08A30; color: #1A1A1A; border-color: #E08A30; }

.mdx-particles { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.mdx-particle {
  position: absolute; bottom: -10px;
  width: var(--size, 8px); height: var(--size, 8px);
  border-radius: 50%; background: var(--bg, #E08A30);
  box-shadow: 0 0 14px var(--bg, #E08A30), 0 0 28px rgba(224,138,48,0.3);
  opacity: 0;
  animation: mdx-rise var(--duration, 5s) ease-out var(--delay, 0s) infinite;
  left: var(--start-x, 50%); will-change: transform, opacity;
}
.mdx-particle.star {
  background: transparent; box-shadow: none;
  color: var(--bg, #FFD580); font-size: var(--size, 12px); border-radius: 0; line-height: 1;
}
@keyframes mdx-rise {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  10% { opacity: 1; } 70% { opacity: 1; }
  100% { transform: translate(var(--drift, 0), -110vh) scale(1.2); opacity: 0; }
}

.mdx-hero-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 0 88px 60px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 5;
}

.mdx-text-side { position: relative; }
.mdx-eyebrow-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(224,138,48,0.15);
  border: 1px solid rgba(224,138,48,0.4);
  border-radius: 50px; color: #E08A30;
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 32px;
  animation: mdx-bob 4s ease-in-out infinite;
}
.mdx-eyebrow-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #E08A30;
  box-shadow: 0 0 10px #E08A30; animation: mdx-pulse 2s ease-in-out infinite;
}
@keyframes mdx-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
@keyframes mdx-pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

.mdx-prelude {
  font-family: 'DM Serif Display', serif; font-style: italic;
  font-size: 22px; color: #C57220;
  margin-bottom: 12px;
}
.mdx-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(48px, 5vw, 80px);
  line-height: 0.92; letter-spacing: -0.01em;
  color: #fff; text-transform: uppercase;
  margin: 0 0 24px;
}
.mdx-title-bar { height: 3px; width: 60px; background: #E08A30; margin: 24px 0; }
.mdx-subtitle {
  font-family: 'DM Serif Display', serif; font-style: italic;
  font-size: 22px; color: rgba(255,255,255,0.78);
  line-height: 1.3; margin-bottom: 36px;
}
.mdx-description {
  font-size: 15px; line-height: 1.7;
  color: rgba(255,255,255,0.65);
  max-width: 460px; margin-bottom: 36px;
}

.mdx-cta-row { display: flex; gap: 14px; align-items: center; }
.mdx-btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 36px;
  background: #E08A30; color: #1A1A1A;
  border: none; border-radius: 50px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 12px 32px rgba(224,138,48,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.mdx-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(224,138,48,0.55); }
.mdx-btn-primary:active { transform: translateY(0); }

.mdx-btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 24px;
  background: transparent; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.mdx-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.55); }

.mdx-pages-meta {
  margin-top: 32px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* === Cover side === */
.mdx-cover-side {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 600px;
}
.mdx-stack-bg-1, .mdx-stack-bg-2 {
  position: absolute;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0,0,0,0.4);
}
.mdx-stack-bg-1 img, .mdx-stack-bg-2 img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mdx-stack-bg-1 {
  width: 320px; height: 460px;
  transform: translate(95px, -16px) rotate(8deg);
  opacity: 0.5; z-index: 1;
}
.mdx-stack-bg-2 {
  width: 340px; height: 490px;
  transform: translate(50px, -10px) rotate(5deg);
  opacity: 0.75; z-index: 2;
}

.mdx-cover {
  position: relative;
  width: 380px; height: 540px;
  background: #fff; color: #1A1A1A;
  border-radius: 6px;
  overflow: hidden;
  z-index: 4;
  transform: rotate(-2deg);
  box-shadow: 0 40px 90px rgba(0,0,0,0.7), 0 0 0 1px rgba(224,138,48,0.5);
  animation: mdx-float 6s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.5s;
}
.mdx-cover:hover { transform: rotate(0deg) scale(1.03); }
@keyframes mdx-float {
  0%,100% { transform: rotate(-2deg) translateY(0) }
  50% { transform: rotate(-2deg) translateY(-10px) }
}
.mdx-cover:hover { animation-play-state: paused; }

.mdx-halo {
  position: absolute; inset: -60px;
  border-radius: 20px;
  background: radial-gradient(ellipse at center, rgba(224,138,48,0.45) 0%, rgba(224,138,48,0.1) 40%, transparent 70%);
  animation: mdx-glow 2.4s ease-in-out infinite;
  z-index: 3; pointer-events: none;
}
@keyframes mdx-glow {
  0%,100% { opacity: 0.6; transform: scale(0.95) }
  50% { opacity: 1; transform: scale(1.1) }
}

.mdx-shimmer {
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  animation: mdx-shine 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mdx-shine { 0%,40% { left: -100% } 100% { left: 120% } }

.mdx-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mdx-cover-content {
  position: absolute; inset: 0;
  padding: 32px 28px;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.88) 60%, rgba(255,255,255,0.97) 100%);
  z-index: 2;
}
.mdx-cover.has-real-cover .mdx-cover-content {
  background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(0,0,0,0.88) 100%);
  color: #fff;
}
.mdx-cover-meta {
  font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; color: #1A1A1A;
}
.mdx-cover.has-real-cover .mdx-cover-meta { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.mdx-cover.has-real-cover .mdx-cover-content > * { color: #fff; }

/* === Bottom sections (sous le hero) === */
.mdx-bottom {
  background: #fff; color: #1A1A1A;
  padding: 80px 88px;
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 60px;
  max-width: 1440px; margin: 0 auto; width: 100%;
  box-sizing: border-box;
}
.mdx-bottom-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #C57220; font-weight: 600;
  margin-bottom: 14px;
}
.mdx-bottom h3 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
  font-size: 28px; line-height: 1.1;
  margin: 0 0 18px;
  color: #1A1A1A; text-transform: uppercase; letter-spacing: -0.005em;
}
.mdx-bottom h3 em { font-family: 'DM Serif Display', serif; font-style: italic; color: #C57220; font-weight: 400; text-transform: none; }
.mdx-bottom p { font-size: 15px; line-height: 1.65; color: #5C5950; }

.mdx-agency-card {
  padding: 32px 28px;
  background: #F5F1E8;
  border-radius: 12px;
}
.mdx-agency-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.mdx-agency-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: #1A1A1A; color: #E08A30;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 18px;
}
.mdx-agency-name { font-weight: 700; font-size: 16px; color: #1A1A1A; }
.mdx-agency-role { font-size: 13px; color: #8B8579; margin-top: 2px; }

.mdx-contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mdx-contacts a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: #fff; border: 1px solid #E5E1D8;
  border-radius: 10px; text-decoration: none;
  color: #1A1A1A; transition: all 0.2s;
  font-size: 13px; font-weight: 600;
}
.mdx-contacts a i { color: #E08A30; font-size: 18px; }
.mdx-contacts a:hover { background: #1A1A1A; color: #fff; border-color: #1A1A1A; transform: translateY(-2px); }
.mdx-contacts a:hover i { color: #E08A30; }
.mdx-contacts a.wa { background: #25D366; color: #fff; border-color: #25D366; }
.mdx-contacts a.wa i { color: #fff; }
.mdx-contacts a.wa:hover { background: #128C7E; }

/* === FLIPBOOK plein écran === */
.mdx-flipbook {
  position: fixed; inset: 0;
  background: #0A0A0A;
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.mdx-flipbook.open { display: flex; animation: mdx-zoom-in 0.4s ease-out; }
@keyframes mdx-zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.mdx-flip-head {
  padding: 18px 32px;
  display: flex; justify-content: space-between; align-items: center;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mdx-flip-head .mdx-flip-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 16px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.mdx-flip-head .mdx-flip-tools { display: flex; gap: 8px; }
.mdx-flip-head button {
  width: 40px; height: 40px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.mdx-flip-head button.close { font-size: 24px; }
.mdx-flip-head button:hover { background: #E08A30; color: #1A1A1A; border-color: #E08A30; }

.mdx-flip-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px 80px;
}
#mdxPageFlip { max-width: 1100px; width: 100%; height: 100%; max-height: 100%; }
#mdxPageFlip .page { background: #fff; overflow: hidden; }
#mdxPageFlip .page img {
  width: 100%; height: 100%; object-fit: contain;
  display: block; pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}

.mdx-flip-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); z-index: 5;
}
.mdx-flip-loading::before {
  content: ''; width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: #E08A30; border-radius: 50%;
  animation: mdx-spin 0.9s linear infinite;
  margin-bottom: 16px;
}
@keyframes mdx-spin { to { transform: rotate(360deg); } }
.mdx-flip-loading.hidden { display: none; }

.mdx-flip-nav-prev, .mdx-flip-nav-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 50%;
  cursor: pointer; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 6;
}
.mdx-flip-nav-prev { left: 16px; }
.mdx-flip-nav-next { right: 16px; }
.mdx-flip-nav-prev:hover, .mdx-flip-nav-next:hover { background: #E08A30; color: #1A1A1A; border-color: #E08A30; }
.mdx-flip-nav-prev:disabled, .mdx-flip-nav-next:disabled { opacity: 0.2; cursor: not-allowed; }

.mdx-flip-footer {
  padding: 14px 32px;
  display: flex; justify-content: center; align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.mdx-flip-footer .mdx-keys { display: flex; gap: 14px; }
.mdx-flip-footer .mdx-key { display: flex; align-items: center; gap: 6px; }
.mdx-flip-footer .mdx-key kbd {
  display: inline-block; padding: 2px 7px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; font-family: 'DM Mono', monospace;
  font-size: 10px; color: #fff;
}

/* === ZOOM overlay desktop === */
.mdx-zoom-overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: mdx-fade-in 0.3s ease-out;
}
@keyframes mdx-fade-in { from { opacity: 0 } to { opacity: 1 } }

.mdx-zoom-img-wrap {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
}
.mdx-zoom-img-wrap.grabbing { cursor: grabbing; }
.mdx-zoom-img-wrap img {
  max-width: 90%; max-height: 90%;
  display: block;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
}

.mdx-zoom-close {
  position: absolute; top: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.mdx-zoom-close:hover { background: #E08A30; color: #1A1A1A; border-color: #E08A30; }

.mdx-zoom-info {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: #fff;
  padding: 8px 16px; border-radius: 50px;
  font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.12em;
  z-index: 10;
}

} /* end @media min-width: 768px */

/* PN_DESKTOP_v1_2_NOIR */
@media (min-width: 768px) {
  /* Fond noir homogène — éviter blanc visible quand cover ou dernière page seule */
  #mdxPageFlip,
  #mdxPageFlip .stf__parent,
  #mdxPageFlip .stf__block,
  #mdxPageFlip .stf__wrapper { background: transparent !important; }
  /* La cover/4e de couv en mode single : centrée plein largeur visible */
  #mdxPageFlip .--simple {
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }
}
/* END PN_DESKTOP_v1_2_NOIR */


/* PN_DESKTOP_v1_3_SINGLEPAGE — Masquer demi-pages vides */
@media (min-width: 768px) {
  /* Quand cover seule (idx=0) : cache la moitié gauche */
  .mdx-flip-stage.single-cover #mdxPageFlip {
    clip-path: inset(-50px -50px -50px 50%);
    -webkit-clip-path: inset(-50px -50px -50px 50%);
    transition: clip-path 0.4s ease 0.5s;
  }
  /* Quand dernière page seule (idx=last) : cache la moitié droite */
  .mdx-flip-stage.single-last #mdxPageFlip {
    clip-path: inset(-50px 50% -50px -50px);
    -webkit-clip-path: inset(-50px 50% -50px -50px);
    transition: clip-path 0.4s ease 0.5s;
  }
  /* Transition douce pendant flip */
  .mdx-flip-stage #mdxPageFlip { transition: clip-path 0.3s ease; }
  /* Cible précise : page sans image (page blanche fictive) */
  #mdxPageFlip .page:not(:has(img)) {
    background: transparent !important;
    box-shadow: none !important;
  }
}
/* END PN_DESKTOP_v1_3_SINGLEPAGE */
