/* ============================================================
   INSTAGRAM FEED — Obsidian Ritual
   Galerie de publications + lightbox (images, carrousels, vidéos)
   ============================================================ */

.lm-insta {
  padding: 6rem 4rem 7rem;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

/* En-tête centré */
.lm-insta__header {
  max-width: 760px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.lm-insta__header .lm-display-title {
  margin-top: .6rem;
}

.lm-insta__intro {
  color: var(--muted);
  max-width: 620px;
  margin: 1.6rem auto 0;
  line-height: 1.9;
  font-size: .98rem;
}

/* Grille responsive */
.lm-insta__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

/* Vignette = bouton remis à zéro */
.lm-insta__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--bg3);
  overflow: hidden;
  cursor: pointer;
  outline: none;
}

/* Masquée tant que « Voir plus » n'a pas été cliqué */
.lm-insta__item.is-hidden {
  display: none;
}

.lm-insta__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

/* Badge « play » sur les vignettes vidéo */
.lm-insta__play {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.lm-insta__play svg {
  margin-left: 2px;
}

/* Voile + glyphe Instagram doré au survol */
.lm-insta__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-l, var(--gold));
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, .15), rgba(0, 0, 0, .55));
  opacity: 0;
  transition: opacity .5s ease;
}

.lm-insta__overlay svg {
  transform: scale(.8);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.lm-insta__item:hover img,
.lm-insta__item:focus-visible img {
  transform: scale(1.06);
}

.lm-insta__item:hover .lm-insta__overlay,
.lm-insta__item:focus-visible .lm-insta__overlay {
  opacity: 1;
}

.lm-insta__item:hover .lm-insta__overlay svg,
.lm-insta__item:focus-visible .lm-insta__overlay svg {
  transform: scale(1);
}

.lm-insta__item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* État vide */
.lm-insta__empty {
  text-align: center;
  color: var(--muted);
  font-size: .98rem;
  letter-spacing: .03em;
  padding: 2rem 0;
}

/* ------------------------------------------------------------
   Bouton « Voir plus »
   ------------------------------------------------------------ */
.lm-insta__more-wrap {
  text-align: center;
  margin-top: 2.6rem;
}

.lm-insta__more {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 2.2rem;
  background: transparent;
  border: 1px solid var(--border2, var(--border));
  color: var(--text);
  font-family: "Jost", sans-serif;
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .4s ease, color .4s ease, background .4s ease;
}

.lm-insta__more svg {
  transition: transform .4s ease;
}

.lm-insta__more:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 169, 110, .06);
}

.lm-insta__more:hover svg {
  transform: translateY(3px);
}

/* ------------------------------------------------------------
   Bouton « Nous suivre sur Instagram »
   ------------------------------------------------------------ */
.lm-insta__cta {
  text-align: center;
  margin-top: 3.5rem;
}

.lm-insta__follow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .95rem 2.4rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Jost", sans-serif;
  font-size: .74rem;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .45s ease, color .45s ease;
}

.lm-insta__follow-icon {
  display: inline-flex;
}

.lm-insta__follow:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ============================================================
   LIGHTBOX — visionneuse plein écran
   ============================================================ */
.lm-insta-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 7, 6, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 5vh 7vw;
}

.lm-insta-lightbox.is-open {
  display: flex;
}

.lm-insta-lightbox__figure {
  margin: 0;
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  animation: lm-insta-pop .5s cubic-bezier(.2, .8, .2, 1);
}

@keyframes lm-insta-pop {
  from { opacity: 0; transform: scale(.965) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Scène média : cadre filet or + ombre */
.lm-insta-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.lm-insta-lightbox__stage img,
.lm-insta-lightbox__stage video {
  display: block;
  max-width: min(92vw, 1000px);
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  border: 1px solid rgba(201, 169, 110, .28);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .65);
}

/* L'attribut hidden doit l'emporter sur le display:block ci-dessus */
.lm-insta-lightbox__stage [hidden] {
  display: none;
}

/* Méta : légende + lien */
.lm-insta-lightbox__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  max-width: 640px;
  text-align: center;
}

.lm-insta-lightbox__meta figcaption {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.75;
  letter-spacing: .015em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lm-insta-lightbox__link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.5rem;
  border: 1px solid rgba(201, 169, 110, .4);
  color: var(--gold);
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .4s ease, border-color .4s ease, color .4s ease;
}

.lm-insta-lightbox__link:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

/* Boutons fermer / navigation — pastilles cerclées */
.lm-insta-lightbox__close,
.lm-insta-lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
}

.lm-insta-lightbox__close:hover,
.lm-insta-lightbox__nav:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 169, 110, .08);
}

.lm-insta-lightbox__close {
  top: 2rem;
  right: 2.2rem;
}

.lm-insta-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lm-insta-lightbox__nav--prev { left: 2rem; }
.lm-insta-lightbox__nav--next { right: 2rem; }

/* Verrou du scroll d'arrière-plan */
body.lm-insta-lock {
  overflow: hidden;
}

/* Curseur : pendant la lightbox, on masque le curseur custom doré
   (peu visible sur le fond sombre) et on rétablit le curseur natif. */
body.lm-insta-lock { cursor: auto; }
body.lm-insta-lock #lm-cursor,
body.lm-insta-lock #lm-cursor-ring { opacity: 0 !important; }
.lm-insta-lightbox button,
.lm-insta-lightbox a { cursor: pointer; }
.lm-insta-lightbox__stage video { cursor: auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .lm-insta__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .lm-insta-lightbox__nav--prev { left: .6rem; }
  .lm-insta-lightbox__nav--next { right: .6rem; }
}

@media (max-width: 640px) {
  .lm-insta {
    padding: 4.5rem 1.5rem 5rem;
  }
  .lm-insta__grid {
    grid-template-columns: 1fr;
  }
  .lm-insta-lightbox {
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .lm-insta-lightbox__figure {
    gap: 1rem;
  }
  .lm-insta-lightbox__stage img,
  .lm-insta-lightbox__stage video {
    max-width: 100vw;
    max-height: 64vh;
    border-left: none;
    border-right: none;
  }
  .lm-insta-lightbox__close,
  .lm-insta-lightbox__nav {
    width: 42px;
    height: 42px;
  }
  .lm-insta-lightbox__close {
    top: 1rem;
    right: 1rem;
  }
  .lm-insta-lightbox__nav { top: auto; bottom: 1.2rem; transform: none; }
  .lm-insta-lightbox__nav--prev { left: 1.2rem; }
  .lm-insta-lightbox__nav--next { right: 1.2rem; }
  .lm-insta-lightbox__meta figcaption {
    display: none;
  }
}

/* ============================================================
   ACCESSIBILITÉ — mouvement réduit
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .lm-insta__item img,
  .lm-insta__overlay,
  .lm-insta__overlay svg,
  .lm-insta__more,
  .lm-insta__more svg,
  .lm-insta__follow,
  .lm-insta-lightbox__close,
  .lm-insta-lightbox__nav,
  .lm-insta-lightbox__link {
    transition: none;
  }
  .lm-insta-lightbox__figure {
    animation: none;
  }
  .lm-insta__item:hover img,
  .lm-insta__item:focus-visible img {
    transform: none;
  }
  .lm-insta__overlay svg {
    transform: scale(1);
  }
}
