/* Base variables */
:root {
    --bg-color: #ffffff;
    --text-primary: #111111;
    --text-muted: #666666;
    --nav-color: #888888;
    --nav-active: #000000;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    --spacing-lg: 4rem;
    --spacing-md: 2rem;
    --spacing-sm: 1rem;
}

/* Reset basics */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    text-align: center;
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 0.2em; /* Reduced from 0.3em */
    text-transform: uppercase;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--nav-color);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.15em; /* Reduced from 0.2em */
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--nav-active);
}

/* Main Gallery Area */
.gallery-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 4rem;
}

.main-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #f8f8f8; /* Slight background for the image bleeding area, typical for full width galleries or just white */
    padding: 0;
    position: relative;
    /* max height or aspect ratio mapping */
    height: 70vh;
    min-height: 400px;
}

/* Optional: if you want the image to span the whole container width if landscape */
.image-container {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#main-photo {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain; /* ensures whole image is visible */
    transition: opacity 2s ease;
}

#main-photo.fade-out {
    opacity: 0;
}

/* Navigation Arrows */
.nav-arrow {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 1rem;
    color: #444;
    transition: color 0.3s ease;
    z-index: 10;
}

.nav-arrow:hover {
    color: #000;
}

.arrow-icon {
    width: 32px;
    height: 32px;
}

.prev-arrow {
    left: 2rem;
}

.next-arrow {
    right: 2rem;
}

/* Caption */
.caption-container {
    margin-top: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.caption {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.08em; /* Reduced from 0.1em */
    color: var(--text-primary);
}

.admin-controls {
    margin-top: 1rem;
}

.delete-btn {
    background: none;
    border: none;
    color: #cc0000;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.delete-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Thumbnails */
.thumbnail-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* allow wrapping on small screens */
    gap: 16px; /* Strict 16px gap */
    margin-top: 1rem;
    max-width: 90%;
}

.thumbnail {
    height: 60px; /* same height for all */
    margin: 0; /* Ensuring no manual margins */
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 2s ease;
    object-fit: cover; /* Ensure aspect ratio is handled somewhat */
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
}



/* Mobile Responsiveness */
@media (max-width: 768px) {
    .site-header {
        padding: 2rem 0 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }

    .main-nav ul {
        gap: 1rem;
    }

    .main-nav a {
        font-size: 0.75rem;
    }

    .main-image-wrapper {
        height: 50vh;
    }

    .prev-arrow {
        left: 0.5rem;
    }
    
    .next-arrow {
        right: 0.5rem;
    }
}
