/* Mamma Sceglie — veste grafica morbida e serena.
   Si appoggia a Fondamenta: colori, font e forme arrivano da theme.json,
   qui solo ciò che theme.json non esprime. Mobile-first. */

:root {
	--m-rosa: var(--wp--preset--color--accent);
	--m-rosa-velo: var(--wp--preset--color--accent-soft);
	--m-rosa-cipria: var(--wp--preset--color--accent-light);
	--m-cielo: var(--wp--preset--color--sky);
	--m-salvia: var(--wp--preset--color--sage-soft);
	--m-burro: var(--wp--preset--color--butter);
	--m-bordo: color-mix(in srgb, var(--wp--preset--color--accent-light) 55%, var(--wp--preset--color--base));
	--m-cuore: url('../img/cuore.svg');
	--m-onda: url('../img/onda.svg');
}

/* ---------- Sfondo: due aloni di colore, leggerissimi ---------- */
body {
	background-image:
		radial-gradient(720px 420px at 105% -4%, color-mix(in srgb, var(--wp--preset--color--accent-light) 38%, transparent), transparent 70%),
		radial-gradient(680px 460px at -8% 6%, color-mix(in srgb, var(--wp--preset--color--sky) 70%, transparent), transparent 70%);
	background-repeat: no-repeat;
}
::selection { background: var(--wp--preset--color--accent-light); color: var(--wp--preset--color--contrast); }
:where(p) { text-wrap: pretty; }
.wp-block-post-content > p:first-of-type { font-size: var(--wp--preset--font-size--large); line-height: 1.6; }

/* ---------- Testata: cuore accanto al nome, bordo rosato ---------- */
.fondamenta-header {
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 94%, transparent) !important;
	border-bottom: 1px solid var(--m-bordo);
}
.fondamenta-header.is-scrolled { box-shadow: 0 10px 28px -20px rgba(110, 60, 85, .6); }
.fondamenta-header .wp-block-site-title { font-size: 1.625rem; font-weight: 600; letter-spacing: -.01em; }
.fondamenta-header .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--contrast); display: inline-flex; align-items: center; gap: .45em; }
.fondamenta-header .wp-block-site-title a::before {
	content: ""; width: .8em; height: .72em; flex: none;
	background: var(--m-rosa);
	-webkit-mask: var(--m-cuore) center / contain no-repeat; mask: var(--m-cuore) center / contain no-repeat;
	transition: transform var(--wp--custom--transition);
}
.fondamenta-header .wp-block-site-title a:hover::before { transform: scale(1.18) rotate(-6deg); }
.fondamenta-header .wp-block-navigation-item__content { border-radius: 999px; padding: .55rem .9rem; border-bottom: 0 !important; transition: background var(--wp--custom--transition), color var(--wp--custom--transition); }
.fondamenta-header .wp-block-navigation-item__content:hover { background: var(--m-rosa-velo); color: var(--wp--preset--color--accent-dark); }
.fondamenta-header .current-menu-item > .wp-block-navigation-item__content,
.fondamenta-header [aria-current="page"].wp-block-navigation-item__content { background: var(--m-rosa-velo); color: var(--wp--preset--color--accent-dark); font-weight: 700; }
.fondamenta-header .wp-block-navigation__responsive-container-open { background: var(--m-rosa-velo); color: var(--wp--preset--color--accent-dark); border-radius: 999px; }
.fondamenta-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--base); background-image: radial-gradient(500px 360px at 100% 0, var(--m-rosa-velo), transparent 70%); }

/* ---------- Pulsanti: pillola morbida ---------- */
.wp-element-button, .wp-block-button__link {
	min-height: 48px; border-radius: 999px;
	box-shadow: 0 12px 24px -14px rgba(169, 78, 110, .75);
	transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition), background-color var(--wp--custom--transition);
}
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(169, 78, 110, .75); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--primary-dark);
	border: 2px solid var(--wp--preset--color--primary); box-shadow: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--m-cielo); color: var(--wp--preset--color--primary-dark); box-shadow: none; }

/* ---------- Etichetta sopra i titoli: un cuoricino ---------- */
.fondamenta-eyebrow, .fondamenta-etichetta {
	font-family: var(--wp--preset--font-family--sans);
	letter-spacing: .12em !important;
	color: var(--wp--preset--color--accent-dark);
}
.fondamenta-eyebrow::before, .fondamenta-etichetta::before {
	width: .95em; height: .85em; margin-right: .6em; vertical-align: -.05em;
	border-radius: 0; box-shadow: none !important;
	background: var(--m-rosa);
	-webkit-mask: var(--m-cuore) center / contain no-repeat; mask: var(--m-cuore) center / contain no-repeat;
}

/* ---------- Schede e riquadri ---------- */
.fondamenta-card, .is-style-card, .cbcon-card, .cbann-card {
	border-radius: var(--wp--custom--radius--card);
	border: 1px solid var(--m-bordo);
	box-shadow: var(--wp--preset--shadow--md);
	background-color: #fff;
	overflow: hidden;
	transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
}
.cbcon-card { padding: 1.5rem; }
@media (hover: hover) {
	.cbcon-card:hover, .cbann-card:hover { transform: translateY(-4px); box-shadow: var(--wp--preset--shadow--lg); }
}
.is-style-evidenziato {
	background-color: var(--m-rosa-velo); border-top: 0; border-radius: var(--wp--custom--radius--card);
	border: 1px solid var(--m-bordo);
}
.is-style-scuro {
	background: linear-gradient(155deg, var(--wp--preset--color--primary-dark), #4b7387);
	border-radius: var(--wp--custom--radius--card);
}
.is-style-scuro a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--accent-light); }

/* Immagini e foto: angoli generosi */
.wp-block-image img, .wp-block-post-featured-image img, .wp-block-cover, .wp-block-media-text__media img { border-radius: var(--wp--custom--radius--card); }
.wp-block-cover { overflow: hidden; }
.is-style-rounded-full img { border-radius: 999px !important; }

/* Citazioni e separatori */
.wp-block-quote { border-left: 0; border-radius: var(--wp--custom--radius--card); background: var(--m-rosa-velo); padding: 1.25rem 1.5rem; }
.wp-block-quote.is-style-plain { background: transparent; padding: 0; }
.wp-block-separator { border-color: var(--m-bordo); }
.is-style-checklist li::before { color: var(--wp--preset--color--support); }

/* Dettagli / domande frequenti */
.wp-block-details {
	background: #fff; border: 1px solid var(--m-bordo); border-radius: var(--wp--custom--radius--medium);
	padding: 1rem 1.25rem; margin-block: .75rem;
}
.wp-block-details summary { cursor: pointer; font-weight: 700; }
.wp-block-details[open] { background: var(--m-rosa-velo); }

/* Campi dei moduli e ricerca */
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="tel"], select, textarea,
.wp-block-search__input {
	border: 1.5px solid var(--wp--preset--color--neutral-300); border-radius: 14px; background: #fff;
	padding: .75rem 1rem; font: inherit; color: var(--wp--preset--color--contrast);
}
input:focus, select:focus, textarea:focus { border-color: var(--m-rosa); outline: 3px solid color-mix(in srgb, var(--m-rosa) 28%, transparent); outline-offset: 1px; }
.wp-block-search__button { border-radius: 999px; }

/* ---------- Onde: separatore tra sezioni (classe .mamma-onda) ---------- */
.mamma-onda { display: block; height: clamp(36px, 6vw, 80px); background: var(--wp--preset--color--accent-soft); -webkit-mask: var(--m-onda) bottom / 100% 100% no-repeat; mask: var(--m-onda) bottom / 100% 100% no-repeat; margin: 0 !important; }
.mamma-onda--cielo { background: var(--wp--preset--color--sky); }
.mamma-onda--salvia { background: var(--wp--preset--color--sage-soft); }
.mamma-onda--rovescia { transform: scaleY(-1); }

/* ---------- Pagina iniziale: hero e categorie ---------- */
.mamma-hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--m-rosa-velo), var(--wp--preset--color--base)); }
.mamma-hero__illustrazione img { border-radius: var(--wp--custom--radius--large) !important; box-shadow: var(--wp--preset--shadow--lg); width: 100%; }
.mamma-rassicurazioni { display: flex; flex-wrap: wrap; gap: .5rem .75rem; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.mamma-rassicurazioni li { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--m-bordo); border-radius: 999px; padding: .4rem .9rem; font-size: .9375rem; font-weight: 600; color: var(--wp--preset--color--accent-dark); }
.mamma-rassicurazioni li::before { content: ""; width: .8em; height: .72em; background: var(--m-rosa); -webkit-mask: var(--m-cuore) center / contain no-repeat; mask: var(--m-cuore) center / contain no-repeat; }
.mamma-categorie { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .mamma-categorie { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .mamma-categorie { grid-template-columns: repeat(4, 1fr); } }
.mamma-categoria { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; border-radius: var(--wp--custom--radius--card); border: 1px solid var(--m-bordo); text-decoration: none; color: var(--wp--preset--color--contrast); transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition); }
.mamma-categoria:hover { transform: translateY(-4px); box-shadow: var(--wp--preset--shadow--md); color: var(--wp--preset--color--contrast); }
.mamma-categoria img { width: 56px; height: 56px; padding: 10px; background: #fff; border-radius: 18px; }
.mamma-categoria strong { font-family: var(--wp--preset--font-family--sora); font-size: 1.375rem; font-weight: 600; line-height: 1.2; }
.mamma-categoria span { font-size: .9375rem; color: var(--wp--preset--color--neutral-600); }
.mamma-categoria--cielo { background: var(--m-cielo); }
.mamma-categoria--salvia { background: var(--m-salvia); }
.mamma-categoria--rosa { background: var(--m-rosa-velo); }
.mamma-categoria--burro { background: var(--m-burro); }

/* ---------- Plugin ChiBri: confronto, annunci, checklist ---------- */
.cbcon-card { background: #fff; gap: .75rem; }
.cbcon-marca { color: var(--wp--preset--color--accent-dark); font-weight: 700; letter-spacing: .1em; }
.cbcon-titolo { font-family: var(--wp--preset--font-family--sora); font-size: 1.5rem; font-weight: 600; }
.cbcon-prezzo { font-family: var(--wp--preset--font-family--sora); font-size: 1.375rem; color: var(--wp--preset--color--primary-dark); }
.cbcon-procontro > div { border-radius: var(--wp--custom--radius--medium); padding: .85rem 1rem; }
.cbcon-procontro > div:first-child { background: var(--m-salvia); }
.cbcon-procontro > div:last-child { background: var(--m-rosa-velo); }
.cbcon-btn--acquisto, .cbcon-filtri .cbcon-btn { background: var(--wp--preset--color--accent) !important; min-height: 46px; box-shadow: 0 12px 24px -14px rgba(169, 78, 110, .75); }
.cbcon-btn--scheda { border: 2px solid var(--wp--preset--color--primary) !important; color: var(--wp--preset--color--primary-dark) !important; }
.cbcon-filtri, .cbann-filtri { background: var(--m-cielo); border-radius: var(--wp--custom--radius--card); padding: 1.25rem 1.5rem; }
.cbcon-campo select, .cbann-form select, .cbann-filtri select { border-radius: 14px; border-width: 1.5px; }
.cbcon-tabella-wrap { border-radius: var(--wp--custom--radius--card); border: 1px solid var(--m-bordo); background: #fff; }
.cbcon-tabella thead th { background: var(--m-rosa-velo); font-family: var(--wp--preset--font-family--sora); font-weight: 600; }
.cbcon-dati, .cbcon-procontro--grande > div, .cbann-dati, .cbann-box, .cbcl__lista li { border-radius: var(--wp--custom--radius--medium); }
.cbcon-sicurezza, .cbann-avviso { background: var(--m-burro); border: 0; border-radius: var(--wp--custom--radius--medium); }
.cbann-avviso { border-left: 5px solid var(--wp--preset--color--accent); }
.cbann-card .cbann-foto { background: var(--m-rosa-velo); }
.cbann-prezzo { font-family: var(--wp--preset--font-family--sora); font-size: 1.25rem; color: var(--wp--preset--color--primary-dark); }
.cbann-btn, .cbcl__btn { background: var(--wp--preset--color--accent); min-height: 46px; box-shadow: 0 12px 24px -14px rgba(169, 78, 110, .75); }
.cbann-btn--chiaro, .cbcl__btn--chiaro { background: transparent; box-shadow: none; }
.cbcl__lista li { background: #fff; border: 1px solid var(--m-bordo); }
.cbcl__lista input { accent-color: var(--wp--preset--color--accent); }

/* ---------- Piè di pagina: chiaro e accogliente ---------- */
.mamma-footer { position: relative; margin-top: 0; }
.mamma-footer .mamma-onda { margin-bottom: -1px !important; }
.mamma-footer__corpo { background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--contrast); }
.mamma-footer a { color: var(--wp--preset--color--primary-dark); text-underline-offset: .2em; }
.mamma-footer a:hover { color: var(--wp--preset--color--accent-dark); }
.mamma-footer .wp-block-site-title a { color: var(--wp--preset--color--contrast); text-decoration: none; font-family: var(--wp--preset--font-family--sora); font-size: 1.75rem; }
.mamma-footer__titolo { font-family: var(--wp--preset--font-family--sora); font-size: 1.25rem !important; font-weight: 600; }
.mamma-footer__legale { color: var(--wp--preset--color--neutral-600); }

/* Movimento ridotto: niente animazioni */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
	.wp-block-button__link:hover, .cbcon-card:hover, .cbann-card:hover, .mamma-categoria:hover { transform: none; }
}

/* =====================================================================
   Home reale: testata con illustrazione, schede con icone, titoli allineati
   ===================================================================== */

/* Il motivo a blocchi del tema padre non serve più */
.fondamenta-motivo::after { display: none; }

/* Testata della home: sfumatura rosata e illustrazione (sotto il testo su telefono, a destra su schermi larghi) */
.fondamenta-hero.fondamenta-motivo { background-image: linear-gradient(180deg, var(--m-rosa-velo), var(--wp--preset--color--base) 92%); }
.fondamenta-hero.fondamenta-motivo::after {
	display: block; content: ""; position: relative; z-index: 1;
	right: auto; top: auto; bottom: auto; opacity: 1; border-radius: 0;
	width: min(88%, 440px); height: auto; aspect-ratio: 640 / 520;
	margin: var(--wp--preset--spacing--40) auto 0;
	background: url('../img/hero-mamma.svg') center / contain no-repeat;
	filter: drop-shadow(0 24px 30px rgba(110, 60, 85, .22));
}
@media (min-width: 960px) {
	.fondamenta-hero.fondamenta-motivo::after {
		position: absolute; right: max(24px, calc((100% - 1200px) / 2)); top: 50%; transform: translateY(-50%);
		margin: 0; width: min(40vw, 480px);
	}
	.fondamenta-hero.fondamenta-motivo > * {
		max-width: 560px !important; margin-left: max(0px, calc((100% - 1200px) / 2)) !important; margin-right: auto !important;
	}
}

/* Schede "scheda" della home */
.is-style-scheda {
	border-radius: var(--wp--custom--radius--card); border: 1px solid var(--m-bordo);
	box-shadow: var(--wp--preset--shadow--md);
	transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
}
@media (hover: hover) { .is-style-scheda:hover { transform: translateY(-4px); box-shadow: var(--wp--preset--shadow--lg); } }

/* Titoli di sezione allineati alle schede */
.entry-content > section:nth-of-type(2) > h2,
.entry-content > section:nth-of-type(3) > h2 { max-width: var(--wp--style--global--wide-size, 1200px); margin-left: auto; margin-right: auto; }

/* "Da dove vuoi cominciare?": un'icona e un colore per categoria */
.entry-content > section:nth-of-type(2) .is-style-scheda::before {
	content: ""; display: block; width: 60px; height: 60px; margin-bottom: 1rem;
	background: #fff center / 34px no-repeat; border-radius: 20px;
}
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(1) > .is-style-scheda { background-color: var(--m-cielo) !important; }
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(2) > .is-style-scheda { background-color: var(--m-salvia) !important; }
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(3) > .is-style-scheda { background-color: var(--m-rosa-velo) !important; }
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(1) > .is-style-scheda::before { background-image: url('../img/icona-passeggino.svg'); }
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(2) > .is-style-scheda::before { background-image: url('../img/icona-seggiolino.svg'); }
.entry-content > section:nth-of-type(2) .wp-block-column:nth-child(3) > .is-style-scheda::before { background-image: url('../img/icona-tiralatte.svg'); }

/* "Perché fidarti": un cuoricino per ogni motivo */
.entry-content > section:nth-of-type(3) .is-style-scheda::before {
	content: ""; display: block; width: 30px; height: 27px; margin-bottom: .9rem; background: var(--m-rosa);
	-webkit-mask: var(--m-cuore) center / contain no-repeat; mask: var(--m-cuore) center / contain no-repeat;
}
.entry-content > section:nth-of-type(3) .is-style-scheda { background-color: #fff !important; }

/* Sezione "usato": fondo rosa con onda in alto */
.entry-content > section.has-accent-soft-background-color { position: relative; }

/* Titolo della testata un po' più raccolto; pulsanti pieni sempre rosa */
.fondamenta-hero h1 { font-size: clamp(2.25rem, 4.3vw, 3.6rem); }
.wp-block-button__link.has-primary-background-color { background-color: var(--wp--preset--color--accent) !important; }
.wp-block-button__link.has-primary-background-color:hover { background-color: var(--wp--preset--color--accent-dark) !important; }

/* Se la sezione sopra il piè di pagina è già rosa, niente onda: il fondo continua senza strisce */
main:has(.entry-content > :last-child.has-accent-soft-background-color) + footer .mamma-onda,
main:has(> .has-accent-soft-background-color:last-child) + footer .mamma-onda { display: none; }

/* Nessuno stacco crema tra contenuto e piè di pagina */
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }

/* Testata su telefono: il nome del sito si legge per intero, il pulsante non va a capo */
@media (max-width: 600px) {
	.fondamenta-header .wp-block-site-title { font-size: 1.2rem; }
	.fondamenta-header__azioni { gap: .1rem !important; }
	.fondamenta-header__cta .wp-block-button__link { white-space: nowrap; padding: .5rem .95rem; font-size: .875rem; }
}

/* Confronti: l'area esce dalla colonna di testo (stretta) e usa tutta la larghezza ampia;
   pro e contro si dispongono in base alla larghezza della scheda, non dello schermo. */
.cbcon:has(.cbcon-griglia), .cbcon:has(.cbcon-tabella-wrap) {
	width: min(var(--wp--style--global--wide-size, 1200px), calc(100vw - 3rem));
	max-width: none; position: relative; left: 50%; transform: translateX(-50%);
}
.cbcon-griglia { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.cbcon-procontro { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)) !important; }
.cbcon-procontro > div { min-width: 0; overflow-wrap: anywhere; }
