/*
Theme Name: Mazzini Maremma
Theme URI: https://www.mazzinimaremma.it
Description: Child theme di Divi 5 per il sito dell'Azienda Agricola Mazzini Maremma (Braccagni, GR). Contiene i font in locale, il CSS e le funzioni personalizzate.
Author: Massimo
Template: Divi
Version: 0.1.0
Text Domain: mazzini-maremma
*/

/* ==========================================================================
   CSS personalizzato del sito — da qui in giù.
   I font sono in fonts/fonts.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header globale (sezione con classe mm-header)
   Colori: solo variabili dei colori globali di Divi.
   -------------------------------------------------------------------------- */

/* Logo: larghezza naturale, il menu prende lo spazio che resta. */
.mm-header .mm-header__logo {
	flex: 0 0 auto;
	width: auto;
}

.mm-header .mm-header__nav {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

.mm-header .mm-header__logo .et_pb_image,
.mm-header .mm-header__logo .et_pb_image_wrap,
.mm-header .mm-header__logo img {
	display: block;
}

/* Voci di menu: padding 10×14 e 8 px tra una voce e l'altra, come nel mockup. */
.mm-header .et_pb_menu .et_pb_menu__menu > nav > ul.et-menu {
	margin: 0;
	gap: 8px;
}

.mm-header .et_pb_menu .et_pb_menu__menu > nav > ul.et-menu > li {
	margin: 0;
	padding: 0;
}

.mm-header .et_pb_menu .et_pb_menu__menu > nav > ul.et-menu > li > a {
	padding: 10px 14px;
	line-height: 1.6;
	opacity: 1;
}

.mm-header .et_pb_menu .et_pb_menu__menu > nav > ul.et-menu > li > a:hover {
	opacity: 1;
	text-decoration: underline;
	text-decoration-color: var(--gcid-primary-color);
	text-decoration-thickness: 3px;
	text-underline-offset: 8px;
}

/* Voce attiva: grassetto e sottolineatura Rosso Pomodoro di 3 px, offset 8 px. */
.mm-header .et_pb_menu .et-menu > li.current-menu-item > a,
.mm-header .et_pb_menu .et_mobile_menu li.current-menu-item > a {
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--gcid-primary-color);
	text-decoration-thickness: 3px;
	text-underline-offset: 8px;
}

/* Pillola del telefono: non cambia forma al passaggio del mouse. */
body #page-container .mm-header .mm-pillola-telefono,
body #page-container .mm-header .mm-pillola-telefono:hover {
	padding: 11px 20px !important;
	white-space: nowrap;
}

/* Menu a tendina su mobile: largo quanto l'header, sotto il bordo. */
@media (max-width: 980px) {
	.mm-header .et_pb_row {
		position: relative;
	}

	.mm-header .mm-header__nav,
	.mm-header .et_pb_menu,
	.mm-header .et_pb_menu_inner_container,
	.mm-header .et_pb_menu__wrap,
	.mm-header .et_mobile_nav_menu,
	.mm-header .mobile_nav {
		position: static;
	}

	.mm-header .et_pb_menu .et_mobile_menu {
		top: calc(100% + 14px);
		left: 0;
		right: 0;
		width: auto;
		padding: 8px 16px 16px;
	}

	.mm-header .et_pb_menu .et_mobile_menu li a {
		padding: 12px 8px;
		font-size: 17px;
		font-weight: 600;
		border-bottom: 0;
	}
}

@media (max-width: 767px) {
	.mm-header .et_pb_menu .et_mobile_menu {
		top: calc(100% + 10px);
	}
}

/* --------------------------------------------------------------------------
   Footer globale: silhouette (mm-paesaggio) e fascia verde (mm-footer)
   -------------------------------------------------------------------------- */

/* Silhouette: 100% × 80 px, ritagliata e ancorata in basso, attaccata al footer. */
.mm-paesaggio .et_pb_image,
.mm-paesaggio .et_pb_image_wrap {
	display: block;
	width: 100%;
	margin: 0;
}

.mm-paesaggio img {
	display: block;
	width: 100%;
	height: 80px;
	object-fit: cover;
	object-position: center bottom;
	margin-bottom: -1px;
}

/* Elenchi del footer: 10 px tra una riga e l'altra.
   Link senza sottolineatura: compare al passaggio del mouse e col focus da tastiera. */
.mm-footer .et_pb_text p {
	padding-bottom: 0;
}

.mm-footer .et_pb_text p + p {
	margin-top: 10px;
}

.mm-footer .et_pb_text a {
	text-decoration: none;
}

.mm-footer .et_pb_text a:hover,
.mm-footer .et_pb_text a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Effetti (i colori --mm-… arrivano dai colori globali di Divi, vedi functions.php)
   -------------------------------------------------------------------------- */

:root {
	/* Velo Notte: overlay dell'hero. */
	--mm-velo-notte: linear-gradient(90deg, rgba(28, 28, 80, 0.85) 0%, rgba(28, 28, 80, 0.55) 55%, rgba(28, 28, 80, 0.1) 100%);
	/* Ombra di foto e card. */
	--mm-ombra: 0 8px 22px rgba(28, 28, 134, 0.12);
	/* Ombra delle card prodotto. */
	--mm-ombra-card: 0 2px 4px rgba(28, 28, 134, 0.06), 0 10px 28px rgba(28, 28, 134, 0.12);
	--mm-raggio: 20px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

/* Focus da tastiera sempre visibile, Blu Mare Notte. */
a:focus-visible,
button:focus-visible,
.et_pb_button:focus-visible {
	outline: 3px solid var(--mm-blu-mare-notte);
	outline-offset: 3px;
}

.mm-hero a:focus-visible,
.mm-hero button:focus-visible,
.mm-footer a:focus-visible {
	outline-color: var(--mm-bianco-latte);
}

/* Link nel testo: Rosso Pomodoro sottolineato, più scuro al passaggio del mouse. */
#main-content .et_pb_text a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

#main-content .et_pb_text a:hover {
	color: var(--mm-rosso-pomodoro-maturo);
}

/* I paragrafi dei moduli Testo non aggiungono spazio sotto: lo spazio lo dà il layout. */
#main-content .et_pb_text p:last-of-type {
	padding-bottom: 0;
}

/* I titoli non aggiungono spazio sotto: lo spazio lo dà il layout. */
#main-content .et_pb_heading .et_pb_module_header {
	padding-bottom: 0;
}

/* Sopratitolo (eyebrow). */
.mm-sopratitolo p {
	text-transform: uppercase;
}

/* Pulsanti blu e a contorno: leggero schiarimento al passaggio del mouse. */
body #page-container .et_pb_section .mm-pulsante--blu:hover,
body #page-container .et_pb_section .mm-pulsante--contorno:hover,
body #page-container .et_pb_section .mm-pulsante--contorno-bianco:hover {
	opacity: 0.88;
}

/* --------------------------------------------------------------------------
   Home — hero
   -------------------------------------------------------------------------- */

.mm-hero {
	position: relative;
	overflow: hidden;
}

/* Velo Notte sopra il poster e il video. */
.mm-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--mm-velo-notte);
	pointer-events: none;
}

.mm-hero > .et_pb_row {
	position: relative;
	z-index: 2;
}

/* Video di sfondo: riempie l'hero come object-fit: cover (video in 16:9). */
.mm-hero__video {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	container-type: size;
	opacity: 0;
	transition: opacity 0.8s ease;
	pointer-events: none;
}

.mm-hero--video-attivo .mm-hero__video {
	opacity: 1;
}

.mm-hero--in-pausa .mm-hero__video {
	opacity: 0;
}

.mm-hero__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100cqw, 177.78cqh);
	height: max(100cqh, 56.25cqw);
	/* Divi limita ogni iframe al 100% della larghezza: qui deve poter sbordare. */
	max-width: none;
	max-height: none;
	transform: translate(-50%, -50%);
	border: 0;
}

/* Pulsante tondo per mettere in pausa il video. */
.mm-hero__pausa {
	position: absolute;
	top: 24px;
	right: 32px;
	z-index: 3;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mm-bianco-latte);
	color: var(--mm-inchiostro);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.mm-hero__pausa[hidden] {
	display: none;
}

.mm-hero .mm-hero__testi {
	max-width: 760px;
}

.mm-hero__sottotitolo {
	max-width: 32em;
}

/* Trattino rosso prima del sopratitolo. */
.mm-trattino {
	display: inline-block;
	width: 28px;
	height: 3px;
	margin-right: 12px;
	vertical-align: middle;
	background: var(--mm-rosso-pomodoro);
}

/* Pillola bianca «Guarda il video completo». */
@media (min-width: 981px) {
	.mm-hero .mm-hero__video-link {
		flex: 0 0 auto;
		width: auto;
	}
}

#main-content .et_pb_text a.mm-pillola-video {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px 12px 14px;
	border-radius: 999px;
	background: var(--mm-bianco-latte);
	color: var(--mm-inchiostro);
	text-decoration: none;
	white-space: nowrap;
}

#main-content .et_pb_text a.mm-pillola-video:hover {
	color: var(--mm-inchiostro);
	text-decoration: underline;
}

.mm-pillola-video__icona {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--mm-rosso-pomodoro);
	color: var(--mm-bianco-latte);
}

/* --------------------------------------------------------------------------
   Home — componenti
   -------------------------------------------------------------------------- */

/* Icona di linea blu in un cerchio bianco da 64 px (card dei valori). */
.mm-icona-valore {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--mm-bianco-latte);
}

.mm-icona-valore svg {
	display: block;
}

/* Card «Perché scegliere»: icona da 84 px a sinistra, testo a destra. */
.mm-motivo .mm-icona-motivo {
	flex: 0 0 84px;
	width: 84px;
	margin: 0;
}

.mm-motivo .mm-icona-motivo img {
	display: block;
	width: 84px;
	height: 84px;
}

.mm-motivo > .et_pb_group {
	flex: 1 1 auto;
	min-width: 0;
}

/* Numeri grandi delle bande: sempre su una riga. */
.mm-numero p {
	white-space: nowrap;
}

/* Foto con raggio 20 e ombra, nei formati 4:3, 3:4 e 4:5. */
.mm-foto,
.mm-foto .et_pb_image_wrap {
	display: block;
	width: 100%;
}

.mm-foto .et_pb_image_wrap,
.mm-foto--mancante .et_pb_text_inner {
	border-radius: var(--mm-raggio);
	box-shadow: var(--mm-ombra);
	overflow: hidden;
}

.mm-foto--3-4 .et_pb_image_wrap,
.mm-foto--3-4.mm-foto--mancante .et_pb_text_inner {
	aspect-ratio: 3 / 4;
}

.mm-foto--4-3 .et_pb_image_wrap,
.mm-foto--4-3.mm-foto--mancante .et_pb_text_inner {
	aspect-ratio: 4 / 3;
}

.mm-foto--4-5 .et_pb_image_wrap {
	aspect-ratio: 4 / 5;
}

.mm-foto img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Segnaposto visibile per una foto non ancora ricevuta. */
.mm-foto--mancante .et_pb_text_inner {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--mm-sabbia-di-maremma);
}

.mm-prodotto .mm-prodotto__sotto {
	margin-top: -8px;
}

/* Cartello PNRR: centrato, all'80% della larghezza del contenuto. */
.mm-cartello-pnrr {
	width: 80%;
	align-self: center;
	margin-left: auto;
	margin-right: auto;
}

.mm-cartello-pnrr a,
.mm-cartello-pnrr .et_pb_image_wrap,
.mm-cartello-pnrr img {
	display: block;
	width: 100%;
	height: auto;
}

/* --------------------------------------------------------------------------
   Pagine interne — componenti
   -------------------------------------------------------------------------- */

/* Paragrafo introduttivo sotto l'H1. */
.mm-intro {
	max-width: 34em;
}

/* Righe bianche con icona da 64 px (Lotta integrata). */
.mm-motivo .mm-icona-motivo--64 {
	flex-basis: 64px;
	width: 64px;
}

.mm-motivo .mm-icona-motivo--64 img {
	width: 64px;
	height: 64px;
}

.mm-pratica .mm-pratica__testo {
	flex: 1 1 auto;
	min-width: 0;
}

.mm-pratica strong {
	color: var(--mm-blu-mare-notte);
}

/* Chip a pillola: testo blu su pastello. */
.mm-chip-modulo ul.mm-chip {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mm-chip__voce {
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	color: var(--mm-blu-mare-notte);
}

.mm-chip--grandi {
	gap: 10px;
}

.mm-chip-modulo ul.mm-chip--grandi {
	gap: 10px;
}

.mm-chip--grandi .mm-chip__voce {
	padding: 8px 18px;
	font-size: 17px;
}

.mm-chip__voce--pesca {
	background: var(--mm-rosa-pesca);
}

.mm-chip__voce--sole {
	background: var(--mm-giallo-sole);
}

.mm-chip__voce--paesaggio {
	background: var(--mm-verde-paesaggio);
}

.mm-chip__voce--cielo {
	background: var(--mm-azzurro-cielo);
}

/* Card prodotto: foto 4:3 a filo in alto, ombra, testo sotto. */
.mm-card-prodotto {
	overflow: hidden;
	box-shadow: var(--mm-ombra-card);
}

.mm-card-prodotto .mm-foto .et_pb_image_wrap,
.mm-card-prodotto .mm-foto--mancante .et_pb_text_inner {
	border-radius: 0;
	box-shadow: none;
}

.mm-card-prodotto > .et_pb_group {
	flex: 1 1 auto;
}

.mm-card-prodotto .mm-chip-modulo {
	margin-top: auto;
}

/* Elenco di definizioni (orari, recapiti): etichetta blu a sinistra, valore a destra. */
.mm-definizioni dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px 20px;
	margin: 0;
}

.mm-definizioni dt {
	font-weight: 800;
	color: var(--mm-blu-mare-notte);
}

.mm-definizioni dd {
	margin: 0;
}

#main-content .mm-definizioni--recapiti a {
	color: var(--mm-blu-mare-notte);
	font-weight: 700;
}

.mm-definizioni--recapiti dl {
	gap: 12px 20px;
}

@media (max-width: 479px) {
	.mm-definizioni dl {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.mm-definizioni dd {
		margin-bottom: 10px;
	}
}

/* Box con i pulsanti in fondo, alto quanto la mappa accanto. */
.mm-box-alto > .mm-pulsanti {
	margin-top: auto;
}

/* Didascalia sotto la mappa. */
.mm-didascalia {
	font-size: 14px;
}

/* --------------------------------------------------------------------------
   Mappa OpenStreetMap (shortcode [mm_mappa])
   -------------------------------------------------------------------------- */

.mm-mappa {
	width: 100%;
	aspect-ratio: 16 / 10;
	min-height: 400px;
	border-radius: var(--mm-raggio);
	overflow: hidden;
	background: var(--mm-bordo-lino);
	isolation: isolate;
}

.mm-mappa__segnaposto {
	color: var(--mm-rosso-pomodoro);
	background: none;
	border: 0;
}

.mm-mappa__goccia {
	fill: currentColor;
	stroke: var(--mm-bianco-latte);
	stroke-width: 2;
}

.mm-mappa__punto {
	fill: var(--mm-bianco-latte);
}

.mm-mappa .leaflet-container,
.mm-mappa.leaflet-container {
	font-family: inherit;
}

.mm-intro--largo {
	max-width: 36em;
}

/* Le ancore non finiscono a filo del bordo dello schermo. */
.mm-ancora {
	scroll-margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Pagine di solo testo (Privacy, Cookie policy)
   -------------------------------------------------------------------------- */

/* Colonna di lettura stretta, allineata a sinistra con il resto del sito. */
.mm-testo-lungo .et_pb_text {
	max-width: 46em;
}

.mm-testo-lungo .et_pb_text h2 {
	margin-top: 1.6em;
	padding-bottom: 0.4em;
	font-size: 28px;
	line-height: 1.15;
}

.mm-testo-lungo .et_pb_text p,
.mm-testo-lungo .et_pb_text ul,
.mm-testo-lungo .et_pb_text ol {
	padding-bottom: 1em;
}

/* Segnaposto visibile per un testo non ancora ricevuto. */
.mm-testo-mancante .et_pb_text_inner {
	padding: 24px;
	border: 2px dashed var(--mm-bordo-lino);
	border-radius: var(--mm-raggio);
	background: var(--mm-sabbia-di-maremma);
}

/* Riquadro al posto della mappa finché manca il consenso ai contenuti di terzi. */
.mm-mappa {
	position: relative;
}

.mm-mappa__consenso {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 24px;
	text-align: center;
	background: var(--mm-sabbia-di-maremma);
	color: var(--mm-inchiostro);
}

.mm-mappa__consenso p {
	max-width: 26em;
	padding: 0;
}

.mm-mappa__mostra {
	padding: 16px 28px;
	border: 0;
	border-radius: 999px;
	background: var(--mm-blu-mare-notte);
	color: var(--mm-bianco-latte);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.mm-mappa__mostra:hover {
	opacity: 0.88;
}

.mm-mappa__consenso a {
	font-size: 14px;
	text-decoration: underline;
}
