/* === Case Study Standard Layout === */
.cs-hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 120px 0;
    position: relative;
}

.cs-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(137, 56, 159, 0.85) 0%, rgba(237, 41, 37, 0.85) 100%);
}

.cs-hero .container {
    position: relative;
    z-index: 1;
}

.cs-hero .cs-logo {
    max-width: 200px;
    margin-bottom: 32px;
}

.cs-hero h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
    max-width: 900px;
}

.cs-hero p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    line-height: 1.6;
    max-width: 800px;
}

.cs-client-info {
    background: #F9F9F9;
    padding: 48px 0;
}

.cs-client-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.cs-client-info-item h4 {
    color: #89389f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.cs-client-info-item p {
    color: #2B2B2B;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
}

.cs-client-info-item a {
    color: #2B2B2B;
    text-decoration: none;
}

.cs-client-info-item a:hover {
    color: #89389f;
}

.cs-section-white {
    background: #fff;
    padding: 80px 0;
}

.cs-section-gray {
    background: #F9F9F9;
    padding: 80px 0;
}

.cs-section-title {
    color: #2B2B2B;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
}

.cs-section-content {
    color: #424242;
    font-size: 18px;
    line-height: 1.7;
}

.cs-section-content p {
    margin-bottom: 16px;
}

.cs-challenge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-top: 40px;
}

.cs-challenge-grid img {
    width: 100%;
    border-radius: 8px;
}

.cs-solution-item {
    margin-bottom: 32px;
}

.cs-solution-item h3 {
    color: #2B2B2B;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cs-solution-item p {
    color: #424242;
    font-size: 17px;
    line-height: 1.6;
}

.cs-results-grid {
    display: grid;
    gap: 24px;
    margin-top: 40px;
}

.cs-result-item {
    background: #fff;
    padding: 28px;
    border-radius: 8px;
    border-left: 4px solid #89389f;
}

.cs-result-item h3 {
    color: #89389f;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cs-result-item p {
    color: #424242;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.cs-tags-label {
    color: #89389f;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
}

.cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.cs-tag {
    background: #fff;
    color: #2B2B2B;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #E0E0E0;
}

.cs-cta {
    background: linear-gradient(135deg, #89389f 0%, #ed2925 100%);
    padding: 80px 0;
    text-align: center;
}

.cs-cta h2 {
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cs-cta p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    margin-bottom: 32px;
}

.cs-cta-button {
    display: inline-block;
    background: #fff;
    color: #89389f;
    padding: 16px 40px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
}

.cs-cta-button:hover {
    transform: translateY(-2px);
}

/* Case study mobile overrides */
@media (max-width: 768px) {
    .cs-hero {
        padding: 80px 0;
    }

    .cs-hero h1 {
        font-size: 32px;
    }

    .cs-hero p {
        font-size: 17px;
    }

    .cs-client-info-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cs-challenge-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .cs-cta h2 {
        font-size: 32px;
    }
}

/* Case Study Responsive Styles */

/* Hide testimonials/customer feedback sections */
body section div[style*="border-left: 4px solid #89389f"],
body section div[style*="border-left: 6px solid #89389f"],
body section div[style*="border-left:4px solid #89389f"],
body section div[style*="border-left:6px solid #89389f"] {
    display: none !important;
}

/* Hide the entire testimonial section if it only contains the testimonial */
body section:has(div[style*="border-left: 4px solid #89389f"]):not(:has(h2)),
body section:has(div[style*="border-left: 6px solid #89389f"]):not(:has(h2)) {
    display: none !important;
}

/* Base responsive image handling */
body img {
    max-width: 100% !important;
}

/* Ensure containers have proper padding on all devices */
.container {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* Hero section constraints - remove full-width stretching */
body section[style*="padding: 0"] {
    background: #F9F9F9 !important;
    padding: 60px 0 !important;
}

body section[style*="padding: 0"] div {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

body section[style*="padding: 0"] div img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Mobile: reduce hero padding */
@media screen and (max-width: 768px) {
    body section[style*="padding: 0"] {
        padding: 40px 0 !important;
    }

    body section[style*="padding: 0"] div {
        padding: 0 20px !important;
    }
}

/* Tablet and below (max-width: 992px) */
@media screen and (max-width: 992px) {

    /* Adjust section padding for tablets */
    body section[style*="padding"] {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    /* Make 2-column grids single column */
    body section .container div[style*="grid-template-columns: 1fr 1fr"],
    body section .container div[style*="grid-template-columns:1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
    }

    /* Stack client info grid on tablets */
    body section .container div[style*="grid-template-columns: repeat(3, 1fr)"],
    body section .container div[style*="grid-template-columns:repeat(3,1fr)"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
    }

    /* Reduce heading sizes */
    body h1[style*="font-size"] {
        font-size: 36px !important;
    }

    body h2[style*="font-size"] {
        font-size: 28px !important;
    }

    body h3[style*="font-size"] {
        font-size: 22px !important;
    }
}

/* Mobile devices (max-width: 768px) */
@media screen and (max-width: 768px) {

    /* Container padding */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Further reduce section padding */
    body section[style*="padding"] {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    /* Keep padding: 0 sections at 0 */
    body section[style="padding: 0;"],
    body section[style*="padding: 0"] {
        padding: 0 !important;
    }

    /* Ensure all grids become flex columns */
    body section div[style*="display: grid"],
    body section div[style*="display:grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
    }

    /* Reduce all heading sizes for mobile */
    body h1,
    body h1[style*="font-size"] {
        font-size: 28px !important;
        line-height: 1.2 !important;
    }

    body h2,
    body h2[style*="font-size"] {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    body h3,
    body h3[style*="font-size"] {
        font-size: 20px !important;
    }

    body h4,
    body h4[style*="font-size"] {
        font-size: 14px !important;
    }

    /* Adjust paragraph and list font sizes */
    body p[style*="font-size: 18px"],
    body p[style*="font-size:18px"],
    body li[style*="font-size: 18px"],
    body li[style*="font-size:18px"] {
        font-size: 16px !important;
    }

    body p[style*="font-size: 20px"],
    body p[style*="font-size:20px"] {
        font-size: 18px !important;
    }

    /* Reduce logo sizes */
    body img[style*="height: 60px"],
    body img[style*="height:60px"] {
        height: 40px !important;
    }

    /* Adjust max-width containers */
    body div[style*="max-width: 900px"],
    body div[style*="max-width:900px"],
    body div[style*="max-width: 700px"],
    body div[style*="max-width:700px"] {
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Reduce padding on cards and testimonials */
    body div[style*="padding: 40px"],
    body div[style*="padding:40px"] {
        padding: 24px !important;
    }

    body div[style*="padding: 32px"],
    body div[style*="padding:32px"] {
        padding: 20px !important;
    }

    /* Adjust result cards */
    body .result-card h3,
    body div[style*="font-size: 56px"] {
        font-size: 40px !important;
    }

    /* Make service/tech tags stack better */
    body div[style*="display: flex; flex-wrap: wrap"],
    body div[style*="display:flex;flex-wrap:wrap"] {
        gap: 8px !important;
    }

    body span[style*="padding: 10px 20px"],
    body span[style*="padding:10px 20px"] {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    /* CTA button adjustments */
    body a.btn[style*="padding"],
    body a[style*="padding: 14px 32px"] {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }

    /* Testimonial adjustments */
    body div[style*="border-left: 4px solid"],
    body div[style*="border-left: 6px solid"],
    body div[style*="border-left:4px solid"],
    body div[style*="border-left:6px solid"] {
        border-left-width: 3px !important;
    }

    /* Device sections - ensure flex layout */
    body .devices-section,
    body div[style*="display: flex"][style*="justify-content: center"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 24px !important;
    }

    /* Image max-widths for devices */
    body .device-laptop,
    body img[style*="max-width: 500px"] {
        max-width: 100% !important;
    }

    body .device-mobile,
    body img[style*="max-width: 150px"] {
        max-width: 200px !important;
    }
}

/* Small mobile devices (max-width: 480px) */
@media screen and (max-width: 480px) {

    /* Tighter container padding */
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Even smaller padding */
    body section[style*="padding"] {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }

    /* Keep padding: 0 sections at 0 */
    body section[style="padding: 0;"],
    body section[style*="padding: 0"] {
        padding: 0 !important;
    }

    /* Further reduce heading sizes */
    body h1,
    body h1[style*="font-size"] {
        font-size: 24px !important;
    }

    body h2,
    body h2[style*="font-size"] {
        font-size: 20px !important;
    }

    body h3,
    body h3[style*="font-size"] {
        font-size: 18px !important;
    }

    /* Adjust max-width containers */
    body div[style*="max-width: 900px"],
    body div[style*="max-width:900px"],
    body div[style*="max-width: 700px"],
    body div[style*="max-width:700px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Reduce result card numbers */
    body .result-card h3,
    body div[style*="font-size: 56px"],
    body h3[style*="font-size: 56px"] {
        font-size: 32px !important;
    }

    /* Smaller logo */
    body img[style*="height: 60px"],
    body img[style*="height:60px"] {
        height: 32px !important;
    }

    /* Reduce paragraph font sizes further */
    body p[style*="font-size: 18px"],
    body p[style*="font-size:18px"],
    body li[style*="font-size: 18px"],
    body li[style*="font-size:18px"] {
        font-size: 15px !important;
    }
}

/* Override for max-width containers to ensure proper width */
@media screen and (max-width: 900px) {

    body div[style*="max-width: 900px"],
    body div[style*="max-width:900px"] {
        max-width: 100% !important;
    }
}

@media screen and (max-width: 700px) {

    body div[style*="max-width: 700px"],
    body div[style*="max-width:700px"] {
        max-width: 100% !important;
    }
}