/* Case Study Layout Styles - Aligned with ibute branding */

/* Hero Section Styles */
.hero-card {
    position: relative;
    z-index: 1;
}

/* Custom Spacing Class */
.case-study-main-spacing {
    padding-top: 70px !important;
}

@media (min-width: 1024px) {
    .case-study-main-spacing {
        padding-top: 70px !important;
    }
}

/* Two-Column Layout: TOC Left, Content Right */
.case-study-layout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.case-study-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar Wrapper - Sticky container for TOC and CTA */
.case-study-content-wrapper>.case-study-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for the sticky sidebar */
.case-study-content-wrapper>.case-study-sidebar::-webkit-scrollbar {
    width: 6px;
}

.case-study-content-wrapper>.case-study-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.case-study-content-wrapper>.case-study-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.case-study-content-wrapper>.case-study-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Table of Contents */
.case-study-toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
    height: auto;
    overflow: visible;
}

.case-study-toc .case-study-toc-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

.case-study-toc .case-study-toc-links {
    max-height: none;
    overflow-y: visible;
}

.case-study-toc .case-study-toc-link {
    display: block;
    padding: 0.625rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.case-study-toc .case-study-toc-link:hover {
    color: #0048ff;
    background: rgba(0, 72, 255, 0.05);
    border-left-color: #0048ff;
    padding-left: 1rem;
}

.case-study-toc .case-study-toc-link.active {
    color: #0048ff;
    font-weight: 600;
    background: rgba(0, 72, 255, 0.08);
    border-left-color: #0048ff;
    padding-left: 1rem;
}

/* Case Study Main Content */
.case-study-main-content {
    max-width: 900px;
}

/* Section Spacing */
.case-study-main-content section {
    margin-bottom: 4rem;
}

/* Typography */
.case-study-main-content h2 {
    font-size: 2rem;
    font-weight: 400 !important;
    color: #01023b;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Aeonik', sans-serif;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.case-study-main-content h2:first-of-type {
    margin-top: 0;
}

.case-study-main-content h3 {
    font-size: 1.5rem;
    font-weight: 400 !important;
    color: #01023b;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-family: 'Aeonik', sans-serif;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.case-study-main-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #01023b;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-family: 'Aeonik', sans-serif;
}

.case-study-main-content p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.25rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.case-study-main-content ul,
.case-study-main-content ol {
    margin-bottom: 1.75rem;
    padding-left: 1.75rem;
}

.case-study-main-content li {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 0.75rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.case-study-main-content strong {
    font-weight: 600;
    color: #01023b;
}

/* Special Content Boxes */
.challenge-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 1.75rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}

.insight-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #0048ff;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 72, 255, 0.1);
}

.result-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #00c64d;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 198, 77, 0.1);
}

.innovation-box {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-left: 4px solid #8b5cf6;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.1);
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.comparison-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comparison-card ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.comparison-card li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* Challenge Cards */
.challenge-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.challenge-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Testing Grid */
.testing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.testing-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
}

.testing-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #01023b;
    margin-bottom: 1rem;
    margin-top: 0;
}

.testing-card ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Tech Stack Grid */
.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tech-category {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tech-category h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0048ff;
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: 'Aeonik', sans-serif;
}

.tech-category ul {
    margin: 0;
    padding-left: 1.25rem;
}

.tech-category li {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

/* Value Cards */
.value-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #0048ff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.value-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #01023b;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.value-card p {
    margin-bottom: 0.75rem;
}

.value-card ul {
    margin-bottom: 0;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.achievement-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.achievement-item:hover {
    background: #f9fafb;
    border-color: #00c64d;
}

.achievement-item i {
    color: #00c64d;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.achievement-item span {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

/* Testimonial Card */
.testimonial-card {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 2px solid #e9d5ff;
    border-radius: 1rem;
    padding: 2.5rem;
    margin: 2rem 0;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.1);
}

.quote-icon {
    font-size: 4rem;
    color: #8b5cf6;
    opacity: 0.2;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #4b5563;
    font-style: italic;
    margin: 0 0 1.5rem 0;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    text-align: right;
    margin-top: 1.5rem;
}

.author-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #01023b;
    margin-bottom: 0.25rem;
}

.author-title {
    font-size: 0.9375rem;
    color: #6b7280;
}

/* Lesson Cards */
.lesson-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #02C8F5;
    border-radius: 0.75rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.lesson-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #01023b;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Final CTA Box */
.final-cta-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 3px solid #0048ff;
    padding: 2.5rem;
    margin: 3rem 0;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(0, 72, 255, 0.15);
}

.final-cta-box h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #01023b;
    margin-top: 0;
    margin-bottom: 1.25rem;
    text-align: center;
}

.final-cta-box p {
    text-align: center;
}

.final-cta-box ul,
.final-cta-box ol {
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Related Content Grid */
.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.related-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.related-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #01023b;
    margin-top: 0;
    margin-bottom: 1rem;
}

.related-card ul {
    margin: 0;
    padding-left: 1.25rem;
}

.related-card li {
    margin-bottom: 0.75rem;
}

.related-card a {
    color: #0048ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-card a:hover {
    color: #0040e6;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .case-study-content-wrapper {
        grid-template-columns: 1fr;
    }

    .case-study-content-wrapper>.case-study-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .case-study-toc {
        margin-bottom: 2rem;
    }

    .comparison-grid,
    .testing-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .case-study-layout-container {
        padding: 0 1rem;
    }

    .case-study-main-content h2 {
        font-size: 1.75rem;
        margin-top: 2.5rem;
    }

    .case-study-main-content h3 {
        font-size: 1.375rem;
        margin-top: 2rem;
    }

    .case-study-main-content h4 {
        font-size: 1.125rem;
    }

    .case-study-main-content p,
    .case-study-main-content li {
        font-size: 1rem;
        line-height: 1.75;
    }

    .tech-stack-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        padding: 1.75rem;
    }

    .quote-icon {
        font-size: 3rem;
    }
}