/* PANTRY PAL CASE STUDY STYLES */

/* 1. Lock the Body */
body.case-study-body {
    overflow: hidden;
    height: 100vh;
}

/* 2. Nav Bar */
.centered-nav.case-study-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 90px;
    transform: none !important; 
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 3.8rem; 
    background: transparent;
    z-index: 1000;
    padding-top: 2.8rem;
    padding-bottom: 2rem;
    box-sizing: border-box;
}

/* 3. The Main Split Layout */
.case-layout {
    display: flex;
    height: 100vh;
    padding-top: 0;
    box-sizing: border-box;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* 4. Left Sidebar (Fixed) */
.case-sidebar {
    width: 330px;
    position: fixed;
    height: 100vh;
    top: 0;
    z-index: 50;
    left: 0;
    background-color: var(--bg-color);
    padding-left: 4%;
    padding-right: 0; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
}

.case-sidebar::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%; 
    transform: translateY(-50%);
    height: 78%; 
    width: 5px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: opacity 0.2s ease; 
}

.sidebar-logo img {
    width: 280px; /* Restored original size */
    height: auto;
    margin-bottom: 1rem; /* Increased gap between logo and links */
}

/* Sidebar Toggle Arrow */
.sidebar-toggle-btn {
    position: absolute;
    right: -1px; 
    top: 55%; /* Shifted lower to stay centered on the line */
    transform: translateY(-50%) rotate(0deg); 
    width: 24px; 
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    color: var(--text-color);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar-toggle-btn svg {
    display: block;
    width: 100%;
    height: 100%;
}
  
/* Collapsed Sidebar State */
.case-sidebar.collapsed {
    transform: translateX(-370px);
}

.case-sidebar.collapsed::after {
    opacity: 0;
}
  
.case-sidebar.collapsed .sidebar-toggle-btn {
    right: -24px; 
    transform: translateY(-50%) rotate(180deg);
}

/* Table of Contents */
.case-toc {
    list-style: none !important;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    align-items: flex-start;
}

.toc-link {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Geist', sans-serif;
    font-size: 2.5rem; 
    letter-spacing: -0.02em;
    font-weight: 400;
    display: flex; 
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.toc-link.active {
    font-weight: 700;
}

.toc-link::before {
    content: '➜';
    display: inline-block;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;  
    margin-right: 0;
    transform: translateX(-20px); 
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 400; 
}

.toc-link.active::before {
    opacity: 1;
    max-width: 60px; 
    margin-right: 10px; 
    transform: translateX(0); 
}

/* 5. Right Content (Scrollable) */
.case-content {
    height: 100vh;
    overflow-y: auto;
    margin-left: 360px; 
    width: calc(100% - 330px);
    padding: 0 5%; /* Restored fluid padding so grid fills screen */
    box-sizing: border-box;
    scroll-behavior: smooth;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.case-content::-webkit-scrollbar {
    display: none; 
}

/* Content Auto-Centering when Collapsed */
.case-sidebar.collapsed + .case-content {
    margin-left: 0; 
    width: 100%;
    padding: 0 10%; /* Extra padding when centered */
}

/* Section Styling */
.case-section {
    margin-bottom: 22vh; 
    min-height: 50vh; 
    scroll-margin-top: 30px;
}

/* --- GRID & SECTION WRAPPERS (Restored to Full Width) --- */
.snapshot-container {
    display: flex;
    gap: 1rem; 
    align-items: stretch; 
    width: 100%;
    padding-top: 3%;
}

.phone-grid {
    flex: 3; 
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: auto auto; 
    gap: .3rem; 
    justify-items: center;
}

.phone-grid img {
    width: 78%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); 
}

.snapshot-labels {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    padding-top: 2rem; 
    padding-bottom: 2rem;
}

.snapshot-labels p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;
    line-height: 1.2;
    margin: 0;
    color: var(--text-color);
}

.branding-block {
    width: 100%;
    max-width: 1000px; 
    margin: 22vh auto 0 auto; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.branding-right {
    display: flex;
    flex-direction: column;
    gap: 3rem; 
}

.brand-row {
    display: flex;
    align-items: center; 
    gap: 4rem; 
    max-height: 180px;
}

.brand-icon {
    width: 170px;  
    height: auto;
    object-fit: contain;
    flex-shrink: 0; 
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.1));
}

.brand-row p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;
    line-height: 1.3; 
    margin: 0;
    color: var(--text-color);
    max-width: 520px; 
}

.project-specs {
    display: grid;
    grid-template-columns: 1fr 2fr;
    width: 100%;
    max-width: 1000px; 
    margin: 22vh auto 0 auto; 
    font-family: 'Geist', sans-serif;
    font-weight: 300;
}

.spec-label, .spec-value {
    font-size: 2.3rem;
    color: var(--text-color);
    text-align: center;
    padding: 2.5rem 0;
    background-image: linear-gradient(to right, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: bottom;
    background-size: 18px 3px; 
    background-repeat: repeat-x;
    border: none; 
}

.spec-label {
    background-image: 
        linear-gradient(to right, var(--text-color) 40%, rgba(255,255,255,0) 0%),
        linear-gradient(to bottom, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: bottom, right;
    background-size: 18px 3px, 3px 18px;
    background-repeat: repeat-x, repeat-y;
}

.last-row {
    background-image: none;
}

.spec-label.last-row {
    background-image: linear-gradient(to bottom, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: right;
    background-size: 3px 18px;
    background-repeat: repeat-y;
}

.opportunity-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; 
    gap: 4rem;
    align-items: baseline;
    font-family: 'Geist', sans-serif;
    font-weight: 300;
}

.opp-column h2 {
    font-size: 2.3rem;
    font-weight: 300;
    margin: 0;
    max-width: 100px;
}

.opp-column p {
    font-size: 2.3rem;
    line-height: 1.1;
    margin: 0;
    margin-bottom: 4rem;
}

.demographic-container {
    display: flex;
    flex-direction: row;
    align-items: center; 
    justify-content: space-between;
    gap: 1rem; 
    width: 100%;
}

.demo-text {
    flex: 3; 
    max-width: 700px; 
}

.demo-text p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 2.5rem; 
    color: var(--text-color);
    margin-top: 0px;
}

.demo-image {
    flex: 2; 
    display: flex;
    justify-content: center; 
    align-items: center;
}

.demo-image img {
    width: 100%;
    max-width: 250px; 
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

/* --- UPDATED UX FLOW SECTION (PERFECT CENTERING) --- */

.uxflow-container {
    width: 100%;
    /* Constrains the readable area to match your other sections */
    max-width: 1100px; 
    /* Centers the entire container within the scrollable content area */
    margin: 0 auto; 
    display: flex;
    flex-direction: column;
    /* Forces all children (text, grids, iterations) to the vertical center */
    align-items: center; 
}

.ux-text p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem;
    font-weight: 300;
    line-height: 1.1;
    color: var(--text-color);
    margin-bottom: 2rem;
    /* Centers the box, but keeps the writing left-to-right */
    max-width: 850px; 
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    padding-left: 5rem;
}

.ux-wireframes {
    display: grid;
    /* Balances the 3-column grid in the center of the container */
    justify-content: center; 
    grid-template-columns: repeat(3, auto);
    gap: 3rem; /* Increased gap slightly for better visual breathing room */
    width: 100%;
    align-items: start;
}

.wireframe-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: auto;
}

.wireframe-item img {
    /* Scaled for impact; ensures they look consistent with high-fi mockups */
    height: 52vh; 
    width: auto;
    border-radius: 25px;
    display: block;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.12));
}

.wireframe-item h3 {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;
    color: var(--text-color);
    margin: 0;
}

/* --- ITERATIONS & STEPS (AUTO-CENTERED WRAPPERS) --- */

.ux-iterations {
    margin-top: 22vh;
    display: flex;
    flex-direction: column;
    gap: 6rem; 
    width: 100%;
    max-width: 1100px;
    /* Ensures the list of iterations stays centered */
    margin-left: auto;
    margin-right: auto;
}


.iteration-row {
    display: grid;
    /* Widened the label column slightly to prevent crowding */
    grid-template-columns: 220px 1fr;
    gap: 4rem;
    align-items: center; 
}

.iter-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem;
    font-weight: 300;
    color: var(--text-color);
}

.iter-desc p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem;
    font-weight: 300;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
}

.status-icon {
    width: 45px; /* Adjust size of X and Checkmark */
    height: auto;
    display: block;
}

.flow-step-container {
    margin: 22vh auto 0 auto;
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 3rem; 
    row-gap: 1rem;    
    align-items: center; 
}

/* Standard Phone & Text styles remain consistent */
.flow-phone-img {
    grid-column: 1; 
    grid-row: 1;    
    height: 72vh;
    width: auto;
    display: block;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.15));
}

.flow-text-wrapper p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem;
    font-weight: 300;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
    max-width: 700px;
}

.flow-label {
    grid-column: 1; 
    grid-row: 2;    
    font-family: 'Geist', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-color);
    margin: 0;
    text-align: center; 
}

.ux-philosophy {
    min-height: 80vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 4rem; 
    margin-top: 22vh;
    margin-bottom: 22vh;
}

.ux-philosophy p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;  
    color: var(--text-color);
    line-height: 1.2;
    margin: 0;
    max-width: 400px; 
}

.ui-choices-container {
    width: 100%;
    max-width: 870px; 
    margin: 0 auto;   
    padding-top: 5vh; 
    display: flex;
    flex-direction: column;
    gap: 3.5rem; 
}

.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 3rem; 
    width: 100%;
    align-items: start;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 1.5rem; 
}

.color-swatch {
    width: 100%; 
    aspect-ratio: 1 / 1; 
    border: 2px solid #000000; 
    box-shadow: 0 10px 10px rgba(0,0,0,0.1);
}

.color-label {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;  
    color: var(--text-color);
    margin: 0;
    text-align: center;
}

.ui-text-block p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;  
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
}

.food-grid-section {
    width: 100%;
    margin-top: 22vh; 
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    border-collapse: collapse; 
}

.food-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem; 
    position: relative;
}

.food-item img {
    width: 100%;
    max-width: 200px; 
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.1));
}

.food-item:not(:nth-child(3n)) {
    background-image: linear-gradient(to bottom, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: right;
    background-size: 3px 18px; 
    background-repeat: repeat-y;
}

.food-item:nth-child(1),
.food-item:nth-child(2) {
    background-image: 
        linear-gradient(to bottom, var(--text-color) 40%, rgba(255,255,255,0) 0%),
        linear-gradient(to right, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: right, bottom;
    background-size: 3px 18px, 18px 3px; 
    background-repeat: repeat-y, repeat-x;
}

.food-item:nth-child(3) {
    background-image: linear-gradient(to right, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: bottom;
    background-size: 18px 3px;
    background-repeat: repeat-x;
}

.food-item:nth-child(4),
.food-item:nth-child(5) {
    background-image: linear-gradient(to bottom, var(--text-color) 40%, rgba(255,255,255,0) 0%);
    background-position: right;
    background-size: 3px 18px;
    background-repeat: repeat-y;
}

.food-grid-text p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem;
    font-weight: 300;
    line-height: 1.25;
    color: var(--text-color);
    margin: 0;
}

.reflection-container {
    width: 100%;
    max-width: 1100px; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 3rem; 
}

.reflection-container p {
    font-family: 'Geist', sans-serif;
    font-size: 2.3rem; 
    font-weight: 300;
    line-height: 1.3; /* Increased slightly for a "Reflection" feel */
    color: var(--text-color);
    max-width: 850px; 
    margin-left: auto;
    margin-right: auto;
    text-align: left; 
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 1024px) {
    #mobileNotice { display: none !important; }
    
    body.case-study-body { 
        overflow-y: auto; 
        height: auto; 
    }

    .case-layout {
        flex-direction: column;
        padding-top: 0;
        height: auto;
    }

    .case-sidebar {
        width: 100%;
        height: auto;
        padding: 0; 
        position: relative;
        border: none; 
    }

    .sidebar-logo { display: none !important; }
    .case-sidebar::after { display: none; }
    .case-toc { display: none; }
    .sidebar-toggle-btn { display: none; }

    .case-content {
        margin-left: 0;
        width: 100%;
        padding: 2rem 1.5rem;
        overflow: visible;
    }

    .case-section {
        margin-bottom: 10vh;
        min-height: auto;
    }

    .snapshot-labels p, .brand-row p, .opp-column p, .demo-text p, .ux-text p,
    .iter-desc p, .flow-text-wrapper p, .ux-philosophy p, .ui-text-block p,
    .color-label, .food-grid-text p, .reflection-container p {
        font-size: 1.15rem !important; 
        line-height: 1.5;
    }

    .spec-label, .spec-value {
        font-size: 1.15rem !important;
        padding: 1rem 0;
    }

    h2, .opp-column h2 {
        font-size: 1.75rem !important;
    }

    .snapshot-container {
        flex-direction: column-reverse;
        gap: 2rem;
    }
    
    .snapshot-labels {
        flex-direction: row;
        text-align: center;
        padding: 0;
    }
    
    .phone-grid { gap: 0.2rem; }

    .brand-row {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        max-height: none;
    }
    
    .brand-icon { width: 100px; }

    .project-specs {
        grid-template-columns: 1fr; 
        margin-top: 4rem;
    }
    
    .spec-label {
        background: none; 
        font-weight: 700;
        padding-bottom: 0;
        text-align: left;
    }
    
    .spec-value {
        background: none; 
        border-bottom: 1px solid var(--text-color);
        padding-top: 0.5rem;
        text-align: left;
    }

    .opportunity-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .demographic-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .ux-wireframes {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .wireframe-item img {
        height: auto;
        width: 100%;
        max-width: 400px;
    }

    .ux-iterations { gap: 3rem; }
    
    .iteration-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .flow-step-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 1.5rem;
        text-align: center;
        justify-items: center;
    }
    
    .flow-phone-img {
        grid-column: 1;
        grid-row: 1;
        height: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .flow-text-wrapper {
        grid-column: 1;
        grid-row: 2;
    }
    
    .flow-label {
        grid-column: 1;
        grid-row: 3;
        font-size: 1.5rem;
    }

    .color-palette-grid {
        grid-template-columns: 1fr; 
        gap: 2rem;
    }
    
    .color-item {
        flex-direction: row;
        justify-content: start;
    }
    
    .color-swatch { width: 80px; }

    .food-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .food-item, .food-item:nth-child(n) {
        background-image: none !important;
        border: 1px solid rgba(0,0,0,0.1);
    }
    
    body.dark-mode .food-item {
        border-color: rgba(255,255,255,0.2);
    }
}