/* Base Mobile Styles */
.case-studies-section {
    background-color: var(--color-bg);
    color: var(--color-white);
    flex: none;
    order: 0;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    /* padding: 0 20px; /* Add consistent mobile padding if needed, or rely on page-content */
}

.fit-contain {
    object-fit: contain;
    width: 100%;
    height: auto;
}

.fit-cover {
    object-fit: cover;
}

.case-studies-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0; /* Consider 0 20px for mobile if not handled by parent */
    gap: 100px;
}

.case-study-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 350px;
    height: auto;
    min-height: unset;
    align-items: stretch;
    position: relative;
    background: transparent; /* Remove background color */
    gap: 20px; /* Add gap between image and content */
    text-decoration: none; /* Remove link underline */
    color: inherit; /* Inherit text color */
    cursor: pointer;
}

.case-study-item:hover {
    transform: translateY(-5px);
}

.case-study-item:hover .case-study-image {
    transform: scale(1.05);
}

/* Remove background colors from case study items */
.case-study-item:nth-child(1),
.case-study-item:nth-child(2),
.case-study-item:nth-child(3) {
    background-color: transparent;
}

.case-study-image-container {
    position: relative;
    width: 100%;
    height: 350px; /* Base height for mobile */
    aspect-ratio: 1; /* Maintain square aspect ratio on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border-radius: 10px;
}

.case-study-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.case-study-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: 75px;
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
}

.case-studies-section h2.case-study-title { /* This is the main section title */
    font-family: 'Trap', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3.75vw, 36px); /* clamp is good for responsiveness */
    line-height: 120%;
    letter-spacing: -1px;
    color: var(--color-white);
    text-align: left; /* Or center for mobile if preferred */
    width: 100%; /* Ensure it takes full width if text-align is used */
    padding: 0 20px; /* Add padding if .case-studies-container doesn't have it */
}

.case-study-item h3.case-study-title { /* This is the title within each item */
    width: 100%;
    height: 25px;
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 18px;
    line-height: 140%;
    color: #FFFFFF;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
    margin: 0;
}

.case-study-description {
    width: 100%;
    height: 50px;
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 18px;
    line-height: 140%;
    color: #FFFFFF;
    opacity: 0.5;
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
    margin: 0;
}

/* Case Study Tags */
.case-study-tags {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 10px;
    position: absolute;
    flex-wrap: wrap;
    justify-content: flex-end;
    right: 10px;
    top: 10px;
}

.case-study-tag {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 8px 14px;
    gap: 10px;
    height: 36px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 100px;
    flex: none;
    flex-grow: 0;
    
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    display: flex;
    align-items: flex-end;
    text-align: center;
    color: #FFFFFF;
    opacity: 0.8;
}


/* Responsive scaling from 425px and up */
@media (min-width: 425px) {
    .case-study-item {
        max-width: min(1200px, 100vw - 40px); /* Scale with viewport, max 1200px */
    }
    
    .case-study-image-container {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 1; /* 2:1 aspect ratio for larger screens */
        max-width: 1200px;
        max-height: 600px;
    }
    
    .case-study-image {
        position: static;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }
}

/* Large Desktop Styles */
@media (min-width: 1240px) {
    .case-studies-container {
        display: flex;
        flex-direction: column;
        gap: 60px;
        align-items: center;
    }

    .case-study-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 20px;
        width: 1200px;
        height: 695px;
        flex: none;
        order: 0;
        flex-grow: 0;
        max-width: 1200px;
    }

    .case-study-image-container {
        width: 1200px;
        height: 600px;
        aspect-ratio: 2 / 1;
        border-radius: 10px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
        position: relative;
    }

    .case-study-image {
        position: absolute;
        width: 1200px;
        height: 600px;
        left: calc(50% - 1200px/2);
        top: calc(50% - 600px/2);
        border-radius: 10px;
    }

    .case-study-content {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        padding: 0px;
        width: 1200px;
        height: 75px;
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
        gap: 0;
    }

    .case-study-content > div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        width: 600px;
        height: 75px;
        flex: none;
        flex-grow: 1;
    }

    .case-study-item h3.case-study-title {
        width: 600px;
        height: 25px;
        font-weight: 500;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    .case-study-description {
        width: 600px;
        height: 50px;
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
    }

    .case-study-tags {
        right: 20px;
        top: 20px;
    }
}

/* Work Detail Page Header Tags */
.work-tags-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 10px;
    flex-wrap: wrap;
}

.work-tag-header {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 14px;
    gap: 10px;
    height: 36px;
    background: none;
    border: 1px solid var(--color-white-40);
    border-radius: 100px;
    flex: none;
    flex-grow: 0;
    
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    text-align: center;
    color: #FFFFFF;
    opacity: 0.8;
}

/* Next Case Section */
.next-case-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
    
    width: 100%;
    
    margin-left: auto;
    margin-right: auto;
    
}

.next-case-title {
    font-family: 'Trap', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3.75vw, 36px);
    line-height: 120%;
    letter-spacing: -1px;
    color: var(--color-white);
    text-align: center;
    margin: 0;
}

.next-case-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    width: 100%;
    
}

.next-case-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    transition: transform 0.3s ease;
}

.next-case-item:hover {
    transform: translateY(-5px);
}

.next-case-image-container {
    position: relative;
    width: 100%;
    
   
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border-radius: 10px;
    aspect-ratio: 1/1;
}

.next-case-image-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.next-case-item:hover .next-case-image-container img {
    transform: scale(1.05);
}

.next-case-tags {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 10px;
    position: absolute;
    right: 10px;
    top: 10px;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
}

.next-case-tag {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 14px;
    gap: 10px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    flex: none;
    flex-grow: 0;
    
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    text-align: center;
    color: #FFFFFF;
    opacity: 0.8;
}

.next-case-content {
    display: flex;
    flex-direction: column;
   
    width: 100%;
}

.next-case-content h3 {
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 18px;
    line-height: 140%;
    color: #FFFFFF;
    
    margin: 0;
}

.next-case-content p {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    font-size: 18px;
    line-height: 140%;
    color: #FFFFFF;
    opacity: 0.5;
    
    margin-top: 0px;
}

/* Responsive adjustments for Next Case */




@media (min-width: 1024px) {
    .next-case-section {
        padding: 0;
    }
    
    .next-case-image-container {
        
        aspect-ratio: 2 / 1;
    }
    
    .next-case-tags {
        right: 20px;
        top: 20px;
    }
}