/* DM Serif Display Font Face Declarations */
@font-face {
    font-family: 'DMSerifDisplay';
    src: url('/img/fonts/DMSerifDisplay-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Override gray background from main.css */
body, html, main {
    background: white !important;
    overflow-x: hidden !important;
}

/* Prevent horizontal scrolling on all sections */
section {
    overflow-x: hidden !important;
}

/* Case Studies Hero Section */
.case-studies-hero {
    background: linear-gradient(to bottom, #00843e 0%, #00843e 40%, #007f79 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 120px 20px 80px;
}

.case-studies-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.case-studies-hero-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-align: center;
}

.case-studies-hero-title {
    font-family: 'DMSerifDisplay', serif;
    font-size: 5rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    line-height: 1.1;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.case-studies-hero-subtitle {
    font-size: 1.8rem;
    line-height: 1.5;
    color: white;
    opacity: 0.95;
    max-width: 900px;
    margin: 0 auto;
    font-weight: 400;
}

/* Case Studies Grid Section */
.case-studies-grid-section {
    padding: 100px 20px;
    background: white;
    position: relative;
}

.case-studies-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

/* Case Study Card */
.case-study-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 132, 62, 0.1);
}

.case-study-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0, 132, 62, 0.2);
    border-color: rgba(0, 132, 62, 0.3);
}

/* Case Study Image */
.case-study-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #00843e 0%, #007f79 100%);
}

.case-study-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

.case-study-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-study-card:hover .case-study-image img {
    transform: scale(1.08);
}

/* Badge */
.case-study-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 132, 62, 0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.case-study-badge.pdf-badge {
    background: rgba(234, 90, 61, 0.95);
}

/* Case Study Content */
.case-study-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: white;
}

.case-study-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.case-study-category {
    display: inline-block;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #00843e;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-study-type {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.case-study-type svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.case-study-title {
    font-family: 'DMSerifDisplay', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a3d3e;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.case-study-description {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0 0 30px 0;
    flex: 1;
}

/* Highlights */
.case-study-highlights {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
    border-radius: 15px;
    border-left: 5px solid #00843e;
    position: relative;
}

.case-study-highlights::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 132, 62, 0.05), transparent);
    pointer-events: none;
    border-radius: 15px;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    color: #1a3d3e;
    font-size: 1.05rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.highlight-item svg {
    flex-shrink: 0;
    color: #00843e;
    margin-top: 2px;
}

/* CTA Button */
.case-study-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffd100;
    color: #0d3542;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
    letter-spacing: 0.5px;
}

.case-study-cta:hover {
    background: #e6bc00;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 209, 0, 0.5);
    color: #0d3542;
}

.case-study-cta svg {
    transition: transform 0.3s ease;
}

.case-study-cta:hover svg {
    transform: translateX(5px);
}

/* PDF Download specific styling */
.case-study-card[data-type="pdf"] .case-study-cta {
    background: #ea5a3d;
    color: white;
    box-shadow: 0 4px 15px rgba(234, 90, 61, 0.3);
}

.case-study-card[data-type="pdf"] .case-study-cta:hover {
    background: #d84a2d;
    box-shadow: 0 6px 25px rgba(234, 90, 61, 0.5);
    color: white;
}

/* Bottom CTA Section */
.case-studies-cta-section {
    background: linear-gradient(to bottom, #00843e 0%, #007f79 100%);
    padding: 100px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.case-studies-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.case-studies-cta-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.case-studies-cta-title {
    font-family: 'DMSerifDisplay', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    line-height: 1.2;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.case-studies-cta-description {
    font-size: 1.5rem;
    line-height: 1.6;
    margin: 0 0 50px 0;
    color: white;
    opacity: 0.95;
}

.case-studies-cta-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-secondary {
    display: inline-block;
    padding: 18px 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.btn-cta-primary {
    background: #ffd100;
    color: #0d3542;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
}

.btn-cta-primary:hover {
    background: #e6bc00;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 209, 0, 0.5);
    color: #0d3542;
}

.btn-cta-secondary {
    background: transparent;
    color: white;
    border: 3px solid white;
}

.btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .case-studies-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .case-study-image {
        height: 300px;
    }
}

@media (max-width: 1024px) {
    .case-studies-hero {
        min-height: 50vh;
        padding: 100px 20px 70px;
    }
    
    .case-studies-hero-title {
        font-size: 3.5rem;
    }
    
    .case-studies-hero-subtitle {
        font-size: 1.4rem;
    }
    
    .case-studies-grid-section {
        padding: 80px 20px;
    }
    
    .case-studies-container {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .case-studies-cta-section {
        padding: 80px 20px;
    }
    
    .case-studies-cta-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .case-studies-hero {
        padding: 80px 20px 60px;
    }
    
    .case-studies-hero-title {
        font-size: 2.8rem;
    }
    
    .case-studies-hero-subtitle {
        font-size: 1.2rem;
    }
    
    .case-studies-grid-section {
        padding: 60px 20px;
    }
    
    .case-study-image {
        height: 240px;
    }
    
    .case-study-content {
        padding: 30px;
    }
    
    .case-study-title {
        font-size: 1.8rem;
    }
    
    .case-study-description {
        font-size: 1rem;
    }
    
    .case-studies-cta-section {
        padding: 60px 20px;
    }
    
    .case-studies-cta-title {
        font-size: 2.2rem;
    }
    
    .case-studies-cta-description {
        font-size: 1.2rem;
    }
    
    .case-studies-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .case-studies-hero-title {
        font-size: 2.2rem;
    }
    
    .case-studies-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .case-study-image {
        height: 200px;
    }
    
    .case-study-content {
        padding: 25px;
    }
    
    .case-study-title {
        font-size: 1.6rem;
    }
    
    .case-study-description {
        font-size: 0.95rem;
    }
    
    .case-study-highlights {
        padding: 20px;
    }
    
    .highlight-item {
        font-size: 0.95rem;
    }
    
    .case-studies-cta-title {
        font-size: 1.8rem;
    }
    
    .case-studies-cta-description {
        font-size: 1.1rem;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary {
        padding: 16px 32px;
        font-size: 1.1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .case-study-card,
    .case-study-image img,
    .case-study-cta,
    .btn-cta-primary,
    .btn-cta-secondary {
        transition: none;
    }
    
    .case-study-card:hover {
        transform: none;
    }
    
    .case-study-card:hover .case-study-image img {
        transform: none;
    }
}

/* Focus States for Accessibility */
.case-study-cta:focus,
.btn-cta-primary:focus,
.btn-cta-secondary:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .case-studies-hero {
        background: white;
        color: black;
        padding: 20px;
        min-height: auto;
    }
    
    .case-studies-hero::before {
        display: none;
    }
    
    .case-study-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 2px solid #ddd;
    }
    
    .case-studies-cta-section {
        display: none;
    }
    
    .case-study-cta {
        display: none;
    }
}

/* Loading State Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.case-study-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
