/* Galenko Frontend Styles - Masonry Layout & Lightbox */
:root {
    --photo-container-height: 6rem;
}

@media (max-width: 768px) {
    :root {
        --photo-container-height: 3rem;
    }
}


/* Masonry Gallery Layout */
.gallery {
    columns: 3;
    column-gap: 8px;
    column-fill: balance;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 8px;
    width: 100%;
}

.gallery-item a {
    display: block;
    width: 100%;
    transition: transform 0.2s ease;
    text-decoration: none;
    cursor: zoom-in;
}

.gallery-item a:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    vertical-align: bottom;
}

.gallery-icon {
    margin: 0;
    padding: 0;
}

/* Beautiful Minimalistic Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery {
        columns: 2;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 600px) {
    .gallery {
        columns: 1;
    }
    
    .lightbox-nav {
        display: none;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
    }
    
    .lightbox-counter {
        bottom: 20px;
    }
}

/* Accessibility Improvements */
.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Hide empty gallery captions only on photos post type */
body.single-photo .gallery-item figcaption{
    display: none !important;
}




li.wp-block-post.photo.type-photo{
    padding-top: var(--photo-container-height);
}
li.wp-block-post.photo.type-photo > div{
    position: relative;
}
li.wp-block-post.photo.type-photo .photo-thumbnails{
    position: absolute;
    top: calc(var(--photo-container-height) * -1);
    right:0;
    bottom:0;
    height: var(--photo-container-height);
    overflow: hidden;
    opacity: 1;
    display: flex;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}
li.wp-block-post.photo.type-photo time{
    text-shadow: 0 0 5px #fff;
}
/* Ensure thumbnails crop from left when container resizes */
li.wp-block-post.photo.type-photo .photo-thumbnails a {
    flex: 1 1 0;
    width: auto;
    height: 100%;
    display: block;
}

li.wp-block-post.photo.type-photo .photo-thumbnails img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Random Photos on Archive - Horizontal flex layout for shuffled thumbnails */
.random-photos {
    display: flex;
    gap: .5rem;
    margin: 0 0 var(--photo-container-height);
    max-width: 100%;
}

.random-photos a {
    flex: 1 1 0;
    display: none; /* Hidden by default, shown by JS */
    transition: transform 0.3s ease;
    &:hover {
        transform: scale(1.1);
        z-index: 2;
    }
}

.random-photos a.visible {
    display: block;
}

.random-photos img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
