.group-conception {
    position: relative;
    width: 100%;
    min-height: 100dvh;
}

.group-conception__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.group-conception__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.group-conception__main {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    background: #DCB77C;
}

.group-conception__overlay {
    position: absolute;
    inset: 0;
    background: rgba(220, 183, 124, 0.3);
    z-index: 2;
}

.group-conception__title {
    position: relative;
    padding-top: clamp(2rem, 5dvh, 4rem);
    text-align: center;
    color: #ffffff;
    font-family: 'Alkatra', cursive;
    font-size: clamp(40px, 6vw, 114px);
    font-weight: 600;
    letter-spacing: 1.2px;
    z-index: 3;
    opacity: 0;
}

/* Updated cards container */
.group-conception__cards {
    position: relative;
    display: flex;
    justify-content: center;
    gap: clamp(2rem, 3vw, 4rem);
    padding: clamp(2rem, 6dvh, 6rem) clamp(4rem, 8vw, 8rem); /* Consistent outer margins */
    z-index: 3;
    max-width: 1920px;
    margin: 0 auto;
}

/* Updated card styles */
.group-conception__card {
    flex: 1;
    max-width: 546px;
    min-width: 280px;
    /* Remove aspect-ratio to allow dynamic height */
    background: rgba(32, 124, 138, 0.65);
    padding: clamp(1.5rem, 3vw, 3rem);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2rem;
    height: auto; /* Allow content to determine height */
    min-height: min-content; /* Ensure minimum height based on content */
}

.group-conception__card-title {
    color: #ffffff;
    font-family: 'Alkatra', cursive;
    font-size: clamp(18px, 2vw, 30px);
    font-weight: 600;
    letter-spacing: 1.2px;
}

.group-conception__card-text {
    color: #ffffff;
    font-family: 'Inter Tight', sans-serif;
    font-size: clamp(16px, 1.5vw, 24px);
    font-weight: 600;
    letter-spacing: 1.2px;
    line-height: 1.6;
    overflow-wrap: break-word; /* Add this */
    word-wrap: break-word; /* Add this */
    -webkit-hyphens: auto; /* Safari fix */
    hyphens: auto;
    max-height: calc(100% - 4rem); /* Account for title and gaps */
    overflow: hidden; /* Add this */
}

/* Tablet breakpoint */
@media screen and (max-width: 1024px) {
    .group-conception__cards {
        padding: 2rem clamp(2rem, 5vw, 4rem);
        gap: 2rem;
    }
    
    .group-conception__card {
        min-height: min-content; /* Override previous fixed heights */
        height: auto;
    }
}

/* Mobile breakpoint */
@media screen and (max-width: 767px) {
    .group-conception__main {
        background: rgba(37, 56, 57, 0.5);
    }

    .group-conception__title {
        font-size: clamp(32px, 6vw, 40px);
        color: #DCB77C;
        padding: 1rem;
    }

    .group-conception__cards {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 2rem clamp(1.5rem, 4vw, 2rem); /* Consistent mobile margins */
    }

    .group-conception__card {
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: clamp(1rem, 4vw, 1.5rem);
        gap: 1rem;
    }

    .group-conception__card-title {
        font-size: clamp(16px, 4vw, 20px);
        color: #DCB77C;
        margin-bottom: 0.5rem;
    }

    .group-conception__card-text {
        max-height: none; /* Remove max-height on mobile */
        font-size: clamp(14px, 3.5vw, 16px);
        line-height: 1.5;
    }
}

/* Small mobile devices */
@media screen and (max-width: 375px) {
    .group-conception__cards {
        padding: 1.5rem 1rem;
    }

    .group-conception__card {
        padding: 1rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.fade-right {
    animation: fadeRight 1s ease-out forwards;
}

.fade-left {
    animation: fadeLeft 1s ease-out forwards;
}

.fade-up {
    animation: fadeUp 1s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* RTL Support */
[dir="rtl"] .group-conception__title {
    font-family: 'Alkatra', 'Cairo', cursive;
}

[dir="rtl"] .group-conception__card-title,
[dir="rtl"] .group-conception__card-text {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .group-conception__cards {
    direction: rtl;
}

[dir="rtl"] .fade-right {
    animation: fadeRightRTL 1s ease-out forwards;
}

[dir="rtl"] .fade-left {
    animation: fadeLeftRTL 1s ease-out forwards;
}

@keyframes fadeRightRTL {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeLeftRTL {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}