/* =================================================================
   FARMACIE LOMBARDI — DESIGN SYSTEM
   Token, reset, tipografia, componenti. Fonte: brand manual Spacewalkers.
   ================================================================= */

/* Font Jost self-hosted (variabile 300-700). Sostituto web di Futura. */
@font-face {
	font-family: 'Jost';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('../fonts/jost-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Jost';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('../fonts/jost-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	/* --- Brand palette (le "case") --- */
	--c-green:  #368930;  /* primario */
	--c-blue:   #0091D9;
	--c-red:    #CB0F22;
	--c-orange: #E86100;
	--c-yellow: #F79400;

	/* --- Varianti --- */
	--c-green-700: #2a6b25;
	--c-green-800: #20561d;
	--c-green-50:  #eaf3e9;
	--c-blue-700:  #006a9e;
	--c-blue-50:   #e6f4fb;
	--c-orange-700: #b54400;

	/* --- Neutri --- */
	--c-ink:    #1D1D1B;   /* testo (no nero puro) */
	--c-muted:  #5b5b58;
	--c-line:   #e6e6e3;
	--c-bg:     #ffffff;
	--c-bg-alt: #f7f7f4;
	--c-white:  #ffffff;

	/* --- Semantici --- */
	--c-text:    var(--c-ink);
	--c-primary: var(--c-green);
	--c-link:    var(--c-green-700);
	--c-link-hover: var(--c-red);

	/* --- Tipografia (Jost ~ Futura) --- */
	--font-display: 'Jost', -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
	--font-body:    'Jost', -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;

	--fw-light: 300;
	--fw-regular: 400;
	--fw-medium: 500;
	--fw-semibold: 600;
	--fw-bold: 700;

	/* Scala tipografica fluida (mobile-first) */
	--fs-h1: clamp(2.2rem, 5vw + 1rem, 3.5rem);
	--fs-h2: clamp(1.7rem, 3vw + 1rem, 2.6rem);
	--fs-h3: clamp(1.3rem, 1.5vw + 1rem, 1.9rem);
	--fs-h4: clamp(1.1rem, 1vw + 0.9rem, 1.4rem);
	--fs-body: clamp(1rem, 0.3vw + 0.95rem, 1.125rem);
	--fs-small: 0.875rem;

	--lh-tight: 1.1;
	--lh-snug: 1.3;
	--lh-body: 1.6;

	/* --- Spaziature (scala 4px) --- */
	--sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
	--sp-5: 1.5rem;   --sp-6: 2rem;    --sp-8: 3rem;    --sp-10: 4rem;
	--sp-12: 6rem;

	/* --- Layout --- */
	--container: 1200px;
	--container-narrow: 820px;
	--gutter: clamp(1rem, 4vw, 2.5rem);

	/* --- Radius / ombre --- */
	--radius-sm: 8px;
	--radius: 16px;
	--radius-lg: 28px;
	--radius-pill: 999px;
	--shadow-sm: 0 2px 8px rgba(0,0,0,.06);
	--shadow: 0 8px 24px rgba(0,0,0,.10);
	--shadow-lg: 0 16px 40px rgba(0,0,0,.14);

	/* --- Transizioni --- */
	--t-fast: .15s ease;
	--t: .25s ease;
}

/* ----------------------------- Reset ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	font-family: var(--font-body);
	font-weight: var(--fw-regular);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	color: var(--c-text);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-link-hover); }
ul, ol { padding-left: 1.2em; }

/* --------------------------- Tipografia -------------------------- */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	line-height: var(--lh-tight);
	color: var(--c-ink);
	text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { line-height: var(--lh-body); }
.lead { font-size: 1.2em; font-weight: var(--fw-light); }
.uppercase { text-transform: uppercase; letter-spacing: .02em; }
.bold { font-weight: var(--fw-bold); }
.text-green { color: var(--c-green); } .text-blue { color: var(--c-blue); }
.text-red { color: var(--c-red); } .text-orange { color: var(--c-orange); }
.text-yellow { color: var(--c-yellow); } .text-white { color: #fff; }

/* ----------------------------- Layout ---------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--alt { background: var(--c-bg-alt); }
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stack > * + * { margin-top: var(--sp-4); }

/* ----------------------------- Bottoni --------------------------- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	padding: .8em 1.6em;
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	line-height: 1; text-align: center;
	border: 2px solid transparent;
	border-radius: var(--radius-pill);
	background: var(--c-green-700); color: #fff;
	transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--c-green-800); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 3px solid var(--c-blue-700); outline-offset: 3px; }
.btn--blue { background: var(--c-blue-700); } .btn--blue:hover { background: #00577f; }
.btn--red { background: var(--c-red); } .btn--red:hover { background: #a50c1b; }
.btn--orange { background: var(--c-orange-700); } .btn--orange:hover { background: #923700; }
.btn--outline { background: transparent; color: var(--c-green-700); border-color: var(--c-green-700); }
.btn--outline:hover { background: var(--c-green-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-ink); }

/* ------------------------------ Card ----------------------------- */
.card {
	background: #fff; border-radius: var(--radius);
	box-shadow: var(--shadow-sm); overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform var(--t), box-shadow var(--t);
	border-top: 4px solid var(--c-green);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.card__title { font-size: var(--fs-h4); }
.card__meta { color: var(--c-muted); font-size: var(--fs-small); }
.card--blue { border-top-color: var(--c-blue); }
.card--red { border-top-color: var(--c-red); }
.card--orange { border-top-color: var(--c-orange); }
.card--yellow { border-top-color: var(--c-yellow); }

/* ------------------------------ Badge ---------------------------- */
.badge {
	display: inline-block; padding: .3em .9em;
	font-size: var(--fs-small); font-weight: var(--fw-semibold);
	border-radius: var(--radius-pill);
	background: var(--c-green-50); color: var(--c-green-700);
}
.badge--blue { background: var(--c-blue-50); color: var(--c-blue-700); }

/* ------------------------------ Form ----------------------------- */
.field { display: grid; gap: .35rem; margin-bottom: var(--sp-4); }
.field label { font-weight: var(--fw-semibold); }
.field input, .field textarea, .field select,
.wpcf7 input:not([type=submit]), .wpcf7 textarea, .wpcf7 select {
	width: 100%; padding: .75em 1em;
	border: 2px solid var(--c-line); border-radius: var(--radius-sm);
	background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field textarea:focus, .field select:focus,
.wpcf7 input:focus, .wpcf7 textarea:focus {
	outline: none; border-color: var(--c-blue);
	box-shadow: 0 0 0 3px rgba(0,145,217,.18);
}
.wpcf7 input[type=submit] { /* riusa lo stile .btn */
	display: inline-flex; padding: .8em 1.8em; border: 0;
	border-radius: var(--radius-pill); background: var(--c-green-700); color: #fff;
	font-family: var(--font-display); font-weight: var(--fw-bold); cursor: pointer;
	transition: background var(--t-fast), transform var(--t-fast);
}
.wpcf7 input[type=submit]:hover { background: var(--c-green-700); transform: translateY(-2px); }

/* --------------------------- Accessibilità ----------------------- */
.skip-link {
	position: absolute; left: -999px; top: 0; z-index: 1000;
	background: var(--c-green-700); color: #fff; padding: .75em 1.25em; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--c-blue-700); outline-offset: 2px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* --------------------------- Utility ----------------------------- */
.bg-green { background: var(--c-green); color: #fff; }
.bg-blue { background: var(--c-blue); color: #fff; }
.bg-red { background: var(--c-red); color: #fff; }
.bg-orange { background: var(--c-orange); color: #fff; }
.bg-alt { background: var(--c-bg-alt); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ===================== TASTE v2: shape & motion ==================== */
/* SHAPE LOCK: superfici/card = 20px · bottoni = pill · input = 10px */
:root {
	--radius: 20px;
	--radius-lg: 28px;
	--radius-sm: 10px;
	--ease-out: cubic-bezier(.16,1,.3,1);
}

/* Pennellate originali Figma: posizionamento base per i decori del tema. */
.brush { position: absolute; z-index: 0; pointer-events: none; opacity: .92; }

/* Motion: reveal allo scroll (JS: .is-visible su [data-reveal]) */
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(26px); }
.reveal-ready [data-reveal].is-visible {
	opacity: 1; transform: none;
	transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal-ready [data-reveal][data-reveal-delay="1"].is-visible { transition-delay: .08s; }
.reveal-ready [data-reveal][data-reveal-delay="2"].is-visible { transition-delay: .16s; }
.reveal-ready [data-reveal][data-reveal-delay="3"].is-visible { transition-delay: .24s; }

/* Icone (glifi reali Phosphor inline) */
.ico { width: 30px; height: 30px; display: inline-flex; flex: none; color: inherit; }
.ico svg { width: 100%; height: 100%; }

/* --------------------- prefers-reduced-motion -------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
	[data-reveal] { opacity: 1 !important; transform: none !important; }
}
