/* ---------------------------------------------------------------------- */
/* --- GLOBAL BASE STYLES --- */
/* ---------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

/* 💥 NEW FIX: Prevents all content from overflowing the viewport width 💥 */
html, body {
    overflow-x: hidden; 
}

/* NEW: This container centers all content and sets the maximum width */
.site-container {
    max-width: 1728px; 
    margin: 0 auto; /* This centers the container on the screen */
    width: 100%; /* Ensures it takes full width up to the max-width limit */
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: #000000;
    line-height: 1.4; /* RESTORED: Slightly tighter line height for dense text */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; 
}

ul, ol {
    list-style: disc; /* Ensure list markers are present */
    padding: 0;
    margin-top: 0;
    margin-bottom: 16px; /* RESTORED: Reduced from 24px */
    /* Padding is handled by .case-study-content, but we add 20px for indentation */
    padding-left: 20px; 
}

ul li, ol li {
    margin-bottom: 4px; /* RESTORED: Even tighter spacing between list items */
}

a {
    text-decoration: none;
    color: #000000;
}

/* ---------------------------------------------------------------------- */
/* --- GLOBAL HEADER (61PX) - APPLIES TO ALL PAGES --- */
/* ---------------------------------------------------------------------- */
.global-header {
    width: 100%;
    height: 61px;
    border-bottom: 1px solid #000000;
    display: flex;
    align-items: center; 
    padding-left: 22px;
    padding-right: 100px;
}

.header-logo-link {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.06em; 
    color: #000000;
}


/* ---------------------------------------------------------------------- */
/* --- HOME PAGE STYLES (INDEX.HTML) --- */
/* ---------------------------------------------------------------------- */

/* Main wrapper for home page content. */
.main-wrapper {
    /* CHANGED: Reduces the left padding on the index page content from 100px to 22px */
    padding-left: 22px; 
    padding-right: 0; /* Allows full-width lines to extend */
}

.home-content-container {
    display: flex; 
    justify-content: flex-start;
    align-items: flex-start; 
    gap: 26px; 
    margin-top: 20px; 
    margin-left: 22px; 
}

.left-column-wrapper {
    flex-shrink: 0; 
    margin-top: -5px; 
}

/* Bio Text Style */
.home-bio {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 300; 
    font-size: 16px;
    letter-spacing: -0.02em; 
    line-height: 1; 
    margin-top: 10px; 
    margin-bottom: 8px; 
    max-width: 320px;
    text-align: justify;
    padding: 0; 
}

.home-bio a {
    text-decoration: underline;
}

.home-content-container .image-column img {
    object-fit: cover;
    max-width: 100%; 
    height: auto; 
}

@media (min-width: 768px) {

    .home-content-container .image-column img {
        width: 319px;
        height: 499px;
        margin-top: 5px; 
    }
}

.case-study-list {
    width: 100%; 
    min-width: 380px; 
}

/* List Item and Divider Line Styles */
.list-item-container {
    display: flex;
    justify-content: flex-start; 
    align-items: center;
    height: 43px; 
    margin-bottom: 0;
    border-bottom: 1px solid #000000; 
    
    /* Full-width line trick for the index page */
    margin-right: -100vw; 
    padding-right: 100vw; 
    box-sizing: border-box; 
    position: relative;
}

.list-item-container.header-row,
.list-item-container[style*="border-bottom: none"] {
    height: auto;
    border-bottom: none;
    margin-bottom: 10px;
    margin-right: 0; 
    padding-right: 0;
}

.list-item-container.header-row {
    margin-top: 6px;
    margin-bottom: 10px;
}

.case-study-link {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 500; 
    font-size: 22px;
    letter-spacing: -0.06em; 
    text-decoration: none;
    color: #000000;
    display: block;
    
    margin-right: 46px; 
    flex-shrink: 0; 
}

.preview-frame {
    width: 46px; 
    height: 29px; 
    flex-shrink: 0; 
    background-color: #EEEEEE; 
    overflow: hidden; /* 💥 CRUCIAL: Hides images that are outside the frame 💥 */
    position: relative;
}

/* 💥 UPDATED: Styles for the image slider wrapper (no flex) 💥 */
.preview-slider {
    position: relative; /* Allows images inside to be absolutely positioned */
    width: 100%; /* Now takes full width of the frame */
    height: 100%;
    overflow: hidden;
}

/* Stacks the images (base container) */
.frame-stack {
    height: 100%; /* Now 100% of the 29px frame height */
    width: 100%;
    position: relative; 
}

/* 💥 FINAL FIX: Image sizing and stacking for opacity animation 💥 */
.frame-stack img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; /* 100% of 29px */
    width: 100%; /* 100% of 46px */
    display: block;
    
    /* CRITICAL FIX: Ensures image scales to fit 46px x 29px container */
    object-fit: contain; 
    
    margin: 0 auto;
    opacity: 0; /* All images start invisible */
    
    /* Add the animation properties to the image itself */
    animation-timing-function: step-end;
    animation-iteration-count: infinite;
}

/* ----------------------------------------------------------- */
/* --- NEW OPACITY ANIMATION DEFINITIONS (3 IMAGES) --- */
/* ----------------------------------------------------------- */

/* Eaze Redesign (3 Images: 3s total cycle time) */

/* Targets the FIRST image in the list */
.slider-eazeredesign .frame-stack img:nth-child(1) {
    animation-duration: 3s;
    animation-name: frame-fade-1;
}

/* Targets the SECOND image in the list */
.slider-eazeredesign .frame-stack img:nth-child(2) {
    animation-duration: 3s;
    animation-name: frame-fade-2;
}

/* Targets the THIRD image in the list */
.slider-eazeredesign .frame-stack img:nth-child(3) {
    animation-duration: 3s;
    animation-name: frame-fade-3;
}


/* Keyframe 1: Visible 0-33.33% (1st second) */
@keyframes frame-fade-1 {
    0%, 33.33% { opacity: 1; }
    33.331%, 100% { opacity: 0; }
}

/* Keyframe 2: Visible 33.33%-66.66% (2nd second) */
@keyframes frame-fade-2 {
    0%, 33.33% { opacity: 0; }
    33.331%, 66.66% { opacity: 1; }
    66.661%, 100% { opacity: 0; }
}

/* Keyframe 3: Visible 66.66%-100% (3rd second) */
@keyframes frame-fade-3 {
    0%, 66.66% { opacity: 0; }
    66.661%, 100% { opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* --- CASE STUDY PAGE CONTENT STYLES --- */
/* ---------------------------------------------------------------------- */

/* FIX: This wrapper applies the necessary 100px padding to all content */
.case-study-content {
    padding-left: 22px;
    padding-right: 22px;
    padding-top: 10px; 
    padding-bottom: 80px; 
}

/* Fix for all case study images */
.case-study-content img {
    max-width: 100%; 
    height: auto;
    display: block;
}

/* PAGE TITLE STYLE (H1) */
.case-study-content h1 {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: bold; /* RESTORED: Bold */
    text-transform: uppercase; /* RESTORED: Uppercase */
    line-height: -0.06em;
    font-size: 42px; /* RESTORED: Larger font size */
    letter-spacing: -0.02em;
    margin-top: 0; 
    margin-bottom: 0; /* RESTORED: Removed all space below H1 */
    
    /* REMOVED REDUNDANT PADDING HERE */
}

/* Section Title Style (H2) */
.case-study-content h2 {
    font-size: 24px; /* RESTORED: Smaller font size */
    font-weight: bold;
    margin-top: 0px; /* RESTORED: Reduced from 40px */
    margin-bottom: 0; /* RESTORED: Ensures content immediately follows */

    /* REMOVED REDUNDANT PADDING HERE */
}

/* Base style for all text paragraphs */
.body-copy {
    font-size: 18px; /* RESTORED: Larger font size */
    font-weight: 300; 
    line-height: 1.1em; /* Ensures body copy uses the same line height */
    margin-top: 0; 
    margin-bottom: 6px; /* RESTORED: Reduced margin */
    /* max-width: 1100px; /* Optional: Keep text readable */
    text-align: justify; 
}

.back-link {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 16px; 
    letter-spacing: -0.02em; 
    text-decoration: none;
    display: block;
    margin-bottom: 10px; 
}

/* --- Image and Layout Classes --- */
.single-image {
    max-width: 100%;
    margin: 20px auto; /* RESTORED: Reduced margin */
    text-align: center;
    /* REMOVED REDUNDANT PADDING HERE */
}

.single-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.image-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 20px auto; /* RESTORED: Reduced margin */
    gap: 20px; /* Maintain gap for flex layout */
    /* REMOVED REDUNDANT PADDING HERE */
}

.image-row > div {
    margin-bottom: 15px; /* RESTORED: Margin for stacking */
}

/* Two images per row (50/50 split) */
.two-up > div {
    width: calc(50% - 10px); /* Adjust for 20px gap */
}

/* Multi images per row (flexible, defaults to 25% for 4+ items) */
.multi-up > div {
    /* Use flex-basis for cleaner multi-column layout with gap */
    flex-basis: calc(25% - 15px); 
    min-width: 0;
}

/* CSS for the HTML Spacer Class */
.spacer-60 {
    height: 60px; /* Adjust this height to control the amount of empty space */
}

/* ---------------------------------------------------------------------- */
/* --- MOBILE RESPONSIVENESS (Max 767px) --- */
/* ---------------------------------------------------------------------- */
@media (max-width: 767px) {
    
    /* GLOBAL HEADER MOBILE ADJUSTMENTS (Keep 16px padding) */
    .global-header {
        padding-left: 16px; 
        padding-right: 16px; 
    }

    /* HOME PAGE MOBILE ADJUSTMENTS */
    .main-wrapper {
        /* Re-apply 16px padding to wrapper to push all index content */
        padding-left: 16px; 
        padding-right: 0; 
    }
    
    .home-content-container {
        flex-direction: column; 
        gap: 16px; 
        margin-top: 20px;
        width: 100%; 
    }

    /* Ensure the image column itself takes full width */
    .home-content-container .image-column {
        width: 100%;
        max-width: 100%; 
        overflow: hidden;
        padding: 0; /* Clear previous padding experiments */
    }

    .left-column-wrapper {
        width: 100%;
    }
    
    /* 💥 YOUR CHOSEN FIX: Image scales to 90% to avoid overflow on index page 💥 */
    .home-content-container .image-column img {
        width: 90%; 
        height: auto;
        display: block;
    }

    /* Case Study List Rules (Ensures it shrinks, and the padding on .main-wrapper is used) */
    .case-study-list {
        min-width: auto; 
    }
    
    .list-item-container {
        width: 100%; 
    }
    
    /* Case Study Link Text (Removes the excessive padding we tested) */
    .case-study-link {
        padding-left: 0; 
        padding-right: 0; 
    }
    
    /* Ensure the full-width line trick is disabled on mobile */
    .list-item-container:not(.header-row) {
        margin-right: 0;
        padding-right: 0;
    }
    
    /* CASE STUDY MOBILE ADJUSTMENTS (These remain unchanged as they were working) */
    .case-study-content {
        padding-left: 16px; 
        padding-right: 16px;
        padding-top: 24px;
        padding-bottom: 40px;
    }

    
    .case-study-content h1 {
        font-size: 30px; 
        line-height: 1.1;
        margin-bottom: 0; 
    }

    .case-study-content h2 {
        margin-top: 24px; 
    }

    .body-copy {
        text-align: justify;
        margin-bottom: 12px; 
    }

    ul, ol {
        margin-bottom: 12px; 
        padding-left: 36px; 
    }

    .single-image, .image-row {
        margin: 15px auto; 
    }

    .image-row > div {
        margin-bottom: 10px; 
    }

    .image-row {
        flex-direction: column;
        gap: 0; 
    }

    .image-row > div,
    .two-up > div,
    .multi-up > div {
        width: 100%; 
    }
}

