/* Case Study Specific Styles */

.case-study {
    padding-top: 60px;
}

.case-study-section {
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Force consistent spacing between ALL sections */
.case-study-section + .case-study-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove any extra margins from content blocks */
.case-study-section > * {
    margin-top: 0 !important;
}

.case-study-section > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.case-study-section > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove WordPress block spacing */
.case-study-section .wp-block-generateblocks-container,
.case-study-section figure,
.case-study-section .gb-block-image {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure project details section has no extra spacing */
.project-details {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.case-study-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem 2rem;
    align-items: center;
    background-color: #ffffff;
}

.case-study-hero-simple {
    background-color: #ffffff;
    padding: 2rem 0 0.5rem;
    text-align: center;
}

.case-study-hero-simple h1 {
    font-size: 36px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 1rem;
    font-family: 'Merriweather Sans', sans-serif;
}

.case-study-hero-simple .subtitle {
    font-size: 18px;
    color: #565656;
    margin-bottom: 0;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.case-study-hero .hero-content {
    max-width: none;
}

.case-study-hero h1 {
    font-size: 48px;
    margin-bottom: 1.5rem;
    color: #000000;
}

.subtitle {
    font-size: 24px;
    color: #565656;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    font-size: 18px;
    color: #565656;
}

.meta-item strong {
    color: #000000;
}

.hero-image {
    text-align: center;
}

/* Project details grid */
.project-details .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    text-align: center;
    margin: 0.5rem 0;
}

.detail-item h4 {
    margin-bottom: 0.5rem;
    color: #000000;
    font-size: 16px;
}

.detail-item p {
    color: #565656;
    margin-bottom: 0;
    font-size: 14px;
}

/* Case study images */
.case-study-image {
    margin: 0.25rem 0;
    text-align: center;
}

.case-study-image.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.case-study-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.case-study-image figcaption {
    font-size: 14px;
    color: #888;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Consistent text coloring */
.case-study-section h2 {
    color: #000000;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 28px;
    margin-bottom: 1.5rem;
    margin-top: 1rem !important;
    padding-top: 0 !important;
}

.case-study-section h3 {
    color: #000000;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 22px;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.case-study-section p {
    color: #565656;
    font-size: 16px !important;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.case-study-section ul li {
    color: #565656;
    font-size: 16px !important;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.case-study-section ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.case-study-section ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Override any inherited styles */
.case-study-section {
    font-size: 16px !important;
}

.case-study-section * {
    font-size: 16px !important;
}

/* Headings should keep their specific sizes */
.case-study-section h1 {
    font-size: 36px !important;
}

.case-study-section h2 {
    font-size: 28px !important;
}

.case-study-section h3 {
    font-size: 22px !important;
}

.case-study-section h4 {
    font-size: 18px !important;
}

/* Specific overrides for all text elements */
.case-study-section ul {
    font-size: 16px;
}

.case-study-section ol {
    font-size: 16px;
}

.case-study-section ol li {
    color: #565656;
    font-size: 16px !important;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.case-study-section a {
    color: #0693e3;
    text-decoration: underline;
}

.case-study-section a:hover {
    text-decoration: underline;
    color: #0570b8;
}

/* Responsive font sizes */
/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .case-study-section {
        font-size: 18px !important;
    }

    .case-study-section * {
        font-size: 18px !important;
    }

    .case-study-section h1 {
        font-size: 42px !important;
    }

    .case-study-section h2 {
        font-size: 32px !important;
    }

    .case-study-section h3 {
        font-size: 26px !important;
    }

    .case-study-section h4 {
        font-size: 20px !important;
    }

    .case-study-section p {
        font-size: 18px !important;
    }

    .case-study-section ul li {
        font-size: 18px !important;
    }

    .case-study-section ol li {
        font-size: 18px !important;
    }

    .case-study-hero-simple h1 {
        font-size: 42px !important;
    }

    .case-study-hero-simple .subtitle {
        font-size: 20px !important;
    }
}

/* Extra large screens (1400px and up) */
@media (min-width: 1400px) {
    .case-study-section {
        font-size: 20px !important;
    }

    .case-study-section * {
        font-size: 20px !important;
    }

    .case-study-section h1 {
        font-size: 48px !important;
    }

    .case-study-section h2 {
        font-size: 36px !important;
    }

    .case-study-section h3 {
        font-size: 28px !important;
    }

    .case-study-section h4 {
        font-size: 22px !important;
    }

    .case-study-section p {
        font-size: 20px !important;
    }

    .case-study-section ul li {
        font-size: 20px !important;
    }

    .case-study-section ol li {
        font-size: 20px !important;
    }

    .case-study-hero-simple h1 {
        font-size: 48px !important;
    }

    .case-study-hero-simple .subtitle {
        font-size: 22px !important;
    }
}

/* Tablet and medium screens */
@media (max-width: 768px) {
    .case-study-section {
        font-size: 16px !important;
        padding: 0 1rem;
    }

    .case-study-section * {
        font-size: 16px !important;
    }

    .case-study-section h1 {
        font-size: 28px !important;
    }

    .case-study-section h2 {
        font-size: 24px !important;
    }

    .case-study-section h3 {
        font-size: 20px !important;
    }

    .case-study-section h4 {
        font-size: 18px !important;
    }

    .case-study-section p {
        font-size: 16px !important;
    }

    /* Better mobile list styling */
    .case-study-section ul {
        padding-left: 1.5rem !important;
        margin: 1rem 0 !important;
    }

    .case-study-section ul li {
        font-size: 16px !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.5 !important;
    }

    .target-groups li {
        font-size: 16px !important;
        padding: 0.75rem 0 !important;
    }

    .case-study-section ol li {
        font-size: 14px !important;
    }

    .case-study-hero-simple h1 {
        font-size: 28px !important;
    }

    .case-study-hero-simple .subtitle {
        font-size: 16px !important;
    }
}

.hero-image img {
    width: 350px;
    height: 400px;
    object-fit: cover;
    object-position: center top;
    border-radius: 20px;
    border: 4px solid #67e0ff;
    box-shadow: 0 12px 32px rgba(103, 224, 255, 0.4),
                0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image img:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(103, 224, 255, 0.5),
                0 8px 24px rgba(0, 0, 0, 0.15);
}

.case-study-section {
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.case-study-section h2 {
    font-size: 36px;
    margin-bottom: 2rem;
    color: #000000;
    border-bottom: 2px solid #67e0ff;
    padding-bottom: 1rem;
}

.case-study-section p {
    font-size: 20px;
    line-height: 1.7;
    color: #565656;
    margin-bottom: 2rem;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.research-item {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid #67e0ff;
}

.research-item h3 {
    font-size: 24px;
    margin-bottom: 1rem;
    color: #000000;
}

.research-item p {
    font-size: 18px;
    color: #565656;
    margin-bottom: 0;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-top: 3px solid #67e0ff;
}

.feature h3 {
    font-size: 22px;
    margin-bottom: 1rem;
    color: #000000;
}

.feature p {
    font-size: 18px;
    color: #565656;
    margin-bottom: 0;
    line-height: 1.6;
}

.impact-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    padding: 3rem 0;
}

.metric {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.metric-number {
    display: block;
    font-size: 48px;
    font-weight: 500;
    color: #67e0ff;
    font-family: 'Merriweather Sans', sans-serif;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 18px;
    color: #565656;
    font-family: 'Merriweather Sans', sans-serif;
}

.case-study-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    border-top: 1px solid #e0e0e0;
}

.nav-button {
    display: inline-block;
    background-color: #000000;
    color: #ffffff !important;
    padding: 16px 32px;
    text-decoration: none !important;
    border-radius: 9999px;
    font-family: 'Merriweather Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.case-study-nav .nav-button {
    color: #ffffff !important;
    text-decoration: none !important;
}

.case-study-nav .nav-button:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

.nav-button:hover {
    background-color: #67e0ff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Responsive Design for Case Studies */
@media (max-width: 768px) {
    .case-study-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .case-study-hero h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .case-study-section {
        padding: 2rem 1rem;
    }
    
    .case-study-section h2 {
        font-size: 28px;
    }
    
    .case-study-section p {
        font-size: 18px;
    }
    
    .research-grid,
    .features-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .impact-metrics {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .metric-number {
        font-size: 36px;
    }
    
    .case-study-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 2rem 1rem;
    }
    
    .nav-button {
        width: 100%;
        text-align: center;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .case-study-hero h1 {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .meta-item {
        font-size: 16px;
    }
    
    .research-item,
    .feature {
        padding: 1.5rem;
    }
    
    .research-item h3,
    .feature h3 {
        font-size: 20px;
    }
    
    .research-item p,
    .feature p {
        font-size: 16px;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: #67e0ff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.scroll-to-top::before {
    content: '↑';
    font-weight: bold;
}

/* Mobile specific styling for scroll-to-top */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}