/* ==========================================================================
   Wagnernet Gallery — frontend styles
   Self-contained: no Bootstrap or other framework dependencies required.
   All classes can be overridden by template/custom CSS.
   ========================================================================== */

/* ----- Grid ------------------------------------------------------------- */
.wngallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .wngallery-cols-2 .wngallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wngallery-cols-3 .wngallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wngallery-cols-4 .wngallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.wngallery-item {
    position: relative;
    overflow: hidden;
}

.wngallery-link {
    display: block;
    line-height: 0;
    text-decoration: none;
    cursor: zoom-in;
}

.wngallery-thumb {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.25s ease;
}

/* ----- Lightbox modal — Lightbox2-style framed window ------------------- */
.wngallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.78);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.wngallery-modal.is-open {
    display: flex;
}

.wngallery-modal-dialog {
    position: relative;
    background: #fff;
    padding: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    max-width: min(90vw, 1400px);
    max-height: 92vh;
    margin: 0 auto;
    color: #333;
    box-sizing: border-box;
    animation: wngallery-zoom-in 0.55s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Soft, visible zoom-in (easeOutCubic) — distributes the movement evenly
   across the duration so the zoom is clearly visible without feeling
   abrupt. Starts at 60% scale for a noticeable but graceful expansion. */
@keyframes wngallery-zoom-in {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.wngallery-modal-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.wngallery-modal-img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    margin: 0 auto;
    border-radius: 2px;
}

.wngallery-modal-caption {
    text-align: center;
    color: #444;
    padding: 0.75rem 0.5rem 0.25rem;
    font-size: 0.95rem;
    border-top: 1px solid #eee;
    margin-top: 0.5rem;
}

/* ----- Buttons (close + nav) — same offset, SVG-icon centered ---------- */
.wngallery-modal .wngallery-close,
.wngallery-modal .wngallery-prev,
.wngallery-modal .wngallery-next {
    position: absolute;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    transition: background 0.15s ease;
}

.wngallery-modal .wngallery-close:hover,
.wngallery-modal .wngallery-prev:hover,
.wngallery-modal .wngallery-next:hover {
    background: rgba(0, 0, 0, 0.85);
}

.wngallery-modal .wngallery-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
}

.wngallery-modal .wngallery-prev,
.wngallery-modal .wngallery-next {
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
}

.wngallery-modal .wngallery-prev { left: 0.5rem; }
.wngallery-modal .wngallery-next { right: 0.5rem; }

/* SVG icons inside buttons render perfectly centered */
.wngallery-modal button > svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}

/* Single-image gallery: hide nav arrows */
.wngallery-modal[data-single="true"] .wngallery-prev,
.wngallery-modal[data-single="true"] .wngallery-next {
    display: none;
}
