/* --- Global Styles --- */
body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    margin: 0;
    background-color: #fff;
    color: #000000;
}

/* --- Header & Footer Styles --- */
header, footer {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
header {
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
footer {
    bottom: 0;
    text-align: center;
    font-size: 0.8rem;
    padding: 10px 20px;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: inherit;
}
.header-link {
    text-decoration: none;
    color: inherit;
}


/* --- Main Content (for Homepage & About) --- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 110px 20px 90px 20px;
    box-sizing: border-box;
}
.page-header {
    text-align: center;
    margin-bottom: 40px;
}
.page-header h2 {
    font-weight: 300;
    font-size: 2rem;
    margin: 0 0 10px 0;
}
.page-header p {
    font-size: 1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Homepage Portfolio Grid (Hover Effect) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 15px;
}
.portfolio-grid a.portfolio-item {
    display: block;
    position: relative;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.portfolio-grid a.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.portfolio-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.portfolio-item-text h3 {
    font-weight: 300;
    font-size: 1.1rem;
    margin: 0 0 5px 0;
}
.portfolio-item-text p {
    font-weight: 300;
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}
.portfolio-grid a.portfolio-item:hover .portfolio-item-overlay {
    opacity: 1;
}
.portfolio-grid a.portfolio-item:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* --- Gallery Page Snap-Scroll Styles --- */
.gallery {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    box-sizing: border-box;
    padding-top: 80px; /* Clear desktop header */
    padding-bottom: 60px; /* Clear desktop footer */
    margin: 0;
    max-width: 100%;
}
.image-block {
    scroll-snap-align: start;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center; /* Reverted to center */
    padding: 40px 20px; /* Default padding for subsequent blocks */
    box-sizing: border-box;
}
.image-block:first-child {
    padding-top: 80px; /* Extra padding top ONLY for desktop first block */
}

.content-wrapper {
    display: inline-block;
    width: 100%;
    max-width: min(90vw, 1200px);
    text-align: center;
    box-sizing: border-box; /* Added for safety */
}
.image-block img {
    max-height: 80vh;
    display: block;
    object-fit: contain;
    margin: 0 auto;
    max-width: 100%; /* Ensure image never exceeds its wrapper */
}

/* --- Gallery Intro Header Styles --- */
.gallery-intro-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px auto;
    color: #000;
    /* padding-top removed */
}
.gallery-intro-header h2 {
    font-weight: 300;
    font-size: 1.75rem;
    margin: 0 0 10px 0;
}
.gallery-intro-header p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* --- Navigation Styles --- */
nav {
    display: flex;
    gap: 25px;
}
nav a {
    text-decoration: none;
    color: #000000;
    font-weight: bold;
}
nav a.active {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    padding: 5px 10px;
    margin: -5px -10px;
}

/* --- Responsive Navigation --- */
#nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    position: relative;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background-color: #000;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s ease-in-out;
}
.nav-toggle-label span::before { content: ''; top: -8px; }
.nav-toggle-label span::after { content: ''; top: 8px; }

@media (max-width: 768px) {
    /* --- UPDATED MOBILE STYLES --- */
    header {
        /* Mobile header height is implicitly shorter due to content/padding */
        /* Recalculate padding based on this assumed height (~60px) */
    }
    footer {
        /* Mobile footer height is implicitly shorter due to content/padding */
        /* Recalculate padding based on this assumed height (~50px) */
    }

    nav {
        display: none;
        flex-direction: column;
        align-items: center;
        position: absolute;
        top: 60px; /* Assumed mobile header height */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    nav a {
        padding: 15px;
        width: 100%;
        text-align: center;
    }
    nav a.active {
        margin: 0;
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    .nav-toggle-label {
        display: flex;
        align-items: center;
    }
    #nav-toggle:checked ~ nav {
        display: flex;
    }
    #nav-toggle:checked ~ nav a {
        padding: 15px;
        width: 100%;
        text-align: center;
    }
    #nav-toggle:checked ~ .nav-toggle-label span {
        background-color: transparent;
    }
    #nav-toggle:checked ~ .nav-toggle-label span::before {
        transform: rotate(45deg);
        top: 0;
    }
    #nav-toggle:checked ~ .nav-toggle-label span::after {
        transform: rotate(-45deg);
        top: 0;
    }
    
    .main-content {
        padding: 90px 10px 80px 10px; /* Header(~60) + 30px top, Footer(~50) + 30px bottom */
    }
    
    .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    
    .portfolio-item-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.4);
        padding: 10px;
    }
    .portfolio-item-text h3 { font-size: 1rem; }
    .portfolio-item-text p { font-size: 0.8rem; }

    .gallery {
        padding-top: 60px; /* Clear mobile header */
        padding-bottom: 50px; /* Clear mobile footer */
    }
    .image-block {
        padding: 20px 10px; /* Consistent padding for all blocks on mobile */
        min-height: 100vh; /* Ensure block fills screen height */
        box-sizing: border-box;
    }
    /* REMOVED: Specific padding-top for first child on mobile */
    /* .image-block:first-child { padding-top: 50px; } */

    .image-block img {
        max-height: 85vh; /* Limit image height relative to viewport */
        max-width: 100%; /* Ensure image fits horizontally */
    }
    
    .gallery-intro-header {
        margin-bottom: 20px;
         /* No extra padding-top needed, vertical centering handles it */
    }
    .gallery-intro-header h2 {
        font-size: 1.5rem;
    }
    .gallery-intro-header p {
        font-size: 0.9rem;
    }
}