/* --- Configuration: CSS Variables --- */
:root {
    --bg-color: #43043d;
    --text-color: #f0f0f0;
    --accent-color: #9d78bb; /* Vibrant Pink/Magenta */
    --accent-hover-color: #680e4c; /* Slightly transparent for hover */
    --secondary-color: #91c4f3; /* Vibrant Teal/Cyan */
    --border-color: #43043d;
    --container-width: 960px;
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- Basic Reset & Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main {
    max-width: var(--container-width);
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 70vh;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* --- Header & Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #680e4c;
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
}

.nav-toggle {
    display: none; /* Hidden on desktop */
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    position: relative;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.2s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.2s ease-in-out;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* --- Mobile Navigation Styles --- */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #111;
        flex-direction: column;
        align-items: center;
        padding: 0;

        /* Hide menu by default */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    }

    .nav-menu.is-active {
        max-height: 500px; /* Or a sufficiently large value */
        padding: 1rem 0;
    }

    .nav-item {
        margin: 0;
    }

    /* Hamburger animation to 'X' */
    .nav-toggle.is-active .hamburger {
        background: transparent;
    }

    .nav-toggle.is-active .hamburger::before {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .nav-toggle.is-active .hamburger::after {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 1.0rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: #680e4c;
    border-top: 1px solid var(--border-color);
}

/* --- Portfolio Gallery --- */
.gallery {
    /* Masonry layout is now handled by js/gallery.js. */
    /* This selector is kept for potential future styling of the container. */
    width: 100%;
}

.gallery-item {
    display: block;
    break-inside: avoid; /* Prevent items from breaking across columns */
    margin-bottom: 20px; /* Corresponds to Macy.js margin.y */
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color);
}

/* --- Links Page --- */
.links-container {
    text-align: center;
}

#links-list a {
    display: block;
    max-width: 400px;
    margin: 1rem auto;
    padding: 1rem;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#links-list a:hover {
    background-color: var(--accent-hover-color);
    text-decoration: none;
}

/* --- Contact Page --- */
#contact-email a {
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .nav-menu {
        margin-top: 1rem;
        flex-direction: column;
        align-items: center;
    }
    .nav-item {
        margin: 0.5rem 0;
    }
}

/* --- Homepage Carousel --- */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: var(--container-width);
    height: 60vh;
    margin: 0 auto 3rem auto;
    overflow: visible;
    padding: 0 80px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 90%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
    transition: all 0.5s ease-in-out;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.carousel-slide.active {
    opacity: 1;
    width: 85%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 10;
}

.carousel-slide.prev {
    opacity: 0.6;
    transform: translate(-120%, -50%) scale(0.75);
    z-index: 5;
}

.carousel-slide.next {
    opacity: 0.6;
    transform: translate(20%, -50%) scale(0.75);
    z-index: 5;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

/* --- Image Buttons Section --- */
.image-buttons-section {
    text-align: center;
    margin: 3rem 0;
}

.image-buttons-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.image-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.image-button {
    flex: 1;
    max-width: 300px;
    min-width: 250px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-button:hover {
    transform: translateY(-5px);
}

.placeholder-image {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--border-color);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.button-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.image-button:hover .button-image {
    transform: scale(1.05);
}

.image-button p {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
}

/* --- Meet the Bean Button --- */
.meet-bean-section {
    text-align: center;
    margin: 4rem 0;
}

.meet-bean-btn {
    display: inline-block;
    background-color: #91c4f3;
    color: #43043d;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meet-bean-btn:hover {
    background-color: #7bb5e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* --- Responsive adjustments for new elements --- */
@media (max-width: 768px) {
    .carousel-container {
        height: 40vh;
        padding: 0 40px;
    }
    
    .carousel-slide {
        width: 85%;
        height: 85%;
    }
    
    .carousel-slide.active {
        width: 95%;
    }
    
    .carousel-slide.prev {
        transform: translate(-130%, -50%) scale(0.7);
    }
    
    .carousel-slide.next {
        transform: translate(30%, -50%) scale(0.7);
    }
    
    .image-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .image-button {
        max-width: 90%;
    }
    
    .carousel-btn {
        padding: 0.5rem;
        font-size: 1.2rem;
    }
    
    .carousel-btn.prev {
        left: 0.5rem;
    }
    
    .carousel-btn.next {
        right: 0.5rem;
    }
}
