/* ============================================================
   GALLERY — a big scattered wall of tilted polaroids
   Built on the color/font variables defined in style.css.
   ============================================================ */

.gal-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 24px 100px;
}

.gal-wrap h1 {
    text-align: center;
    margin-bottom: 40px;
}

.gal-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 44px 34px;
}

.gal-polaroid {
    display: block;
    width: 280px;
    padding: 16px 16px 16px;
    background: #FDFCF9;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gal-polaroid:hover {
    transform: rotate(0deg) scale(1.05) translateY(-6px) !important;
    box-shadow: 0 16px 28px rgba(0,0,0,0.24);
    z-index: 2;
    position: relative;
}

.gal-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    background: #e0dcd4; /* placeholder tone while a lazy image is still loading */
}

@media (max-width: 600px) {
    .gal-polaroid { width: 42vw; padding: 10px 10px 10px; }
    .gal-grid { gap: 26px 16px; }
    .gal-wrap { padding: 40px 16px 70px; }
}

/* ---- Lightbox modal ---- */

.gal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gal-modal-overlay.visible {
    display: flex;
}

.gal-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 90vh;
}

.gal-modal-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.gal-modal-nav {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.gal-modal-arrow {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.gal-modal-arrow:hover {
    background: rgba(255,255,255,0.2);
}

.gal-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}

.gal-modal-close:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .gal-modal-close { top: 14px; right: 18px; font-size: 34px; }
    .gal-modal-arrow { width: 42px; height: 42px; }
}

/* ---- Load More ---- */

.gal-load-more-wrap {
    text-align: center;
    margin-top: 40px;
}

.gal-load-more {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 17px;
    padding: 13px 30px;
    border-radius: 8px;
    border: none;
    background: var(--color-primary);
    color: var(--color-background);
    cursor: pointer;
}

.gal-load-more:hover {
    opacity: 0.9;
}
