.case-study-item {
    background-color: var(--gbg-color-body);
    border-radius: var(--gbg-border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0;
}

.case-study-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
    text-decoration: none;
}
a.case-study-wrapper:hover {
    border: none !important;
}

@media screen and (min-width: 768px) {
    .case-study-wrapper {
        flex-direction: row;
        gap: 24px;
    }
}

/* Image Section */
.case-study-image {
    display: none;
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--gbg-border-radius-lg);
    background-color: var(--gbg-color-grey);
}

@media screen and (min-width: 768px) {
    .case-study-image {
        display: block;
        width: 50%;
        height: auto;
        min-height: 320px;
        aspect-ratio: 5/6;
    }
}

.case-study-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Content Section */
.case-study-content {
    background-color: var(--gbg-color-light-citron);
    border: 1px solid var(--gbg-color-dark-citron);
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    margin-bottom: 1px;
    gap: 20px;
    border-radius: var(--gbg-border-radius-lg);
    aspect-ratio: 1/1;
}

@media screen and (min-width: 768px) {
    .case-study-content {
        padding: 32px;
        gap: 24px;
        aspect-ratio: unset;
    }
}

/* Header Section with Logo */
.case-study-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.case-study-logo {
    flex-basis: 50%;
}

.case-study-logo img {
    width: auto;
    height: auto;
    object-fit: contain;
    max-height: 60px;
}

.case-study-header-text {
    text-align: end;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
    border: 1px solid var(--gbg-color-primary);
    border-radius: var(--gbg-border-radius-md);
    padding: 4px 10px;
    margin: 0;
}

.case-study-header-text p {
    margin: 0;
    color: var(--gbg-color-primary);
    font-size: 14px;
    line-height: 1.25 !important;
}

@media screen and (min-width: 998px) {
    .case-study-header-text {
        padding: 8px 12px;
    }

    .case-study-header-text p {
        line-height: 1 !important;
    }
}

/* Title Section */
.case-study-title-section {
    flex: 1;
    display: flex;
    align-items: center;
}

.case-study-title-section .wp-block-heading {
    margin: 0;
    color: var(--gbg-color-primary);
    font-size: clamp(24px, 4vw, 40px) !important;
    font-weight: 500;
    line-height: 1 !important;
}

@media screen and (min-width: 998px) {
    .case-study-title-section .wp-block-heading {
        max-width: 80%;
        text-wrap: pretty;
    }
}

/* Footer Section */
.case-study-footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.case-study-footer-left {
    flex-shrink: 0;
}

.case-study-footer-left p,
.case-study-footer-right p {
    margin: 0;
    color: var(--gbg-color-primary);
}

.case-study-footer-left p {
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -3px;
    font-weight: 500;
    line-height: 1.05 !important;
}

.case-study-footer-right p {
    font-size: clamp(16px, 4vw, 20px);
    line-height: 1.25 !important;
}

/* Editor specific styles */
.editor-styles-wrapper .case-study-item {
    margin-bottom: 20px;
}

.editor-styles-wrapper .case-study-title-section .block-editor-block-list__layout {
    width: 100%;
}
