/*
 * TAF Machinery – Home restyling 2026
 * Figma "TAF Restyling 2026", frame Homepage (1:12).
 * Ambito: sezioni Avia con classe taf-home-sec (e varianti) + shortcode [taf_categorie].
 * Nessun selettore globale: tutto è limitato alle classi taf-home-* / taf-cat-*.
 */

.taf-home-sec,
.taf-cat-grid {
	--taf-home-dark: #1e1e1e;
	--taf-home-text: #000000;
	--taf-home-accent: #e65100;
	--taf-home-accent-hover: #c24400;
	--taf-home-soft: #f7f6f5;
	--taf-home-gutter: clamp(20px, 6.25vw, 120px);
	--taf-home-max: 1432px;
	--taf-home-title: 42px;

	/*
	 * Altezza hero calcolata sul viewport: la fascia "Si affidano a noi"
	 * (titolo + loghi) deve restare sempre nel primo viewport.
	 * Spazio occupato sopra/sotto l'hero: top bar, barra header (--taf-header-h,
	 * misurata da taf-header.js), admin bar, barra CTA mobile.
	 */
	--taf-clients-pad: 74px;
	--taf-clients-gap: 39px;
	--taf-logo-row: 77px;
	--taf-hero-topbar: 52px;
	--taf-hero-adminbar: 0px;
	--taf-hero-cta: 0px;
	--taf-hero-min: 300px;
	--taf-hero-max: 664px;
	--taf-hero-fold: calc(var(--taf-hero-topbar) + var(--taf-header-h, 94px) + var(--taf-hero-adminbar) + var(--taf-hero-cta) + var(--taf-clients-pad) + var(--taf-home-title) * 1.36 + var(--taf-clients-gap) + var(--taf-logo-row) + 16px);
}

#top.admin-bar .taf-home-sec {
	--taf-hero-adminbar: 32px;
}

/* ===================================================================
 * Struttura comune delle sezioni Avia
 * ================================================================= */
#top .taf-home-sec {
	font-family: 'manrope', 'Manrope', sans-serif;
	color: var(--taf-home-text);
	border: 0;
}

.responsive #top #wrap_all .taf-home-sec .container {
	width: 100%;
	max-width: calc(var(--taf-home-max) + 2 * var(--taf-home-gutter));
	padding: 0 var(--taf-home-gutter);
	box-sizing: border-box;
}

#top .taf-home-sec .container .content,
#top .taf-home-sec .container .template-page {
	padding-top: 0;
	padding-bottom: 0;
	border: 0;
}

#top .taf-home-sec .entry-content-wrapper > :last-child {
	margin-bottom: 0;
}

/* Titoli di sezione (Manrope Bold 42px, #1e1e1e) */
/*
 * !important necessari: il custom.css del tema padre (non modificabile) forza
 * ".av-special-heading.av-special-heading-h2 h2 { font-size: 16px !important }"
 * con colore arancio e padding 10px.
 */
#top .taf-home-title,
#top .taf-home-title.av-special-heading.av-special-heading-h2 {
	margin: 0 !important;
	padding: 0 !important;
}

#top .taf-home-title .av-special-heading-tag,
#top .taf-home-title.av-special-heading.av-special-heading-h2 h2 {
	margin: 0;
	padding: 0 !important;
	font-family: 'manrope', 'Manrope', sans-serif;
	font-size: var(--taf-home-title) !important;
	font-weight: 700 !important;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: none;
	color: var(--taf-home-dark) !important;
}

/*
 * Bordo del titolo Enfold usato come spazio bianco (nessuna linea visibile):
 * l'altezza è lo spazio tra il titolo e il contenuto della sezione.
 */
#top .taf-home-title .special-heading-border {
	display: block;
	width: 100%;
	height: var(--taf-home-title-gap, 0px);
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

#top .taf-home-title .special-heading-inner-border {
	display: block;
	height: 0;
	margin: 0;
	border: 0 !important;
	opacity: 0;
}

#top .taf-home-clients {
	--taf-home-title-gap: var(--taf-clients-gap);
}

#top .taf-home-about {
	--taf-home-title-gap: 18px;
}

#top .taf-home-reviews {
	--taf-home-title-gap: 38px;
}

#top .taf-home-title--center {
	text-align: center;
}

/* ===================================================================
 * 1. Hero (altezza dal viewport, max 664px, overlay nero 30%)
 * ================================================================= */
#top .taf-home-hero {
	position: relative;
	background-position: 50% 34% !important;
	background-size: cover;
}

#top .taf-home-hero .container {
	display: flex;
	align-items: flex-end;
	min-height: clamp(var(--taf-hero-min), calc(100vh - var(--taf-hero-fold)), var(--taf-hero-max));
	min-height: clamp(var(--taf-hero-min), calc(100svh - var(--taf-hero-fold)), var(--taf-hero-max));
}

#top .taf-home-hero .container > .content,
#top .taf-home-hero .container > main {
	width: 100%;
	padding: 0 0 clamp(32px, 12vh, 163px);
}

#top .taf-home-hero .av_textblock_section,
#top .taf-home-hero .avia_textblock {
	margin: 0;
	color: #ffffff !important;
}

#top .taf-home-hero__title {
	margin: 0;
	padding: 0;
	font-family: 'manrope', 'Manrope', sans-serif;
	font-size: 64px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: none;
	color: #ffffff !important;
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

#top .taf-home-hero__subtitle {
	margin: 0;
	padding: 0;
	font-size: 42px;
	font-weight: 400;
	line-height: 1.36;
	color: #ffffff !important;
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

/* ===================================================================
 * 2. Si affidano a noi (loghi)
 * ================================================================= */
#top .taf-home-clients {
	padding: var(--taf-clients-pad) 0 0;
}

#top .taf-home-logos {
	margin: 0;
}

#top .taf-home-logos .avia-content-slider-inner,
#top .taf-home-logos .slide-entry-wrap {
	height: auto !important;
}

#top .taf-home-logos .slide-entry-wrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px clamp(16px, 2.5vw, 40px);
	padding: 0 clamp(0px, 2vw, 39px);
	margin: 0;
	position: static;
	width: auto;
}

#top .taf-home-logos .slide-entry-wrap::before,
#top .taf-home-logos .slide-entry-wrap::after {
	display: none;
}

#top .taf-home-logos .slide-entry {
	float: none;
	flex: 0 1 auto;
	min-width: 0;
	width: auto !important;
	margin: 0 !important;
	padding: 0;
	border: 0 !important;
	background: none;
}

#top .taf-home-logos .slide-entry img {
	display: block;
	width: auto;
	max-width: min(146px, 100%);
	height: auto;
	max-height: 77px;
	margin: 0 auto;
}

/* ===================================================================
 * 3. Le nostre attrezzature (testo + griglia categorie)
 * ================================================================= */
#top .taf-home-equipment {
	padding: 74px 0 78px;
}

#top .taf-home-intro {
	max-width: 874px;
	margin: 0 auto 45px;
	font-size: 18px;
	line-height: 28px;
	text-align: center;
	color: var(--taf-home-text);
}

#top .taf-home-intro p {
	margin: 0;
}

#top .taf-home-intro strong {
	font-weight: 700;
}

#top .taf-home-sec .avia_codeblock_section,
#top .taf-home-sec .avia_codeblock {
	margin: 0;
}

.taf-cat-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px 37px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#top .taf-cat-grid .taf-cat-card {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
}

#top .taf-cat-card__link {
	display: block;
	color: var(--taf-home-dark);
	text-decoration: none;
	border-radius: 20px;
}

.taf-cat-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 453 / 275;
	border-radius: 20px;
	background: var(--taf-home-soft);
}

#top .taf-cat-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease;
}

#top .taf-cat-card__title {
	min-height: 2.72em;
	margin: 15px 0 0;
	padding: 0;
	font-family: 'manrope', 'Manrope', sans-serif;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: none;
	color: var(--taf-home-dark);
}

#top .taf-cat-card__link:hover .taf-cat-card__title,
#top .taf-cat-card__link:focus-visible .taf-cat-card__title {
	text-decoration: underline;
	text-underline-offset: 4px;
}

#top .taf-cat-card__link:hover .taf-cat-card__img {
	transform: scale(1.04);
}

#top .taf-cat-card__link:focus-visible {
	outline: 2px solid var(--taf-home-accent);
	outline-offset: 4px;
}

/* ===================================================================
 * 4. Chi siamo (sfondo #f7f6f5, testo + immagine 749x421)
 * ================================================================= */
#top .taf-home-about {
	padding: 104px 0 105px;
	background-color: var(--taf-home-soft);
}

#top .taf-home-about .entry-content-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 598fr) minmax(0, 749fr);
	gap: 40px 85px;
	align-items: center;
}

#top .taf-home-about .entry-content-wrapper::before,
#top .taf-home-about .entry-content-wrapper::after {
	display: none;
}

#top .taf-home-about .flex_column {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	min-height: 0;
}

#top .taf-home-about .avia_textblock {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	color: var(--taf-home-text);
}

#top .taf-home-about .avia_textblock p {
	margin: 0;
}

#top .taf-home-about .avia_textblock strong {
	font-weight: 700;
}

#top .taf-home-about .avia-image-container,
#top .taf-home-about .avia-image-container-inner,
#top .taf-home-about .avia-image-overlay-wrap {
	display: block;
	width: 100%;
	margin: 0;
}

#top .taf-home-about .avia-image-container img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 749 / 421;
	object-fit: cover;
	border-radius: 20px;
}

/* Pulsante primario arancio con freccia (come "Richiedi un preventivo") */
#top .taf-home-btn {
	margin: 27px 0 0;
}

#top .taf-home-btn .avia-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 60px;
	margin: 0 !important;
	padding: 10px 30px;
	border: 0;
	border-radius: 20px;
	background-color: var(--taf-home-accent);
	color: #ffffff;
	text-decoration: none;
	font-family: 'manrope', 'Manrope', sans-serif;
	font-size: 18.67px;
	font-weight: 700;
	line-height: 28px;
	letter-spacing: 0;
	text-transform: none;
	opacity: 1;
	transition: background-color 0.2s ease;
}

#top .taf-home-btn .avia-button::after {
	content: '';
	flex: 0 0 auto;
	width: 27px;
	height: 15px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27' height='15' viewBox='0 0 27 15'%3E%3Cpath d='M0 7.5h25M19 1.5l6 6-6 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27' height='15' viewBox='0 0 27 15'%3E%3Cpath d='M0 7.5h25M19 1.5l6 6-6 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
	transition: transform 0.2s ease;
}

#top .taf-home-btn .avia-button:hover,
#top .taf-home-btn .avia-button:focus-visible {
	background-color: var(--taf-home-accent-hover);
	color: #ffffff;
}

#top .taf-home-btn .avia-button:hover::after {
	transform: translateX(3px);
}

#top .taf-home-btn .avia-button:focus-visible {
	outline: 2px solid var(--taf-home-dark);
	outline-offset: 3px;
}

#top .taf-home-btn .avia-button .avia_iconbox_title {
	color: inherit;
}

/* ===================================================================
 * 5. Dicono di noi (widget recensioni: contenuto gestito dal plugin)
 * ================================================================= */
#top .taf-home-reviews {
	padding: 122px 0 121px;
}

#top .taf-home-reviews .avia_codeblock_section {
	margin-top: 0;
}

/* ===================================================================
 * Responsive
 * ================================================================= */
@media (max-width: 1499px) {
	#top .taf-cat-card__title {
		font-size: 24px;
	}
}

@media (max-width: 1199px) {
	.taf-home-sec {
		--taf-home-title: 36px;
		--taf-clients-pad: 64px;
		--taf-logo-row: 52px;
		--taf-hero-max: 520px;
	}

	#top.taf-has-cta-bar .taf-home-sec {
		--taf-hero-cta: 80px;
	}

	#top .taf-home-hero__title {
		font-size: 52px;
	}

	#top .taf-home-hero__subtitle {
		font-size: 34px;
	}

	#top .taf-home-logos .slide-entry img {
		max-height: 52px;
	}

	#top .taf-home-about .entry-content-wrapper {
		gap: 40px 48px;
	}
}

@media (max-width: 1023px) {
	.taf-cat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 24px;
	}

	#top .taf-cat-card__title {
		min-height: 0;
		font-size: 22px;
		margin-top: 12px;
	}

	#top .taf-home-about .entry-content-wrapper {
		grid-template-columns: minmax(0, 1fr);
	}

	#top .taf-home-about {
		padding: 72px 0;
	}

	#top .taf-home-reviews {
		padding: 80px 0;
	}

	#top .taf-home-equipment {
		padding: 64px 0 72px;
	}
}

@media (max-width: 767px) {
	.taf-home-sec {
		--taf-home-title: 30px;
		--taf-clients-pad: 40px;
		--taf-clients-gap: 24px;
		--taf-logo-row: 96px;
		--taf-hero-min: 220px;
		--taf-hero-max: 420px;
	}

	#top .taf-home-hero .container > .content,
	#top .taf-home-hero .container > main {
		padding-bottom: clamp(28px, 6vh, 56px);
	}

	#top .taf-home-hero__title {
		font-size: 34px;
	}

	#top .taf-home-hero__subtitle {
		font-size: 24px;
	}

	/* Mobile: loghi su 2 righe da 4, entrambe nel primo viewport */
	#top .taf-home-logos .slide-entry-wrap {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 16px 12px;
		padding: 0;
	}

	#top .taf-home-logos .slide-entry img {
		max-height: 40px;
	}

	#top .taf-home-equipment {
		padding: 56px 0 56px;
	}

	#top .taf-home-intro {
		margin-bottom: 32px;
		font-size: 16px;
		line-height: 26px;
	}

	#top .taf-home-about {
		padding: 56px 0;
	}

	#top .taf-home-about .avia_textblock {
		font-size: 16px;
		line-height: 26px;
	}

	#top .taf-home-reviews {
		padding: 56px 0;
		--taf-home-title-gap: 24px;
	}

	.taf-cat-grid {
		gap: 24px 16px;
	}

	.taf-cat-card__media {
		border-radius: 14px;
	}

	#top .taf-cat-card__title {
		margin-top: 8px;
		font-size: 17px;
		line-height: 1.3;
	}
}

@media (max-width: 559px) {
	#top .taf-home-btn .avia-button {
		width: 100%;
	}
}

/* Schermi bassi (portatili 1366x768, tablet orizzontali): fascia loghi più compatta */
@media (max-height: 860px) and (min-width: 768px) {
	.taf-home-sec {
		--taf-clients-pad: 40px;
		--taf-clients-gap: 24px;
	}
}

@media (max-height: 700px) and (max-width: 767px) {
	.taf-home-sec {
		--taf-clients-pad: 28px;
		--taf-clients-gap: 18px;
	}
}

@media (max-width: 782px) {
	#top.admin-bar .taf-home-sec {
		--taf-hero-adminbar: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#top .taf-cat-card__img,
	#top .taf-home-btn .avia-button,
	#top .taf-home-btn .avia-button::after {
		transition: none;
	}

	#top .taf-cat-card__link:hover .taf-cat-card__img {
		transform: none;
	}
}
