/* ── Gallery ──────────────────────────────────────────────── */

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
}

@media (min-width: 640px)  { .gallery__grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (min-width: 1024px) { .gallery__grid { grid-template-columns: repeat(4, 1fr); } }

.gallery__item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--color-primary-dark);
}

.gallery__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    display: block;
}

.gallery__item:hover .gallery__img { transform: scale(1.08); }

/* Hover overlay */
.gallery__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30,61,143,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gallery__overlay svg {
    width: 40px;
    height: 40px;
    color: var(--color-gold);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

.gallery__item:hover .gallery__overlay { opacity: 1; }

/* Focus visible state (keyboard nav) */
.gallery__item:focus-visible {
    outline: 3px solid var(--color-gold);
    outline-offset: 2px;
}

/* ── Cobblestone divider ─────────────────────────────────── */
/* Inspired by the cobblestone path in the logo */
.cobblestone-divider {
    height: 56px;
    overflow: hidden;
    background: var(--color-off-white);
}

.cobblestone-divider__inner {
    height: 100%;
    background-color: var(--color-primary-dark);
    background-image:
        linear-gradient(rgba(200,146,10,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200,146,10,.06) 1px, transparent 1px);
    background-size: 32px 24px;
    background-position: -16px -12px;
    border-top: 3px solid var(--color-gold);
    opacity: 0.85;
}

/* ── Lightbox ────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: zoom-out;
}

.lightbox__content {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    z-index: 1;
    max-width: 95vw;
    max-height: 95vh;
    padding: var(--space-4);
    animation: lightboxIn .25s ease;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.lightbox__img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dark);
}

.lightbox__caption {
    color: rgba(255,255,255,.7);
    font-size: var(--text-sm);
    text-align: center;
    max-width: 600px;
}

.lightbox__close {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,.1);
    color: var(--color-white);
    transition: background var(--transition-fast);
    z-index: 2;
}
.lightbox__close:hover { background: rgba(255,255,255,.2); }
.lightbox__close svg  { width: 20px; height: 20px; }

.lightbox__nav {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(200,146,10,.15);
    color: var(--color-gold);
    border: 1px solid rgba(200,146,10,.3);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.lightbox__nav:hover { background: var(--color-gold); color: var(--color-dark); }
.lightbox__nav svg  { width: 24px; height: 24px; }

@media (max-width: 480px) {
    .lightbox__nav { display: none; }
}
