/* Galerie APTO Obernai - version dynamique, indépendante de style.css */
.gallery-nav-current{color:var(--accent)!important}
.gallery-intro{background:#fff;padding:clamp(3rem,6vw,5.8rem) 0 clamp(2.5rem,4vw,4rem);border-bottom:1px solid var(--line)}
.gallery-intro-grid{display:block;max-width:850px}
.gallery-intro h1{font-size:clamp(2rem,4vw,3rem);line-height:1.05;letter-spacing:-.052em;font-weight:850;color:var(--navy);margin:1rem 0 1.1rem}
.gallery-intro h1 em{font-style:normal;color:var(--accent)}
.gallery-lead{max-width:610px;color:var(--muted);font-size:clamp(1rem,1.35vw,1.12rem);line-height:1.7;margin:0}
.gallery-section{padding:clamp(2.4rem,5vw,4.5rem) 0 1.5rem}
.gallery-back{display:inline-flex;align-items:center;text-decoration:none;color:var(--muted);font-size:.85rem;font-weight:700;margin-bottom:2.2rem}
.gallery-back:hover{color:var(--accent)}
.gallery-topline{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin-bottom:1.7rem}
.gallery-topline h2{color:var(--navy);font-size:1.25rem;font-weight:800;letter-spacing:-.02em;margin:0}
.gallery-topline span{color:var(--muted);font-size:.85rem}
/* Colonnes plutôt que tuiles à hauteur imposée : aucune photo n'est recadrée. */
.gallery-grid{columns:3;column-gap:clamp(.85rem,1.7vw,1.35rem)}
.gallery-tile{position:relative;width:100%;display:block;break-inside:avoid;margin:0 0 clamp(.85rem,1.7vw,1.35rem);padding:0;border:0;border-radius:12px;background:#edf1f2;overflow:hidden;cursor:zoom-in;box-shadow:0 6px 25px rgba(16,39,52,.06);text-align:left}
.gallery-tile img{display:block;width:100%;height:auto;object-fit:contain;transition:transform .3s ease;transform:translateZ(0)}
.gallery-tile-overlay{position:absolute;inset:auto 0 0;display:flex;justify-content:flex-start;gap: .4rem;align-items:center;padding:1.4rem 1rem .8rem;color:white;background:linear-gradient(transparent,rgba(5,24,30,.65));font-size:.78rem;font-weight:750;opacity:0;transition:opacity .2s}
.gallery-tile:hover img{transform:scale(1.015)}
.gallery-tile:hover .gallery-tile-overlay,.gallery-tile:focus-visible .gallery-tile-overlay{opacity:1}
.gallery-tile:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.gallery-empty{padding:3rem;text-align:center;color:var(--muted);background:#f3f6f7;border-radius:12px}
.gallery-lightbox[hidden]{display:none!important}
.gallery-lightbox{position:fixed;inset:0;z-index:1100;display:flex;align-items:center;justify-content:center;background:rgba(7,15,23,.97);padding:4rem 4.5rem 2rem;color:#fff}
.lightbox-figure{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;max-width:100%;max-height:100%;margin:0}
.lightbox-figure img{display:block;object-fit:contain;max-width:100%;max-height:calc(100dvh - 7.2rem);width:auto;height:auto;box-shadow:0 7px 28px rgba(0,0,0,.2)}
.lightbox-figure figcaption{font-size:.85rem;color:#bac8d0;font-variant-numeric:tabular-nums}
.lightbox-close,.lightbox-arrow{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;border:1px solid rgba(255,255,255,.3);background:rgba(12,22,28,.65);cursor:pointer}
.lightbox-close:hover,.lightbox-arrow:hover{background:rgba(255,255,255,.19)}
.lightbox-close{top:1.1rem;right:1.2rem;width:44px;height:44px;font-size:2rem;line-height:1}
.lightbox-arrow{top:50%;transform:translateY(-50%);width:42px;height:58px;font-size:2.4rem;line-height:1}
.lightbox-prev{left:1.1rem}.lightbox-next{right:1.1rem}
@media(max-width:991.98px){.gallery-grid{columns:2}}
@media(max-width:767.98px){.gallery-lightbox{padding:4.1rem .6rem 3rem}.lightbox-arrow{top:auto;bottom:.6rem;transform:none;height:42px}.lightbox-prev{left:.75rem}.lightbox-next{right:.75rem}.lightbox-figure img{max-height:calc(100dvh - 9rem)}.gallery-tile-overlay{opacity:1}}
@media(max-width:520px){.gallery-grid{columns:1}.gallery-topline{align-items:center}.gallery-section{padding-bottom:2.5rem}}
@media(prefers-reduced-motion:reduce){.gallery-tile img,.gallery-tile-overlay{transition:none}.gallery-tile:hover img{transform:none}}
/* Un lien de navigation supplémentaire nécessite le menu mobile légèrement plus tôt. */
@media (min-width:992px) and (max-width:1199.98px){
.desktop-nav,.nav-member{display:none}
.mobile-menu-toggle{display:inline-flex}
.mobile-nav{display:none;flex-direction:column;gap:0;padding-bottom:.7rem;border-top:1px solid var(--line)}
.mobile-nav.is-open{display:flex}
.mobile-nav a{display:block;padding:.75rem .35rem;font-size:.95rem;border-bottom:1px solid var(--line)}
.mobile-nav a:last-child{border-bottom:0}
}

/* Visionneuse mobile en paysage : toute la hauteur disponible, sans recadrage. */
@media (max-width: 991.98px) and (orientation: landscape) {
  .gallery-lightbox {
    padding: .35rem;
  }
  .lightbox-figure {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    gap: 0;
  }
  .lightbox-figure img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - .7rem);
  }
  .lightbox-figure figcaption {
    position: absolute;
    bottom: .5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: .15rem .5rem;
    border-radius: .3rem;
    background: rgba(7, 15, 23, .65);
  }
  .lightbox-arrow {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}
