/**
 * Hello Elementor — correzioni che contrastano Global / Bacheca.
 * Caricato in coda (priority alta) così prevale sul Kit Elementor.
 *
 * Kit → Stile del tema → Pulsanti dipinge hover/focus su OGNI <button> nativo.
 * Qui si ANNULLA (unset), non si sostituisce con un altro colore:
 * ogni controllo tiene lo sfondo/colore che gli abbiamo dato noi.
 */

/* Staff: isolamento locale (il pannello non usa <button> nativi). */
#staff-drawer-root {
	--e-global-color-accent: #111111;
	--e-global-color-primary: #111111;
	--e-global-color-secondary: #111111;
}

/*
 * Neutralizza Theme Style Pulsanti su controlli nativi, anche fuori da .elementor
 * (widget fissi spostati su body). Nessun colore assegnato.
 *
 * Esclusi:
 *  - .elementor-button / .wp-element-button = CTA Elementor
 *  - .button = Woo
 *  - tutto dentro .bacheca-dash-container = hover Dashboard
 *  - volume hero + accordion footer = hanno lo skin proprio sotto
 */
body:not(.wp-admin) :is(
	button:not(.elementor-button):not(.wp-element-button):not(.button):not(.bacheca-home-video-hero__sound):not(.bacheca-own-footer__toggle),
	input[type="button"]:not(.button),
	input[type="submit"]:not(.button),
	input[type="reset"]:not(.button)
):not(:where(.bacheca-dash-container *)):is(:hover, :focus, :focus-visible, :active) {
	background-color: unset !important;
	background-image: none !important;
	box-shadow: none !important;
}

/*
 * Skin proprio volume Home Video Hero (fuori dal reset unset sopra).
 */
body:not(.wp-admin) button.bacheca-home-video-hero__sound,
body:not(.wp-admin) button.bacheca-home-video-hero__sound:hover,
body:not(.wp-admin) button.bacheca-home-video-hero__sound:focus,
body:not(.wp-admin) button.bacheca-home-video-hero__sound:focus-visible,
body:not(.wp-admin) button.bacheca-home-video-hero__sound:active {
	background-color: rgba(0, 0, 0, 0.45) !important;
	background-image: none !important;
	box-shadow: none !important;
}

/*
 * Skin proprio accordion footer (fuori dal reset unset sopra).
 */
body:not(.wp-admin) button.bacheca-own-footer__toggle,
body:not(.wp-admin) button.bacheca-own-footer__toggle:hover,
body:not(.wp-admin) button.bacheca-own-footer__toggle:focus,
body:not(.wp-admin) button.bacheca-own-footer__toggle:focus-visible,
body:not(.wp-admin) button.bacheca-own-footer__toggle:active {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
}

body:not(.wp-admin) button.bacheca-own-footer__toggle::before,
body:not(.wp-admin) button.bacheca-own-footer__toggle::after {
	content: none !important;
	background: none !important;
}

/*
 * Lightbox Elementor (Image Carousel / media) — piano 900 della scala Bacheca
 * (logo 300, staff 400–460, drawer 480). Senza questo la linguetta STAFF resta sopra.
 */
body:not(.wp-admin) .elementor-lightbox,
body:not(.wp-admin) .dialog-lightbox-widget,
body:not(.wp-admin) .dialog-type-lightbox {
	z-index: 900 !important;
}

/*
 * Linguetta STAFF nascosta solo mentre la lightbox è aperta
 * (classe body impostata da elementor-loader.php).
 */
body:not(.wp-admin).bacheca-e-lightbox-open .staff-drawer-tab,
body:not(.wp-admin).bacheca-e-lightbox-open #staff-drawer-root .staff-drawer-tab {
	visibility: hidden !important;
	pointer-events: none !important;
}

/*
 * Rotazione telefono (coppia JS: bacheca_theme_elementor_orientation_script).
 *
 * Bug: verticale ok → orizzontale (CSS tablet) → di nuovo verticale = fascia
 * vuota a destra. Causa: zoom Chrome rimasto < 1 e/o Stretch Elementor con
 * width:100vw + left in px del landscape. I widget PHP si adattano da soli.
 *
 * Qui: html/body e sezioni al 100% del contenitore, MAI 100vw.
 * Niente overflow-x:hidden su html/body (taglia WhatsApp / social / drawer).
 * Lo JS aspetta ~400ms, resetta lo scale, pulisce gli inline Stretch.
 */
html {
	width: 100%;
	max-width: 100%;
}
body:not(.wp-admin) {
	width: 100%;
	max-width: 100%;
}
body:not(.wp-admin) .elementor,
body:not(.wp-admin) .elementor-section,
body:not(.wp-admin) .elementor-container,
body:not(.wp-admin) .e-con,
body:not(.wp-admin) .e-con-inner {
	max-width: 100%;
	box-sizing: border-box;
}
body:not(.wp-admin) .elementor-section.elementor-section-stretched,
body:not(.wp-admin) .e-con.elementor-section-stretched {
	width: 100% !important;
	max-width: 100% !important;
	left: 0 !important;
	right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
