/* --- Global & Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background-color: #eeeeee; 
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.6; }

/* --- Header & Nav --- */
.site-header {
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    background: rgba(238, 238, 238, 0.95);
    z-index: 100;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    width: 100%;
}

.site-header nav {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%; 
    position: relative; 
}

/* FIX: Ensure logo is clickable and on top */
.logo {
    z-index: 20;
    position: relative;
}

.site-logo-img { 
    height: 24px; 
    width: auto; 
    display: block; 
    cursor: pointer;
    /* Smooth spin transition */
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    pointer-events: none; 
}

/* HAMBURGER MENU */
.mobile-menu-toggle {
    display: block; 
    cursor: pointer;
    z-index: 20; /* Keep menu button clickable too */
}
.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin-bottom: 5px;
}

/* NAV LINKS */
#nav-links {
    display: none; 
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%; 
    left: 0;
    background: #eeeeee; 
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    z-index: 1000;
    border-top: 1px solid #ddd;
    list-style: none;
}

#nav-links.active { display: flex; }

#nav-links a {
    display: block;
    padding: 1rem;
    color: #333;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

#nav-links a:hover {
    background-color: rgba(0,0,0,0.02);
    opacity: 1; 
}
#nav-links a.active { font-weight: 600; }

/* --- Fading Carousel --- */
.carousel-container {
    position: relative;
    width: 100%;
    height: 80vh; 
    overflow: hidden;
    background: #111; 
}

.carousel-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.carousel-slide.active { opacity: 1; z-index: 2; }

.carousel-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.6);
    transform: scale(1.1);
    z-index: 1;
}

.carousel-img {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    width: auto; height: auto;
    object-fit: contain;
    z-index: 2;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    cursor: pointer;
}

.carousel-date {
    position: absolute;
    bottom: 2rem; right: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    z-index: 3;
    pointer-events: none;
}

.carousel-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    z-index: 10;
    padding: 1rem;
    user-select: none;
    transition: color 0.3s;
}
.carousel-nav:hover { color: white; }
.carousel-nav.prev { left: 1rem; }
.carousel-nav.next { right: 1rem; }

/* --- Flex Grid --- */
.masonry-grid {
    display: flex;
    flex-wrap: wrap;       
    justify-content: center; 
    align-items: flex-start; 
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-item {
    flex: 0 0 calc((100% - 3rem) / 3);
    max-width: 400px;
    position: relative;
    margin-bottom: 0;
    overflow: hidden; 
    border-radius: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.3s;
}
.grid-item img:hover { 
    opacity: 1; 
    transform: scale(1.03); 
}

.photo-date {
    font-size: 0.75rem; color: #666;
    margin-top: 5px; text-align: right;
}

.gallery-header { padding: 3rem 2rem 1rem; text-align: center; }
.gallery-title { font-weight: 300; letter-spacing: 0.1em; text-transform: capitalize; }

/* --- Footer --- */
.site-footer {
    margin-top: auto; 
    padding: 3rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #eeeeee;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-weight: 500;
    color: #333;
    margin: 0 5px;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(238,238,238,0.98); 
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 1; transition: opacity 0.3s;
}
.lightbox.hidden { opacity: 0; pointer-events: none; }
.lightbox img { max-width: 90vw; max-height: 90vh; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.lightbox-close {
    position: absolute; top: 2rem; right: 2rem;
    font-size: 3rem; cursor: pointer; color: #333;
}

/* --- Loading Spinner --- */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50vh;
    width: 100%;
}
.spinner {
    width: 40px; 
    height: 40px; 
    border: 3px solid rgba(0,0,0,0.1); 
    border-top-color: #333; 
    border-radius: 50%; 
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Back to Top --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.3s;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
#back-to-top:hover {
    background: #555;
}

/* --- Mobile Fixes --- */
@media (max-width: 900px) {
    .grid-item { flex: 0 0 calc((100% - 1.5rem) / 2); }
}

@media (max-width: 600px) {
    .grid-item { flex: 0 0 100%; max-width: 100%; }
    
    .carousel-nav {
        display: block !important; 
        font-size: 1.5rem; 
        padding: 1rem 0.5rem;
        background: rgba(0,0,0,0.1);
        border-radius: 4px;
    }
    .carousel-nav.prev { left: 5px; }
    .carousel-nav.next { right: 5px; }
}
