/* ══════════════════════════════════════════════════════
   LIGHTBOX SANS JAVASCRIPT — HTML Popover API
   Fichier : /templates/shaper_helixultimate/css/image-lightbox.css
   Utilisé par les overrides article (image d'en-tête)
   ══════════════════════════════════════════════════════ */

/* Bouton qui enveloppe la miniature */
.at-lightbox-btn {
  display: block;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
.at-lightbox-btn img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;        /* garde les proportions malgré les attributs width/height */
}
.at-lightbox-btn:focus-visible {
  outline: 3px solid #de5a2a;
  outline-offset: 3px;
}

/* Icône loupe en bas à droite (toujours visible, utile sur mobile) */
.at-lightbox-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E")
    center / 20px no-repeat;
  pointer-events: none;
  opacity: .85;
  transition: opacity .2s;
}
.at-lightbox-btn:hover::after { opacity: 1; }

/* Le popover plein écran */
.at-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  align-items: center;
  justify-content: center;
}
.at-lightbox:popover-open { display: flex; }
.at-lightbox::backdrop { background: rgba(0, 0, 0, .88); }

.at-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

/* Bouton de fermeture */
.at-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 30px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  transition: background .2s;
}
.at-lightbox__close:hover,
.at-lightbox__close:focus-visible { background: rgba(255, 255, 255, .35); outline: none; }

/* Navigateurs sans Popover API : on cache le bouton d'agrandissement
   et la loupe, l'image reste affichée normalement */
@supports not selector(:popover-open) {
  .at-lightbox-btn { cursor: default; }
  .at-lightbox-btn::after { display: none; }
}
