/*
 * Pronto Tetto: correzioni dall'audit UX del 15/11/2026 (AUDIT-UX-2026-11-15.md), applicate il 16/11.
 * Caricato dopo pt-cta.css da mu-plugins/pt-ux.php. I numeri nei titoli sono quelli dell'audit.
 */

/* ---------- 1. Banda "Hai già le foto?" (Danni) e pulsanti lunghi: niente sbordo sotto i 1025 px ---------- */
/* La colonna era flex in colonna con a capo: testo e pulsante finivano affiancati fuori schermo. */
body .pt-now-row .pt-now-col:last-child > .elementor-widget-wrap { flex-wrap: nowrap; }
@media (max-width: 1024px) {
	body .elementor-widget-ceabutton a.cea-button-link,
	body .elementor-widget-button a.elementor-button,
	body .elementor-widget:is(.pt-cta-p, .pt-cta-s, .pt-cta-g) a.elementor-button { white-space: normal !important; max-width: 100%; }
	body .elementor-widget-ceabutton .cea-button-content-wrapper { min-width: 0; }
	body .pt-now-row .pt-now-col:last-child .elementor-widget-ceabutton a.cea-button-link { line-height: 1.35; text-align: center; }
}
@media (max-width: 767px) {
	body .pt-now-row .pt-now-col:last-child .elementor-widget-ceabutton a.cea-button-link { width: 100%; justify-content: center; }
}

/* ---------- 4. Casella del consenso: 24 px anche in errore (il tema dà min-height 40px a ogni input) ---------- */
div.wpforms-container-full input[type="checkbox"] { min-height: 0 !important; }
div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox input[type="checkbox"],
div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox input[type="checkbox"].wpforms-error { height: 24px !important; box-shadow: none !important; margin-top: 1px !important; }
div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox { overflow: visible !important; }
div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox input[type="checkbox"].wpforms-error { outline: 2px solid var(--pt-err) !important; outline-offset: 2px; border-radius: 3px; }

/* ---------- 5. Focus da tastiera visibile su header, menu, topbar e footer (WCAG 2.4.7) ---------- */
.site-header a:focus-visible { outline: 3px solid #00AEF2 !important; outline-offset: 3px; }
.header-navbar .wp-menu > li:not(.pt-menu-cta) > a:focus-visible,
.header-navbar .wp-menu .sub-menu a:focus-visible,
.header-topbar a:focus-visible { outline: 3px solid currentColor !important; outline-offset: 4px; border-radius: 2px; }
body .header-navbar .wp-menu > li.pt-menu-cta > a:focus-visible { outline: 3px solid #fff !important; outline-offset: 3px; }
body .header-sticky .header-navbar .wp-menu > li.pt-menu-cta > a:focus-visible { outline-color: var(--pt-ink) !important; }
.beruco-page-header a:focus-visible { outline: 3px solid #fff !important; outline-offset: 3px; }
.site-footer a:focus-visible, #site-footer a:focus-visible { outline: 3px solid #00AEF2 !important; outline-offset: 3px; }

/* ---------- 6. "Contattaci subito" leggibile anche come pagina corrente, su header scuro o bianco ---------- */
body .header-navbar .wp-menu > li.pt-menu-cta.current-menu-item > a,
body .header-sticky .header-navbar .wp-menu > li.pt-menu-cta.current-menu-item > a,
body .sticky-head .wp-menu > li.pt-menu-cta.current-menu-item > a { background: var(--pt-brand) !important; color: var(--pt-ink) !important; box-shadow: none !important; }
body .header-navbar .wp-menu > li.pt-menu-cta.current-menu-item > a:hover { background: #fff !important; color: var(--pt-ink) !important; box-shadow: inset 0 0 0 2px var(--pt-ink) !important; }
/* Header bianco (sticky) e sottomenu bianchi: voce corrente in #0077A8 (l'azzurro #00AEF2 su bianco è 2,5:1) */
body .header-sticky .header-navbar .wp-menu > li:is(.current-menu-item, .current-menu-ancestor, .current-menu-parent, .current_page_parent):not(.pt-menu-cta) > a,
body .header-navbar .wp-menu .sub-menu li.current-menu-item > a { color: var(--pt-link) !important; }

/* ---------- 10. Contrasti ---------- */
/* Rifacimento: riga "Il problema è in un punto solo?" nel box scuro dell'interruttore */
body .cea-switcher-content .pt-xlink, body .cea-switcher-content .pt-xlink p { color: #C4C8D4 !important; }
body .cea-switcher-content .pt-xlink a { color: #5CCBFF !important; }
/* Titoli nascosti per gli screen reader: colore AA anche per i controlli automatici */
.pt-sr-only .elementor-heading-title { color: var(--pt-link) !important; }

/* ---------- 8. Pagine interne: CTA nella fascia titolo (solo desktop, sotto i 1025 px c'è la barra fissa) ---------- */
.pt-ph-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.pt-ph-cta .pt-cta { margin: 0 !important; }
.pt-ph-cta .pt-cta i { font-size: 16px; }
.pt-ph-cta .pt-cta--p:hover { background: #fff !important; color: var(--pt-ink) !important; }
.pt-ph-cta .pt-cta--s { color: #fff !important; box-shadow: inset 0 0 0 2px #fff !important; }
.pt-ph-cta .pt-cta--s:hover { background: #fff !important; color: var(--pt-ink) !important; }
.pt-ph-cta .pt-cta:focus-visible { outline: 3px solid #fff !important; outline-offset: 3px; box-shadow: 0 0 0 6px var(--pt-ink) !important; }
@media (max-width: 1024px) { .pt-ph-cta { display: none; } }

/* 8. Mobile: meno vuoto bianco tra fascia titolo e contenuto delle pagine Elementor */
@media (max-width: 767px) {
	body.elementor-page.page:not(.home) .beruco-content-wrap { padding-top: 0 !important; }
	body.pt-svc-page [data-elementor-type="wp-page"] > .elementor-top-section:first-child { padding-top: 32px !important; }
}

/* ---------- 9. Pagine servizio su mobile: stessi testi e sezioni, meno spazio ---------- */
@media (max-width: 767px) {
	body.pt-svc-page [data-elementor-type="wp-page"] { line-height: 1.6; }
	body.pt-svc-page [data-elementor-type="wp-page"] :is(.elementor-widget-text-editor, .elementor-widget-text-editor p, .elementor-widget-text-editor li, .fbox-content, .cea-switcher-content p, .elementor-icon-list-text) { line-height: 1.6 !important; }
	body.pt-svc-page .elementor-top-section.pt-svc-sec:not(.pt-form-band):not(.elementor-element-69821c90) { padding-top: 36px !important; padding-bottom: 36px !important; }
	/* Card e box: meno imbottitura verticale */
	body.pt-svc-page .feature-box-wrapper.feature-box-default { padding-top: 22px !important; padding-bottom: 22px !important; }
	body.pt-svc-page .elementor-widget-ceafeaturebox:not(:last-child) { margin-bottom: 12px !important; }
	body.pt-svc-page .cea-featured-icon { padding: 14px !important; margin-bottom: 12px !important; }
	body.pt-svc-page .cea-counter-wrapper { padding-top: 24px !important; padding-bottom: 24px !important; margin-bottom: 12px !important; }
	body.pt-svc-page .elementor-inner-section { padding-top: 0 !important; }
	/* Foto decorative più basse (le gallerie dei cantieri restano intere) */
	body.pt-svc-page .elementor-widget-image img { max-height: 210px; width: 100%; object-fit: cover; }
	/* Foto ritagliate a triangolo (solo decorative): nascoste su mobile */
	body.pt-svc-page .vertical-bg-img .elementor-widget-image { display: none; }
	/* Contatti e mappa in fondo (già nel footer): più compatti */
	body.pt-svc-page .pt-map { min-height: 220px !important; }
	body.pt-svc-page .pt-map-ph { padding-top: 28px !important; padding-bottom: 28px !important; }
	/* Le 4 schede telefono, email, sede, orari ripetono parola per parola il footer: su mobile restano solo lì */
	body.pt-svc-page .pt-s10 .elementor-inner-section:has(.pt-contact) { display: none; }
	body.pt-svc-page .feature-box-wrapper { margin-bottom: 0 !important; }
	body.pt-svc-page .cea-switcher-header { margin-bottom: 28px !important; }
	body.pt-svc-page a.cea-popup-anything.popup-trigger-icon { padding: 48px !important; }
}

/* ---------- Minori ---------- */
/* Articoli: niente parole spezzate nella riga meta, breadcrumb che va a capo invece di uscire */
.pt-blog-meta, .pt-blog-meta * { word-break: normal !important; overflow-wrap: normal !important; }
ul.page-title-elements li, ul.page-title-elements li * { word-break: normal !important; }
/* Menu mobile (pannello bianco): voce corrente in #0077A8 */
.mobile-menu-floating li:is(.current-menu-item, .current-menu-ancestor, .current-menu-parent) > a { color: var(--pt-link) !important; }
.pt-breadcrumb ol.breadcrumb { flex-wrap: wrap !important; row-gap: 4px; max-width: 100%; }
.pt-breadcrumb ol.breadcrumb > li { white-space: normal !important; min-width: 0; }

/* Menu mobile: velo scuro sul resto della pagina (un tocco sul velo lo chiude, col tema) */
body.mobile-menu-active::after { content: ""; position: fixed; inset: 0; z-index: 999998; background: rgba(20, 20, 34, .6); }

/* Sezioni "stretch" di Elementor già larghe come lo schermo prima del JS (salto di layout su Chi siamo) */
@media (max-width: 1024px) {
	body:not(.elementor-editor-active) .elementor-section.elementor-section-stretched { width: 100vw; margin-left: calc(50% - 50vw); }
	/* margin e non left: il JS di Elementor misura la posizione e poi scrive solo width e left */
}

/* Pagine legali: carattere di riserva con le stesse misure di DM Sans (salto di layout della cookie policy) */
/* size-adjust misurato sul testo della cookie policy: DM Sans 400 = Arial x 1,041, DM Sans 700 = Arial Bold x 1,021 */
@font-face { font-family: "PT DM Sans Fallback"; font-weight: 400; src: local("Arial"), local("ArialMT"); size-adjust: 104.11%; ascent-override: 95.1%; descent-override: 29.8%; line-gap-override: 0%; }
@font-face { font-family: "PT DM Sans Fallback"; font-weight: 700; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 102.08%; ascent-override: 97%; descent-override: 30.4%; line-gap-override: 0%; }
body:is(.page-id-66379, .page-id-63930) .beruco-content-wrap { font-family: "DM Sans", "PT DM Sans Fallback", sans-serif; }

/* Chi riduce le animazioni non ha lo scorrimento animato */
@media (prefers-reduced-motion: reduce) {
	html, body { scroll-behavior: auto !important; }
}

/* Hero home: form compatto (2026-11-16), solo .pt-hero-form, le bande delle pagine servizio restano com'erano */
.pt-hero-form .pt-form-card { padding: 22px 24px 18px; }
.pt-hero-form .pt-form-title { margin: 0 0 4px !important; font-size: 21px !important; line-height: 1.25 !important; }
.pt-hero-form .pt-form-sub { margin: 0 0 14px !important; font-size: 15px !important; line-height: 1.45 !important; }
.pt-hero-form .pt-form-compact .wpforms-field-container { gap: 10px 12px !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-field-label { margin: 0 0 4px !important; font-size: 13px !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-field :is(input[type="text"], input[type="tel"], input[type="email"], select) { height: 44px !important; min-height: 44px !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox li { min-height: 24px !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-field-gdpr-checkbox label.wpforms-field-label-inline { font-size: 13px !important; line-height: 1.4 !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-submit-container { margin-top: 12px !important; }
.pt-hero-form div.wpforms-container-full.pt-form-compact button.wpforms-submit { min-height: 48px !important; padding: 13px 20px !important; }
.pt-hero-form .pt-form-micro { margin: 8px 0 0 !important; font-size: 13px !important; }
/* Hero home mobile: Nome e Telefono affiancati (2026-11-16) */
@media (max-width: 639px) { .pt-hero-form .pt-form-card { padding: 20px 16px 16px; } .pt-hero-form div.wpforms-container-full.pt-form-compact .wpforms-field.pt-c6 { grid-column: span 6; } }
