/* =========================================================
   Zebe Feature Cards — frontend styles
   ========================================================= */

/* ── Reset ── */
.zfc-wrapper *,
.zfc-wrapper *::before,
.zfc-wrapper *::after {
    box-sizing: border-box;
}

/* ── Wrapper ── */
.zfc-wrapper {
    position: relative;
    width: 100%;
}

/* ── Grid — desktop ── */
.zfc-grid {
    display: grid;
    gap: 16px;
    width: 100%;
}

.zfc-grid--grid-1 { grid-template-columns: 1fr; }
.zfc-grid--grid-2 { grid-template-columns: repeat(2, 1fr); }
.zfc-grid--grid-3 { grid-template-columns: repeat(3, 1fr); }
.zfc-grid--grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Alternating: first card spans 2/3, second 1/3, repeats */
.zfc-grid--alternating {
    grid-template-columns: repeat(6, 1fr);
}
.zfc-grid--alternating .zfc-card:nth-child(odd)  { grid-column: span 4; }
.zfc-grid--alternating .zfc-card:nth-child(even) { grid-column: span 2; }

/* overflow-right cards always span full width so mockup has room */
.zfc-grid--grid-2 .zfc-card--img-overflow-right,
.zfc-grid--grid-3 .zfc-card--img-overflow-right,
.zfc-grid--grid-4 .zfc-card--img-overflow-right {
    grid-column: 1 / -1;
}

/* ── Card ── */
.zfc-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}

.zfc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

/* ── Card inner — text area ── */
.zfc-card-inner {
    padding: 40px 44px;
    flex: 1;
    position: relative;
    z-index: 2;
}

/* ── Eyebrow ── */
.zfc-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.85;
}

/* ── Heading ── */
.zfc-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 64px;
    font-weight: 400;
    line-height: 1.0;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}

/* ── Lead text ── */
.zfc-lead {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0 0 14px;
    max-width: 520px;
}

/* ── Body text ── */
.zfc-body {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    margin: 0;
    opacity: 0.75;
    max-width: 480px;
}

/* ── Card images ── */
.zfc-card-image {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.zfc-card-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Bottom Right */
.zfc-card-image--bottom-right {
    bottom: 0;
    right: 0;
    width: 45%;
    max-width: 280px;
}

/* Bottom Center */
.zfc-card-image--bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 300px;
}

/* Bottom Left */
.zfc-card-image--bottom-left {
    bottom: 0;
    left: 0;
    width: 45%;
    max-width: 280px;
}

/* Right tall — phone mockup flush right */
.zfc-card--img-right-tall {
    flex-direction: row;
    align-items: stretch;
}

.zfc-card--img-right-tall .zfc-card-inner {
    flex: 1;
    z-index: 2;
}

.zfc-card--img-right-tall .zfc-card-image--right-tall {
    position: relative;
    width: 42%;
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: hidden;
}

.zfc-card--img-right-tall .zfc-card-image--right-tall img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 0 20px 0 0;
}

/* ── Dots navigation ── */
.zfc-dots {
    display: none; /* shown only on mobile via JS */
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.zfc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.18);
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.zfc-dot.active {
    background: #2d5a3d;
    transform: scale(1.3);
}

/* ── Mobile: horizontal scroll-snap slider ── */
@media (max-width: 768px) {

    .zfc-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: 4px;
        /* hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .zfc-grid::-webkit-scrollbar {
        display: none;
    }

    .zfc-card {
        flex: 0 0 var(--zfc-mobile-width, 82%);
        scroll-snap-align: start;
        min-height: 420px;
        border-radius: 20px;
    }

    /* peek right edge of next card */
    .zfc-grid {
        padding-right: 24px;
    }

    /* last card right margin so it fully scrolls into view */
    .zfc-card:last-child {
        margin-right: 24px;
    }

    /* right-tall → stack vertically on mobile */
    .zfc-card--img-right-tall {
        flex-direction: column;
    }

    .zfc-card--img-right-tall .zfc-card-image--right-tall {
        position: absolute;
        width: 55%;
        height: 55%;
        bottom: 0;
        right: 0;
    }

    .zfc-card--img-right-tall .zfc-card-image--right-tall img {
        object-fit: contain;
        object-position: bottom right;
        border-radius: 0;
    }

    /* ── overflow-right on mobile: phone sits below text, centred & overflows bottom ── */
    .zfc-card--img-overflow-right {
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 480px;
        padding-bottom: 0;
    }

    .zfc-card--img-overflow-right .zfc-card-inner {
        flex: 0 0 auto !important;
        width: 100% !important;
        padding-bottom: 16px;
    }

    .zfc-card-image--overflow-right {
        position: relative !important;
        width: 75% !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 auto;
        /* let image bleed below card bottom edge */
        margin-bottom: -40px;
        overflow: visible !important;
    }

    .zfc-card-image--overflow-right img {
        width: 100%;
        height: auto;
    }

    /* heading smaller on mobile */
    .zfc-heading {
        font-size: 48px;
    }

    .zfc-lead {
        font-size: 16px;
    }

    .zfc-card-inner {
        padding: 32px 28px;
    }

    /* show dots */
    .zfc-dots {
        display: flex;
    }
}

/* ── overflow-right: phone mockup floats right, clips outside card ── */

/* The grid row that contains an overflow-right card must clip overflow
   so neighbouring cards aren't pushed. We use a per-card wrapper trick. */
.zfc-card--img-overflow-right {
    overflow: visible !important;
    /* card itself clips its background, mockup overflows */
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Text half */
.zfc-card--img-overflow-right .zfc-card-inner {
    flex: 0 0 54%;
    z-index: 2;
    position: relative;
}

/* Image half — positioned absolute right, overflows top & bottom */
.zfc-card-image--overflow-right {
    position: absolute !important;
    right: 0;
    bottom: 0;
    /* width & top injected via inline style from PHP */
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 3;
    pointer-events: none;
    /* clip background to card shape but let image stick out */
    overflow: visible;
}

.zfc-card-image--overflow-right img {
    width: 100%;
    height: auto;
    display: block;
    /* slight shadow to lift phone off background */
    filter: drop-shadow(0 24px 48px rgba(0,0,0,0.18)) drop-shadow(0 4px 12px rgba(0,0,0,0.12));
}

/* Clip overflow at the grid level so overflow-right phone doesn't
   poke outside the entire widget bounding box */
.zfc-grid {
    overflow: visible;
}

/* Each overflow-right card needs a clip container so it doesn't bleed
   into adjacent grid cells */
.zfc-card--img-overflow-right::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* =========================================================
   Elementor Editor helpers
   ========================================================= */
.elementor-editor-active .zfc-card {
    cursor: default;
}
