/* --- Home Guiding Principles Section (Sticky Scroll) --- */
.principles-section {
    background-color: #ffffff; /* Restored to clean white */
    padding-top: 6rem;
    position: relative;
    z-index: 10;
}

/* ============================================================
   EXACT EDITORIAL HEADER (Matched Structure, Light Background)
   ============================================================ */
.principles-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.principles-kicker {
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 1.5rem;
    display: inline-block;
    position: relative;
    color: var(--brand-purple);
}

.principles-kicker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 30px;
    height: 3px;
    background-color: var(--brand-purple);
}

.principles-title {
    font-family: var(--font-heading, serif);
    font-size: 5rem;
    color: var(--bg-dark, #111111); /* Dark text for the white background */
    margin: 0;
    line-height: 1.1;
    letter-spacing: -1px;
}

.principles-title .sub-heading {
    display: block;
    color: var(--brand-purple); /* Muted grey for the secondary word */
    font-size: 4rem;
    font-weight: 400;
}

.principles-title .title-dash {
    display: inline-block;
    width: 80px;
    height: 4px;
    background-color: var(--brand-purple);
    margin-bottom: 1rem;
    margin-right: 20px;
    vertical-align: middle;
}

.principles-title .title-accent {
    color: var(--brand-purple);
}

.principles-subtitle {
    font-size: 1.25rem;
    color: #555555;
    margin-top: 1.5rem;
    max-width: 600px;
}

@media (max-width: 768px) {
    .principles-title { font-size: 3.5rem; }
    .principles-title .sub-heading { font-size: 2.8rem; }
    .principles-title .title-dash { width: 50px; }
}

/* ============================================================
   SCROLL WRAPPER & NAV (Fixed Spacing)
   ============================================================ */
.principles-scroll-wrapper {
    position: relative;
    height: 400vh;
    width: 100%;
    margin-top: 1rem; /* Drastically reduced from 4rem */
}

.principles-sticky-container {
    position: sticky;
    top: 5rem; /* Leaves a little breathing room when it sticks to the top of the screen */
    height: auto;
    min-height: 75vh; /* Reduced from 100vh */
    display: flex;
    align-items: flex-start; /* Forces the content to sit at the top, right under the header */
    overflow: hidden;
}

.principles-split {
    display: flex;
    width: 100%;
    height: 75vh;
    gap: 4rem;
    align-items: flex-start; /* Changed to flex-start to prevent pushing down */
}

/* Left Navigation */
.principles-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid #e0e0e0; /* Light grey divider */
    padding-right: 2rem;
}

.principle-btn {
    text-align: left;
    background: none;
    border: none;
    font-family: var(--font-heading, serif);
    font-size: 2.5rem;
    color: #cccccc; /* Light grey inactive state */
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
    margin: 0;
}

.principle-btn:hover {
    color: var(--bg-dark, #111111); /* Hovers to dark black */
}

.principle-btn.active {
    color: var(--brand-purple);
    transform: translateX(15px);
}

/* Right Content Window */
.principles-content-window {
    flex: 1.5;
    position: relative;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 4rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.principles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: transform 0.8s ease;
}

/* Animates the image slightly every time the active tab changes */
.principles-content-window.animate-bg .principles-bg {
    transform: scale(1.05);
}

/* The Dark Tint Overlay */
.principles-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 2;
}

/* Text Panels */
.principle-panel {
    position: absolute;
    top: 50%;
    left: 4rem;
    right: 4rem;
    transform: translateY(-50%);
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-40%); /* Slight upward drift on enter */
}

.principle-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%); /* Settles perfectly centered */
}

.principle-panel h3 {
    font-family: var(--font-heading, serif);
    font-size: 3rem;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

.principle-panel p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #f0f0f0;
    margin: 0;
}

/* Responsive (Mobile switches to static click-tabs instead of sticky scroll) */
@media (max-width: 992px) {
    /* 1. Eliminate massive gaps */
    .principles-section { padding-top: 2rem; } 
    .principles-header { margin-bottom: 1.5rem; }
    .principles-scroll-wrapper { height: auto !important; margin-top: 0; }
    .principles-sticky-container { position: relative; height: auto; min-height: auto; top: auto; display: block; }
    .principles-split { flex-direction: column; height: auto; gap: 1.5rem; }
    
    /* 2. Horizontal scrolling menu */
    .principles-nav {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 1rem;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        gap: 1.5rem;
    }
    .principle-btn { font-size: 1.35rem; }
    .principle-btn.active { transform: none; color: var(--brand-purple); }

    /* 3. Fix the collapsing box and clipping */
    .principles-content-window { 
        height: auto; /* Lets the container grow */
        min-height: 350px; /* Guarantees enough image shows */
        width: 100%; 
        padding: 2rem; 
        box-sizing: border-box; /* Fixes right-edge bleed */
        display: flex;
        align-items: center; /* Center the text block vertically */
    }
    
    /* 4. Let the text push the box open (removes absolute positioning) */
    .principle-panel { 
        position: relative; 
        top: auto; 
        left: auto; 
        right: auto; 
        transform: none !important; 
        display: none; /* Hide non-active text */
        margin: 0;
    }
    
    .principle-panel.active { 
        display: block; /* Only show active text, which sets the height */
        opacity: 1; 
        visibility: visible; 
    }

    .principle-panel h3 { font-size: 1.75rem; margin-bottom: 1rem; }
    .principle-panel p { font-size: 1rem; line-height: 1.6; }
}