/* ==========================================================================
   residential-electrical-case-studies.css
   Modern, Innovative Dark Theme for Case Studies
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Variables & Animations
   -------------------------------------------------------------------------- */
:root {
    --primary-bg: #050607;
    --card-bg: #0f1115;
    --neon-accent: #f0b90b;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
}

@keyframes breathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* --------------------------------------------------------------------------
   1. Global Utilities
   -------------------------------------------------------------------------- */
body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.text-link {
    color: var(--neon-accent);
    text-decoration: underline;
    text-decoration-color: rgba(240, 185, 11, 0.3);
}

.text-link:hover {
    color: #fff;
    text-decoration-color: var(--neon-accent);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.section-description {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   2. Hero Section
   -------------------------------------------------------------------------- */
.case-studies-hero {
    position: relative;
    min-height: 70vh;
    /* Changed from fixed height */
    height: auto;
    /* Allow growth */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* Prevent clipping */
    padding-top: 140px;
    /* Increased to account for header + breadcrumbs space */
    padding-bottom: 4rem;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-image {
    position: absolute;
    inset: 0;
    background-image: url('../images/residential-case-studies.jpg');
    /* Ensure fallback or existence */
    background-size: cover;
    background-position: center;
    animation: breathe 25s infinite alternate ease-in-out;
    opacity: 0.6;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 6, 7, 0.85) 0%, rgba(5, 6, 7, 0.7) 50%, #050607 100%);
    z-index: 1;
}

.case-studies-hero-wrapper {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 1rem;
    /* Added spacing from breadcrumbs */
}

/* Ensure the container sits above the overlay */
.case-studies-hero .container {
    position: relative;
    z-index: 5;
}

.summary-badge {
    background: rgba(240, 185, 11, 0.15);
    color: var(--neon-accent);
    border: 1px solid rgba(240, 185, 11, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.case-studies-hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.case-studies-hero-description {
    font-size: 1.2rem;
    color: #ddd;
    line-height: 1.7;
}

/* Breadcrumbs (Consistent relative positioning) */
.breadcrumb-section {
    position: relative;
    width: 100%;
    text-align: center;
    z-index: 10;
    margin-bottom: 2rem;
}

.breadcrumb-nav {
    display: inline-flex;
    gap: 1rem;
    padding: 0.6rem 1.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    backdrop-filter: blur(8px);
    align-items: center;
}

.breadcrumb-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
    text-decoration: none;
}

.breadcrumb-nav span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.breadcrumb-nav a:hover {
    color: var(--neon-accent);
}

.breadcrumb-nav .current {
    color: var(--neon-accent);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   3. Featured Case Study (Panel Upgrade) - Spotlight Specs
   -------------------------------------------------------------------------- */
.featured-case-section {
    padding: 6rem 0;
    position: relative;
}

.spotlight-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Left Specs Card */
.specs-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    position: sticky;
    top: 100px;
    /* Floating effect */
}

.specs-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.specs-header h3 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.period-badge {
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.spec-label {
    color: #888;
}

.spec-value {
    color: #eee;
    text-align: right;
    max-width: 60%;
    font-weight: 500;
}

.spec-item.highlight {
    background: rgba(240, 185, 11, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(240, 185, 11, 0.2);
    margin-top: 1.5rem;
}

.spec-item.highlight .spec-value {
    color: var(--neon-accent);
    font-weight: 700;
}

.image-card {
    background: linear-gradient(135deg, #1a1e26 0%, #0f1115 100%);
    border-radius: 20px;
    height: 200px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s infinite ease-in-out;
}

/* Right Content */
.content-subtitle {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--neon-accent);
    padding-left: 1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.result-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.3s;
}

.result-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
}

.result-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.result-box h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.result-box p {
    color: #aaa;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.testimonial-card {
    background: var(--neon-accent);
    color: #000;
    padding: 3rem;
    border-radius: 24px;
    position: relative;
}

.quote-mark {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 6rem;
    opacity: 0.2;
    line-height: 1;
    font-family: serif;
}

.testimonial-card blockquote {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    margin-bottom: 1.5rem;
}

.testimonial-card cite {
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   4. Success Story (Rewiring) - Split Layout
   -------------------------------------------------------------------------- */
.success-story-section {
    padding: 6rem 0;
    background: #0b0d10;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.story-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.placeholder-wide {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #1e222b 0%, #111418 100%);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ph-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #555;
}

.placeholder-wide p {
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
}

.story-chapter {
    margin-bottom: 2rem;
}

.story-chapter h3 {
    color: var(--neon-accent);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.story-chapter p {
    color: #ccc;
    line-height: 1.6;
}

.testimonial-simple {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    font-style: italic;
    color: #888;
}

.testimonial-simple cite {
    display: block;
    margin-top: 0.5rem;
    color: #fff;
    font-style: normal;
    font-weight: 600;
}

.story-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.metric-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.metric-card.big-glow {
    box-shadow: 0 0 30px rgba(240, 185, 11, 0.1);
    border-color: rgba(240, 185, 11, 0.3);
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.metric-lbl {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   5. Hero Quote (Consistent with Residential Theme)
   -------------------------------------------------------------------------- */
.hero-quote {
    padding: 5rem 0;
    background: var(--neon-accent);
    /* Yellow BG per user's preference */
    color: #000;
}

.hero-quote-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-quote-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 1rem;
}

.hero-quote-description {
    font-size: 1.1rem;
    color: #111;
    margin-bottom: 2rem;
    font-weight: 500;
}

.btn-outline {
    border: 2px solid #000;
    color: #000;
    padding: 1rem 2.5rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #000;
    color: var(--neon-accent);
    border-color: #000;
}

/* --------------------------------------------------------------------------
   6. Additional Case Studies (Hover Grid)
   -------------------------------------------------------------------------- */
.additional-case-studies {
    padding: 6rem 0;
}

.mini-case-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mini-case-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.mini-case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon-header {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.mini-case-card h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.mini-case-card p {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 2rem;
}

.card-footer {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.badg-mini {
    background: rgba(255, 255, 255, 0.05);
    color: var(--neon-accent);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. Contact Section
   -------------------------------------------------------------------------- */
.contact {
    padding: 6rem 0;
    background: #050607;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    background: #0f1115;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    margin-top: 4rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.contact-info {
    padding: 4rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    position: relative;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--neon-accent);
}

.contact-subtitle {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 3rem;
    font-weight: 700;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(240, 185, 11, 0.1);
    color: var(--neon-accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.contact-details strong {
    display: block;
    color: #fff;
    margin-bottom: 0.3rem;
}

.contact-details span,
.contact-details a {
    color: #999;
}

.contact-form {
    padding: 4rem;
}

/* --------------------------------------------------------------------------
   8. Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .spotlight-grid {
        grid-template-columns: 300px 1fr;
        gap: 2rem;
    }

    .mini-case-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .spotlight-grid {
        grid-template-columns: 1fr;
    }

    .specs-card {
        position: static;
        margin-bottom: 2rem;
    }

    .story-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .story-layout .story-narrative {
        order: 1;
    }

    .story-layout .story-metrics {
        order: 2;
    }

    .hero-quote-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-quote-actions {
        display: flex;
        justify-content: center;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .contact-info,
    .contact-form {
        padding: 2rem;
    }

    .mini-case-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .case-studies-hero-title {
        font-size: 2.8rem;
    }
}

/* ==========================================================================
   9. New Layout Additions (User Requested)
   ========================================================================== */

/* Hero Bridges */
.silo-bridge {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 2rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    background: rgba(240, 185, 11, 0.1);
    border: 1px solid rgba(240, 185, 11, 0.2);
    display: inline-block;
    backdrop-filter: blur(10px);
}

.silo-bridge a {
    color: var(--neon-accent);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--neon-accent);
    padding-bottom: 1px;
    transition: all 0.3s;
}

.silo-bridge a:hover {
    color: #fff;
    border-color: #fff;
}

.local-coverage {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-style: italic;
}

.trust-line {
    font-size: 1rem;
    font-weight: 500;
    color: #4ade80;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.trust-line::before {
    content: '✓';
    font-weight: 900;
    background: rgba(74, 222, 128, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Case Types Section */
.case-types {
    padding: 6rem 0;
    background: #0b0d10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.case-types h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 3rem;
    font-weight: 700;
    padding: 0 1rem;
}

.case-types ul {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    /* Improved Responsive Grid */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0 1.5rem;
}

.case-types li {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.case-types li::before {
    content: '⚡';
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(240, 185, 11, 0.4));
    flex-shrink: 0;
}

.case-types li:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(240, 185, 11, 0.3);
    transform: translateX(5px);
}

/* Case Process Section */
.case-process {
    padding: 6rem 0;
    background: var(--bg-card);
}

.case-process h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.case-process ol {
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    margin: 0;
    list-style: none;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    counter-reset: process-counter;
    /* Initialize counter */
    flex-wrap: wrap;
}

.case-process li {
    flex: 1;
    min-width: 200px;
    background: rgba(240, 185, 11, 0.05);
    border: 1px solid rgba(240, 185, 11, 0.1);
    padding: 2rem;
    border-radius: 16px;
    color: #ddd;
    position: relative;
    text-align: center;
    counter-increment: process-counter;
    transition: all 0.3s;
}

.case-process li:hover {
    background: rgba(240, 185, 11, 0.1);
    transform: translateY(-5px);
}

.case-process li::before {
    content: counter(process-counter);
    display: block;
    width: 40px;
    height: 40px;
    background: var(--neon-accent);
    color: #000;
    font-weight: 800;
    border-radius: 50%;
    line-height: 40px;
    margin: 0 auto 1rem;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(240, 185, 11, 0.4);
}

/* Mid-Page CTA */
.mid-case-cta {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--card-bg) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.mid-case-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(240, 185, 11, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.mid-case-cta h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.mid-case-cta p {
    color: #aaa;
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

/* Internal Bridges */
.local-seo,
.experience-signal {
    padding: 3rem 0;
    text-align: center;
    background: #050607;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.local-seo p,
.experience-signal p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ccc;
    padding: 0 1.5rem;
}

.experience-signal {
    background: #0b0d10;
    padding: 4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.experience-signal p {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 500;
}

@media (max-width: 768px) {
    .case-process ol {
        flex-direction: column;
        gap: 1.5rem;
    }

    .case-process li {
        width: 100%;
        min-width: auto;
    }

    .mid-case-cta h2,
    .case-types h2,
    .case-process h2 {
        font-size: 2rem;
    }

    .case-studies-hero-title {
        font-size: 2.2rem;
        /* Even smaller for mobile */
    }
}