/* --- Services Detail Pages (Chapter Index Layout) --- */

.content-wrapper {
    background: #ffffff;
    padding-bottom: 6rem;
    position: relative;
}

/* ============================================================
   1. HERO SECTION & OVERLAPPING HEADER
   ============================================================ */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 65vh; /* Adjust based on how tall you want the hero */
    display: flex;
    align-items: center; /* Centers the header vertically */
    overflow: hidden;
}

/* Update the image z-index to 0 so our tint can sit on top of it */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Add the dark overlay tint to the hero section */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0; /* Shorthand for top/bottom/left/right 0 */
    background-color: rgba(0, 0, 0, 0.65); /* 65% black tint - adjust the 0.65 to go darker or lighter */
    z-index: 1; /* Sits between the image and the text */
}

.hero-section .page-header {
    position: relative;
    z-index: 2; /* Keeps the text above the image and overlay */
    background: transparent; /* Removes any black boxes or solid colors */
    padding: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================
   2. CREATIVE PAGE HEADER (EDITORIAL / LEFT-ALIGNED)
   ============================================================ */
.page-header {
    text-align: left;
    align-items: flex-start;
    padding: 6rem 2rem 4rem 2rem;
    max-width: 1300px; /* Matched to the chapter container width */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.page-kicker {
    color: var(--brand-purple);
    font-family: '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;
}

/* Small decorative line above the kicker (left-aligned) */
.page-kicker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    transform: none;
    width: 30px;
    height: 3px;
    background-color: var(--brand-purple);
}

/* Update the main title to white (the purple spans inside it will stay purple) */
.page-header .page-title {
    font-family: var(--font-heading);
    font-size: 5.5rem;
    color: #ffffff; /* Changed from var(--bg-dark) */
    margin: 0 0 1.5rem 0;
    line-height: 1.1;
    letter-spacing: -1px;
}

/* Creative typographic touch: a purple period at the end of the heading */
.page-header .page-title .title-accent {
    color: var(--brand-purple);
}

/* Em-dash heading: sub-heading stacked under the main title */
.page-title .sub-heading {
    display: block;
    color: var(--brand-purple);
    font-size: 4.5rem;
    font-weight: 400;
}

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

/* Update the subtitle to a light grey/white */
.page-header .page-subtitle {
    font-size: 1.25rem;
    color: #f0f0f0; /* Changed from #555 */
    line-height: 1.7;
    max-width: 650px;
    font-weight: 300;
}

/* ============================================================
   3. SCOPED VERTICAL SCROLLING TEXT (LEFT SIDE, GUTTER)
   ============================================================ */

/* 3.1 The invisible track */
.sticky-track {
    position: absolute;
    /* We match the track exactly to the width and alignment of your chapters */
    max-width: 1300px;
    margin: 0 auto;
    left: 0;
    right: 0;
    top: 8rem; /* Hard limit to prevent bleeding over the top black line */
    bottom: 8rem; /* Hard limit for the bottom */
    z-index: 10;
    pointer-events: none;
}

/* 3.2 The sticky container */
.vertical-text-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 12rem; /* Creates a strict left-hand column for the text to live in */
}

/* 3.3 The text itself */
.vertical-word {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Standard rotation replaces writing-mode, guaranteeing it stays exactly centered in the 12rem box */
    transform: translate(-50%, -50%) rotate(-90deg);
    font-family: var(--font-heading, serif);
    font-size: 9.6rem; /* Accurately reduced by 20% */
    color: transparent;
    -webkit-text-stroke: 2px var(--brand-purple);
    white-space: nowrap; /* Prevents long words from breaking onto two lines */
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    margin: 0;
    line-height: 1;
}

/* Toggled by services.js */
.vertical-word.active {
    opacity: 1;
}

/* ============================================================
   4. CHAPTER INDEX LAYOUT
   ============================================================ */
.chapter-container {
    display: grid;
    grid-template-columns: 1fr 3fr; /* Wider content area */
    max-width: 1300px;
    margin: 0 auto;
    border-top: 2px solid var(--bg-dark);
    padding-top: 5rem;
    margin-top: 5rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.chapter-container:first-of-type {
    border-top: none;
    margin-top: 2rem;
    padding-top: 0;
}

.chapter-marker-col {
    padding-right: 3rem;
}

.chapter-number {
    font-family: var(--font-heading);
    font-size: 6rem;
    color: var(--brand-purple);
    line-height: 0.8;
    margin-bottom: 1rem;
}

.chapter-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bg-dark);
}

.chapter-content-col {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split for text and image */
    gap: 4rem;
    align-items: start; /* Lets the sticky child move freely in the row */
}

/* --- Text Column --- */
.chapter-text h2 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--bg-dark);
    margin-top: 0;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.chapter-text p {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.chapter-text p:first-of-type::first-letter {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    float: left;
    line-height: 1;
    padding-right: 15px;
    padding-top: 5px;
    color: var(--bg-dark);
}

/* --- Sticky Image Wrapper --- */
.chapter-visual-wrapper {
    position: sticky;
    top: 100px; /* Adjust based on fixed nav height */
}

.chapter-visual-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* --- Feature List --- */
.service-features {
    list-style: none;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.service-features li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 1rem;
    color: #444;
    font-size: 1.1rem;
}

.service-features li::before {
    content: '•';
    color: var(--brand-purple);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}

.service-features strong {
    color: var(--bg-dark);
}

.mt-4 { margin-top: 2rem; }

/* =========================================
   Our Process Section (Purple Parallax Theme)
========================================= */
.process-flow-section {
    position: relative;
    width: 100%;
    padding: 6rem 5%;
    background-image: var(--process-bg); /* Replaced URL */
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* THIS CREATES THE PARALLAX EFFECT */
    z-index: 10;
}

.process-flow-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85); 
    z-index: 1;
}

.process-flow-header {
    position: relative;
    z-index: 2; 
    text-align: center;
    margin-bottom: 4rem;
}

.process-flow-header h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: var(--bg-dark); 
    font-weight: 700;
    font-family: var(--font-heading); 
}

.process-flow-header .purple-dot {
    color: var(--brand-purple); 
}

.process-flow-container {
    position: relative;
    z-index: 2; 
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
}

.process-step {
    flex: 1;
    padding: 2rem;
    background: #ffffff;
    border: 2px solid var(--brand-purple); 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.process-step h3 {
    font-size: 1.6rem;
    color: var(--brand-purple); 
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 700;
}

.process-step p {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #444444; 
}

.process-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-purple); 
    font-size: 1.5rem;
    margin-top: 3rem; 
    align-self: flex-start; 
}

.process-arrow.mobile-arrow {
    display: none;
}

/* =========================================
   Global CTA Section
========================================= */
.global-cta-section {
    background-color: #f3f2ef; 
    padding: 8rem 5%;
    text-align: center;
    position: relative;
    z-index: 10; 
}

.global-cta-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.global-cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--bg-dark);
    font-weight: 700;
    font-family: var(--font-heading);
}

.global-cta-content p {
    font-size: 1.15rem;
    color: #444;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.service-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem;
    border-radius: 50px; 
    border: 2px solid var(--brand-purple);
    background: var(--brand-purple);
    color: #ffffff; 
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.service-cta-btn:hover {
    background: transparent;
    color: var(--brand-purple); 
}

/* ============================================================
   SERVICE PAGE NAV OVERRIDE (WHITE TEXT ONLY)
   ============================================================ */
.main-nav.nav-dark .nav-links > li > a,
.main-nav.nav-dark .dropbtn {
    color: #ffffff; 
}

/* Ensures the mobile hamburger menu icon lines are white */
.main-nav.nav-dark .hamburger span {
    background-color: #ffffff;
}

/* ============================================================
   Mobile Responsive Layout 
   ============================================================ */
@media (max-width: 768px) {
    .process-flow-section {
        display: grid;
        grid-template-rows: auto auto; 
        padding: 0; 
        background-image: none; 
    }

    .process-flow-overlay {
        grid-column: 1 / -1;
        grid-row: 1 / 3; 
        align-self: start; 
        position: sticky;
        top: 0;
        height: 100vh;
        width: 100%;
        background-image: var(--process-bg); /* Replaced URL */
        background-size: cover;
        background-position: center;
        z-index: 0;
    }

    .process-flow-overlay::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.85); 
    }

    .process-flow-header {
        grid-column: 1 / -1;
        grid-row: 1; 
        position: relative;
        z-index: 2;
        padding-top: 4rem; 
    }

    .process-flow-container {
        grid-column: 1 / -1;
        grid-row: 2; 
        position: relative;
        z-index: 2;
        padding: 0 5% 4rem 5%; 
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    .process-step {
        width: 100%; 
        margin: 0 auto;
        padding: 2rem;
    }

    .process-arrow.desktop-arrow {
        display: none;
    }

    .process-arrow.mobile-arrow {
        display: flex;
        margin: 0;
        padding: 1.5rem 0;
        align-self: center;
    }
}

/* ============================================================
   5. RESPONSIVE
   ============================================================ */

/* --- Desktop: make room for the left-aligned vertical text --- */
@media (min-width: 1025px) {
    .chapter-container {
        /* Matches the 12rem column above, so the "01" starts right after the vertical text */
        padding-left: 12rem;  
        padding-right: 2rem;
    }
}

/* --- Tablet / Mobile: stack the layout --- */
@media (max-width: 1024px) {
    .chapter-container {
        grid-template-columns: 1fr;
    }
    .chapter-content-col {
        grid-template-columns: 1fr;
    }
    .chapter-marker-col {
        margin-bottom: 3rem;
    }
    .chapter-visual-wrapper {
        position: relative; /* Disable sticky on mobile */
        top: 0;
        margin-bottom: 3rem;
        order: -1; /* Image above the text */
    }

    /* Hide the giant vertical text where it would take too much space */
    .sticky-track {
        display: none;
    }
    .page-title .sub-heading {
        font-size: 3rem;
    }
    .page-title .title-dash {
        width: 60px;
    }
}

/* ============================================================
   6. SERVICE PAGE BUTTONS (PILL DESIGN)
   ============================================================ */

.chapter-content-col .btn-primary {
    background-color: #000000;
    color: #ffffff;
    padding: 16px 45px;
    border-radius: 50px; /* Creates the perfect pill shape */
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.chapter-content-col .btn-primary:hover {
    background-color: var(--brand-purple);
    color: #ffffff;
}

/* --- Mobile: scale the page header --- */
@media (max-width: 768px) {
    .page-header {
        padding: 5rem 1rem 2rem 1rem;
    }
    .page-header .page-title {
        font-size: 3.5rem;
    }
    .page-kicker {
        font-size: 0.85rem;
        letter-spacing: 3px;
    }
}