/* =========================================================
   GW Gallery – Grid
   ========================================================= */

.gw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gw-columns, 4), 1fr);
    gap: 10px;
}

.gw-gallery-grid .gw-gallery-item {
    position: relative;
    overflow: hidden;
    border: 2px solid #aaa;
    border-radius: 4px;
    aspect-ratio: 1.62;
}

.gw-gallery-grid .gw-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gw-gallery-item img:hover {
    transform: scale(1.05);
}

/* Caption overlay */

.gw-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
	box-sizing: border-box;
    background: rgba(0,0,0,0.6);
    color: #ccc;
    padding: 6px 8px;
    font-size: 1.5rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gw-gallery-item:hover .gw-gallery-caption {
    opacity: 1;
}

/* =========================================================
   Slideshow Overlay
   ========================================================= */

.gw-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);
    box-sizing: border-box;
}

.slideshow-image-wrapper {
    position: relative;
    max-width: 85vw;
    max-height: calc(100vh - 140px);
}

.slideshow-image-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border: 3px solid white;
}

/* Caption under slideshow image */

.gw-slideshow-caption {
    color: #fff;
    margin-top: 10px;
    font-size: 1.7rem;
    text-align: center;
}

/* =========================================================
   Slideshow Controls (Desktop)
   ========================================================= */

.gw-slideshow-controls {
    margin-top: 15px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.gw-slideshow-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.gw-slideshow-controls button:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   Mobile Navigation Arrows
   ========================================================= */

.mobile-arrows {
    display: none;
}

.arrow {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    user-select: none;
}

/* =========================================================
   Responsive Behaviour
   ========================================================= */

/* Tablets / small laptops */
@media (max-width: 1000px) {

    .slideshow-image-wrapper {
        max-height: 70vh;
    }

    .slideshow-image-wrapper img {
        max-height: 70vh;
    }

    .mobile-arrows {
        position: absolute;
        top: 50%;
        width: 100%;
        display: flex;
        justify-content: space-between;
        transform: translateY(-50%);
        pointer-events: none;
        padding: 0 5px;
        box-sizing: border-box;
    }
}

/* Tablets / large phones */
@media (max-width: 768px) {

    .gw-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gw-slideshow-controls {
        display: none !important;
    }
}

/* Phones */
@media (max-width: 480px) {

    .gw-gallery-grid {
        grid-template-columns: 1fr;
    }
}
