/*
 * theme-extras.css
 * -----------------------------------------------------------------------
 * Global overrides layered on top of the per-page stylesheets. Loaded on
 * every request (last, so it wins in the cascade). Two concerns live here:
 *
 *   1. Nav submenus — the primary menu supports depth > 1, and the design's
 *      submenu CSS keys off .has-sub / .sub-menu / .is-current. A filter in
 *      functions.php adds those classes so this CSS just works.
 *
 *   2. WPForms — the contact form uses the [wpforms id="10" title="false"]
 *      shortcode. This block restyles WPForms's own output to match the
 *      design's .field input styling and lays fields out side-by-side.
 * -----------------------------------------------------------------------
 */


/* ============================================================================
   NAV SUBMENUS
   ============================================================================ */

/* Give top-level LIs a positioning context for the absolute-positioned sub. */
.nav-links > li { position: relative; }

.sub-menu {
    list-style: none;
    position: absolute;
    top: calc(100% + 12px);
    left: -14px;
    min-width: 268px;
    padding: 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #ECECE7;
    box-shadow: 0 18px 40px rgba(30,30,34,0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 300;
    margin: 0;
}

/* Invisible bridge so the panel survives the gap under the trigger link. */
.sub-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 14px;
}

.has-sub:hover > .sub-menu,
.has-sub:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.sub-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--charcoal);
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

/* No gradient underline inside the submenu. */
.sub-menu a::after { display: none; }

.sub-menu a:hover {
    background: var(--bluetint);
    color: var(--blue);
}

.sub-menu a.is-current,
.sub-menu a.is-active {
    color: var(--blue);
    background: var(--bluetint);
}

/* Optional decorative bits, add via CSS Classes on a menu item if wanted. */
.sub-menu .sub-sep {
    height: 1px;
    margin: 8px 12px;
    background: #EDECE7;
}

.sub-menu .sub-all {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--greytext);
}

.sub-menu .sub-all:hover { color: var(--blue); }

/* Mobile: inside the hamburger panel, submenus flow inline rather than pop. */
@media (max-width: 800px) {
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0 0 0 14px;
        min-width: 0;
    }
    .sub-menu::before { display: none; }
    .sub-menu a { padding: 8px 0; }
}


/* ============================================================================
   WPFORMS — restyle to match the .field input design
   Scoped to .form-card so only the contact form (or anything else you
   wrap in .form-card) is affected. WPForms elsewhere keeps its defaults.
   ============================================================================ */

.form-card .wpforms-container {
    margin: 0;
}

.form-card .wpforms-form,
.form-card .wpforms-field-container {
    display: block;
}

/* Field row — WPForms wraps each field in .wpforms-field */
.form-card .wpforms-field {
    padding: 0 0 18px 0;
    margin: 0;
}

/* Labels */
.form-card .wpforms-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.2px;
}

/* Required asterisk */
.form-card .wpforms-required-label,
.form-card .wpforms-field-required .wpforms-field-label::after {
    color: var(--red);
    font-weight: 700;
}

/* All input types + select + textarea */
.form-card .wpforms-field input[type="text"],
.form-card .wpforms-field input[type="email"],
.form-card .wpforms-field input[type="tel"],
.form-card .wpforms-field input[type="url"],
.form-card .wpforms-field input[type="number"],
.form-card .wpforms-field input[type="password"],
.form-card .wpforms-field input[type="date"],
.form-card .wpforms-field input[type="time"],
.form-card .wpforms-field select,
.form-card .wpforms-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #E2E1DB;
    background: var(--offwhite);
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 14px;
    color: var(--charcoal);
    transition: border-color .18s ease, background .18s ease;
    box-shadow: none;
}

.form-card .wpforms-field input:focus,
.form-card .wpforms-field select:focus,
.form-card .wpforms-field textarea:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
}

.form-card .wpforms-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Placeholder text */
.form-card .wpforms-field input::placeholder,
.form-card .wpforms-field textarea::placeholder {
    color: #A0A0A6;
}

/* Description text under a field */
.form-card .wpforms-field-description {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--greytext);
    line-height: 1.5;
}

/* Checkbox / radio rows (e.g. the GDPR consent tick) */
.form-card .wpforms-field-checkbox ul,
.form-card .wpforms-field-radio ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.form-card .wpforms-field-checkbox li,
.form-card .wpforms-field-radio li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.form-card .wpforms-field-checkbox input,
.form-card .wpforms-field-radio input {
    margin-top: 3px;
    width: auto;
}
.form-card .wpforms-field-checkbox label,
.form-card .wpforms-field-radio label {
    font-size: 13px;
    color: var(--greytext);
    line-height: 1.5;
}

/* Submit button — match the brand pill CTA */
.form-card .wpforms-submit-container {
    padding: 0;
    margin: 4px 0 0 0;
}
.form-card button.wpforms-submit,
.form-card .wpforms-submit-container button[type="submit"] {
    background: linear-gradient(90deg, var(--red) 0%, var(--orange) 30%, var(--blue) 62%, var(--green) 82%, var(--yellow) 100%);
    color: #fff;
    padding: 14px 30px;
    border-radius: 40px;
    border: 0;
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 18px rgba(43,140,230,0.25);
}
.form-card button.wpforms-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(43,140,230,0.32);
}

/* Validation error text + input state */
.form-card .wpforms-error {
    color: var(--red);
    font-size: 12.5px;
    margin-top: 6px;
}
.form-card .wpforms-field input.wpforms-error,
.form-card .wpforms-field select.wpforms-error,
.form-card .wpforms-field textarea.wpforms-error {
    border-color: var(--red);
}

/* Success confirmation */
.form-card .wpforms-confirmation-container-full {
    background: #fff;
    border: 1.5px solid var(--green);
    border-radius: 14px;
    padding: 18px 22px;
    color: var(--charcoal);
    font-size: 14.5px;
    line-height: 1.55;
}


/* ============================================================================
   BLOG THUMB — icon fallback
   page-blog.css sets `.thumb img { width: 100%; height: auto }` so real
   featured images fill the card. Posts without a featured image fall back
   to a small centered brand icon (rendered via <img class="thumb-icon">) —
   this rule overrides the 100%-wide default so the icon stays icon-sized.
   ============================================================================ */

.thumb img.thumb-icon {
    width: 34px;
    height: 34px;
    position: relative;
    z-index: 2;
}
.featured .thumb img.thumb-icon {
    width: 54px;
    height: 54px;
}
