/* TED Emergency — design e sviluppo del tema: FB Engineering */
/*!
 * TED Builder — blocco Sezione, effetti al passaggio, visibilità, stili dei blocchi del nucleo
 */

/* ---------- Home a blocchi ---------- */
.ted-builder > :not(.alignfull):not(.alignwide):not(.ted-divider) {
	width: min(100% - 2 * var(--ted-pad), 780px);
	margin-inline: auto;
}
.ted-builder > .alignwide { width: min(100% - 2 * var(--ted-pad), var(--ted-container)); margin-inline: auto; }
.ted-builder > .alignfull { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.ted-block { position: relative; }
.ted-block + .ted-block { margin-top: 0; }
.ted-block-empty {
	padding: 2rem;
	border: 2px dashed var(--ted-line);
	border-radius: var(--ted-radius);
	color: var(--ted-muted);
	text-align: center;
	font-family: var(--ted-font-heading);
	letter-spacing: .06em;
}

/* ---------- Blocco Sezione ---------- */
.ted-sec {
	--sec-overlay: .6;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: var(--sec-minh, 0);
}
.ted-sec__inner { position: relative; z-index: 1; width: min(100% - 2 * var(--ted-pad), var(--ted-container)); margin-inline: auto; }
.ted-sec--w-narrow .ted-sec__inner { width: min(100% - 2 * var(--ted-pad), 780px); }
.ted-sec--w-full .ted-sec__inner { width: 100%; }
.ted-sec--v-start { justify-content: flex-start; }
.ted-sec--v-end { justify-content: flex-end; }
.ted-sec--t-center .ted-sec__inner { text-align: center; }
.ted-sec--t-center .ted-heading { margin-inline: auto; }
.ted-sec--t-center .ted-line { margin-inline: auto; }
.ted-sec--t-center .wp-block-buttons { justify-content: center; }

.ted-sec--pad-none { padding-block: 0; }
.ted-sec--pad-s { padding-block: calc(var(--ted-py) * .45); }
.ted-sec--pad-m { padding-block: var(--ted-py); }
.ted-sec--pad-l { padding-block: calc(var(--ted-py) * 1.4); }
.ted-sec--pad-xl { padding-block: calc(var(--ted-py) * 2); }

.ted-sec--bg-alt { background: var(--ted-bg-2); }
.ted-sec--bg-surface { background: var(--ted-surface); }
.ted-sec--bg-primary { background: var(--ted-primary); color: var(--ted-on-primary); }
.ted-sec--bg-primary :is(h1, h2, h3, h4, h5, h6, p, li, a, .ted-heading__intro) { color: var(--ted-on-primary); }
.ted-sec--bg-primary .ted-line { background: var(--ted-on-primary); box-shadow: none; }
.ted-sec--bg-gradient { background: radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--ted-primary) 40%, transparent), transparent 60%), linear-gradient(180deg, var(--ted-bg), var(--ted-bg-2)); }
.ted-sec--bg-image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--ted-bg);
	opacity: var(--sec-overlay);
}
.ted-sec__bg { position: absolute; inset: -15% 0; z-index: -2; background-size: cover; background-position: center; }

.ted-sec--decor-glow::after {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	z-index: -1;
	width: 80vmax; height: 80vmax;
	transform: translate(-50%, -50%);
	background: radial-gradient(circle, color-mix(in srgb, var(--ted-primary) 22%, transparent), transparent 60%);
	pointer-events: none;
}
.ted-sec--decor-grid::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(color-mix(in srgb, var(--ted-primary) 9%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--ted-primary) 9%, transparent) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
	mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
	pointer-events: none;
}
.ted-sec--decor-stripes::after {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 10px;
	background: repeating-linear-gradient(-45deg, var(--ted-primary) 0 14px, var(--ted-bg) 14px 28px);
	background-size: 39.6px 39.6px;
	animation: ted-stripes 1.6s linear infinite;
}
.ted-sec__ecg { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: -1; opacity: .8; }
.ted-sec .ted-siren { opacity: .05; }

/* ---------- Titolo di sezione ---------- */
.ted-heading--center { text-align: center; margin-inline: auto; }
.ted-heading--center .ted-line { margin-inline: auto; transform-origin: center; }
.ted-block--logo { line-height: 1; padding-block: 1rem; }
.ted-block--logo.has-text-align-center { text-align: center; }
.ted-block--logo.has-text-align-right { text-align: right; }
.ted-block--counter, .ted-block--timer { margin-block: 1.5rem; }

/* ---------- Effetti al passaggio del mouse ---------- */
.ted-hover-lift, .ted-hover-glow, .ted-hover-zoom, .ted-hover-beacon {
	transition: transform .45s var(--ted-anim-ease), box-shadow .45s, opacity var(--ted-anim-dur) var(--ted-anim-ease), filter var(--ted-anim-dur) var(--ted-anim-ease), clip-path var(--ted-anim-dur) var(--ted-anim-ease);
}
.ted-hover-lift.is-in:hover, .ted-anim-off .ted-hover-lift:hover, .ted-hover-lift:not(.ted-reveal):hover { transform: translateY(-8px); }
.ted-hover-zoom.is-in:hover, .ted-anim-off .ted-hover-zoom:hover, .ted-hover-zoom:not(.ted-reveal):hover { transform: scale(1.04); }
.ted-hover-glow:hover {
	box-shadow: 0 0 0 1px var(--ted-primary), 0 24px 50px -18px var(--ted-glow);
	border-radius: var(--ted-radius);
}
.ted-hover-beacon:hover { animation: ted-hover-beacon 1.1s linear infinite; border-radius: var(--ted-radius); }
@keyframes ted-hover-beacon {
	0%, 100% { box-shadow: 0 0 0 1px var(--ted-line); }
	6%, 16% { box-shadow: 0 0 0 1px var(--ted-beacon), -18px 0 40px -10px var(--ted-beacon); }
	11% { box-shadow: 0 0 0 1px var(--ted-line); }
	50% { box-shadow: 0 0 0 1px var(--ted-line); }
	56%, 66% { box-shadow: 0 0 0 1px var(--ted-primary), 18px 0 40px -10px var(--ted-primary); }
	61% { box-shadow: 0 0 0 1px var(--ted-line); }
}

/* ---------- Visibilità per dispositivo ---------- */
@media (max-width: 767px) { .ted-hide-mobile { display: none !important; } }
@media (min-width: 768px) and (max-width: 1080px) { .ted-hide-tablet { display: none !important; } }
@media (min-width: 1081px) { .ted-hide-desktop { display: none !important; } }

/* ---------- Stili aggiuntivi dei blocchi del nucleo ---------- */
.is-style-ted-solid .wp-block-button__link {
	background: var(--ted-primary);
	color: var(--ted-on-primary);
	border: 2px solid var(--ted-primary);
	box-shadow: 0 10px 30px -12px var(--ted-glow);
}
.is-style-ted-ghost .wp-block-button__link {
	background: transparent;
	color: var(--ted-text);
	border: 2px solid color-mix(in srgb, var(--ted-text) 35%, transparent);
}
.is-style-ted-ghost .wp-block-button__link:hover { border-color: var(--ted-primary); background: var(--ted-primary); color: var(--ted-on-primary); }

.wp-block-group.is-style-ted-card {
	padding: clamp(1.4rem, 3vw, 2.2rem);
	border: 1px solid var(--ted-line);
	border-radius: var(--ted-radius);
	background: var(--ted-surface);
}
.wp-block-group.is-style-ted-hazard {
	position: relative;
	padding: clamp(1.4rem, 3vw, 2.2rem);
	padding-top: calc(clamp(1.4rem, 3vw, 2.2rem) + 10px);
	border: 1px solid color-mix(in srgb, var(--ted-primary) 45%, transparent);
	border-radius: var(--ted-radius);
	background: color-mix(in srgb, var(--ted-primary) 6%, var(--ted-bg));
	overflow: hidden;
}
.wp-block-group.is-style-ted-hazard::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 8px;
	background: repeating-linear-gradient(-45deg, var(--ted-primary) 0 12px, var(--ted-bg) 12px 24px);
}
.wp-block-image.is-style-ted-frame { position: relative; }
.wp-block-image.is-style-ted-frame img { border-radius: var(--ted-radius); position: relative; z-index: 1; }
.wp-block-image.is-style-ted-frame::before {
	content: "";
	position: absolute;
	inset: 1rem -1rem -1rem 1rem;
	border: 2px solid var(--ted-primary);
	border-radius: var(--ted-radius);
}
ul.is-style-ted-check { list-style: none; padding-left: 0; }
ul.is-style-ted-check li { position: relative; padding-left: 2rem; margin-bottom: .6em; }
ul.is-style-ted-check li::before {
	content: "";
	position: absolute;
	left: 0; top: .3em;
	width: 1.1rem; height: 1.1rem;
	background: var(--ted-primary);
	clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}
.wp-block-quote.is-style-ted-callout {
	padding: 1.4rem 1.6rem;
	border: 0;
	border-left: 4px solid var(--ted-primary);
	border-radius: 0 var(--ted-radius) var(--ted-radius) 0;
	background: color-mix(in srgb, var(--ted-primary) 10%, transparent);
	font-size: 1.05em;
}

/* Colonne del nucleo dentro le sezioni */
.ted-sec .wp-block-columns { gap: clamp(1.5rem, 4vw, 3.5rem); }

/* Elenchi e card restano allineati a sinistra anche nelle sezioni centrate */
.ted-sec--t-center .ted-sec__inner :is(ul, ol, .is-style-ted-card, .is-style-ted-hazard) { text-align: left; }
/* Pulsanti leggibili su fondo arancione */
.ted-sec--bg-primary .is-style-ted-ghost .wp-block-button__link { color: var(--ted-on-primary); border-color: var(--ted-on-primary); }
.ted-sec--bg-primary .is-style-ted-ghost .wp-block-button__link:hover { background: var(--ted-on-primary); color: var(--ted-primary); }
.ted-sec--bg-primary .ted-btn, .ted-sec--bg-primary .is-style-ted-solid .wp-block-button__link { background: var(--ted-on-primary); color: var(--ted-primary); border-color: var(--ted-on-primary); }

/* =================================================================
 * TED Builder — righe, colonne e moduli sul sito
 * ================================================================= */
.tedb-sec { position: relative; }
.tedb-row { display: grid; grid-template-columns: var(--tedb-cols, 1fr); gap: 2rem; align-items: start; }
.tedb-row--gap-none { gap: 0; }
.tedb-row--gap-s { gap: 1rem; }
.tedb-row--gap-l { gap: clamp(2rem, 5vw, 4.5rem); }
.tedb-row--v-center { align-items: center; }
.tedb-row--v-end { align-items: end; }
.tedb-row--v-stretch { align-items: stretch; }
.tedb-row--v-stretch > .tedb-col > .tedb-mod:only-child, .tedb-row--v-stretch > .tedb-col > .tedb-mod:only-child > * { height: 100%; }
.tedb-col { min-width: 0; }
.tedb-mod:last-child { margin-bottom: 0 !important; }
.tedb-mod.has-text-align-center { text-align: center; }
.tedb-mod.has-text-align-right { text-align: right; }
.tedb-mod.has-text-align-center .ted-line, .tedb-mod.has-text-align-center .ted-heading { margin-inline: auto; }
.tedb-mod.has-text-align-right .ted-line { margin-left: auto; }
.tedb-mod .ted-heading { margin-bottom: 0; }
.tedb-mod .ted-heading--right { text-align: right; margin-left: auto; }
@media (max-width: 1080px) { .tedb-row--cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) { .tedb-row { grid-template-columns: 1fr; } }

.tedb-text { max-width: 72ch; }
.has-text-align-center .tedb-text { margin-inline: auto; }
.tedb-text--small { font-size: .9rem; }
.tedb-text--large { font-size: 1.18rem; }
.tedb-text--lead { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.45; }
.tedb-text > :last-child { margin-bottom: 0; }

.tedb-img { margin: 0; position: relative; display: inline-block; max-width: 100%; }
.tedb-img__box { overflow: hidden; }
.tedb-img img { width: 100%; transition: transform 1s var(--ted-anim-ease); }
.tedb-img--round .tedb-img__box { border-radius: var(--ted-radius); }
.tedb-img--circle .tedb-img__box { border-radius: 50%; aspect-ratio: 1; }
.tedb-img--circle img { height: 100%; object-fit: cover; }
.tedb-img--frame { margin: 0 1rem 1rem 0; }
.tedb-img--frame .tedb-img__box { border-radius: var(--ted-radius); position: relative; z-index: 1; }
.tedb-img--frame::before { content: ""; position: absolute; inset: 1rem -1rem -1rem 1rem; border: 2px solid var(--ted-primary); border-radius: var(--ted-radius); }
.tedb-img--zoom:hover img { transform: scale(1.06); }
.tedb-img figcaption { margin-top: .6rem; font-size: .88rem; color: var(--ted-muted); }

.tedb-btn--sm { padding: .7em 1.2em; font-size: .82rem; }
.tedb-btn--lg { padding: 1.2em 2.2em; font-size: 1.1rem; }
.tedb-btn--gradient { background: linear-gradient(120deg, var(--ted-primary), var(--ted-primary-2), var(--ted-primary)); background-size: 200% 100%; border-color: transparent; animation: ted-shift 6s linear infinite; }

.tedb-logo { line-height: 1; padding-block: .5rem; }
.tedb-ibox--plain { background: none; border: 0; padding: 0; }
.tedb-ibox--hazard { border-color: color-mix(in srgb, var(--ted-primary) 45%, transparent); padding-top: calc(clamp(1.6rem, 3vw, 2.4rem) + 8px); }
.tedb-ibox--hazard::before { transform: none !important; height: 8px; background: repeating-linear-gradient(-45deg, var(--ted-primary) 0 12px, var(--ted-bg) 12px 24px); }
.tedb-box-link { display: block; color: inherit; }
.tedb-box-link:hover { color: inherit; }
.has-text-align-center .ted-pillar__icon { margin-inline: auto; }

.tedb-list { margin: 0; padding: 0; list-style: none; }
.has-text-align-center .tedb-list { display: inline-block; text-align: left; }
.tedb-list li { position: relative; padding-left: 2rem; margin-bottom: .6em; }
.tedb-list--cross li::before, .tedb-list--check li::before, .tedb-list--plain li::before { content: ""; position: absolute; left: 0; }
.tedb-list--cross li::before { top: .3em; width: 1.05rem; height: 1.05rem; background: var(--ted-primary); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.tedb-list--check li::before { top: .25em; width: .55rem; height: 1rem; border: solid var(--ted-primary); border-width: 0 3px 3px 0; transform: rotate(45deg); left: .3rem; }
.tedb-list--plain li::before { top: .6em; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ted-primary); }
.tedb-list--number { counter-reset: tedb; }
.tedb-list--number li { counter-increment: tedb; }
.tedb-list--number li::before { content: counter(tedb); position: absolute; left: 0; top: .05em; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ted-primary); color: var(--ted-on-primary); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

.tedb-spacer { position: relative; display: flex; align-items: center; }
.tedb-spacer__line { display: block; width: 100%; height: 1px; background: var(--ted-line); }
.tedb-spacer__stripes { display: block; width: 100%; height: 10px; background: repeating-linear-gradient(-45deg, var(--ted-primary) 0 14px, transparent 14px 28px); }
.tedb-spacer__ecg { width: 100%; height: 60px; }

.tedb-video { position: relative; width: 100%; overflow: hidden; border-radius: var(--ted-radius); background: #000; }
.tedb-video iframe, .tedb-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
