/* ==========================================================
   GALERIES : pagination, visionneuse (zoom + navigation)
   ========================================================== */
[data-lightbox] { cursor: zoom-in; }
.gl-hidden { display: none !important; }

/* ---------- Pagination ---------- */
.gl-pager { margin: 1.75rem 0 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.gl-status { color: #5a5160; font-size: .9rem; margin: 0; }
.gl-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.gl-pages button {
    min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; border-radius: 999px; border: 2px solid #750069;
    background: #fff; color: #750069; font-weight: 700; font-size: .95rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem; transition: background .15s;
}
.gl-pages button:hover:not([disabled]):not([aria-current]) { background: #f4f0f8; }
.gl-pages button[aria-current="page"] { background: #750069; color: #fff; cursor: default; }
.gl-pages button[disabled] { opacity: .4; cursor: not-allowed; }
.gl-pages button:focus-visible { outline: 3px solid #42bd2e; outline-offset: 2px; }
.gl-pages .gl-gap { align-self: center; color: #750069; padding: 0 .15rem; }
@media (max-width: 520px) { .gl-pages .gl-txt { display: none; } .gl-pages button { min-width: 2.4rem; height: 2.4rem; } }

/* ---------- Tuiles de la photothèque ---------- */
.ph-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .ph-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .ph-grid { gap: .7rem; } }
.ph-card { display: block; position: relative; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ph-card img { width: 100%; height: 16rem; object-fit: cover; display: block; transition: transform .35s; }
@media (max-width: 640px) { .ph-card img { height: 10rem; } }
.ph-card:hover img { transform: scale(1.05); }
.ph-card figcaption, .ph-cap { padding: .6rem .8rem; font-size: .88rem; color: #2d3748; line-height: 1.35; }
.ph-zoom { position: absolute; top: .6rem; right: .6rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: rgba(117,0,105,.88); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.ph-card:hover .ph-zoom, .ph-card:focus-visible .ph-zoom { opacity: 1; }
@media (hover: none) { .ph-zoom { opacity: .9; } }
.ph-card:focus-visible, .gallery-item:focus-visible { outline: 3px solid #42bd2e; outline-offset: 2px; }
.gal-more { text-align: center; margin-top: 1.5rem; }

/* ---------- Visionneuse plein écran ---------- */
.gl-box { position: fixed; inset: 0; z-index: 10001; display: none; background: rgba(18, 0, 16, .95); color: #fff; touch-action: none; }
.gl-box.open { display: block; }
.gl-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .8rem; background: linear-gradient(to bottom, rgba(18,0,16,.85), rgba(18,0,16,0)); }
.gl-count { font-weight: 600; font-size: .95rem; }
.gl-tools { display: flex; align-items: center; gap: .35rem; }
.gl-zoom { min-width: 3.2rem; text-align: center; font-size: .85rem; opacity: .9; }
.gl-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.gl-btn:hover:not([disabled]) { background: rgba(255,255,255,.28); }
.gl-btn[disabled] { opacity: .35; cursor: default; }
.gl-btn:focus-visible { outline: 3px solid #42bd2e; outline-offset: 2px; }
.gl-btn svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gl-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 3.6rem 0 3.4rem; }
.gl-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; opacity: 0; transition: opacity .2s; }
.gl-img.ready { opacity: 1; }
.gl-box.is-zoomed .gl-stage { cursor: grab; }
.gl-box.is-dragging .gl-stage { cursor: grabbing; }
.gl-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; padding: 1rem; max-width: 80%; }
.gl-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 3rem; height: 3rem; }
.gl-prev { left: .7rem; } .gl-next { right: .7rem; }
.gl-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; text-align: center; padding: .8rem 4.5rem 1rem; font-size: .95rem; line-height: 1.4; background: linear-gradient(to top, rgba(18,0,16,.85), rgba(18,0,16,0)); pointer-events: none; }
@media (max-width: 600px) { .gl-nav { width: 2.6rem; height: 2.6rem; } .gl-prev { left: .3rem; } .gl-next { right: .3rem; } .gl-cap { padding: .8rem 3.5rem 1rem; } .gl-zoom { display: none; } }
@media (prefers-reduced-motion: reduce) { .gl-img, .ph-card img, .ph-zoom { transition: none; } }
