/*
Theme Name: Centro Media Conciliazione
Theme URI: https://centromediaconciliazione.it
Author: Centro Media Conciliazione
Description: Tema del sito di Centro Media Conciliazione, organismo di mediazione iscritto al n. 886. Block theme (editor del sito), colori coordinati con l'area riservata app.centromediaconciliazione.it.
Version: 1.2.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cmc
*/

/* ── Base ─────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
a { text-underline-offset: .18em; }
::selection { background: var(--wp--preset--color--primary); color: #fff; }

/* ── Header ──────────────────────────────────────────────────────────── */
.cmc-header {
	position: sticky; top: 0; z-index: 50;
	backdrop-filter: saturate(160%) blur(12px);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	background: rgb(255 255 255 / .86) !important;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.cmc-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--wp--preset--color--ink); }
.cmc-brand__logo { display: block; height: 3.9rem; width: auto; }
.cmc-brand__logo--white { height: 4.2rem; filter: brightness(0) invert(1); opacity: .95; }
.cmc-brand__tag {
	padding-left: .9rem; border-left: 1px solid var(--wp--preset--color--line);
	font: 500 .78rem/1.35 var(--wp--preset--font-family--body); color: var(--wp--preset--color--muted);
}
.cmc-brand__mark {
	display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem;
	background: linear-gradient(135deg, var(--wp--preset--color--primary), var(--wp--preset--color--primary-dark));
	color: #fff; font: 800 .82rem/1 var(--wp--preset--font-family--heading); letter-spacing: .04em;
	box-shadow: 0 6px 16px -6px rgb(63 81 181 / .7);
}
.cmc-brand__name { font: 700 1.02rem/1.15 var(--wp--preset--font-family--heading); }
.cmc-brand__name small { display: block; font: 500 .72rem/1.3 var(--wp--preset--font-family--body); color: var(--wp--preset--color--muted); }
.cmc-header .wp-block-navigation a { font-weight: 500; text-decoration: none; }
.cmc-header .wp-block-button__link { white-space: nowrap; }
.cmc-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }

/* ── Bottoni ─────────────────────────────────────────────────────────── */
.wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }
.is-style-cmc-accent .wp-block-button__link {
	background: var(--wp--preset--color--accent); color: #fff;
	box-shadow: 0 10px 24px -10px rgb(255 64 129 / .75);
}
.is-style-cmc-ghost .wp-block-button__link {
	background: rgb(255 255 255 / .1); color: #fff; border: 1px solid rgb(255 255 255 / .35);
}
.is-style-cmc-ghost .wp-block-button__link:hover { background: rgb(255 255 255 / .18); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.cmc-hero {
	position: relative; overflow: hidden; isolation: isolate;
	background:
		radial-gradient(900px 480px at 85% -10%, rgb(255 64 129 / .28), transparent 60%),
		radial-gradient(700px 520px at 0% 110%, rgb(121 134 203 / .45), transparent 60%),
		linear-gradient(160deg, #283593 0%, #3f51b5 55%, #3949ab 100%) !important;
}
.cmc-hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18;
	background-image: radial-gradient(rgb(255 255 255 / .9) 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.cmc-eyebrow {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .38rem .8rem; border-radius: 999px;
	background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .22);
	font-size: .8rem; font-weight: 600; letter-spacing: .02em;
}
.cmc-eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #69f0ae; box-shadow: 0 0 0 4px rgb(105 240 174 / .25); }
.cmc-hero h1 { text-wrap: balance; }
.cmc-hero__mock img { filter: drop-shadow(0 40px 60px rgb(10 16 60 / .45)); border-radius: 18px; }

/* ── Striscia fiducia ────────────────────────────────────────────────── */
.cmc-trust p { display: flex; align-items: center; gap: .55rem; margin: 0; }
.cmc-trust p::before {
	content: ""; flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%;
	background: var(--wp--preset--color--primary-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f51b5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/62% no-repeat;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.cmc-card {
	height: 100%;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
	box-shadow: 0 1px 2px rgb(26 31 54 / .04), 0 8px 24px -12px rgb(26 31 54 / .12);
}
.cmc-card:hover { transform: translateY(-4px); border-color: rgb(63 81 181 / .35) !important; box-shadow: 0 18px 40px -18px rgb(63 81 181 / .45); }
.cmc-icon {
	display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .9rem;
	background: var(--wp--preset--color--primary-light); color: var(--wp--preset--color--primary);
	margin-bottom: 1rem;
}
.cmc-icon svg { width: 1.5rem; height: 1.5rem; }

/* Card su fondo scuro (sezione associati) */
.cmc-card--dark { background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); box-shadow: none; }
.cmc-card--dark:hover { border-color: rgb(255 128 171 / .55) !important; box-shadow: 0 18px 40px -18px rgb(0 0 0 / .6); }
.cmc-card--dark .cmc-icon { background: rgb(255 64 129 / .16); color: #ff80ab; }
.cmc-associati { background: radial-gradient(800px 420px at 100% 0%, rgb(63 81 181 / .45), transparent 60%), var(--wp--preset--color--night) !important; }

/* ── Passi ───────────────────────────────────────────────────────────── */
.cmc-steps { counter-reset: step; }
.cmc-step { position: relative; counter-increment: step; }
.cmc-step::before {
	content: counter(step);
	display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: 1rem;
	border-radius: 50%; background: var(--wp--preset--color--primary); color: #fff;
	font: 700 1.05rem/1 var(--wp--preset--font-family--heading);
	box-shadow: 0 0 0 6px var(--wp--preset--color--primary-light);
}

/* ── Materie ─────────────────────────────────────────────────────────── */
.cmc-chips { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; padding: 0 !important; margin: 0; }
.cmc-chips li {
	padding: .5rem .9rem; border-radius: 999px; background: #fff;
	border: 1px solid var(--wp--preset--color--line); font-size: .92rem;
}

/* ── Tabelle tariffe ─────────────────────────────────────────────────── */
.cmc-table table { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); }
.cmc-table th { background: var(--wp--preset--color--primary); color: #fff; font-weight: 600; text-align: left; }
.cmc-table th, .cmc-table td { padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.cmc-table tr:last-child td { border-bottom: 0; }
.cmc-table tbody tr:nth-child(even) td { background: #fafbfe; }
.cmc-table td:not(:first-child), .cmc-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.cmc-table { overflow-x: auto; }
/* Tabella informativa (etichetta / valore): tutto a sinistra, testo a capo */
.cmc-table--info td, .cmc-table--info td:not(:first-child) { text-align: left; white-space: normal; }
.cmc-table--info td:first-child { width: 34%; font-weight: 600; color: var(--wp--preset--color--muted); }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.cmc-faq .wp-block-details {
	background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px;
	padding: 1.1rem 1.3rem; margin-block-start: .75rem;
}
.cmc-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.cmc-faq summary::-webkit-details-marker { display: none; }
.cmc-faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--wp--preset--color--primary); transition: transform .2s ease; }
.cmc-faq details[open] summary::after { transform: rotate(45deg); }
.cmc-faq details > :not(summary) { color: var(--wp--preset--color--muted); }

/* ── CTA ─────────────────────────────────────────────────────────────── */
.cmc-cta { position: relative; overflow: hidden; }
.cmc-cta::before {
	content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%;
	background: radial-gradient(circle, rgb(255 64 129 / .45), transparent 70%);
}
.cmc-cta > * { position: relative; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.cmc-footer a { color: inherit; text-decoration: none; opacity: .85; }
.cmc-footer a:hover { opacity: 1; text-decoration: underline; }
.cmc-footer .wp-block-heading { letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; color: #9fa8da; }
.cmc-footer .wp-block-column p a { overflow-wrap: normal; white-space: nowrap; }

/* ── Animazione d'ingresso (rispetta prefers-reduced-motion) ────────── */
@media (prefers-reduced-motion: no-preference) {
	.cmc-reveal { animation: cmc-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
	.cmc-reveal-2 { animation: cmc-rise .7s .12s cubic-bezier(.2, .7, .2, 1) both; }
	@keyframes cmc-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 781px) {
	.cmc-header .wp-block-button__link { white-space: nowrap; padding: .5rem .8rem !important; font-size: .85rem !important; }
	.cmc-brand__name { font-size: .92rem; }
	.cmc-hero__mock { margin-top: 1rem; }
	.cmc-brand__name small { display: none; }
	.cmc-brand__tag { display: none; }
	.cmc-brand__logo { height: 2.8rem; }
}
