/* ==========================================================================
   SuiteAI — Galerie photos & vidéos + visionneuse plein écran
   ========================================================================== */
.gallery-section { padding-left: 4%; padding-right: 4%; }
.sg { max-width: 1400px; margin: 0 auto; }
/* l'indice « Faites glisser » de l'ancien carrousel n'a plus lieu d'être */
.gallery-section:has(.sg) .section-header::after, #gallery:has(.sg) .section-header::after { content: none !important; display: none !important; }

/* Filtres */
.sg-filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem;
  margin: 0 auto 2.4rem;
}
.sg-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.15rem; border-radius: 999px;
  border: 1px solid rgba(201,169,110,0.25); background: rgba(255,255,255,0.02);
  color: var(--text-secondary, #bbb); font-family: var(--font-body); font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  transition: all .35s var(--ease-out-expo);
}
.sg-chip span { font-size: 0.68rem; opacity: 0.6; }
.sg-chip i { font-size: 0.62rem; color: var(--gold); }
.sg-chip:hover { border-color: var(--gold); color: var(--text-primary, #f5f0e8); }
.sg-chip.active { background: var(--gold); border-color: var(--gold); color: #0D0D0D; }
.sg-chip.active i, .sg-chip.active span { color: #0D0D0D; opacity: 0.75; }

/* Grille mosaïque */
.sg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 14px;
}
.sg-tile {
  position: relative; display: block; width: 100%; height: 100%;
  padding: 0; border: 0; margin: 0; cursor: zoom-in;
  overflow: hidden; border-radius: 12px; background: #151413;
  isolation: isolate;
}
.sg-tile::before { /* shimmer pendant le chargement */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(201,169,110,0.08) 50%, transparent 70%);
  background-size: 200% 100%; animation: sgShimmer 1.4s infinite linear;
}
.sg-tile.loaded::before { display: none; }
@keyframes sgShimmer { to { background-position: -200% 0; } }
/* neutralise les anciens styles du carrousel (.gallery-item) */
.sg-grid .sg-tile { flex: none; min-width: 0; scroll-snap-align: none; }
.sg-grid .sg-tile img, .sg-grid .sg-tile video { height: 100%; min-height: 0; }
.sg-xl { grid-column: span 2; grid-row: span 2; }
.sg-tall { grid-row: span 2; }
.sg-wide { grid-column: span 2; }
.sg-tile img, .sg-tile video, .sg-embed-ph {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  transition: transform 1.2s var(--ease-out-expo), filter .6s;
}
.sg-embed-ph { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--gold); background: #111; }
.sg-tile:hover img, .sg-tile:hover video { transform: scale(1.07); }
.sg-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(0deg, rgba(10,10,10,0.75) 0%, rgba(10,10,10,0) 45%);
  opacity: 0; transition: opacity .5s;
}
.sg-tile:hover .sg-shade, .sg-tile.is-video .sg-shade { opacity: 1; }
.sg-cap {
  position: absolute; left: 1.1rem; right: 3.2rem; bottom: 0.95rem; z-index: 3;
  font-family: var(--font-heading); font-size: 1.15rem; font-style: italic; color: #fbf6ec;
  text-align: left; opacity: 0; transform: translateY(10px);
  transition: all .5s var(--ease-out-expo);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-tile:hover .sg-cap { opacity: 1; transform: none; }
.sg-zoom {
  position: absolute; right: 0.9rem; bottom: 0.9rem; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,13,13,0.55); border: 1px solid rgba(201,169,110,0.5);
  color: var(--gold-light, #E8D5A8); font-size: 0.75rem;
  opacity: 0; transform: scale(0.7); transition: all .45s var(--ease-out-expo);
  backdrop-filter: blur(6px);
}
.sg-tile:hover .sg-zoom { opacity: 1; transform: none; }
.sg-play {
  position: absolute; top: 50%; left: 50%; z-index: 3;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,13,13,0.45); border: 1px solid rgba(232,213,168,0.75);
  color: #fff; font-size: 1.05rem; padding-left: 4px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .5s var(--ease-out-expo), opacity .4s;
}
.sg-play::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(232,213,168,0.4); animation: sgPulse 2.4s infinite;
}
@keyframes sgPulse { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.sg-tile.is-video:hover .sg-play { transform: scale(0.8); opacity: 0.35; }
.sg-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.sg-more-wrap { text-align: center; margin-top: 2.6rem; }
.sg-more {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 2.2rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  transition: all .4s var(--ease-out-expo);
}
.sg-more:hover { background: var(--gold); color: #0D0D0D; }
.sg-more i { font-size: 0.7rem; transition: transform .4s; }
.sg-more:hover i { transform: translateY(3px); }

/* ---------- Visionneuse ---------- */
html.sg-lock, html.sg-lock body { overflow: hidden; }
.sg-lb {
  position: fixed; inset: 0; z-index: 100000; display: none;
  color: #fff; font-family: var(--font-body); cursor: auto;
}
.sg-lb.open { display: block; }
.sg-lb-bg { position: absolute; inset: 0; background: rgba(6,6,6,0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sg-lb-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.4rem;
}
.sg-lb-count { font-size: 0.8rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.7); }
.sg-lb-actions { display: flex; gap: 0.5rem; }
.sg-lb-btn, .sg-lb-nav {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #fff;
  transition: all .3s;
}
.sg-lb-btn:hover, .sg-lb-nav:hover { background: var(--gold); border-color: var(--gold); color: #0D0D0D; }
.sg-lb-nav { position: absolute; top: 50%; z-index: 3; margin-top: -23px; }
.sg-lb-prev { left: 1.2rem; }
.sg-lb-next { right: 1.2rem; }
.sg-lb-stage { position: absolute; inset: 70px 90px 130px; z-index: 2; }
.sg-lb-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sg-lb-media {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); background: #000;
}
.sg-lb-embed { width: min(100%, calc((100vh - 200px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; }
.sg-lb-embed iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }
.sg-lb-cap {
  position: absolute; left: 0; right: 0; bottom: 98px; z-index: 3; text-align: center;
  font-family: var(--font-heading); font-style: italic; font-size: 1.15rem; color: #f5f0e8;
}
.sg-lb-thumbs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; gap: 8px; padding: 14px 1.4rem 18px; overflow-x: auto;
  justify-content: safe center; scrollbar-width: none;
}
.sg-lb-thumbs::-webkit-scrollbar { display: none; }
.sg-lb-thumb {
  position: relative; flex: 0 0 auto; width: 74px; height: 54px; padding: 0; cursor: pointer;
  border-radius: 6px; overflow: hidden; border: 1px solid transparent; background: #1a1a1a;
  opacity: 0.45; transition: all .3s; color: var(--gold);
}
.sg-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-lb-thumb.is-video::after {
  content: "\f04b"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.65rem;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); color: #fff;
}
.sg-lb-thumb:hover { opacity: 0.85; }
.sg-lb-thumb.active { opacity: 1; border-color: var(--gold); transform: translateY(-3px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .sg-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 210px; }
}
@media (max-width: 768px) {
  .gallery-section { padding-left: 4%; padding-right: 4%; }
  .sg-filters { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; margin-bottom: 1.6rem; scrollbar-width: none; }
  .sg-filters::-webkit-scrollbar { display: none; }
  .sg-chip { flex: 0 0 auto; padding: 0.55rem 0.95rem; font-size: 0.72rem; }
  .sg-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 8px; }
  .sg-tile { border-radius: 8px; }
  .sg-cap { opacity: 1; transform: none; font-size: 0.95rem; left: 0.7rem; bottom: 0.6rem; }
  .sg-shade { opacity: 1; }
  .sg-zoom { display: none; }
  .sg-play { width: 50px; height: 50px; margin: -25px 0 0 -25px; font-size: 0.9rem; }
  .sg-lb-stage { inset: 64px 0 110px; }
  .sg-lb-nav { display: none !important; }
  .sg-lb-media { border-radius: 0; }
  .sg-lb-cap { bottom: 84px; font-size: 1rem; padding: 0 1rem; }
  .sg-lb-thumb { width: 58px; height: 44px; }
  .sg-lb-thumbs { padding: 10px 0.8rem 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-play::after, .sg-tile::before { animation: none; }
}
