*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-dark: #f0ece6;
    --color-medium: #c8c0b4;
    --color-light: #9a9288;
    --color-accent: #b08d57;
    --color-accent-light: #d4b980;
    --color-bg: #1a1714;
    --font-cursive: 'Alex Brush', cursive;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Figtree', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-serif);
    color: var(--color-dark);
    background-color: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Nav Bar ── */
.gallery-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(26, 23, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-back {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-dark);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.nav-back:hover { opacity: 1; }

.nav-title {
    font-family: var(--font-cursive);
    font-size: 24px;
    color: var(--color-dark);
}

/* ── Photo Grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    transition: transform 0.3s ease;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item .item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 14px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

.gallery-item .item-date {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

.modal-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.modal-arrow svg { width: 22px; height: 22px; }

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

.modal-prev { left: 16px; }
.modal-next { right: 16px; }

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    width: 100%;
}

.modal-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain;
}

.modal-caption {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--color-dark);
    text-align: center;
    margin-top: 20px;
    line-height: 1.6;
    max-width: 600px;
}

.modal-date {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    color: var(--color-light);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .gallery-nav {
        padding: 14px 16px;
    }

    .nav-title {
        font-size: 20px;
    }

    .modal-overlay {
        padding: 16px;
    }

    .modal-img {
        max-height: 60vh;
        border-radius: 8px;
    }

    .modal-caption {
        font-size: 16px;
        margin-top: 16px;
    }

    .modal-arrow { display: none; }
}
