/*
 * Ads Manager Hub — styles du moteur (chargés par le plugin, une seule feuille).
 * Reprend l'ouverture en « clin d'œil » de vos islands (ads-islands.css v1.08) :
 * hauteur 0 → hauteur de la création, cubic-bezier(0.22, 0.61, 0.36, 1), ouverture par le haut.
 */
:root { --amh-ease: cubic-bezier(0.22, 0.61, 0.36, 1); }

.amh-slot { display: block; width: 100%; clear: both; }
.amh-slot.amh-empty, .amh-slot.amh-off { display: none; }

/* Boîte de l'emplacement. La place est réservée par le CSS du serveur (min-height du conteneur .amh-slot).
   Ouverture « volet » / « fondu » : la boîte prend la place réservée, la création y est centrée verticalement.
   Ouverture « hauteur » (ancien clin d'œil) : la boîte part de 0 px, création alignée en haut. */
.amh-box {
  position: relative; width: 100%; height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  transition: height var(--amh-open-ms, 0ms) var(--amh-ease);
}
.amh-box--hauteur { justify-content: flex-start; }
/* « Volet » : cache de la couleur du fond qui se retire vers le bas (transform : aucun décalage de mise en page). */
.amh-cover {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  transform-origin: 50% 100%; transform: scaleY(1);
  transition: transform var(--amh-open-ms, 500ms) var(--amh-ease);
}
.amh-cover.is-open { transform: scaleY(0); }
.amh-stage { position: relative; display: flex; justify-content: center; align-items: flex-start; width: 100%; }
.amh-ad { max-width: 100%; }
.amh-ad iframe { display: block; max-width: none; }
/* Création suivante (rafraîchissement) : chargée par-dessus, invisible, jusqu'à sa réponse. L'actuelle reste affichée. */
.amh-ad.amh-pending { position: absolute; top: 0; left: 0; right: 0; visibility: hidden; display: flex; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .amh-box, .amh-cover { transition: none; }
}

/* ---------- Sticky ---------- */
.amh-sticky {
  position: fixed; left: 0; right: 0; z-index: 2147483000;
  display: flex; justify-content: center; align-items: center;
  background: var(--amh-sticky-bg, #fff); box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
  visibility: hidden;
}
.amh-sticky--haut { top: 0; transform: translateY(-100%); border-bottom: 1px solid #e0e0e0; }
.amh-sticky--bas { bottom: 0; transform: translateY(100%); border-top: 1px solid #e0e0e0; box-shadow: 0 -4px 12px rgba(0, 0, 0, .15); }
.amh-sticky.is-active { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.amh-sticky.is-hidden-by-modal { visibility: hidden; }
.amh-sticky-inner { position: relative; }
/* Place faite au sticky haut : espaceur en tête de page (le moteur compense le défilement quand le haut de page
   n'est pas visible). Réservation avant le premier affichage : classe amh-top-reserve posée par un script de <head>,
   reprise ensuite par le moteur dans l'espaceur (même hauteur, aucun déplacement). */
.amh-sticky-spacer { display: block; height: 0; margin: 0; padding: 0; border: 0; }
html.amh-top-reserve body { padding-top: var(--amh-top-reserve, 0px) !important; }
.amh-sticky .amh-stage { display: block; }
/* Petite croix grise translucide, hors de la création (à droite), zone tactile de 32 px. */
.amh-close-mini {
  position: absolute; top: 2px; inset-inline-start: calc(100% + 4px);
  width: 32px; height: 32px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.amh-close-mini::before {
  content: "\00d7"; display: block; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(119, 119, 119, .6); color: #fff; font: 600 16px/22px Arial, sans-serif; text-align: center;
}
.amh-close-mini:focus-visible { outline: 2px solid #2271b1; outline-offset: 1px; border-radius: 50%; }

/* ---------- Interstitiel personnalisé ---------- */
.amh-inter {
  position: fixed; inset: 0; z-index: 2147483600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, var(--amh-overlay, .5));
  backdrop-filter: none; -webkit-backdrop-filter: none;
  visibility: hidden; opacity: 0; transition: opacity .25s ease;
}
.amh-inter.is-open { visibility: visible; opacity: 1; }
.amh-inter-box { position: relative; transform-origin: center center; }
.amh-inter-box .amh-stage { display: block; }
.amh-inter-close {
  position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: #1d2327; font: 600 22px/36px Arial, sans-serif; padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.amh-inter-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
html.amh-scroll-lock, html.amh-scroll-lock body { overflow: hidden !important; }
/* La barre de défilement disparaît pendant le blocage : sa place est gardée, la page ne bouge pas. */
html.amh-scroll-lock { scrollbar-gutter: stable; }

/* ---------- Habillage (image et vidéo) ---------- */
.amh-skin {
  position: absolute; top: 0; left: 0; right: 0; height: 0; z-index: 1; overflow: hidden;
  visibility: hidden; pointer-events: none;
}
/* Pleine largeur de l'écran et coupe ce qui dépasse : la création (1349 px) ne crée jamais de défilement horizontal.
   Sa largeur n'est donnée qu'à la réponse remplie (moteur). */
.amh-skin-canvas { position: absolute; top: 0; left: 50%; }
.amh-skin.is-on { visibility: visible; }
.amh-skin.is-on .amh-skin-canvas { pointer-events: auto; }
.amh-skin .amh-stage { display: block; }
/* Le contenu du thème passe devant ; règles appliquées seulement quand une campagne est affichée (voir moteur). */

.amh-vskin-player { position: absolute; top: 0; z-index: 2; background: #000; overflow: hidden; }
.amh-vskin-player video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Lecteur VAST : invisible tant que l'annonce n'a pas démarré (jamais de cadre noir vide). */
.amh-vskin-player.is-waiting { visibility: hidden; }
/* Bandeau haut (partie visible du lecteur) : la vidéo ne joue que s'il est visible à 50 % au moins. */
.amh-vskin-band { position: absolute; top: 0; pointer-events: none; visibility: hidden; }
.amh-vskin-toggle {
  position: absolute; z-index: 5; transform: translateX(-50%);
  border: 0; border-radius: 22px; padding: 10px 20px; cursor: pointer;
  background: rgba(255, 255, 255, .95); color: #1d2327; font: 600 14px/1.2 Arial, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); white-space: nowrap;
}
.amh-vskin-toggle:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; }

/* ---------- Parallaxe ---------- */
.amh-parallax-window { position: relative; overflow: hidden; margin: 0 auto; background: #f2f2f2; }
.amh-parallax-window .amh-stage { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }

/* ---------- Inread ---------- */
.amh-inread { position: relative; width: 100%; background: #000; }
.amh-inread video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.amh-inread .amh-stage { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
/* Lecteur VAST (SDK IMA) : zone de l'annonce sur tout le cadre, vidéo de contenu cachée. */
.amh-vast-ad { position: absolute; inset: 0; overflow: hidden; }
.amh-vast-ad iframe, .amh-vast-ad video { width: 100% !important; height: 100% !important; }
video.amh-vast-content { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.amh-inread-display .amh-stage { position: relative; }
.amh-inread-close {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; font: 600 18px/30px Arial, sans-serif; cursor: pointer; padding: 0;
}
.amh-inread-sound {
  position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 3; border: 0; border-radius: 16px; padding: 6px 12px;
  background: rgba(0, 0, 0, .55); color: #fff; font: 600 12px Arial, sans-serif; cursor: pointer;
}

/* ---------- Création tierce 1×1 ---------- */
.amh-hors-page { position: absolute; width: 1px; height: 1px; overflow: hidden; left: 0; top: 0; }
