/* ============================================================
   MANE Ingénierie — Section « Nos réalisations » + visionneuse
   (utilise les variables définies dans style.css)
   ============================================================ */

.realisations {
  position: relative;
  background: var(--ink);
  overflow: hidden;
}
.realisations::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(31,139,203,.16), transparent 55%),
    radial-gradient(70% 60% at 0% 100%, rgba(14,92,138,.18), transparent 55%);
  pointer-events: none;
}
.realisations > .container { position: relative; }
.realisations__lead {
  color: var(--on-dark-soft);
  font-size: 1.05rem;
  max-width: 56ch;
  margin: 20px auto 0;
}

/* ---------- Grille ---------- */
.realisations__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(42px, 6vw, 66px);
}

/* ---------- Carte projet ---------- */
.realc {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius, 14px);
  overflow: hidden;
  background: #0e1622;
  border: 1px solid var(--line-dark);
  cursor: pointer;
  text-align: left;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), border-color .35s;
}
.realc.realc--in { opacity: 1; transform: none; }
.realc:hover { border-color: rgba(91,197,238,.45); }
.realc:focus-visible { outline: 2.5px solid var(--blue-light); outline-offset: 3px; }

.realc__media { position: absolute; inset: 0; }
.realc__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.realc:hover .realc__media img { transform: scale(1.07); }

/* Dégradé bas pour lisibilité du texte */
.realc::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,13,20,.9) 0%, rgba(8,13,20,.35) 38%, transparent 65%);
  z-index: 1;
  transition: background .35s;
}
.realc:hover::after { background: linear-gradient(to top, rgba(8,13,20,.92) 0%, rgba(8,13,20,.45) 45%, rgba(31,139,203,.12) 100%); }

/* Texte (nom + période) */
.realc__info {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: clamp(16px, 2vw, 22px);
}
.realc__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: -.01em;
  margin: 0 0 4px;
}
.realc__period {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .08em;
  color: var(--blue-light);
}

/* Badge nombre de photos + loupe */
.realc__badge {
  position: absolute; top: 14px; right: 14px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(8,13,20,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
}
.realc__badge svg { width: 14px; height: 14px; }

.realc__view {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .35s var(--ease);
  pointer-events: none;
}
.realc__view span {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(214,25,30,.92);
  box-shadow: 0 12px 30px -10px rgba(214,25,30,.7);
  transform: scale(.7);
  transition: transform .35s var(--ease);
}
.realc__view svg { width: 26px; height: 26px; color: #fff; }
.realc:hover .realc__view { opacity: 1; }
.realc:hover .realc__view span { transform: scale(1); }

/* ---------- Carte « à venir » ---------- */
.realc--soon {
  cursor: default;
  background: rgba(255,255,255,.035);
  border: 1px dashed rgba(255,255,255,.18);
}
.realc--soon::after { display: none; }
.realc--soon:hover { border-color: rgba(255,255,255,.30); }
.realc__soon {
  position: absolute; inset: 0;
  z-index: 1;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  color: var(--on-dark-soft);
  padding: 20px 20px 70px;
  text-align: center;
}
.realc__soon svg { width: 40px; height: 40px; opacity: .55; }
.realc__soon span {
  font-family: var(--font-mono); font-size: .76rem;
  letter-spacing: .1em; text-transform: uppercase;
}

/* ============================================================
   VISIONNEUSE (lightbox)
   ============================================================ */
body.lb-open { overflow: hidden; }

.lightbox {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 4vw, 48px);
  background: rgba(8,12,18,.95);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }

.lightbox__stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 1120px; max-height: 100%;
}
.lightbox__img {
  max-width: 100%; max-height: 76vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 30px 90px -20px rgba(0,0,0,.85);
  background: #0e1622;
}
.lightbox.is-anim .lightbox__img { animation: lb-zoom .4s var(--ease); }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.lightbox__caption {
  display: flex; align-items: center; gap: 16px;
  color: var(--on-dark);
}
.lightbox__title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.lightbox__counter { font-family: var(--font-mono); font-size: .82rem; color: var(--on-dark-soft); }

.lightbox__close {
  position: absolute; top: clamp(12px, 3vw, 28px); right: clamp(12px, 3vw, 28px);
  z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.10); color: #fff;
  transition: background .25s, transform .25s var(--ease);
}
.lightbox__close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.lightbox__close svg { width: 22px; height: 22px; }

.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.10); color: #fff;
  transition: background .25s;
}
.lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__nav svg { width: 24px; height: 24px; }
.lightbox__nav--prev { left: clamp(8px, 2vw, 26px); }
.lightbox__nav--next { right: clamp(8px, 2vw, 26px); }
.lightbox__nav[disabled] { opacity: 0; pointer-events: none; }

@media (max-width: 600px) {
  .lightbox__nav { width: 44px; height: 44px; bottom: 14px; top: auto; transform: none; }
  .lightbox__nav--prev { left: calc(50% - 56px); }
  .lightbox__nav--next { right: calc(50% - 56px); }
  .lightbox__img { max-height: 64vh; }
  .lightbox__stage { gap: 12px; padding-bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .realc { opacity: 1; transform: none; transition: border-color .35s; }
  .realc__media img, .realc__view span { transition: none; }
  .lightbox, .lightbox.is-anim .lightbox__img { transition: none; animation: none; }
  .lightbox__close:hover { transform: none; }
}
