/* ============================================================
   GRID BLOCK — base (layout 1: noborder)
   ============================================================ */
section.grid--block-section {
    background: #07130F;
    padding: 80px 0px;
}

.grid--main-wrap {
    padding: 20px 20px 0px 20px;
    margin: 20px 20px 0px 20px;
}

.grid--Content-wrap h4 {
    margin: 20px 0px;
    color: #F6F6F6;
    font-size: 28px;
    font-weight: 400;
    line-height: 120%;
}

.grid--Content-wrap p {
    color: #F6F6F6;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: 0.045px;
}

.grid--Image-wrap {
    text-align: center;
}

.grid--block-track {
    display: flex;
    align-items: stretch; /* all cards equal height so CTAs line up */
}

/* Desktop stays untouched */
.grid--block-dots { display: none; }


/* ============================================================
   GRID BLOCK — layout 2 (card with expanding CF7 form)
   ============================================================ */
section.grid--block-section--layout2 {
    background: #000000;
    padding-bottom: 80px;
    border: 0px;
}

.grid--bigContent-wrap-lay2 {
    height: 100%;
}

.grid--main-wrap-layout2 {
    display: flex;
    padding: 20px;
    flex-direction: column;
    gap: 40px;
    flex: 1 0 0;
    align-self: stretch;
    border-radius: 20px;
    border: 1px solid #FFF;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    margin: 20px 10px;
    /* animate only the box growth — text width is fixed below so it won't reflow */
    transition: flex-grow 0.45s ease;
}

.grid--Content-wrap-lay2 h5 {
    color: rgba(246, 246, 246, 0.65);
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: 0.045px;
}

.grid--Content-wrap-lay2 h4 {
    color: #F6F6F6;
    font-size: 32px;
    font-weight: 500;
    line-height: 38px;
    margin-bottom: 10px;
}

.grid--bigContent-wrap-lay2 ul {
    padding-left: 30px;
    margin-bottom: 30px;
}

.grid--bigContent-wrap-lay2 ul li {
    color: #F6F6F6;
    font-size: 18px;
    font-weight: 400;
    line-height: 30px;
    letter-spacing: 0.045px;
    list-style: disc;
}

.grid--bigContent-wrap-lay2 p {
    color: #F6F6F6;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: 0.045px;
}

/* ---- card internal structure: top row (content | form) + full-width CTA ---- */
.grid--card-top {
    display: flex;
    flex-direction: column;
    gap: 40px;
    flex: 1 1 auto;
    min-width: 0;
}

.grid--card-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
    overflow-wrap: anywhere; /* long words won't spill mid-animation */
}

/* CTA — full width, both collapsed and expanded; pinned to card bottom */
.grid--link-wrap-lay2 {
    margin-top: auto; /* pushes button to bottom so all CTAs align */
}
.grid--link-wrap-lay2 a {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 16px;
}

/* CF7 form — hidden until expand, fades in after the box finishes growing */
.grid--cf7-form {
    min-width: 0;
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
}
.grid--cf7-form[hidden] { display: none; }

/* hide CF7's own submit — the green CTA triggers it */
.grid--cf7-form .wpcf7-submit { display: none; }

/* CF7 fields fill their column */
.grid--cf7-form .wpcf7-form-control-wrap,
.grid--cf7-form input.wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
}


/* ============================================================
   EXPAND BEHAVIOUR — desktop only (single source of truth)
   ============================================================ */
@media (min-width: 768px) {
    /* active card grows to ~50% of the row (2 of 4 parts) */
    .grid--main-wrap-layout2.is-expanded {
        flex-grow: 2;
    }

    /* split into two columns: content left, form right */
    .grid--main-wrap-layout2.is-expanded .grid--card-top {
        flex-direction: row;
        gap: 30px;
        align-items: stretch;
    }

    /* FIXED px width => text wraps ONCE, no frame-by-frame flicker.
       (A % here would reflow every frame as the box animates.) */
    .grid--main-wrap-layout2.is-expanded .grid--card-left {
        flex: 0 0 315px;
    }

    /* form fills the remaining right side */
    .grid--main-wrap-layout2.is-expanded .grid--cf7-form {
        flex: 1 1 0;
        opacity: 1;
        display: flex;
        align-items: flex-end;
    }

    /* when any card is expanded, freeze the OTHER cards' content width
       so their text wraps once and doesn't reflow as they shrink.
       :has() handles it CSS-only; the .has-expanded selector is a
       fallback you can drive via JS for browsers without :has(). */
    .grid--block-track:has(.is-expanded) .grid--main-wrap-layout2:not(.is-expanded) .grid--card-top,
    .grid--block-track.has-expanded .grid--main-wrap-layout2:not(.is-expanded) .grid--card-top {
        width: 280px;      /* settled narrow width of a shrunk card — tune to taste */
        flex: 0 0 auto;
    }
}

/* mobile: no two-column split — form just drops below content */
@media (max-width: 767px) {
    .grid--main-wrap-layout2.is-expanded .grid--cf7-form {
        opacity: 1;
    }
}


/* ============================================================
   MOBILE — slider + sizing
   ============================================================ */
@media (max-width: 767px) {
    section.grid--block-section {
        padding-top: 0;
    }
    .grid--block-slider {
        overflow: hidden;
        position: relative;
    }
    .grid--block-track {
        display: flex;
        flex-wrap: nowrap;
        transition: transform 0.4s ease;
        will-change: transform;
        width: 100%;
        gap: 20px;
    }
    .grid--block-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .grid--main-wrap-layout2 {
        margin: 0;
        padding: 20px;
    }
    .grid--Content-wrap-lay2 h4 {
        font-size: 24px;
        line-height: 30px;
    }
    .grid--block-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 24px !important;
        width: 100%;
    }
    .grid--block-dot {
        width: 8px; height: 8px;
        border-radius: 50%;
        border: none;
        background: rgba(255,255,255,0.3);
        padding: 0;
        cursor: pointer;
        transition: background 0.3s, width 0.3s;
    }
    .grid--block-dot.active {
        background: #00d563;
        width: 24px;
        border-radius: 4px;
    }
    .grid--Content-wrap h4 {
        font-size: 24px;
    }
    .grid--main-wrap {
        margin: 0px;
        padding: 0px;
    }
}


/* ============================================================
   TABLET
   ============================================================ */
@media (max-width: 1100px) and (min-width: 996px) {
    .grid--Image-wrap img {
        width: 100%;
        height: 235px;
    }
    .grid--main-wrap {
        margin: 0;
        padding: 0;
    }
    .grid--main-wrap-layout2 {
        margin: 0;
        padding: 15px;
        border-radius: 14px;
    }
    .grid--Content-wrap-lay2 h4 {
        font-size: 22px;
        line-height: 30px;
    }
    .grid--Content-wrap-lay2 h5 {
        font-size: 14px;
        line-height: 20px;
    }
    .grid--bigContent-wrap-lay2 ul li {
        font-size: 14px;
        line-height: 20px;
        margin-bottom: 6px;
    }
    .leftright--Content p {
        font-size: 14px;
    }
    .grid--Content-wrap p {
        font-size: 14px;
    }
    .grid--Content-wrap h4 {
        font-size: 22px;
    }
    .section--Title.big--title h2 {
        font-size: 38px;
    }
    /* keep the fixed-width fix proportional on smaller desktops */
    .grid--main-wrap-layout2.is-expanded .grid--card-left {
        flex: 0 0 260px;
    }
}

@media (max-width: 1366px) and (min-width: 824px) {
    .grid--link-wrap-lay2 a {
        font-size: 16px;
    }
}