/* Gallery CSS — Time Estate Agents */

/* ============================================================
   GALLERY SKELETON LOADER
   ============================================================ */
.tea-gallery-skeleton {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: .4; }
    50%       { opacity: .8; }
}

.tea-gallery-skeleton-item {
    border-radius: 8px;
    background: #e5e7eb;
    animation: skeleton-pulse 1.5s ease infinite;
}

.tea-gallery-skeleton-item:nth-child(1) { height: 240px; }
.tea-gallery-skeleton-item:nth-child(2) { height: 180px; }
.tea-gallery-skeleton-item:nth-child(3) { height: 300px; }
.tea-gallery-skeleton-item:nth-child(4) { height: 200px; }
.tea-gallery-skeleton-item:nth-child(5) { height: 260px; }
.tea-gallery-skeleton-item:nth-child(6) { height: 220px; }

/* ============================================================
   GALLERY MASONRY
   ============================================================ */
.tea-gallery-grid {
    columns: 3;
    column-gap: 1rem;
    padding: 0;
}

.tea-gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #f3f4f6;
    transition: transform .3s ease, box-shadow .3s ease;
}

.tea-gallery-item:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 32px rgba(26, 39, 68, .2);
    z-index: 1;
}

.tea-gallery-item img {
    width: 100%;
    display: block;
    transition: transform .6s ease, filter .3s ease;
    aspect-ratio: auto;
    object-fit: cover;
    min-height: 160px;
    max-height: 500px;
}

.tea-gallery-item:hover img {
    transform: scale(1.06);
    filter: brightness(0.85);
}

.tea-gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 39, 68, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    color: #fff;
    font-size: 1.75rem;
}

.tea-gallery-item:hover .tea-gallery-item__overlay,
.tea-gallery-item:focus  .tea-gallery-item__overlay {
    opacity: 1;
}

/* Focus ring for accessibility */
.tea-gallery-item:focus-visible {
    outline: 3px solid var(--tea-gold, #c9a84c);
    outline-offset: 2px;
}

/* Google Maps photos badge */
.tea-gallery-item.from-google::after {
    content: 'G';
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4285F4;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .tea-gallery-grid {
        columns: 2;
    }
    .tea-gallery-skeleton {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .tea-gallery-grid {
        columns: 1;
    }
    .tea-gallery-skeleton {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.tea-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .94);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.tea-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.tea-lightbox__img {
    max-width: min(90vw, 1200px);
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
    object-fit: contain;
    transition: transform .2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.tea-lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .2s;
    z-index: 10000;
}

.tea-lightbox__close:hover {
    background: rgba(255, 255, 255, .3);
    transform: rotate(90deg);
}

.tea-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .2s;
    z-index: 10000;
}

.tea-lightbox__nav:hover {
    background: rgba(255, 255, 255, .3);
}

.tea-lightbox__prev {
    left: 1.25rem;
}

.tea-lightbox__prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

.tea-lightbox__next {
    right: 1.25rem;
}

.tea-lightbox__next:hover {
    transform: translateY(-50%) translateX(3px);
}

/* Caption */
.tea-lightbox__caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
    background: rgba(0, 0, 0, .4);
    padding: .4rem 1rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* Loading spinner inside lightbox */
.tea-lightbox__img[src=''] {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: none;
}
