/* ============================================================
   CASE STUDY COMPONENTS (Shared across all case study pages)
   ============================================================ */

/* --- Animations --- */
@keyframes sw-shimmer-h {
    0% {
        background-position: 200% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes sw-shimmer-v {
    0% {
        background-position: 50% 0%;
    }

    50% {
        background-position: 50% 100%;
    }

    100% {
        background-position: 50% 200%;
    }
}

@keyframes sw-shimmer-diagonal {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

@keyframes sw-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- Case Study Page Wrapper --- */
.sw-case-study-page {
    --sw-border: #e2e8f0;
    --sw-light-bg: #f8fafc;
    color: #1e293b;
    font-family: 'Roboto', sans-serif;
}

/* FIX: Force Transparent Header on Case Studies for Overlay Effect */
body[class*="case-study-"] .sw-site-header {
    background: transparent !important;
}

/* RESTORED: Radial gradients behind logo/nav are critical for readability */
/* body[class*="case-study-"] .sw-site-header::before {
    display: none !important;
} */

/* FIX: Force Overlay Layout (Remove global padding so image hits top) */
body[class*="case-study-"] .sw-page-content,
body[class*="case-study-"] .sw-main {
    padding-top: 0 !important;
}

/* Page-Specific Accent Assignments (Scope: Body) */
/* Colors MUST match case-studies.html index page categories */

/* TOUR Category - Green (#22c55e / #4ade80) */
body.case-study-rebelution-page,
body.case-study-slightly-stoopid-page,
body.case-study-revivalists-page {
    --sw-acc-grad: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #22c55e 100%);
    --hero-bg-gradient: linear-gradient(135deg, #166534 0%, #22c55e 100%);
}

/* RELEASE Category - Emerald (#059669 / #10b981) */
body.case-study-rebelution-inthemoment-page,
body.case-study-boygenius-page,
body.case-study-hirie-page {
    --sw-acc-grad: linear-gradient(135deg, #059669 0%, #10b981 50%, #059669 100%);
    --hero-bg-gradient: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
}

/* LABEL Category - Emerald (#059669 / #10b981) */
body.case-study-easy-star-records-page {
    --sw-acc-grad: linear-gradient(135deg, #059669 0%, #10b981 50%, #059669 100%);
    --hero-bg-gradient: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
}

/* PROMOTER Category - Sky Blue (#0ea5e9 / #38bdf8) */
body.case-study-all-good-presents-page,
body.case-study-bamp-project-page {
    --sw-acc-grad: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #0ea5e9 100%);
    --hero-bg-gradient: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
}

/* FESTIVAL Category - Amber (#f59e0b / #fbbf24) */
body.case-study-point-break-festival-page {
    --sw-acc-grad: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
    --hero-bg-gradient: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

/* GOV/DIGITAL/VIRAL Category - Purple (#8b5cf6 / #a78bfa) */
body.case-study-gnarly-davidson-page,
body.case-study-night-teacher-page,
body.case-study-usaf-space-force-page {
    --sw-acc-grad: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #8b5cf6 100%);
    --hero-bg-gradient: linear-gradient(135deg, #5b21b6 0%, #8b5cf6 100%);
}

/* --- Hero Section (layout only, colors per-page) --- */
/* Base Hero Refactor for Split Layout (Image Top, Gradient Bottom) */
/* Base Hero Refactor for Split Layout (Image Top, Gradient Bottom) */
.sw-case-hero {
    padding: 2rem;
    padding-top: 64px;
    /* MATCH LIVE SITE EXACTLY */
    min-height: 270px;
    /* Ensure visual height matches */
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Gradient Background (Bottom Section) */
    background: var(--hero-bg-gradient, linear-gradient(135deg, #1e293b 0%, #0f172a 100%));
}

/* The Image Section (Top) */
.sw-case-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    /* Cover full hero area */
    background-image: var(--hero-bg-image);
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* The Dark Overlay for Image (Matches live site .Intro style) */
/* UPDATED: Balanced opacity for text contrast + image visibility */
.sw-case-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    /* Heavy vignette: Dark top/bottom (0.75), mid-tone center (0.4) */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0.75) 100%);
    z-index: 1;
    pointer-events: none;
}

.sw-case-hero-content {
    position: relative;
    z-index: 2;
    /* FIX: Raised to 2 to sit ON TOP of the ::after overlay (z-index 1) */
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 16px;
}

.sw-case-hero .sw-case-badge {
    /* FIX: User requested removal */
    display: none;
}

/* Page-specific hero background images */
/* --- Page-Specific Hero Definitions --- */

.sw-hero-rebelution {
    --hero-bg-image: url('/images/case-study-headers/header-rebelution.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.sw-hero-slightly-stoopid {
    --hero-bg-image: url('/images/case-study-headers/header-slightly-stoopid.png');
    --hero-bg-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.sw-hero-usaf-space-force {
    --hero-bg-image: url('/images/case-study-headers/header-usaf-space-force.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #0f172a 0%, #475569 100%);
}

.sw-hero-boygenius {
    --hero-bg-image: url('/images/case-study-headers/header-boygenius.png');
    --hero-bg-gradient: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.sw-hero-revivalists {
    --hero-bg-image: url('/images/case-study-headers/header-revivalists.png');
    --hero-bg-gradient: linear-gradient(135deg, #7c2d12 0%, #f97316 100%);
}

.sw-hero-all-good-presents {
    --hero-bg-image: url('/images/case-study-headers/header-all-good-presents.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #581c87 0%, #a855f7 100%);
}

.sw-hero-bamp-project {
    --hero-bg-image: url('/images/case-study-headers/header-bamp-project.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #134e4a 0%, #14b8a6 100%);
}

.sw-hero-point-break-festival {
    --hero-bg-image: url('/images/case-study-headers/header-point-break-festival.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #0e7490 0%, #22d3ee 100%);
}

.sw-hero-gnarly-davidson {
    --hero-bg-image: url('/images/case-study-headers/header-gnarly-davidson.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #18181b 0%, #52525b 100%);
}

.sw-hero-night-teacher {
    --hero-bg-image: url('/images/case-study-headers/header-night-teacher.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #312e81 0%, #6366f1 100%);
}

.sw-hero-easy-star-records {
    --hero-bg-image: url('/images/case-study-headers/header-easy-star-records.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #14532d 0%, #22c55e 100%);
}

.sw-hero-rebelution-inthemoment {
    --hero-bg-image: url('/images/header-rebelution-inthemoment.jpg');
    --hero-bg-gradient: linear-gradient(135deg, #78350f 0%, #d97706 100%);
}

/* Fallbacks/Others */
.sw-hero-hirie {
    /* Using existing PNG if header not downloaded */
    --hero-bg-image: url('/images/case-study-images/hero-hirie.png');
    --hero-bg-gradient: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
}

.sw-case-hero h1 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 1rem;
    line-height: 1.15;
    /* FIX: Heavy "Lift" Shadow - 3 layers of darkness */
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 8px 16px rgba(0, 0, 0, 0.8),
        0 16px 32px rgba(0, 0, 0, 0.6);
}

.sw-case-hero .sw-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
    /* FIX: Pure white */
    color: #ffffff;
    margin: 0;
    line-height: 1.6;
    /* FIX: Strong shadow */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1);
}

/* --- Stats Bar --- */
.sw-stats-bar {
    background: #fff;
    border-bottom: 1px solid var(--sw-border);
    padding: 2rem 1.5rem;
}

.sw-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.sw-stat-number {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;

    /* Default Gradient applied if variable exists, else generic fallback */
    background: var(--sw-acc-grad, linear-gradient(90deg, #475569, #64748b, #94a3b8, #64748b, #475569));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Fallback for transparency */
    animation: sw-shimmer-h 4s linear infinite;
}

.sw-stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .sw-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sw-stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* --- Section Headers --- */
.sw-section-header {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sw-gradient-bar {
    flex-shrink: 0;
    width: 4px;
    min-height: 0 !important;
    height: auto !important;
    align-self: stretch !important;
    background-size: 100% 200%;
    animation: sw-shimmer-v 3s linear infinite;
    border-radius: 2px;
}

.sw-section-kicker {
    display: inline-block;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Gradient Background Pill Style */
    background-image: var(--sw-acc-grad, linear-gradient(135deg, #df7706, #f59e0b, #fbbf24, #f59e0b, #d97706));
    background-size: 200% 100%;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    /* -webkit-background-clip: text; REMOVED */
    /* -webkit-text-fill-color: transparent; REMOVED */
    /* color: transparent; REMOVED */
    animation: sw-shimmer-h 3s linear infinite;
}

.sw-section-headline {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    color: #111;
    margin: 0 0 0.5rem;
    letter-spacing: 0.02em;
}

.sw-section-subhead {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

/* --- Content Sections --- */
.sw-content-section {
    padding: 1.5rem 0;
}

.sw-content-section.sw-alt-bg {
    background: var(--sw-light-bg);
}

.sw-block-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

@media (max-width: 1024px) {
    .sw-block-container {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .sw-block-container {
        padding: 0 20px;
    }
}

.sw-content-text {
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.8;
}

.sw-content-text p {
    margin: 0 0 1.5rem;
}

/* --- Callout Box --- */
.sw-callout-box {
    border-left: 4px solid var(--sw-accent, #f59e0b);
    padding: 1.5rem 2rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
}

.sw-cs-hero-row .sw-callout-box {
    overflow: hidden;
    clear: right;
}

.sw-callout-box p {
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.7;
}

.sw-callout-box strong {
    color: #fde047;
}

/* --- Card Grids --- */
.sw-approach-grid,
.sw-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.sw-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {

    .sw-approach-grid,
    .sw-insight-grid {
        grid-template-columns: 1fr;
    }

    .sw-result-grid {
        grid-template-columns: 1fr;
    }
}

.sw-approach-card,
.sw-result-card,
.sw-insight-card {
    background: #fff;
    border: 1px solid var(--sw-border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.sw-approach-card:hover,
.sw-result-card:hover,
.sw-insight-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.sw-approach-card .sw-card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #fff;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-size: 300% 300%;
    animation: sw-shimmer-diagonal 4s ease-in-out infinite;
}

.sw-approach-card h4,
.sw-result-card h4,
.sw-insight-card h4 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 0.75rem;
}

.sw-approach-card p,
.sw-result-card p,
.sw-insight-card p {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #334155;
    margin: 0;
    line-height: 1.6;
}

/* --- Insight Callout --- */
.sw-insight-callout {
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
}

.sw-insight-callout h3 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
}

.sw-insight-callout p {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin: 0;
}

/* --- Terminal CTA --- */
.sw-terminal-cta {
    background: #0a0a0a;
    border-radius: 16px;
    overflow: hidden;
    margin: 2rem 0;
}

.sw-term-header {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sw-term-dots {
    display: flex;
    gap: 6px;
}

.sw-term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.sw-term-dot.r {
    background: #ff5f56;
}

.sw-term-dot.y {
    background: #ffbd2e;
}

.sw-term-dot.g {
    background: #27ca40;
}

.sw-term-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 0.1em;
}

.sw-term-body {
    position: relative;
    padding: 2rem;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* Duplicate removed - using definition at line ~1680 instead */

.sw-status-blink {
    position: relative;
    z-index: 10;
    display: block;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #10b981;
    margin-bottom: 1rem;
    animation: sw-blink 1.5s ease-in-out infinite;
}

.sw-cta-glitch-text {
    position: relative;
    z-index: 10;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.sw-btn-terminal {
    position: relative;
    z-index: 10;
    display: inline-block;
    padding: 16px 40px;
    background: #0a0a0a;
    border: 2px solid;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: fit-content;
}

.sw-btn-terminal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Related/Learn More Section */
.sw-related-section {
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
}

.sw-related-section p {
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    color: #475569;
    margin: 0;
}

.sw-related-section a {
    font-weight: 700;
    text-decoration: none;
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sw-shimmer-h 3s linear infinite;
    transition: all 0.2s ease;
    padding-bottom: 2px;
    /* Prevent descender clipping */
}

.sw-link-tour {
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80, #22c55e, #16a34a);
}

.sw-link-analytics {
    background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24, #f59e0b, #d97706);
}

.sw-link-festivals {
    background: linear-gradient(90deg, #7c3aed, #8b5cf6, #a78bfa, #8b5cf6, #7c3aed);
}

.sw-link-releases {
    background: linear-gradient(90deg, #0891b2, #06b6d4, #67e8f9, #06b6d4, #0891b2);
}

/* --- Fade Up Animation --- */
.sw-fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: swFadeUp 0.6s ease forwards;
}

@keyframes swFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Carousel Component (structure only) --- */
@media (max-width: 768px) {
    .sw-cs-carousel-col {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .sw-cs-carousel-col {
        float: right;
        width: 280px;
        margin: 0 0 1.5rem 2rem;
        shape-outside: margin-box;
    }

    .sw-cs-carousel {
        position: relative;
        width: 100%;
        border-radius: 16px;
        overflow: hidden;
        aspect-ratio: 9 / 16;
        background: #0a0a0a;
    }

    .sw-cs-slide {
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 0.8s ease;
    }

    .sw-cs-slide.active {
        opacity: 1;
    }

    .sw-cs-slide-image {
        position: absolute;
        inset: 0;
        overflow: hidden;
    }

    .sw-cs-slide-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sw-cs-slide-image::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 35%;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
        z-index: 1;
        pointer-events: none;
    }

    .sw-cs-slide-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 35%;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
        z-index: 1;
        pointer-events: none;
    }

    .sw-cs-slide-stat {
        position: absolute;
        top: 1rem;
        left: 1rem;
        z-index: 2;
        text-align: left;
    }

    .sw-cs-slide-stat .sw-stat-number {
        display: block;
        font-family: 'Roboto Condensed', sans-serif;
        font-size: clamp(2.5rem, 6vw, 3.8rem);
        font-weight: 900;
        line-height: 1;
        margin-bottom: 0.25rem;

        /* Ensure gradient applies here too */
        background: var(--sw-acc-grad, linear-gradient(135deg, #475569, #64748b, #94a3b8, #64748b, #475569));
        background-size: 200% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: sw-shimmer-h 4s linear infinite;
    }

    .sw-cs-slide-stat .sw-stat-label {
        display: block;
        font-size: 0.75rem;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .sw-cs-slide-kicker {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        z-index: 2;
        display: inline-block;
        width: fit-content;
        font-family: 'Roboto Condensed', sans-serif;
        font-size: 0.75rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: #fff;
        padding: 8px 16px;
        border-radius: 100px;
        background: var(--sw-acc-grad, linear-gradient(135deg, #475569, #64748b, #94a3b8, #64748b, #475569));
        background-size: 200% 100%;
        animation: sw-shimmer-h 4s linear infinite;
    }

    .sw-cs-hero-row::after {
        content: "";
        display: table;
        clear: both;
    }

    /* GUI Corner Elements */
    .sw-gui-corner {
        position: absolute;
        width: 20px;
        height: 20px;
        z-index: 10;
        pointer-events: none;
        border: 1.2px solid #fff;
        opacity: 0.8;
    }

    .sw-gui-corner-tr {
        top: 8px;
        right: 8px;
        border-bottom: none !important;
        border-left: none !important;
        border-top-right-radius: 12px;
    }

    .sw-gui-corner-bl {
        bottom: 8px;
        left: 8px;
        border-top: none !important;
        border-right: none !important;
        border-bottom-left-radius: 12px;
    }
}