/* ============================================================
   why_choose_us — landing builder component
   Centered heading + 4 feature cards joined by a wavy
   timeline. Light/Dark/RTL aware. Palette-driven.
   ============================================================ */

.why-choose-section {
    position: relative;
    padding: 64px 0;
}

/* ---- Header ---- */
.why-choose-section__header {
    max-width: 760px;
    margin: 0 auto 56px;
}
.why-choose-section__title {
    margin: 0 0 16px;
    font-weight: 800;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    line-height: 1.3;
    color: var(--dark);
}
.why-choose-section__subtitle {
    margin: 6px 0 0;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.7;
    color: var(--gray-500);
}
body.dark-mode .why-choose-section__title {
    color: #ffffff;
}
body.dark-mode .why-choose-section__subtitle {
    color: var(--gray-400);
}

/* On home wallpaper: snow text matches video_hero / dual_promo_cards */
body.home-wallpaper-active:not(.dark-mode) .why-choose-section__title {
    color: #6a0d7a;
    text-shadow: 0 2px 8px rgba(20, 0, 40, 0.20);
}
body.home-wallpaper-active:not(.dark-mode) .why-choose-section__subtitle {
    color: #bd31d6;
    text-shadow: 0 1px 2px rgba(20, 0, 40, 0.18);
}

/* ---- Cards grid + wavy connector ---- */
.why-choose-section__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* Wavy timeline behind the cards */
.why-choose-section__wave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--primary);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}
body.dark-mode .why-choose-section__wave {
    color: var(--accent);
    opacity: 0.55;
}

/* ---- Card shell ---- */
.why-card {
    position: relative;
    z-index: 1;                      /* above the wave */
    display: flex;
    flex-direction: column;
    overflow: hidden;                /* clip the image to the card's rounded edge */
    border: 1.5px solid var(--primary);
    border-radius: 24px;
    background: #fbdefcf8;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 16px 36px rgba(62, 0, 95, 0.10);
    transition: transform .25s ease, box-shadow .25s ease;
}
.why-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(62, 0, 95, 0.16);
}
body.dark-mode .why-card {
    background: rgba(31, 15, 51, 0.55);
    border-color: rgba(180, 143, 255, 0.65);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.30);
}
body.dark-mode .why-card:hover {
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.40);
}

/* ---- Content slot (icon + text) ---- */
.why-card__content {
    flex: 1 1 auto;                  /* fills the height that's left above the
                                        media slot, so cards align cleanly when
                                        descriptions vary in length */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 36px 22px 0;            /* no bottom padding — let the transparent
                                        PNG sit directly under the text */
}

/* ---- Icon (diamond/rhombus tile — two opposing triangles) ---- */
.why-card__icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 12px;              /* a touch of corner softness so the
                                         rotated edges aren't razor-sharp */
    transform: rotate(45deg);         /* turn the square into a diamond */
    box-shadow: 0 10px 24px rgba(62, 0, 95, 0.20);
    margin: 12px 0;                   /* extra vertical breathing room because
                                         rotation expands the bounding box */
}
.why-card__icon img {
    width: 50%;                       /* a bit smaller so it stays inside the
                                         diamond after counter-rotation */
    height: 50%;
    object-fit: contain;
    transform: rotate(-45deg);        /* keep the icon image itself upright */
    filter: brightness(0) invert(1);  /* render uploaded icon white over the
                                         primary tile, regardless of source */
}
body.dark-mode .why-card__icon {
    box-shadow: 0 10px 24px rgba(180, 143, 255, 0.25);
}

/* ---- Card text ---- */
.why-card__title {
    margin: 0;
    font-weight: 700;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.4;
    color: var(--dark);
}
.why-card__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray-500);
}

/* ---- Media (transparent PNG flowing right after the text) ---- */
.why-card__media {
    width: 100%;
    /* no fixed height, no overflow:hidden — let the transparent PNG
       sit naturally on the card background with no visible slot */
    line-height: 0;                  /* kill any inline-image gap below */
}
.why-card__image {
    width: 100%;
    height: auto;                    /* preserves the PNG's own aspect ratio */
    display: block;
    transition: transform .5s ease;
}
.why-card:hover .why-card__image {
    transform: scale(1.04);
}
body.dark-mode .why-card__title {
    color: #ffffff;
}
body.dark-mode .why-card__description {
    color: var(--gray-400);
}

/* On home wallpaper — match video_hero / dual_promo_cards */
body.home-wallpaper-active:not(.dark-mode) .why-card__title {
    color: #6a0d7a;
}
body.home-wallpaper-active:not(.dark-mode) .why-card__description {
    color: #bd31d6;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1199px) {
    .why-choose-section__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    /* Wave doesn't make sense across two rows — hide it */
    .why-choose-section__wave {
        display: none;
    }
}

@media (max-width: 575px) {
    .why-choose-section {
        padding: 48px 0;
    }
    .why-choose-section__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .why-choose-section__header {
        margin-bottom: 40px;
    }
    .why-card {
        padding: 28px 20px 24px;
    }
}
