/* ==========================================================================
   VALT child theme
   Tokens from the Figma style guide. Typeface: Lato (loaded by Elementor).
   Text sizes desktop / mobile (<= 767px, Elementor's mobile breakpoint).
   ========================================================================== */

:root {
    --valt-font: "Lato", "Helvetica Neue", Arial, sans-serif;

    /* Brand colors */
    --valt-white: #ffffff;
    --valt-pale-grey: #f2f6f9;
    --valt-pale-blue: #c0e0f2;
    --valt-dark-grey: #333333;
    --valt-neutral-dark: #595b5c;
    --valt-neutral: #a8abad;
    --valt-stroke: #e7e7e7;
    --valt-error: #ff5d53;
    --valt-pending: #edb847;
    --valt-success: #66b95f;

    /* Radius / shadows */
    --valt-radius-sm: 8px;
    --valt-radius-md: 22px;
    --valt-radius-lg: 44px;
    --valt-radius-round: 999px;
    --valt-shadow-xxs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --valt-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
    --valt-shadow-sm: 0 2px 4px -2px rgba(0, 0, 0, 0.06), 0 4px 8px -2px rgba(0, 0, 0, 0.1);

    /* Display (hero title & big quotes) */
    --valt-display-size: 3.875rem;  /* 62px */
    --valt-display-lh: 1.2;

    /* Headings (H1-H6) */
    --valt-h1-size: 3rem;      /* 48px */
    --valt-h2-size: 2.5rem;    /* 40px */
    --valt-h3-size: 2.0625rem; /* 33px */
    --valt-h4-size: 1.6875rem; /* 27px */
    --valt-h5-size: 1.4375rem; /* 23px */
    --valt-h6-size: 1.1875rem; /* 19px */

    --valt-h1-lh: 1.18;
    --valt-h2-lh: 1.18;
    --valt-h3-lh: 1.24;
    --valt-h4-lh: 1.24;
    --valt-h5-lh: 1.4;
    --valt-h6-lh: 1.4;

    /* Text */
    --valt-text-lg: 1.5rem;    /* 24px */
    --valt-text-md: 1.25rem;   /* 20px */
    --valt-text-rg: 1rem;      /* 16px */
    --valt-text-sm: 0.875rem;  /* 14px */
    --valt-text-xs: 0.75rem;   /* 12px */
    --valt-text-lh: 1.5;
}

@media (max-width: 767px) {
    :root {
        --valt-display-size: 2.5rem;  /* 40px */
        --valt-h1-size: 2.5rem;       /* 40px */
        --valt-h2-size: 2.25rem;      /* 36px */
        --valt-h3-size: 2rem;         /* 32px */
        --valt-h4-size: 1.5rem;       /* 24px */
        --valt-h5-size: 1.25rem;      /* 20px */
        --valt-h6-size: 1.125rem;     /* 18px */
    }
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* --------------------------------------------------------------------------
   Typography helpers (add the class to any Elementor widget under Advanced > CSS Classes)
   -------------------------------------------------------------------------- */

.valt-display .elementor-heading-title,
.valt-display {
    font-family: var(--valt-font);
    font-weight: 400;
    font-size: var(--valt-display-size);
    line-height: var(--valt-display-lh);
}

.valt-text-lg,
.valt-text-md,
.valt-text-rg,
.valt-text-sm,
.valt-text-xs {
    font-family: var(--valt-font);
    font-weight: 400;
    line-height: var(--valt-text-lh);
}

.valt-text-lg { font-size: var(--valt-text-lg); }
.valt-text-md { font-size: var(--valt-text-md); }
.valt-text-rg { font-size: var(--valt-text-rg); }
.valt-text-sm { font-size: var(--valt-text-sm); }
.valt-text-xs { font-size: var(--valt-text-xs); }

.valt-semibold { font-weight: 600; }
.valt-bold { font-weight: 700; }

/* --------------------------------------------------------------------------
   Buttons
   Primary (dark pill with soft gradient) comes from Elementor's global button style.
   Secondary: white pill with a light border (header "Contact Us").
   -------------------------------------------------------------------------- */

.valt-btn-secondary .elementor-button,
.valt-btn-secondary .elementor-button:hover,
.valt-btn-secondary .elementor-button:focus {
    background: linear-gradient(90deg, var(--valt-white) 0%, var(--valt-pale-grey) 100%);
    color: var(--valt-dark-grey);
    border: 1px solid var(--valt-stroke);
    border-radius: var(--valt-radius-round);
    box-shadow: var(--valt-shadow-xxs);
    padding: 4px 32px;
    min-height: 38px;
    font-weight: 400;
}

.valt-btn-secondary .elementor-button:hover,
.valt-btn-secondary .elementor-button:focus {
    background: var(--valt-pale-grey);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

/* Elementor caps linked SVG images at 48px (.elementor-widget-image a img[src$=".svg"]); outrank it. */
.valt-header .elementor-widget-theme-site-logo a img[src$=".svg"],
.valt-header .elementor-widget-theme-site-logo img,
.valt-header .elementor-widget-image a img[src$=".svg"],
.valt-header .elementor-widget-image img {
    width: 137px;
    height: auto;
    display: block;
}

@media (max-width: 767px) {
    .valt-header .elementor-widget-theme-site-logo a img[src$=".svg"],
    .valt-header .elementor-widget-theme-site-logo img,
    .valt-header .elementor-widget-image a img[src$=".svg"],
    .valt-header .elementor-widget-image img {
        width: 108px;
    }
}

/* --------------------------------------------------------------------------
   Home: hero, problem sections, glass card, closing CTA
   -------------------------------------------------------------------------- */

.valt-hero .elementor-heading-title {
    text-wrap: balance;
}

/* The hard line break of the hero title only makes sense on wide screens */
@media (max-width: 767px) {
    .valt-hero .elementor-heading-title br {
        display: none;
    }
}

/* Desktop: the home is as tall as in the design (Figma frame 1440 x 1217) at any screen width.
   Elementor sizes the hero from the screen width (min-height 56vw, background 100% wide), so
   the page grew with the width and the closing card fell below the fold. Here the hero takes
   what the rest of the page leaves of those 1217px and the wave background follows it, keeping
   the vertical proportions of the design (hero 806px: image 811px tall, 90px from the top).
   On screens taller than the page the hero grows to keep the footer at the bottom. The
   selectors outrank Elementor's per-element ones. */
@media (min-width: 1025px) {
    .valt-bg-wrap {
        --valt-page-height: max(1217px, calc(100vh - var(--wp-admin--admin-bar--height, 0px)));
        /* 464.4px = header + closing statement + footer */
        --valt-hero-height: calc(var(--valt-page-height) - 464.4px);
    }

    .elementor .elementor-element.e-con.valt-hero {
        --min-height: var(--valt-hero-height);
    }

    .elementor .elementor-element.e-con.valt-bg-wrap:has(> .valt-hero):not(.elementor-motion-effects-element-type-background) {
        background-size: 100% calc(var(--valt-hero-height) * 1.006);
        background-position: 0 calc(var(--valt-hero-height) * 0.112);
    }
}

.valt-quote .elementor-heading-title {
    font-family: var(--valt-font);
    font-weight: 400;
    font-size: var(--valt-display-size);
    line-height: 1.18;
    letter-spacing: -0.01em;
    text-indent: -0.45em; /* hanging opening quote, as in the design */
    color: var(--valt-dark-grey);
}

/* "With VALT" card: frosted glass over the wave background */
.valt-card {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.valt-card > .elementor-widget {
    opacity: 0.95;
}

.valt-card .elementor-heading-title {
    text-wrap: balance;
}

/* Fade-in of the card once its section scrolls into view (Figma annotation) */
@media (prefers-reduced-motion: no-preference) {
    .valt-problem .valt-card {
        opacity: 0;
        transform: translateX(24px);
        transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
    }

    .valt-problem.is-inview .valt-card,
    .elementor-editor-active .valt-problem .valt-card {
        opacity: 1;
        transform: none;
    }
}

/* Wide screens: the title breaks after the dash (hard <br>). Below ~1150px the first
   part no longer fits on one line, so the break is dropped and the lines balanced instead */
@media (max-width: 1150px) {
    .valt-cta-card .elementor-heading-title {
        text-wrap: balance;
    }

    .valt-cta-card .elementor-heading-title br {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Section dots (widget "Section Dots")
   -------------------------------------------------------------------------- */

.valt-section-dots {
    --valt-dots-left: 32px;
    --valt-dot-size: 11px;
    --valt-dot-gap: 10px;
    --valt-dot-active: var(--valt-dark-grey);
    --valt-dot-inactive: var(--valt-pale-grey);
    --valt-dot-border: var(--valt-stroke);

    position: fixed;
    left: var(--valt-dots-left);
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: var(--valt-dot-gap);
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.valt-section-dots.is-visible {
    opacity: 1;
    visibility: visible;
}

.valt-section-dots__dot {
    display: block;
    width: var(--valt-dot-size);
    height: var(--valt-dot-size);
    border-radius: 50%;
    background: var(--valt-dot-inactive);
    border: 1px solid var(--valt-dot-border);
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.valt-section-dots__dot:hover,
.valt-section-dots__dot:focus-visible {
    transform: scale(1.25);
    outline: none;
}

.valt-section-dots__dot.is-active {
    background: var(--valt-dot-active);
    border-color: var(--valt-dot-active);
}

/* Keep the widget visible and in flow while editing */
.elementor-editor-active .valt-section-dots {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
}

.elementor-widget-valt-section-dots {
    margin: 0;
}

@media (max-width: 1024px) {
    .valt-section-dots {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Contact form (Elementor Pro Form widget with class .valt-form)
   Field colors, borders and radius come from Elementor's global Form Fields style;
   this handles what the kit cannot: checkbox, "* Required" note and the sent state.
   -------------------------------------------------------------------------- */

.valt-form .elementor-form::before {
    content: "* Required";
    display: block;
    width: 100%;
    text-align: right;
    font-size: var(--valt-text-xs);
    line-height: 1.5;
    color: var(--valt-dark-grey);
    margin-bottom: -8px;
}

.valt-form .elementor-field-group {
    margin-bottom: 0;
}

.valt-form .elementor-field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--valt-dark-grey);
}

.valt-form .elementor-mark-required .elementor-field-label::after {
    content: "*";
    color: var(--valt-dark-grey);
    padding-left: 0;
}

.valt-form .elementor-field-textual {
    min-height: 48px;
    line-height: 1.5;
}

.valt-form .elementor-field-textual::placeholder {
    color: #666666;
    opacity: 1;
}

.valt-form textarea.elementor-field-textual {
    min-height: 140px;
    resize: vertical;
}

/* Consent checkbox */
.valt-form .elementor-field-type-acceptance .elementor-field-subgroup {
    padding-top: 4px;
    padding-bottom: 4px;
}

.valt-form .elementor-field-type-acceptance .elementor-field-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.valt-form .elementor-field-type-acceptance .elementor-field-option label {
    font-size: var(--valt-text-sm);
    line-height: 1.5;
    color: #000000;
    padding: 0;
}

/* The form widget paints every field white with a very specific selector
   (.elementor-N .elementor-element-X .elementor-field-group .elementor-field:not(...)) and the
   kit adds 12px padding, so the checkbox rules need to outrank both. */
.elementor-widget-form.valt-form .elementor-field-group.elementor-field-type-acceptance input.elementor-field[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    border: 1.5px solid var(--valt-neutral-dark);
    border-radius: 6px;
    background-color: var(--valt-white);
    box-shadow: none;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
}

.elementor-widget-form.valt-form .elementor-field-group.elementor-field-type-acceptance input.elementor-field[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform 0.12s ease-in-out;
    background: var(--valt-white);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.elementor-widget-form.valt-form .elementor-field-group.elementor-field-type-acceptance input.elementor-field[type="checkbox"]:checked {
    background-color: var(--valt-dark-grey);
    border-color: var(--valt-dark-grey);
}

.elementor-widget-form.valt-form .elementor-field-group.elementor-field-type-acceptance input.elementor-field[type="checkbox"]:checked::before {
    transform: scale(1);
}

.elementor-widget-form.valt-form .elementor-field-group.elementor-field-type-acceptance input.elementor-field[type="checkbox"]:focus-visible {
    outline: 2px solid var(--valt-pale-blue);
    outline-offset: 2px;
}

/* Submit */
.valt-form .elementor-field-type-submit {
    padding-top: 8px;
}

.valt-form .elementor-field-type-submit .elementor-button {
    min-width: 270px;
}

@media (max-width: 767px) {
    .valt-form .elementor-field-type-submit .elementor-button {
        min-width: 0;
        width: 100%;
    }
}

/* Messages */
.valt-form .elementor-message {
    font-size: var(--valt-text-sm);
    line-height: 1.5;
    margin-top: 16px;
}

.valt-form .elementor-message::before {
    display: none;
}

/* Sent state: the fields disappear and the card only shows the thank-you message */
.valt-form.valt-form--sent .elementor-form::before,
.valt-form.valt-form--sent .elementor-form-fields-wrapper {
    display: none;
}

.valt-form.valt-form--sent .elementor-message-success {
    margin: 0;
    padding: 16px 0;
    text-align: center;
    font-size: var(--valt-text-lg);
    line-height: 1.5;
    color: var(--valt-dark-grey);
    text-wrap: balance;
}

/* Consent checkboxes sit close together (4px in the design) instead of the 24px form row gap */
.valt-form .elementor-field-type-acceptance + .elementor-field-type-acceptance {
    margin-top: -16px;
}

.valt-form .elementor-field-type-acceptance a {
    color: inherit;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Legal pages: sticky table of contents + long-form content
   -------------------------------------------------------------------------- */

.valt-sticky {
    position: sticky;
    top: 96px;
}

@media (max-width: 1024px) {
    .valt-sticky {
        position: static;
    }
}

.valt-toc {
    /* Elementor Pro draws the widget box from these variables */
    --box-border-width: 0;
    --box-border-color: transparent;
    --box-border-radius: 0;
    --box-background-color: transparent;
}

.valt-toc.elementor-widget-table-of-contents,
.valt-toc.elementor-widget-table-of-contents > .elementor-widget-container,
.valt-toc .elementor-toc__header,
.valt-toc .elementor-toc__body {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.valt-toc .elementor-toc__header {
    padding: 0 0 16px;
}

/* Item colors: Elementor defaults hover/active to the global Accent (pale grey here → unreadable)
   and underlines on hover. The widget settings set the colors too; this covers the decoration. */
.elementor-widget.valt-toc {
    --item-text-color: var(--valt-dark-grey);
    --item-text-hover-color: var(--valt-dark-grey);
    --item-text-active-color: var(--valt-dark-grey);
    --item-text-hover-decoration: none;
    --item-text-active-decoration: none;
}

/* The drawer tab / close button only exist on tablet & mobile */
.valt-toc__tab,
.valt-toc__close,
.valt-toc-backdrop {
    display: none;
}

.valt-toc .elementor-toc__header-title {
    font-family: var(--valt-font);
    font-size: var(--valt-h6-size);
    font-weight: 600;
    line-height: var(--valt-h6-lh);
    color: var(--valt-dark-grey);
}

.valt-toc .elementor-toc__body {
    padding: 0;
    background: transparent;
}

.valt-toc .elementor-toc__list-wrapper {
    list-style: none;
    padding: 0;
    margin: 0;
}

.valt-toc .elementor-toc__list-item {
    margin: 0;
}

/* The whole row is the link: padding, radius and hover background live on the <a>,
   not on Elementor's wrapper, so clicking anywhere in the row navigates */
.valt-toc .elementor-toc__list-item-text-wrapper {
    display: block;
    padding: 0;
}

.valt-toc .elementor-toc__list-item-text-wrapper::before {
    display: none;
}

.valt-toc .elementor-toc__list-item-text {
    display: block;
    padding: 8px 16px;
    border-radius: var(--valt-radius-sm);
    font-size: var(--valt-text-sm);
    line-height: 1.5;
    color: var(--valt-dark-grey);
    text-decoration: none;
    transition: background-color 0.2s ease;
    /* Mobile browsers overlay a darker tint on tapped links; the pressed state below replaces it */
    -webkit-tap-highlight-color: transparent;
}

.valt-toc .elementor-toc__list-item-text:hover,
.valt-toc .elementor-toc__list-item-text:active,
.valt-toc .elementor-toc__list-item-text.elementor-item-active {
    background: var(--valt-pale-grey);
    color: var(--valt-dark-grey);
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   Tablet & mobile: the TOC becomes a fixed side drawer with a folder-style tab
   in the bottom right corner of the screen (assets/js/valt.js adds the tab,
   close button and backdrop, and closes the drawer when an entry is tapped).
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    /* The column no longer takes space in the page flow */
    .valt-toc-col {
        display: contents;
    }

    .elementor-widget.valt-toc {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        margin: 0;
        padding: 0;
        z-index: 9000;
        background: var(--valt-white);
        transform: translateX(100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        /* Elementor hides the widget overflow; the tab sits outside the drawer box */
        overflow: visible;
    }

    /* The shadow only exists while open: closed, it would bleed over the right edge of the screen */
    .elementor-widget.valt-toc.is-open {
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
        transform: translateX(0);
    }

    /* Elementor's optimized markup renders header and body as direct children of the widget:
       the header stays put and the list scrolls when it is taller than the screen */
    .valt-toc .elementor-toc__header {
        flex: 0 0 auto;
        padding: 20px 64px 12px 20px;
    }

    .valt-toc .elementor-toc__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 0 20px 24px;
    }

    .valt-toc .elementor-toc__list-item-text {
        padding: 10px 12px;
    }

    /* Folder tab attached to the drawer's left edge, in the bottom right corner of the screen
       (thumb reach on phones): it peeks out of the screen edge when the drawer is closed and
       travels with it when open. Text color and background (normal, hover and focus) are
       Elementor's global primary button style, which the kit applies to every <button>; the
       rest of that style is reset explicitly (hover/focus included) to keep the tab shape. */
    .valt-toc .valt-toc__tab,
    .valt-toc .valt-toc__tab:hover,
    .valt-toc .valt-toc__tab:focus {
        display: flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        left: 0;
        width: auto;
        margin: 0;
        padding: 14px 10px;
        border-right: 0;
        border-radius: var(--valt-radius-sm) 0 0 var(--valt-radius-sm);
        font-family: var(--valt-font);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1;
        text-transform: none;
        box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.16);
        transform: translateX(-100%);
        transition: opacity 0.3s ease;
        writing-mode: vertical-rl;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* At the end of the page the closed tab would cover the footer text */
    .valt-toc:not(.is-open) .valt-toc__tab.is-over-footer {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    }

    .valt-toc .valt-toc__tab:focus-visible,
    .valt-toc .valt-toc__close:focus-visible {
        outline: 2px solid var(--valt-dark-grey);
        outline-offset: 2px;
    }

    .valt-toc__tab svg {
        width: 14px;
        height: 14px;
        transform: rotate(90deg);
        transition: transform 0.3s ease;
    }

    .valt-toc.is-open .valt-toc__tab svg {
        transform: rotate(-90deg);
    }

    .valt-toc .valt-toc__close,
    .valt-toc .valt-toc__close:hover,
    .valt-toc .valt-toc__close:focus {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 14px;
        right: 16px;
        width: 36px;
        height: 36px;
        margin: 0;
        padding: 0;
        border: 1px solid var(--valt-stroke);
        border-radius: 50%;
        background-color: var(--valt-white);
        background-image: none;
        color: var(--valt-dark-grey);
        font-family: var(--valt-font);
        font-size: 22px;
        line-height: 1;
        box-shadow: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .valt-toc .valt-toc__close:hover {
        background-color: var(--valt-pale-grey);
    }

    .valt-toc-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 8999;
        background: rgba(51, 51, 51, 0.3);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .valt-toc-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}

.valt-legal {
    color: var(--valt-dark-grey);
}

.valt-legal h2 {
    font-size: var(--valt-h2-size);
    line-height: var(--valt-h2-lh);
    font-weight: 400;
    margin: 0;
    padding: 20px 0;
    scroll-margin-top: 96px;
}

.valt-legal h3 {
    font-size: var(--valt-h3-size);
    line-height: var(--valt-h3-lh);
    font-weight: 400;
    margin: 0;
    padding: 16px 0 12px;
    scroll-margin-top: 96px;
}

.valt-legal p,
.valt-legal ul,
.valt-legal ol {
    font-size: var(--valt-text-rg);
    line-height: var(--valt-text-lh);
    margin: 0 0 16px;
}

.valt-legal ul,
.valt-legal ol {
    padding-left: 24px;
}

.valt-legal li {
    margin-bottom: 12px;
}

.valt-legal li:last-child {
    margin-bottom: 0;
}

.valt-legal a {
    color: var(--valt-dark-grey);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.valt-footer-links .elementor-icon-list-item a,
.valt-footer-links .elementor-icon-list-text {
    font-weight: 600;
    color: var(--valt-dark-grey);
}

.valt-footer-links .elementor-icon-list-item a:hover .elementor-icon-list-text {
    color: var(--valt-neutral-dark);
}

@media (max-width: 767px) {
    .valt-footer-links .elementor-icon-list-items {
        flex-wrap: wrap;
        row-gap: 8px;
    }
}
