/* ==========================================================================
   Sindesi Search Form — v0.44.22 (E2d, 17/07/2026)
   ==========================================================================
   Shortcode `[sindesi_search_form]` — form ricerca hero-friendly.
   Design isolato con prefisso `.ssf-*` per non collidere con altri moduli.

   ## Layout
     - desktop  ≥ 640px : pill orizzontale (input + button inline)
     - mobile   < 640px : stack verticale (input full-width + button sotto)

   ## Struttura DOM
   .sindesi-search-form          root wrapper
     .ssf-form                    <form>
       .ssf-form__label            <label> con icona SVG + input
         .ssf-form__icon           <svg> lente
         .ssf-form__input          <input type="search">
       .ssf-form__submit           <button>

   ## Focus keyboard
   Il focus va sull'input (autofocus non attivo per non forzare tastiera
   mobile all'apertura homepage). Ring focus outline azzurro Sindesi via
   :focus-within sul .ssf-form (l'intero pill si illumina come Google).

   ## Progressive enhancement
   Zero JS. Submit HTML nativo → browser costruisce URL con query
   `?q={valore}` e naviga a `/dienstleistungen/`.
   ========================================================================== */

.sindesi-search-form {
    --ssf-blue:        #0280DE;
    --ssf-teal:        #08B4BB;
    --ssf-text:        #1a202c;
    --ssf-muted:       #718096;
    --ssf-border:      #e2e8f0;
    --ssf-panel:       #ffffff;
    --ssf-shadow:      0 4px 20px rgba(15, 23, 42, 0.08);
    --ssf-shadow-hover:0 8px 30px rgba(15, 23, 42, 0.14);
    --ssf-shadow-focus:0 0 0 3px rgba(2, 128, 222, 0.20);
    --ssf-radius:      999px; /* pill totale */

    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 640px;
    margin: 24px auto;
    padding: 0 16px;
}

.sindesi-search-form *,
.sindesi-search-form *::before,
.sindesi-search-form *::after {
    box-sizing: border-box;
}

/* Screen reader only helper — a11y label nascosto visivamente. */
.sindesi-search-form .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Form pill (desktop ≥ 640px) ------------------------------------------- */

.ssf-form {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--ssf-panel);
    border: 1px solid var(--ssf-border);
    border-radius: var(--ssf-radius);
    box-shadow: var(--ssf-shadow);
    padding: 6px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ssf-form:hover {
    box-shadow: var(--ssf-shadow-hover);
}

.ssf-form:focus-within {
    box-shadow: var(--ssf-shadow-focus), var(--ssf-shadow-hover);
    border-color: var(--ssf-blue);
}

/* --- Label wraps icon + input --------------------------------------------- */

.ssf-form__label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* consente input di shrinkarsi in flex */
    padding: 0 16px;
    cursor: text;
}

.ssf-form__icon {
    width: 20px;
    height: 20px;
    color: var(--ssf-muted);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.ssf-form:focus-within .ssf-form__icon {
    color: var(--ssf-blue);
}

.ssf-form__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;         /* 16px per prevenire zoom Safari mobile */
    color: var(--ssf-text);
    padding: 12px 0;
    font-family: inherit;
    /* Reset stili tema WP che a volte overrida input. */
    box-shadow: none;
    line-height: 1.4;
}

.ssf-form__input::placeholder {
    color: var(--ssf-muted);
    opacity: 1; /* fix Firefox opacity default */
}

/* Rimuovi la X del type=search su WebKit (era brutta accanto al button). */
.ssf-form__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* --- Submit button --------------------------------------------------------- */

.ssf-form__submit {
    border: 0;
    background: linear-gradient(135deg, var(--ssf-blue), var(--ssf-teal));
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--ssf-radius);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    flex-shrink: 0;
    line-height: 1.4;
    /* Reset stili tema (alcuni temi hivetheme forzano text-shadow o border). */
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(2, 128, 222, 0.25);
}

.ssf-form__submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 14px rgba(2, 128, 222, 0.35);
}

.ssf-form__submit:active {
    transform: translateY(1px);
}

.ssf-form__submit:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -4px;
}

/* --- Mobile stack < 640px -------------------------------------------------- */

@media (max-width: 639px) {
    .ssf-form {
        flex-direction: column;
        border-radius: 20px;    /* meno arrotondato quando è stack */
        padding: 10px;
        gap: 10px;
    }
    .ssf-form__label {
        width: 100%;
        padding: 6px 12px;
        background: transparent;
    }
    .ssf-form__submit {
        width: 100%;
        padding: 14px 24px;
        border-radius: 14px;
    }
}

/* --- Reduced motion respect ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ssf-form,
    .ssf-form__submit,
    .ssf-form__icon {
        transition: none;
    }
    .ssf-form__submit:active {
        transform: none;
    }
}
