/* ===================================================
   MB Website - Home styles (home.css)
   Table of Contents:
   1. Root variables
   2. Base and logo
   3. Carousel
      3.1 Container, slides, headings
      3.2 Navigation buttons
      3.3 Prev/Next helpers
      3.4 Hero scroll arrow
      3.5 Indicators
      3.6 Text overlay
   4. Smooth scrolling
   5. "The Firm" section
   6. Grid/gallery + overlay
   7. Fullscreen viewer
   8. Instagram feeds
   9. Media queries
   =================================================== */

/* ===================== 1) Root variables ===================== */
:root {
    font-family: Inter, sans-serif;
    --primary-color: #8BCC00;
    --neutral-color-1: #000;
    --neutral-color-2: #1F1F1F;
    --text-color-primary: #ffffff;
    --text-color-secondary: #c2c2c2;
    --text-color-tertiary: #999999;
    --line-height: 1.5;
}

/* ===================== 2) Base and Logo ===================== */
/* Base typography and layout + logo sizing */
body {
    align-items: center;
    margin: 0;
    background-color: #000;
    color: var(--text-color-primary);
    width: 100%;
    overflow-x: hidden;
}

/* Logo */
#logo {
    width: 6vw;
    min-width: 64px;
    height: auto;
    flex-shrink: 0;
    fill: var(--text-color-primary);
}

/* ===================== 3) Carousel ===================== */
/* 3.1 Container, slides, headings */
.carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100vh;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide h1 {
    position: absolute;
    bottom: 10%; 
    left: 5%;   
    right: 5%;  
    color: var(--text-color-primary);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7); 
    margin: 0;
    z-index: 5; 
}

/* 3.2 Navigation buttons (overlay buttons) */
.carousel-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    pointer-events: none;
}

.carousel-buttons button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    pointer-events: auto;
    position: relative;
}

.carousel-buttons button img {
    width: 1.5rem;
    height: 1.5rem;
}

.carousel-buttons button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 3.3 Prev/Next helpers */
#prev {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#next {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 3.4 Hero scroll arrow */
.hero-scroll-arrow {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    z-index: 15;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 1);
}

.hero-scroll-arrow:hover {
    transform: translateX(-50%) translateY(4px);
}

.hero-scroll-arrow svg {
    rotate: 90deg;
    stroke: var(--text-color-primary);
    width: 11px;
    height: 19px;
    transition: stroke 0.3s ease;
}
.hero-scroll-arrow p{color: var(--text-color-primary);}
.hero-scroll-arrow:hover p{color: var(--primary-color);}

.hero-scroll-arrow:hover svg {
    stroke: var(--primary-color);
}

/* 3.5 Carousel: Indicators (dots) */
/* Positioned bottom-left; active state uses a subtle primary drop shadow */
.carousel-indicators {
    position: absolute;
    bottom: 32%;
    left: 64px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    z-index: 15;
}

.indicator {
    width: 10px;
    height:  10px;
    background-color:var(--text-color-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.indicator.active {
    background-color: var(--primary-color);
    transform: none;           /* remove scale */
    animation: none;           /* remove glow animation */
    box-shadow: 0 0 2px var(--primary-color); 
    box-shadow: 0 0 3px var(--primary-color); 
    box-shadow: 0 0 4px var(--primary-color); /* simple drop shadow */
}

/* 3.6 Carousel: Text overlay (captions) */
.carousel-text {
    position: absolute;
    bottom: 40%;
    left: 64px;
    color: var(--text-color-primary);
    z-index: 15;
    text-align: left;
}

.carousel-text h3 {
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 1);
    text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8);
    text-shadow: 0px 0px 8px rgba(0, 0, 0, 0.8);
}

.carousel-text h4 {
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.8);
    text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8);
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.8);
    color: var(--text-color-secondary);
}

/* ===================== 4) Smooth Scrolling ===================== */
/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* ===================== 5) "The Firm" Section ===================== */
        #the-firm {
            display: flex;
            flex-direction: column;
            justify-content: center; /* Center vertically */
            align-items: center; /* Center horizontally */
            text-align: center;
            padding: 40px 20px; /* Add padding for spacing */
            color: var(--text-color-primary);
        }

        #the-firm h3 {
            margin-top: 64px;
            color: var(--text-color-primary);
        }

        #the-firm p {
            max-width: 1200px;
            margin-bottom: 20px;
            color: var(--text-color-tertiary);
            text-align: justify;
        }

        .read-more {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: 20px;
        }

        #read-more-link {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            transition: transform 0.3s ease;
            color: var(--primary-color);
        }
        #read-more-link p {color: var(--text-color-primary);

        }

        #read-more-link:hover {
            transform: translateY(4px);
            color: var(--text-color-primary);
        }

        #read-more-link:hover p {
            color: var(--primary-color);
        }

        #read-more-link:hover svg {
            stroke: var(--primary-color);
        }

        #the-firm #read-more-link {
            display: inline-block;
            margin-top: 16px;
            padding: 12px 24px;
            text-decoration: none;
            transition: transform 0.3s ease, background-color 0.3s ease;
        }

        #the-firm .read-more-link:hover {
            transform: translateY(4px);
            background-color: var(--neutral-color-2);
        }

/* ===================== 6) Grid/Gallery + Overlay ===================== */
/* ================= Project Grid ================= */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    max-width: 98%;
    width: 100%;
    margin: 144px auto; /* spacing below fixed header */
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.image-container {
    position: relative;
    aspect-ratio: 1.618 / 1;
    border-radius: 0.25rem;
    overflow: hidden;
    cursor: pointer;
}

.image-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
}

.overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 1rem;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.overlay-title { font-size: 1.50rem; font-weight: 300; letter-spacing: 0%; margin: 0; color: #ffffff;}
.overlay-text  { font-size: 1.1rem; font-weight: 400; line-height: var(--line-height); letter-spacing: 2%; color: var(--text-color-secondary);margin-top: 8px;}

/* Hover / focus reveal */
.image-container:hover .overlay,
.image-container a:focus-visible .overlay { opacity: 1; }

.image-container:hover img,
.image-container a:focus-visible img { transform: scale(1.1); }

/* Accessible focus outline */
.image-container a:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* ============== Responsive ============== */
@media (max-width: 768px) {
    .grid-container { grid-template-columns: repeat(2, 1fr); margin: 96px auto 64px; max-width: 100%; }
}

@media (max-width: 500px) {
    .grid-container { grid-template-columns: 1fr; margin: 80px auto 48px; }
}
/* ===================== 7) Fullscreen Image Viewer ===================== */
/* Fullscreen Image Viewer */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1); 
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1000; 
    padding: 20px; 
    box-sizing: border-box;
}

.fullscreen-image {
    max-width: 90%; 
    max-height: 90%;
    object-fit: contain; 
    box-shadow: 0 0 25px rgba(0,0,0,0.5); 
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease-in-out;
    z-index: 1002; 
}

.fullscreen-close svg { 
    width: 24px; 
    height: 24px; 
    display: block; 
}

.fullscreen-close:hover {
    color: #bbb; 
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.3); 
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    user-select: none; 
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    z-index: 1001; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.fullscreen-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: #eee;
}

/* ===================== 8) Instagram Feeds ===================== */
#instagram-feeds {
    margin: 24px 64px;
    text-align: center;
    padding: 64px;
    background-color: var(--neutral-color-2);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.instagram-media { margin-bottom: 16px; border-radius: 8px; overflow: hidden; position: relative; }
.instagram-media img { width: calc(100% / 3); height: auto; display: block; }
.instagram-media .caption { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.7); color: #fff; padding: 8px 12px; font-size: 0.9rem; }
.instagram-live-feed { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 20px; background-color: #f9f9f9; }
.feed-container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 20px; background-color: #f9f9f9; min-height: 200px; }
.instagram-post { width: 300px; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; }
.instagram-post img { width: 100%; height: auto; display: block; }
.instagram-post:hover { transform: scale(1.05); }
.feed-container p { font-size: 16px; color: #666; text-align: center; width: 100%; }
.instagram-feeds{margin: 0 64px; padding: 24px; border-radius: 8px;}

/* ===================== 9) Media Queries ===================== */
/* Media Queries */

        /* Medium screens and down */
        @media (max-width: 768px) {
            .grid-container {
                grid-template-columns: repeat(2, 1fr);
            }

            .carousel {
                height: 80vh; /* Or another value like 75vh, or even a fixed pixel height if preferred */
            }

            .carousel-slide h1 {
                font-size: 2.5rem; /* Adjust H1 size specifically for carousel on mobile */
                bottom: 15%; /* Optionally adjust position slightly if needed with new height/font size */
            }
            /* Reposition indicators & caption for smaller viewports */
            .carousel-indicators { left: 50%; transform: translateX(-50%); bottom: 12%; gap: 10px; }
            .carousel-text { left: 24px; bottom: 28%; }
            #scroll-down {
                top: 75vh; /* Adjust to be relative to the new carousel height (e.g., 80vh - 5vh buffer) */
            }

            #the-firm {
                margin-top: 64px;
                margin-left: 0;
                margin-right: 0;
                width: 100%;
            }

            #the-firm p {
                margin-top: 64px;
                width: 100%;
                padding: 0 24px;
                box-sizing: border-box;
            }

            .grid-container { /* This re-defines .grid-container for mobile, ensure it's intended */
                margin-top: 64px;
                margin-bottom: 0px;
                margin-left: 0;
                margin-right: 0;
                max-width: 100%;
            }

        }

        /* Small screens and down */
        @media (max-width: 500px) {
            .grid-container {
                grid-template-columns: 1fr; 
            }
            .carousel { height: 70vh; }
            .carousel-slide h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); bottom: 18%; }
            .carousel-text { bottom: 34%; left: 16px; }
            .hero-scroll-arrow { bottom: 6%; }
            .carousel-indicators { bottom: 8%; }
        }
        /* Very small phones */
        @media (max-width: 360px) {
            .carousel { height: 62vh; }
            .carousel-slide h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
            .carousel-text h3 { font-size: 1.1rem; }
            .carousel-text h4 { font-size: 0.85rem; }
        }