/* Sezioni dedicate: condivise con l'editor, nessun layout globale. */
body.p365-home-template #content > .col-full {
	--p365-home-gutter: clamp(1rem, 4vw, 1.25rem);
	box-sizing: border-box;
	max-width: 77.5rem;
	width: calc(100% - var(--p365-home-gutter) - var(--p365-home-gutter));
	margin-inline: auto;
	padding-inline: 0;
}
body.p365-home-template #primary.content-area {
	float: none;
	width: 100%;
	margin: 0;
}
body.p365-home-template .site-main,
body.p365-home-template .p365-home-article { margin: 0; padding: 0; }
.p365-home-content { padding-block: clamp(1.5rem, 2vw, 2rem) clamp(2rem, 5vw, 4rem); }
.p365-home-section {
	margin-block: 0 clamp(2.5rem, 6vw, 5rem);
	color: var(--p365-color-text);
}
.p365-home-section:last-child { margin-bottom: 0; }
.p365-home-section h1,
.p365-home-section h2,
.p365-home-section h3 { color: var(--p365-color-text); font-family: var(--p365-font-serif); font-weight: 500; letter-spacing: -.02em; }
.p365-home-section h1 { font-size: clamp(2.1rem, 4.4vw, 4.25rem); line-height: 1.08; text-wrap: balance; }
.p365-home-section h2 { font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.15; text-wrap: balance; }
.p365-home-section p { font: 400 1rem/1.75 var(--p365-font-sans); }
.p365-home-section .p365-home-copy > p { max-width: 42rem; }
.p365-home-hero {
	--p365-home-media-share: 1fr;
	margin-inline: 0;
	padding: clamp(2rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem);
	min-height: 0;
	height: auto;
	max-height: none;
	background: var(--p365-color-text);
	color: var(--p365-color-white);
}
.p365-home-hero h1,
.p365-home-hero h2,
.p365-home-hero h3,
.p365-home-hero p { color: var(--p365-color-white); }
.p365-home-hero .p365-home-placeholder,
.p365-home-boxes .p365-home-placeholder {
	background: rgb(250 247 239 / 10%);
	border-color: var(--p365-color-gold);
	color: var(--p365-color-white);
}
.p365-home-hero .wp-block-image img { background: #3a352d; }
.p365-home-hero .wp-block-button__link {
	background: var(--p365-color-gold);
	border-color: var(--p365-color-gold);
	color: var(--p365-color-white);
}
.p365-home-hero .wp-block-button__link:hover { background: var(--p365-color-gold-hover); }
.p365-home-section .p365-home-eyebrow {
	color: var(--p365-color-gold);
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	margin-bottom: var(--p365-space-4);
}
.p365-home-split {
	display: grid;
	grid-template-columns: minmax(0, var(--p365-home-media-share, 1.25fr)) minmax(0, 1fr);
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
}
.p365-home-split > * { min-width: 0; margin: 0; }
/* WordPress può aggiungere questo wrapper ai Gruppi già salvati nell'editor.
 * I suoi figli devono restare celle della griglia esterna, non una sola cella. */
.p365-home-split > .wp-block-group__inner-container {
	display: contents;
}
.p365-home-split > .wp-block-group__inner-container > * {
	min-width: 0;
	margin: 0;
}
.p365-home-media .wp-block-image { margin: 0; }
.p365-home-media .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	border-radius: var(--p365-radius);
}
.p365-home-media figcaption { font-size: .875rem; color: var(--p365-color-muted); }
.p365-home-copy > :last-child { margin-bottom: 0; }
.p365-home-section .wp-block-buttons { margin-top: var(--p365-space-6); }
.p365-home-section .wp-block-button__link {
	font: 600 .95rem/1.4 var(--p365-font-sans);
	background: var(--p365-color-gold);
	border: 1px solid var(--p365-color-gold);
	color: var(--p365-color-white);
	border-radius: var(--p365-radius);
	padding: .85rem 1.4rem;
	text-decoration: none;
}
.p365-home-section .wp-block-button__link:hover { background: var(--p365-color-gold-hover); color: var(--p365-color-white); }
.p365-home-section :focus-visible { outline: 3px solid var(--p365-color-focus); outline-offset: 4px; }
.p365-home-products { padding-block: clamp(1.5rem, 4vw, 3rem); border-block: 1px solid var(--p365-color-border); }
.p365-home-section-heading { max-width: 48rem; margin: 0 auto var(--p365-space-8); text-align: center; }
.p365-home-products > .wp-block-buttons { justify-content: center; }
.p365-home-story { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.p365-home-boxes {
	padding: clamp(1rem, 3vw, 2.5rem);
	background: var(--p365-color-text);
	color: var(--p365-color-white);
	border: 1px solid var(--p365-color-border);
}
.p365-home-boxes h1,
.p365-home-boxes h2,
.p365-home-boxes h3,
.p365-home-boxes p { color: var(--p365-color-white); }
@media (min-width: 48rem) {
	body.p365-home-template #content > .col-full {
		--p365-home-gutter: clamp(1.5rem, 3vw, 2rem);
	}
	.p365-home-boxes > .p365-home-media { order: 2; }
	.p365-home-boxes > .p365-home-copy { order: 1; }
	.p365-home-boxes > .wp-block-group__inner-container > .p365-home-media { order: 2; }
	.p365-home-boxes > .wp-block-group__inner-container > .p365-home-copy { order: 1; }
}
/* Istruzioni editoriali palesi: nessuna foto/URL fittizia. Eliminare le note in bozza. */
.p365-home-section .p365-home-placeholder,
.p365-home-placeholder {
	padding: var(--p365-space-4);
	border: 1px dashed var(--p365-color-gold);
	background: var(--p365-color-ivory);
	color: var(--p365-color-text);
	font: 400 .9rem/1.6 var(--p365-font-sans);
}
/* Rendering WooCommerce nativo, presentazione circoscritta alla selezione home. */
.p365-home-template .p365-home-products .p365-home-selection {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none;
	margin: 0 !important;
}
.p365-home-template .p365-home-products .p365-home-selection ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-flow: row;
	align-items: stretch;
	gap: clamp(1rem, 2.5vw, 2rem);
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}
.p365-home-template .p365-home-products ul.products::before,
.p365-home-template .p365-home-products ul.products::after {
	display: none !important;
	content: none !important;
}
.p365-home-template .p365-home-products ul.products li.product {
	box-sizing: border-box;
	display: flex !important;
	grid-column: auto;
	grid-row: auto;
	flex: 0 1 auto;
	flex-direction: column;
	float: none !important;
	clear: none !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 0 var(--p365-space-4);
	text-align: left;
}
.p365-home-template .p365-home-products ul.products li.product > .woocommerce-LoopProduct-link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}
.p365-home-template .p365-home-products ul.products li.product img {
	display: block;
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: contain;
	margin: 0 0 var(--p365-space-4) !important;
	background: var(--p365-color-white);
}
.p365-home-template .p365-home-products ul.products li.product.outofstock,
.p365-home-template .p365-home-products ul.products li.product.outofstock img { opacity: 1; filter: none; }
.p365-home-template .p365-home-products .onsale { display: none; }
.p365-home-template .p365-home-products .woocommerce-loop-product__title {
	margin: 0 0 var(--p365-space-2);
	font-size: clamp(1.1rem, 1.8vw, 1.55rem);
	line-height: 1.25;
	white-space: normal;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}
.p365-home-template .p365-home-products .price {
	margin-top: auto;
	color: var(--p365-color-text);
	font-size: 1rem;
}
.p365-home-template .p365-home-products .price del { opacity: 1; color: var(--p365-color-muted); }
.p365-home-template .p365-home-products .price ins { background: transparent; font-weight: 600; }
.p365-home-template .p365-home-products .p365-home-stock { font-size: .875rem; margin-block: .5rem 1rem; color: var(--p365-color-muted); }
.p365-home-template .p365-home-products a.p365-home-product-link {
	background: transparent;
	color: var(--p365-color-gold);
	padding: .65rem 0;
	border: 0;
	text-decoration: underline;
	text-underline-offset: .25em;
}
@media (max-width: 59.999rem) {
	.p365-home-template .p365-home-products .p365-home-selection ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 47.999rem) {
	.p365-home-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 29.999rem) {
	.p365-home-template .p365-home-products .p365-home-selection ul.products { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Hero compatta: nessuna altezza imposta al testo o alla sezione. Gli stili
 * inline salvati nei blocchi vanno ripristinati dall'editor (vedere README). */
.p365-home-hero.p365-home-split { gap: clamp(1.5rem, 3vw, 2.5rem); }
.p365-home-hero .p365-home-copy,
.p365-home-hero .p365-home-media { min-height: 0; }
.p365-home-hero h1 {
	font-size: clamp(2.5rem, 3.5vw, 3.25rem);
	line-height: 1.12;
	margin-block: 0 1rem;
	overflow-wrap: break-word;
}
.p365-home-hero .p365-home-copy p { font-size: 1rem; margin-block: 0 1rem; }
.p365-home-hero .p365-home-copy > :last-child,
.p365-home-hero .p365-home-copy > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }
.p365-home-hero .wp-block-buttons { margin-top: 1.25rem; }
.p365-home-hero .p365-home-media .wp-block-image img {
	height: clamp(22.5rem, 28vw, 26.25rem);
	object-fit: cover;
	object-position: center;
}
@media (max-width: 47.999rem) {
	.p365-home-hero h1 { font-size: clamp(1.875rem, 5vw, 2.25rem); }
	.p365-home-hero .p365-home-media .wp-block-image img {
		height: auto;
		aspect-ratio: 4 / 3;
	}
}
