﻿/* CSS Document */

.gallery-item-col {
    margin-bottom: 10px;   
}

/* AlbumItem hover overlay */
.gallery-hover-wrapper {
    position: relative;
    display: block;
    width: 100%;
    /* Maintain a consistent thumbnail area at 402x266 (~3:2) */
    aspect-ratio: 402 / 266;
    overflow: hidden;
    max-width: 400px;
}

.gallery-hover-wrapper img.gallery_photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none;
}

/* Ensure non-img placeholders also fill the wrapper */
.gallery-hover-wrapper .gallery_photo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
}

.gallery-hover-wrapper .gallery_photo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1;
}

.link_img:hover .gallery-hover-overlay {
    opacity: 1;
}

/* Center the search icon and animate from right to center on hover */
#search {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(150%, -50%);
    opacity: 0;
    transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
    color: var(--bs-primary);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#search svg {
    width: 32px;
    height: 32px;
}

.link_img:hover #search {
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Slightly scale image on hover for emphasis */
.gallery-hover-wrapper img.gallery_photo {
    transition: transform 0.25s ease-in-out;
}

.link_img:hover .gallery-hover-wrapper img.gallery_photo {
    transform: scale(1.1);
}

/* PhotosViewer masonry layout */
.photos-viewer {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.photos-viewer .photos-prev {
    color: var(--bs-primary);
    text-decoration: none;
}

.masonry-grid {
    column-count: 1;
    column-gap: 1rem;
}

@media (min-width: 576px) {
    .masonry-grid { column-count: 2; }
}
@media (min-width: 768px) {
    .masonry-grid { column-count: 3; }
}
@media (min-width: 992px) {
    .masonry-grid { column-count: 4; }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
}

.masonry-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: .25rem;
}

/* White overlay at 10% on photo hover */
.masonry-item::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    border-radius: .25rem;
    pointer-events: none; /* allow clicks to pass through to overlay button */
}

.masonry-item:hover::after {
    opacity: 1;
}

.masonry-caption {
    text-align: center;
    font-weight: 600;
    margin-top: .5rem;
}

.gallery-item-row {
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.gallery_photo {
    position: relative;
    display: inline-block;
    overflow: hidden;
    max-width: 400px;
    margin-bottom: 10px;
}

.view-icons {
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 15px;
    margin-left: 30px;
}

/* Clickable overlay over photos (matches hover opacity) */
.photo-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    border-radius: .25rem;
    border: 0;
    padding: 0;
    cursor: zoom-in;
    z-index: 2; /* ensure clickable above ::after */
}

.masonry-item:hover .photo-overlay {
    opacity: 1;
}

/* Simple lightbox modal */
.lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-dialog {
    background: #fff;
    border-radius: .5rem;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-header {
    display: flex;
    justify-content: flex-end;
    padding: .5rem .75rem;
    border-bottom: 1px solid #eee;
}

.lightbox-body {
    padding: .5rem;
    position: relative;
}

.lightbox-body img {
    max-width: 85vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-prev { left: .5rem; }
.lightbox-next { right: .5rem; }

.lightbox-nav:hover { background: rgba(0,0,0,0.6); }