/* ==========================================================================
   lf-testimonial-cta — service-page testimonial CTA block (LeFante Law)
   --------------------------------------------------------------------------
   Design:   LeFante-Design-System.pen, frames TCB 01–05 (approved by Chris 2026-11-16)
             Spec: Designs/Testimonial-CTA-Block-Build-Spec.md (v1.1)
   Blocks:   .lf-testimonial-cta (section)  + modifier .lf-testimonial-cta--multi (2–3 videos)
             .lf-video-card     (thumbnail card; an Elementor container rendered as <a>)
             .lf-reviews-panel  (white panel holding the Reputation Hub grid widget)
   Markup:   Elementor v3 containers + widgets; classes are name-only in each element's
             Advanced > CSS Classes field (B1). No element style controls are used (B4).
   Public tokens (override on a parent, T6):
             --lf-testimonial-cta-bg            section ground (default: kit "Color 2" #0D123A)
             --lf-testimonial-cta-reviews-width reviews column width in the 1-video layout
             --lf-reviews-panel-height          fixed iframe height (no layout shift, E6)
             --lf-video-card-title-size         card title size
   Breakpoints (Elementor kit, desktop-first, C6): tablet-extra ≤1200px, mobile ≤767px.
   Home:     protocol-exception W1/D7 (draft only): this CSS sits in the DRAFT page's Elementor
             Pro "Custom CSS". Before the block goes on a second page, move this file to ONE
             conditional home (recommended: an enqueued file from the "LeFante Site" mu-plugin,
             loaded only on pages whose Elementor data contains "lf-testimonial-cta"), and
             remove it from page Custom CSS.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------
   Declared on body, not :root: Elementor's kit colours (--e-global-color-*) are
   defined on the body's .elementor-kit-{id} class, so an alias at :root would
   resolve to nothing (Elementor document §5). protocol-exception T5: same reason.
   ------------------------------------------------------------------------- */
:where(body) {
    /* Global aliases of the Elementor kit (T9) — the only place kit IDs appear */
    --lf-color-navy: var(--e-global-color-primary);        /* #252D6B */
    --lf-color-gold: var(--e-global-color-secondary);      /* #FFC002 */
    --lf-color-white: var(--e-global-color-accent);        /* #FFFFFF */
    --lf-color-navy-deep: var(--e-global-color-36fdf5d);   /* kit "Color 2" #0D123A */
    --lf-color-navy-900: #0c102f;   /* tile body colour measured on /testimonials/; not in the kit */
    --lf-color-border: #abaebb;     /* design system 03, neutral-400 */
    --lf-color-muted: #434343;      /* design system 03, text-muted: 9.9:1 on white */
    --lf-color-text: var(--e-global-color-text);           /* #000000 */

    --lf-font-display: "Montserrat", sans-serif;
    --lf-font-body: "Raleway", sans-serif;

    /* Fluid type (T13): new scale built on top; min at 375px, max at 1240px; rem so user zoom applies */
    --lf-font-size-display-md: clamp(1.875rem, 1.279rem + 2.543vw, 3.25rem);  /* 30 → 52 */
    --lf-font-size-title: clamp(1.125rem, 1.017rem + 0.462vw, 1.375rem);      /* 18 → 22 */
    --lf-font-size-body: clamp(1rem, 0.946rem + 0.231vw, 1.125rem);           /* 16 → 18 */
    --lf-font-size-label: clamp(0.875rem, 0.821rem + 0.231vw, 1rem);          /* 14 → 16 */
    --lf-font-size-overline: clamp(0.8125rem, 0.8125rem + 0vw, 0.8125rem);    /* 13, fixed */

    --lf-space-8: 8px;
    --lf-space-12: 12px;
    --lf-space-16: 16px;
    --lf-space-20: 20px;
    --lf-space-24: 24px;
    --lf-space-32: 32px;
    --lf-space-40: 40px;
    --lf-space-64: 64px;
    --lf-space-80: 80px;

    --lf-duration-base: 300ms;
    --lf-duration-slow: 400ms;
    --lf-focus-ring: 3px;

    /* Component defaults (public tokens) */
    --lf-testimonial-cta-bg: var(--lf-color-navy-deep);
    --lf-testimonial-cta-reviews-width: 460px;  /* design TCB 01: 460 of 1240 */
    --lf-reviews-panel-height: 440px;           /* ≈2.5 reviews visible; list scrolls inside */
    --lf-video-card-title-size: var(--lf-font-size-title);
}

/* --- Section ------------------------------------------------------------- */
.lf-testimonial-cta.e-con {
    --container-max-width: 1240px;  /* site content width (design system 07) */
    --padding-top: var(--lf-space-80);
    --padding-bottom: var(--lf-space-80);
    --padding-left: var(--lf-space-24);
    --padding-right: var(--lf-space-24);
    --flex-direction: column;
    --align-items: center;
    --row-gap: var(--lf-space-40);
    --column-gap: var(--lf-space-40);
    --gap: var(--row-gap) var(--column-gap);
    background-color: var(--lf-testimonial-cta-bg);
}

.lf-testimonial-cta .lf-testimonial-cta__head {
    --flex-direction: column;
    --align-items: center;
    --row-gap: var(--lf-space-16);
    --gap: var(--row-gap) var(--row-gap);
    --padding-top: 0;
    --padding-bottom: 0;
    --padding-left: 0;
    --padding-right: 0;
    text-align: center;
}

.lf-testimonial-cta .lf-testimonial-cta__title .elementor-heading-title {
    margin: 0;
    font-family: var(--lf-font-display);
    font-size: var(--lf-font-size-display-md);
    font-weight: 700;
    line-height: 1.15;
    color: var(--lf-color-white);
}

.lf-testimonial-cta__highlight {
    color: var(--lf-color-gold);
}

.lf-testimonial-cta .lf-testimonial-cta__intro {
    max-width: 760px;  /* design TCB 01 measure */
    font-family: var(--lf-font-body);
    font-size: var(--lf-font-size-body);
    line-height: 1.56;
    color: var(--lf-color-white);
}

.lf-testimonial-cta__intro p {
    margin: 0;
}

/* Rows: 1-video body (card + reviews) and the 2–3 video row */
.lf-testimonial-cta .lf-testimonial-cta__body,
.lf-testimonial-cta .lf-testimonial-cta__videos {
    --flex-direction: row;
    --align-items: flex-start;
    --flex-wrap: nowrap;
    --column-gap: var(--lf-space-40);
    --row-gap: var(--lf-space-24);
    --gap: var(--row-gap) var(--column-gap);
    --padding-top: 0;
    --padding-bottom: 0;
    --padding-left: 0;
    --padding-right: 0;
    width: 100%;
}

.lf-testimonial-cta__body .lf-video-card,
.lf-testimonial-cta__videos .lf-video-card {
    flex: 1 1 0;
    min-width: 0;
}

.lf-testimonial-cta__body .lf-reviews-panel {
    flex: 0 0 var(--lf-testimonial-cta-reviews-width);
}

/* 2–3 videos: smaller card titles, reviews panel full width below the row */
.lf-testimonial-cta--multi {
    --lf-video-card-title-size: var(--lf-font-size-body);
}

.lf-testimonial-cta--multi .lf-testimonial-cta__videos {
    --column-gap: var(--lf-space-32);
    --gap: var(--row-gap) var(--column-gap);
}

.lf-testimonial-cta--multi .lf-reviews-panel {
    width: 100%;
}

/* Button (Elementor Button widget) */
.lf-testimonial-cta .lf-testimonial-cta__button .elementor-button {
    display: inline-flex;
    align-items: center;
    gap: var(--lf-space-8);
    min-height: 54px;  /* design system 05, control-lg */
    padding: 15px 25px;  /* measured site button padding (design system 05) */
    border: 0;
    border-radius: 0;
    background-color: var(--lf-color-gold);
    color: var(--lf-color-navy);
    font-family: var(--lf-font-display);
    font-size: var(--lf-font-size-label);
    font-weight: 700;
    line-height: 1.5;
    text-transform: uppercase;
}

.lf-testimonial-cta__button .elementor-button-text::before {
    content: "»" / "";
    margin-right: var(--lf-space-8);
}

.lf-testimonial-cta .lf-testimonial-cta__button .elementor-button:hover {
    background-color: var(--lf-color-navy);
    color: var(--lf-color-white);
}

.lf-testimonial-cta .lf-testimonial-cta__button .elementor-button:focus-visible {
    outline: var(--lf-focus-ring) solid var(--lf-color-white);
    outline-offset: var(--lf-focus-ring);
}

/* --- Video card (base component) ----------------------------------------- */
.lf-video-card.e-con {
    --flex-direction: column;
    --row-gap: 0;
    --gap: 0 0;
    --padding-top: 0;
    --padding-bottom: 0;
    --padding-left: 0;
    --padding-right: 0;
    background-color: var(--lf-color-navy-900);
    color: var(--lf-color-white);
    text-decoration: none;
}

.lf-video-card:focus-visible {
    outline: var(--lf-focus-ring) solid var(--lf-color-gold);
    outline-offset: var(--lf-focus-ring);
}

.lf-video-card .lf-video-card__media {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.lf-video-card__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Decorative play button: the card is a link, never an inline player */
.lf-video-card__media::before,
.lf-video-card__media::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
}

.lf-video-card__media::before {
    width: 64px;   /* design TCB 00 play button */
    height: 64px;
    margin: -32px 0 0 -32px;
    border: 2px solid var(--lf-color-white);
    border-radius: 50%;
    background-color: rgb(12 16 47 / 0.7);
}

.lf-video-card__media::after {
    margin: -11px 0 0 -6px;  /* optical centre of the triangle */
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent var(--lf-color-white);
}

.lf-video-card .lf-video-card__body {
    --flex-direction: column;
    --row-gap: var(--lf-space-8);
    --gap: var(--row-gap) var(--row-gap);
    --padding-top: var(--lf-space-20);
    --padding-right: var(--lf-space-24);
    --padding-bottom: var(--lf-space-24);
    --padding-left: var(--lf-space-24);
}

.lf-video-card .lf-video-card__title .elementor-heading-title {
    margin: 0;
    font-family: var(--lf-font-display);
    font-size: var(--lf-video-card-title-size);
    font-weight: 600;
    line-height: 1.3;
    color: var(--lf-color-white);
}

.lf-video-card .lf-video-card__cta {
    font-family: var(--lf-font-body);
    font-size: var(--lf-font-size-label);
    font-weight: 700;
    color: var(--lf-color-gold);
    text-decoration: underline;
}

.lf-video-card__cta p {
    margin: 0;
}

.lf-video-card:hover .lf-video-card__cta,
.lf-video-card:focus-visible .lf-video-card__cta {
    color: var(--lf-color-white);
}

@media (prefers-reduced-motion: no-preference) {
    .lf-video-card__media img {
        transition: transform var(--lf-duration-slow) ease;
    }

    .lf-video-card:hover .lf-video-card__media img {
        transform: scale(1.05);
    }

    .lf-testimonial-cta .lf-testimonial-cta__button .elementor-button {
        transition: background-color var(--lf-duration-base) ease, color var(--lf-duration-base) ease;
    }
}

/* --- Reviews panel -------------------------------------------------------- */
.lf-reviews-panel.e-con {
    --flex-direction: column;
    --row-gap: var(--lf-space-12);
    --gap: var(--row-gap) var(--row-gap);
    --padding-top: var(--lf-space-20);
    --padding-right: var(--lf-space-20);
    --padding-bottom: var(--lf-space-20);
    --padding-left: var(--lf-space-20);
    background-color: var(--lf-color-white);
    color: var(--lf-color-text);
}

.lf-reviews-panel__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--lf-space-8);
    margin-bottom: var(--lf-space-12);
}

.lf-reviews-panel__title {
    font-family: var(--lf-font-display);
    font-size: var(--lf-font-size-overline);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lf-color-navy);
}

.lf-reviews-panel__title::before {
    content: "★" / "";
    margin-right: var(--lf-space-8);
    color: var(--lf-color-gold);
}

.lf-reviews-panel__source {
    font-family: var(--lf-font-body);
    font-size: var(--lf-font-size-overline);
    color: var(--lf-color-muted);
}

/* The window: a fixed-height box that shows the reviews list and hides the widget's
   own header ("What our clients say about us", the rating and "Write a review").
   The header lives inside Reputation Hub's cross-origin iframe, so CSS can't remove it;
   the iframe is shifted up by the header's height and the window clips it.
   Remove this crop once a Reputation Hub widget with the header and button switched
   off exists (setting isWriteAReviewButtonEnabled); then set --_lf-reviews-crop to 0. */
.lf-reviews-panel__window {
    container-type: inline-size;
    overflow: hidden;
    height: var(--lf-reviews-panel-height);
    border: 1px solid var(--lf-color-border);
}

.lf-reviews-panel .lf-reviews-panel__frame {
    display: block;
    width: 100%;
    min-width: 100%;
    margin-top: calc(-1 * var(--_lf-reviews-crop));
    /* protocol-exception S4: the Reputation Hub script sets the iframe's height inline;
       a fixed height keeps the list scrolling inside and stops layout shift (E6).
       The iframe must NOT carry scrolling="no" (the site's stock embed does): visitors
       scroll the reviews inside the frame and use the widget's own "Load More". */
    height: calc(var(--lf-reviews-panel-height) + var(--_lf-reviews-crop)) !important;
    border: 0;
}

/* Header height of Reputation Hub widget 6839454b… by frame width, measured
   2026-11-16 (first review card's top minus a 12px gap). The widget changes layout
   at these widths; re-measure if the widget's design changes. */
.lf-reviews-panel__frame { --_lf-reviews-crop: 117px; }  /* ≥943px: header on one row */

@container (max-width: 942px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 142px; } }
@container (max-width: 767px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 262px; } }  /* header stacked */
@container (max-width: 432px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 291px; } }
@container (max-width: 302px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 316px; } }  /* title wraps */
@container (max-width: 292px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 345px; } }
@container (max-width: 284px) { .lf-reviews-panel__frame { --_lf-reviews-crop: 381px; } }

/* --- Tablet and small laptop: ≤1200px ------------------------------------ */
@media (max-width: 1200px) { /* bp: tablet-extra */
    .lf-testimonial-cta.e-con {
        --padding-top: var(--lf-space-64);
        --padding-bottom: var(--lf-space-64);
        --padding-left: var(--lf-space-40);
        --padding-right: var(--lf-space-40);
        --row-gap: var(--lf-space-32);
        --lf-testimonial-cta-reviews-width: 400px;  /* design TCB 04 */
    }

    .lf-testimonial-cta .lf-testimonial-cta__body {
        --column-gap: var(--lf-space-32);
    }

    .lf-testimonial-cta--multi .lf-testimonial-cta__videos {
        --column-gap: var(--lf-space-20);
    }

    .lf-video-card .lf-video-card__body {
        --padding-top: var(--lf-space-16);
        --padding-right: var(--lf-space-16);
        --padding-bottom: var(--lf-space-20);
        --padding-left: var(--lf-space-16);
    }
}

/* --- Phone: ≤767px -------------------------------------------------------- */
@media (max-width: 767px) { /* bp: mobile */
    .lf-testimonial-cta.e-con {
        --padding-left: var(--lf-space-24);
        --padding-right: var(--lf-space-24);
        --row-gap: var(--lf-space-24);
        --lf-reviews-panel-height: 520px;  /* design TCB 05 */
    }

    .lf-testimonial-cta .lf-testimonial-cta__body,
    .lf-testimonial-cta .lf-testimonial-cta__videos {
        --flex-direction: column;
        --row-gap: var(--lf-space-24);
    }

    .lf-testimonial-cta__body .lf-video-card,
    .lf-testimonial-cta__videos .lf-video-card,
    .lf-testimonial-cta__body .lf-reviews-panel {
        flex: 0 0 auto;
        width: 100%;
    }

    .lf-reviews-panel.e-con {
        --padding-top: var(--lf-space-16);
        --padding-right: var(--lf-space-16);
        --padding-bottom: var(--lf-space-16);
        --padding-left: var(--lf-space-16);
    }

    .lf-reviews-panel__source {
        display: none;
    }

    .lf-testimonial-cta .lf-testimonial-cta__button,
    .lf-testimonial-cta .lf-testimonial-cta__button .elementor-button {
        width: 100%;
        justify-content: center;
    }
}
