/*
Theme Name: Cure a Casa
Description: Tema custom per Cure a Casa (MED4YOU Srl) - sanita domiciliare h24 Roma. WordPress + Carbon Fields, senza page builder. Token di design in theme.json.
Author: Digital On
Version: 0.11.5
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: cureacasa
*/

/* ==========================================================================
   Stile di base. I token (colori, font, dimensioni, spaziature) vivono in
   theme.json e WordPress li espone come variabili --wp--preset--* e
   --wp--custom--*. Qui solo reset minimo e alias brevi per i componenti.
   Il CSS dei componenti arriva da S2 in assets/css/.
   ========================================================================== */
:root {
	--cc-red: var(--wp--preset--color--rosso);
	--cc-navy: var(--wp--preset--color--navy);
	--cc-ink: var(--wp--preset--color--inchiostro);
	--cc-bg: var(--wp--preset--color--grigio-chiaro);
	--cc-font-heading: var(--wp--preset--font-family--poppins);
	--cc-font-body: var(--wp--preset--font-family--dm-sans);
	--cc-font-script: var(--wp--preset--font-family--alex-brush);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--cc-bg);
	color: var(--cc-ink);
	font-family: var(--cc-font-body);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	/* Il Figma rende DM Sans con opsz 14 fisso; il browser userebbe opsz = dimensione in px. */
	font-variation-settings: "opsz" 14;
}

img {
	max-width: 100%;
	height: auto;
}

/* Il tag [hidden] deve battere qualunque display dei componenti. */
[hidden] {
	display: none !important;
}

.cc-s1-placeholder {
	max-width: var(--wp--style--global--content-size, 1312px);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--96, 96px) var(--wp--preset--spacing--32, 32px);
}

.cc-s1-placeholder h1 {
	margin: 0 0 16px;
	font-family: var(--cc-font-heading);
	font-weight: 900;
	font-size: var(--wp--preset--font-size--h-1);
	line-height: 1.1;
	color: var(--cc-navy);
}

/* ==========================================================================
   S2 - Utilita globali condivise dai componenti
   ========================================================================== */
:root {
	/* Stati hover derivati dai token (PROPOSTA da ratificare, non nel Figma). */
	--cc-red-hover: #C40202;
	--cc-wa: var(--wp--preset--color--whatsapp);
	--cc-wa-hover: #0F6537;
	--cc-white: var(--wp--preset--color--bianco);
	--cc-ring: var(--wp--preset--color--navy);
	--cc-ease: 180ms ease;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.cc-skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--cc-navy);
	color: #fff;
	border-radius: 10px;
	font-weight: 600;
}

.cc-skip-link:focus {
	top: 16px;
}

/* Focus visibile uniforme (PROPOSTA): anello navy, bianco su fondi scuri. */
:where(a, button, [tabindex]):focus-visible {
	outline: 3px solid var(--cc-ring);
	outline-offset: 3px;
}

/* 0.10.0 (A5) - Fondi scuri e foto: anello bianco con un secondo anello navy
   esterno (leggibile anche sulle zone chiare delle foto). Rapporto >= 3:1. */
:where(.cc-homehero, .cc-zona, .cc-lead, .cc-cta-banner) {
	--cc-ring: #fff;
}

:where(.cc-homehero, .cc-zona, .cc-lead, .cc-cta-banner) :where(a, button, [tabindex]):focus-visible {
	outline-offset: 3px;
	box-shadow: 0 0 0 6px rgba(31, 37, 71, 0.55);
}

/* Campi del form: anello a 3 px, scostato di 2 (bianco sul navy, navy sul bianco di Contatti). */
.cc-form__input:focus-visible,
.cc-form__consent input:focus-visible {
	outline: 3px solid var(--cc-ring);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

a {
	color: inherit;
}

ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   S3 - Elementi condivisi delle sezioni di pagina (intestazioni)
   ========================================================================== */
.cc-eyebrow {
	margin: 0;
	font-family: var(--cc-font-script);
	font-size: var(--wp--preset--font-size--script);
	line-height: 40px;
	color: var(--cc-red);
}

.cc-section-title {
	margin: 0;
	font-family: var(--cc-font-heading);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--h-2);
	line-height: 1.5;
	color: var(--cc-navy);
	text-align: center;
}

.cc-section-sub {
	margin: 0;
	max-width: 542px;
	font-size: 20px;
	line-height: normal;
	color: var(--wp--preset--color--grigio-testo);
	text-align: center;
}

@media (max-width: 768px) {
	.cc-section-title {
		font-size: var(--wp--preset--font-size--h-2-md);
		line-height: 1.2;
	}

	.cc-section-sub {
		font-size: var(--wp--preset--font-size--body-lg);
	}
}

/* Badge bianco rettangolare (Figma: Badge 465:246, 461:287, 454:236...). Riusato da testata, canali, card articolo. */
.cc-badge {
	display: inline-block;
	align-self: flex-start;
	padding: 8px 16px;
	background: #fff;
	border-radius: 10px;
	font-weight: 500;
	font-size: var(--wp--preset--font-size--piccolo);
	line-height: normal;
	color: var(--cc-navy);
}

/* S8 #1 - Avviso emergenze (112). Minimo 14 px, anche su mobile. */
.cc-avviso {
	margin: 0;
	font-size: var(--wp--preset--font-size--piccolo);
	font-weight: 500;
	line-height: 1.45;
	color: var(--cc-ink);
}

.cc-avviso--dark {
	color: #E0E3F5;
}
