/* ================== CASE STUDY PAGE STYLES ================== */

.page-header-container {
    position: sticky;
    top: 0;
    z-index: 999;
}

.case-study-page .main-header {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: var(--header-scrolled-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1001;
}

.case-study-content {
    background-color: var(--bg-secondary);
}

/* Breadcrumb styles moved to main style.css */

/* Header CTA styles moved to main style.css */

/* --- Hero Section --- */
.cs-hero {
    text-align: center;
    padding: 5rem 0;
    background-color: var(--bg-primary);
}

.cs-hero-content {
    max-width: 800px;
    margin: 0 auto 4rem;
}

.case-study-tag {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--primary-blue);
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

body.dark-mode .case-study-tag {
    color: #a5b4fc;
}

.cs-hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-inverted);
    line-height: 1.2;
}

.cs-hero-image-container {
    border-radius: 16px;
    overflow: hidden;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 16px 40px var(--shadow-color);
}

.cs-hero-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ================== SIMPLE HERO CAROUSEL STYLES ================== */
.hero-carousel {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 16px 40px var(--shadow-color);
    overflow: hidden;
    background: #181a20;
    /* Always dark background */
}

.carousel-track-container {
    overflow: hidden;
}

.carousel-track {
    padding: 0;
    margin: 0;
    list-style: none;
    position: relative;
    display: flex;
    transition: transform 0.5s ease-out;
}

.carousel-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: 0;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.6);
}

.carousel-button svg {
    width: 2rem;
    height: 2rem;
    fill: white;
}

.carousel-button--left {
    left: 1rem;
}

.carousel-button--right {
    right: 1rem;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    gap: 0.75rem;
    /* Increased space between dots */
    background: #181a20;
    /* Always dark background */
    padding: 1rem 0 0.5rem 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #444 !important;
    /* Always dark dot */
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 0 1px #222 !important;
    padding: 0;
    outline: none;
}

.carousel-indicator.current-slide {
    background: #a5b4fc !important;
    /* Always dark mode highlight */
    box-shadow: 0 0 0 2px #a5b4fc !important;
}

.carousel-caption {
    background: #181a20;
    /* Always dark background */
    text-align: center;
    font-size: 1rem;
    color: #a5b4fc !important;
    /* Always dark mode color */
    margin: 1rem 0 0 0;
    min-height: 1.5em;
    transition: opacity 0.3s;
    padding-bottom: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* ================== NEXT CASE STUDY SECTION ================== */
.cs-next-project-section {
    padding: 6rem 0 2rem 0;
    /* Adds vertical spacing */
    text-align: center;
    background-color: var(--bg-primary);
}

/* This targets the .section-tag ONLY within the new section */
.cs-next-project-section .section-tag {
    display: inline-flex;
    /* Aligns text and emoji */
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    /* This creates the "pill" shape */
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    background-color: #eef2ff;
    /* Light indigo/lavender background */
    color: var(--primary-blue);
    /* Vibrant indigo text */
    border: 1px solid #c7d2fe;
    /* Soft, slightly darker border */
}

body.dark-mode .cs-next-project-section .section-tag {
    background-color: var(--bg-tertiary);
    color: #a5b4fc;
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    box-shadow: none;
    /* remove glow in dark mode */
}

/* ================== NEXT CASE STUDY SECTION ================== */
.cs-next-project-section {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.cs-next-project-section .section-header {
    margin-bottom: 2.5rem;
}

.case-study-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background-color: var(--bg-primary);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 8px 24px var(--shadow-color);
}

.project-info .project-company {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.project-info .project-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-inverted);
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.project-info .project-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.project-tags span {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-buttons {
    display: flex;
    gap: 1rem;
}

.project-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
}

/* Responsive styles for the next case study section */
@media (max-width: 992px) {
    .case-study-item {
        grid-template-columns: 1fr;
    }

    .project-image {
        order: -1;
        /* Move the image to the top on smaller screens */
    }
}

/* ================== COMMON SECTION STYLES ================== */
.cs-section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-primary);
}

.cs-section .container {
    max-width: 1100px;
}

.cs-section:last-of-type {
    border-bottom: none;
}

.cs-section-container {
    display: flex;
    gap: 5rem;
    /* You can adjust this gap if needed */
    align-items: flex-start;
}

/* --- THIS IS THE UPDATED CODE FOR THE 50/50 SPLIT --- */
.cs-section-text,
.cs-section-sidebar,
.cs-section-media {
    flex: 1;
    /* This sets both columns to take up equal space */
}

/* --- END OF UPDATE --- */

.cs-section-reverse .cs-section-text {
    order: 2;
}

.cs-section-reverse .cs-section-media {
    order: 1;
}

.cs-section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-inverted);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.cs-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 55ch;
}

/* Parallax Container for Section Images */
.cs-image-container {
    border-radius: 12px;
    overflow: hidden;
    perspective: 1000px;
}

.cs-section-media img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}


/* ================== IMAGE STACK CONTAINER ================== */
.cs-image-stack-container {
    background-color: #6E8E9A;
    /* var(--bg-primary);  Default light mode background */
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1rem;
    max-height: 600px;
    /* Set a max height to enable scrolling */
    overflow-y: auto;
    /* Show scrollbar only when needed */
}

/* Specific dark mode styles to match your screenshot */
body.dark-mode .cs-image-stack-container {
    background-color: #1f2937;
    /* A dark background that matches your theme */
    border-color: #374151;
}

.cs-image-stack-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    /* Slightly rounded corners for the images themselves */
}

/* Add space between stacked images */
.cs-image-stack-container img+img {
    margin-top: 1rem;
}

/* --- Custom Scrollbar for a polished look (WebKit browsers: Chrome, Safari) --- */
.cs-image-stack-container::-webkit-scrollbar {
    width: 8px;
    /* Narrow scrollbar */
}

.cs-image-stack-container::-webkit-scrollbar-track {
    background: transparent;
    /* Makes the track invisible */
    margin: 1rem 0;
    /* Adds top and bottom margin to the track */
}

.cs-image-stack-container::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    /* A neutral dark gray for the handle */
    border-radius: 4px;
    /* Rounded handle */
    border: 2px solid transparent;
    /* Creates padding around the handle */
    background-clip: content-box;
}

.cs-image-stack-container::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
    /* Lighter color on hover */
}

/* --- Custom Scrollbar for Firefox --- */
.cs-image-stack-container {
    scrollbar-width: thin;
    scrollbar-color: #4b5563 transparent;
}

/* --- Overview Section --- */
.cs-overview-left h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-inverted);
}

.goals-list {
    list-style: none;
    padding-left: 0;
    counter-reset: goals-counter;
}

.goals-list li {
    counter-increment: goals-counter;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.goals-list li::before {
    content: counter(goals-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-blue);
}

.project-meta {
    padding-top: 0.5rem;
}

.meta-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.meta-item:first-child {
    padding-top: 0;
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.meta-value {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Challenge & Kickoff Sections --- */
.cs-challenge .container,
.cs-kickoff .container {
    display: flex;
    gap: 5rem;
    align-items: center;
}

.cs-challenge-left,
.cs-kickoff-left {
    flex: 1;
}

.cs-challenge-right,
.cs-kickoff-right {
    flex: 1;
}

.needs-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.needs-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.needs-box p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.needs-box-alt {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.needs-box-alt h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.needs-box-alt p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.kickoff-steps {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.kickoff-steps li {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.kickoff-steps span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.kickoff-steps p {
    margin: 0;
    max-width: none;
}

/* YouTube Video Placeholder */
.video-placeholder {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
}

.video-placeholder iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder .video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(255, 0, 0, 0.9);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background-color 0.2s ease;
}

.video-placeholder:hover .video-play-button {
    background-color: red;
}

.video-play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent white;
    margin-left: 3px;
}

/* --- Problem Statement Section --- */
.cs-problem-statement {
    background-color: var(--bg-secondary);
    padding: 5rem 0;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.cs-problem-statement .container {
    max-width: 900px;
}

.problem-statement-heading {
    color: var(--primary-blue);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
}

.problem-statement-text {
    font-size: 1.10rem;
    font-weight: 100;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

body.dark-mode .problem-statement-heading {
    color: #a5b4fc;
    /* Light purple for dark mode */
}

/* --- Insights Section --- */
.cs-insights-section {
    background-color: var(--bg-primary);
    /* Alternating background color */
    padding: 5rem 0;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.cs-insights-section .container {
    max-width: 900px;
    /* Consistent with other full-width sections */
}

.cs-insights-section .section-tag {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--primary-blue);
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .cs-insights-section .section-tag {
    color: #a5b4fc;
}

.cs-insights-section h2 {
    font-size: 2.0rem;
    font-weight: 600;
    color: var(--text-inverted);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.cs-insights-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0;
    /* Remove bottom margin if it's the last element */
    max-width: 75ch;
    /* Adjust max-width for readability */
    margin-left: auto;
    margin-right: auto;
}

/* --- Emerging Themes Section --- */
.theme-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.theme-box:last-of-type {
    margin-bottom: 0;
}

.theme-box h4 {
    margin: 0 0 1rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-box p {
    font-size: 0.95rem;
    max-width: none;
    margin-bottom: 0.75rem;
}

.theme-box p:last-of-type {
    margin-bottom: 0;
}

.theme-box-alt {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.theme-box-alt:last-of-type {
    margin-bottom: 0;
}

.theme-box-alt h4 {
    margin: 0 0 1rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-box-alt p {
    font-size: 0.95rem;
    max-width: none;
    margin-bottom: 0.75rem;
}

.theme-box-alt p:last-of-type {
    margin-bottom: 0;
}

.media-heading {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-tertiary);
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.media-subheading {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* ================== KEY INSIGHTS GRID SECTION ================== */
.cs-insights-grid-section {
    padding: 6rem 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.insight-card {
    background-color: var(--bg-secondary);
    border-radius: 24px;
    /* More rounded corners */
    padding: 2rem;
    text-align: left;
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.insight-number {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.insight-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-description {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive styles for the insights grid */
@media (max-width: 992px) {
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ================== ITERATIONS SECTION ================== */
.cs-iterations-section {
    padding: 6rem 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.cs-iterations-section .section-header p {
    max-width: 75ch;
    /* Sets a max-width for readability */
    margin-left: auto;
    margin-right: auto;
}

.cs-iterations-section .section-tag {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--primary-blue);
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .cs-iterations-section .section-tag {
    color: #a5b4fc;
}

.iterations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.iteration-card {
    background-color: var(--bg-secondary);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.iteration-icon {
    display: inline-flex;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.iteration-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.iteration-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive styles for the iterations grid */
@media (max-width: 992px) {
    .iterations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .iterations-grid {
        grid-template-columns: 1fr;
    }
}

/* ================== RESULTS SECTION ================== */
.cs-results-section {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.cs-results-section .section-tag {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--primary-blue);
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .cs-results-section .section-tag {
    color: #a5b4fc;
}

.cs-results-section .section-header p {
    max-width: 75ch;
    /* Sets a max-width for readability */
    margin-left: auto;
    margin-right: auto;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.result-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.result-card h3 {
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--primary-blue);
    /* Updated color for emphasis */
    margin: 0 0 0.75rem 0;
}

.result-card p {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.results-cta {
    text-align: center;
}

.results-cta .btn {
    margin-bottom: 1.5rem;
}

.cta-citation {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================== CONTENT SWITCHER (TABS) SECTION ================== */
.cs-content-switcher-section {
    padding: 4rem 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

/* Tab buttons container */
.switcher-tabs {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.switcher-tab-link {
    font-family: inherit;
    /* This is the line to add */
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: transparent;
    border: none;
    padding: 0 0 1rem 0;
    /* Padding only on the bottom for spacing */
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease-in-out;
}

.switcher-tab-link:hover {
    color: var(--text-primary);
}

.switcher-tab-link.active {
    color: var(--primary-blue);
}

/* The blue underline for the active tab */
.switcher-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Sits directly on top of the container's border */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-blue);
}

/* Tab content container */
.switcher-content {
    width: 100%;
    border-radius: 16px;
    /* box-shadow: 0 12px 24px var(--shadow-color); */
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.switcher-tab-content {
    display: none;
    /* Hide all content panes by default */
}

.switcher-tab-content.active {
    display: block;
    /* Show only the active one */
}

.switcher-tab-content img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive styles for the results grid */
@media (max-width: 992px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ================== LEARNINGS SECTION ================== */
.cs-learnings-section {
    padding: 6rem 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.learnings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.learning-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.learning-icon {
    display: inline-flex;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.learning-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.learning-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ================== CASE STUDY BLOCKQUOTE FIX ================== */
.cs-blockquote-section {
    text-align: center;
    /* This will center the author-info block */
    padding: 3rem 0;
    /* This adds top and bottom padding */
}

.cs-blockquote-section .author-info {
    display: inline-flex;
    /* Allows the block to be centered like text */
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cs-blockquote-section .author-info cite {
    text-align: left;
    /* Keep the text within the cite block left-aligned */
    font-style: normal;
}

.cs-blockquote-section .author-info svg {
    /* This is the icon */
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
    /* Aligns icon nicely with the text */
}

/* Responsive styles for the learnings grid */
@media (max-width: 992px) {
    .learnings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ================== IMAGE SHOWCASE SECTION ================== */
.cs-image-showcase-section {
    padding: 4rem 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.cs-image-showcase-section-alt {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.image-showcase-container {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 12px 24px var(--shadow-color);
    overflow: hidden;
    display: flex;
    /* This allows the container to hold one or more images */
    background-color: var(--bg-secondary);
    /* A subtle background for the container */
}

.image-showcase-container img {
    flex: 1 1 0;
    /* Allows images to grow and shrink to fill the space */
    min-width: 0;
    /* Important fix for flexbox shrinking */
    width: 100%;
    /* Fallback and ensures it takes up its flex space */
    height: auto;
    display: block;
}

.image-caption {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-tertiary);
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
}

/* --- Responsive Styles for Case Study --- */
@media (max-width: 992px) {
    .btn-back {
        display: none;
    }

    .cs-hero h1 {
        font-size: 2.5rem;
    }

    .cs-section-container {
        width: 100%;
        flex-direction: column;
        gap: 3rem;
    }

    /* --- RESPONSIVE STACKING & SIZING FIX STARTS HERE --- */
    .cs-section-text {
        order: 2;
        width: 100%;
    }

    .cs-section-media,
    .cs-section-sidebar {
        order: 1;
        width: 100%;
    }

    /* --- RESPONSIVE STACKING & SIZING FIX ENDS HERE --- */
    .cs-hero-image-container,
    .cs-image-container {
        max-width: 700px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block;
    }
}



@media (max-width: 992px) {

    .cs-hero-image-container,
    .cs-image-container {
        max-width: 90vw;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .case-study-content {
        padding-top: 0;
    }

    .cs-hero {
        padding: 4rem 0;
    }

    .cs-hero h1 {
        font-size: 2rem;
    }

    .cs-section {
        padding: 4rem 0;
    }

    .problem-statement-text {
        font-size: 1.1rem;
        /* Adjust font size for smaller mobile */
    }

    .cs-hero-image-container,
    .cs-image-container {
        max-width: 98vw !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block;
    }
}

@media (max-width: 768px) {

    .cs-hero-image-container,
    .cs-image-container {
        max-width: 98vw;
        margin-left: auto;
        margin-right: auto;
    }
}


/* ================== AI UPSKILLING CASE STUDY — ADDITIONS ================== */
/* These additions restyle the AI case study (formerly Tailwind) to match the site's tokens. */

/* General utilities */
.ai-center {
    text-align: center;
}

.ai-section {
    padding: 5rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
     line-height: 1.8; /* Matches the line height of other pages */
}

.ai-section.alt {
    background: var(--bg-secondary);
}

.ai-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top Hero */
.ai-hero {
    text-align: center;
    padding: 5rem 0 3rem;
    background: var(--bg-primary);
}

.ai-hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-inverted);
    line-height: 1.2;
    margin: 0;
}

.ai-hero p {
    margin: 1rem auto 0;
    color: var(--text-secondary);
    max-width: 75ch;
}

/* Pill + section titles to align with existing case study styling */
.ai-pill {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--primary-blue);
    border: 1px solid var(--tag-secondary-border, var(--border-light));
    padding: .5rem 1rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: .9rem;
    letter-spacing: .5px;
    text-transform: uppercase;
}

body.dark-mode .ai-pill {
    color: #a5b4fc;
}

.ai-section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-inverted);
    margin: 0 0 1rem 0;
    text-align: center;
}

.ai-section p.lede {
    text-align: center;
    color: var(--text-secondary);
    max-width: 75ch;
    margin: 0 auto 2rem;
}

/* 3-up summary cards */
.ai-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.ai-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    box-shadow: 0 8px 24px var(--shadow-color);
}

.ai-card[style*="background:#e7fee7"] {
    color: #333333; /* Ensures black text in both light and dark modes */
}

.ai-card h3 {
    margin: 0 0 .5rem 0;
    font-weight: 600;
    color: var(--primary-blue);
}

body.dark-mode .ai-card h3 {
    color: #a5b4fc;
}

.ai-card p {
    margin: 0;
    color: var(--text-secondary);
}

@media (max-width: 992px) {
    .ai-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Chart block */
.ai-chart-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 8px 24px var(--shadow-color);
}

.ai-chart-block h3 {
    text-align: center;
    margin: 0 0 .25rem 0;
    color: var(--text-inverted);
}

.ai-chart-block p {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 780px;
    height: 360px;
    margin: 0 auto;
}

/* Two-column content block */
.ai-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 992px) {
    .ai-split {
        grid-template-columns: 1fr;
    }
}

/* Vibe coding interactive tiles */
.vibe-tiles {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
}

.vibe-tile {
    flex: 1 1 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.vibe-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .1);
}

.vibe-tile .emoji {
    font-size: 1.6rem;
    margin-bottom: .25rem;
}

.vibe-info {
    /*
    margin-top: .75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: .75rem;
    text-align: center;
    min-height: 60px;
    color: var(--text-secondary);
    */
    display: flex; /* Enables flexbox */
    justify-content: center; /* Centers content horizontally */
    align-items: center; /* Centers content vertically */
    margin-top: .75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: .75rem;
    text-align: center;
    min-height: 60px;
    color: var(--text-secondary);
}

/* Workflow gates (HITL) */
.hitl {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-light);
    border-radius: 16px;
    padding: 1.25rem;
}

.hitl .gates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gate {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: .75rem;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
    text-align: center;
}

.gate:hover,
.gate.active {
    border-color: var(--primary-blue);
    background: var(--bg-tertiary);
}

.gate h5 {
    margin: .25rem 0 .25rem;
    font-weight: 600;
    color: var(--text-inverted);
    font-size: .95rem;
}

.gate p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: .8rem;
}

.hitl-info {
    margin-top: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    min-height: 100px;
    color: var(--text-secondary);
    display: flex; /* Enables flexbox */
    justify-content: center; /* Centers content horizontally */
    align-items: center; /* Centers content vertically */
    text-align: center; /* Ensures text alignment */
    height: 100%; /* Ensure the container has height */
    min-height: 100px; /* Optional: Set a minimum height */
}

/* Helpers */
.ai-callout {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1rem 1.25rem;
}

.section-spacer {
    height: 2rem;
}