:root {
    --purple: #332f55;
    --green: #c7dc72;
    --pink: #fbddea;
    --offwhite: #f1f0ee;
}

/* =========================
   SECTION
========================= */

.facilities-section {
    position: relative;
    z-index: 10;
    padding: 0 .1%;
    overflow: hidden;
    background: transparent;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* סידור הכרטיסים */
.facility-card:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
}

.facility-card:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
}

.facility-card:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.facility-card:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

/* =========================
   CARD
========================= */

.facility-card {
    position: relative;
    display: flex;
    height: 280px;
    overflow: hidden;
    background: #fff;
    border-radius: 30px;
    text-decoration: none;

    transition:
        transform .35s ease,
        box-shadow .35s ease;
}

.facility-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 18px 35px rgba(0, 0, 0, .02);
}

/* =========================
   TEXT SIDE
========================= */

.facility-side {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 50%;
    padding: 45px;
    background: #fff;
    box-sizing: border-box;
}

.facility-icon {
    width: 85px;
    margin-bottom: 5px;
}

.facility-side h3 {
    margin: 0;
    color: var(--purple);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.1;
}

.facility-side p {
    margin: 0;
    color: var(--purple);
    font-size: 28px;
}

.card-arrow {
    position: absolute;
    top: 35px;
    inset-inline-start: 35px;
    color: var(--purple);
    font-size: 40px;
    line-height: 1;
}

.facility-divider {
    display: none;
}

/* =========================
   IMAGE SIDE
========================= */

.facility-image {
    position: relative;
    flex: 0 0 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

/* הצורה הלבנה והקו הירוק */
.facility-mask {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: 100px;
    height: 100%;
    pointer-events: none;
}

.facility-mask path:last-child {
    vector-effect: non-scaling-stroke;
}

/* =========================
   IMAGE ROTATION – CSS ONLY
========================= */

.facility-photo {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1);

    animation-name: facilityImageFade;
    animation-duration: 14s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* התמונה הראשונה */
.facility-photo:first-of-type {
    animation-delay: 0s;
}

/* התמונה השנייה */
.facility-photo:last-of-type {
    animation-delay: -7s;
}

@keyframes facilityImageFade {

    0% {
        opacity: 1;
        transform: scale(1);
    }

    43% {
        opacity: 1;
        transform: scale(1.05);
    }

    50% {
        opacity: 0;
        transform: scale(1.06);
    }

    93% {
        opacity: 0;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   BACKGROUND ELEMENTS
========================= */

.bg-logo {
    position: absolute;
    right: 40px;
    bottom: 40px;
    width: 180px;
    opacity: .05;
}

.bg-pink {
    position: absolute;
    left: -120px;
    bottom: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--pink);
    opacity: .55;
}

.bg-u {
    position: absolute;
    left: -40px;
    top: -20px;
    width: 240px;
    height: 240px;
    opacity: .08;
}

.bg-u::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-radial-gradient(
            circle at center top,
            transparent 0 25px,
            var(--green) 25px 31px
        );
    clip-path: inset(0 0 50% 0);
}

.dots {
    position: absolute;
    width: 140px;
    height: 70px;
    background-image:
        radial-gradient(currentColor 2px, transparent 2px);
    background-size: 20px 20px;
}

.dots-green {
    left: 50%;
    bottom: 80px;
    color: var(--green);
}

.dots-pink {
    top: 80px;
    right: 100px;
    color: var(--pink);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .facilities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .facility-card {
        height: 320px;
        flex-direction: column;
    }

    .facility-image {
        order: 1;
        flex: none;
        width: 100%;
        height: 62%;
        overflow: hidden;
        border-radius: 30px 30px 0 0;
    }

    .facility-side {
        order: 2;
        width: 100%;
        height: 38%;
        padding: 20px 0;
        align-items: center;
        box-sizing: border-box;
    }

    .facility-side::after {
        display: none;
    }

    .facility-icon {
        width: 52px;
        margin-bottom: 12px;
    }

    .facility-side h3 {
        font-size: 20px;
    }

    .facility-side p {
        font-size: 15px;
    }

    .card-arrow {
        display: none;
    }

    /* ביטול הצורה והקו הירוק במובייל */
    .facility-mask {
        display: none;
    }

    /* פינות מעוגלות רק בחלק העליון */
    .facility-photo {
        border-radius: 30px 30px 0 0;
    }
}

/* נגישות: ביטול תנועה למי שבחר בכך במכשיר */
@media (prefers-reduced-motion: reduce) {

    .facility-photo {
        animation: none;
        opacity: 0;
        transform: none;
    }

    .facility-photo:first-of-type {
        opacity: 1;
    }

    .facility-card {
        transition: none;
    }
}