:root {
	--sm-navy: #1f355f;
	--sm-blue: #1c5fa8;
	--sm-red: #c52a30;
	--sm-mio: #007c68;
	--sm-mio-hover: #006a59;
	--sm-ink: #23272e;
	--sm-muted: #5b6470;
	--sm-bg: #ffffff;
	--sm-soft: #f2f5f9;
	--sm-line: #e3e8ef;
	--sm-radius: 14px;
	--sm-max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--sm-ink);
	background: var(--sm-bg);
	line-height: 1.6;
}
section[id], footer[id] { scroll-margin-top: 84px; }
.sm-wrap { max-width: var(--sm-max); margin: 0 auto; padding: 0 1.25rem; }
.sm-section { padding: 3.5rem 0; }
.sm-section--soft { background: var(--sm-soft); }
.sm-h2 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 1rem; color: var(--sm-navy); }
.sm-lead { color: var(--sm-muted); max-width: 60ch; }

/* Ticker */
.sm-ticker { background: var(--sm-red); color: #fff; overflow: hidden; white-space: nowrap; }
.sm-ticker__track { display: inline-block; padding: 0.8rem 0; font-weight: 700; font-size: 1.02rem; animation: sm-ticker 22s linear infinite; }
@keyframes sm-ticker { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .sm-ticker__track { animation: none; } html { scroll-behavior: auto; } }

/* Header */
.sm-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--sm-line); }
.sm-header__bar { display: flex; align-items: center; gap: 1rem; min-height: 68px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.sm-logo { font-weight: 800; text-decoration: none; color: var(--sm-navy); letter-spacing: 0.01em; }
.sm-logo span { color: var(--sm-red); }
/* Logo WordPress: the_custom_logo() stampa .custom-logo-link > img.custom-logo con width/height nativi, vincolati qui */
.custom-logo-link { display: inline-flex; align-items: center; max-width: 340px; flex-shrink: 0; }
.custom-logo { height: 48px; width: auto; max-width: 100%; }
@media (max-width: 860px) { .custom-logo-link { max-width: 220px; } .custom-logo { height: 40px; } }
.sm-nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.sm-nav a { color: var(--sm-navy); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.sm-nav a:hover { color: var(--sm-blue); }
.sm-cta { background: var(--sm-red); color: #fff !important; padding: 0.6rem 1.1rem; border-radius: 999px; }
.sm-cta:hover { background: var(--sm-navy); }
.sm-cta:active { transform: translateY(1px); }
/* Bottone MioDottore: verde ufficiale + logo (se caricato) + freccetta */
.sm-mio { display: inline-flex; align-items: center; gap: 0.55rem; background: var(--sm-mio); color: #fff !important; font-weight: 700; text-decoration: none; padding: 0.65rem 1.2rem; border-radius: 999px; }
.sm-mio:hover { background: var(--sm-mio-hover); }
.sm-mio:active { transform: translateY(1px); }
.sm-mio img { height: 1.4rem; width: auto; }
.sm-mio__arrow { font-weight: 800; }
.sm-mio--sm { padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.sm-mio--sm img { height: 1.1rem; }
.sm-burger { display: none; }
.sm-burger-label { display: none; cursor: pointer; font-size: 1.6rem; margin-left: auto; }
@media (max-width: 860px) {
	.sm-burger-label { display: block; }
	.sm-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--sm-line); }
	.sm-burger:checked ~ .sm-nav { display: flex; }
}

/* Hero */
.sm-hero { padding: 4.5rem 0 3.5rem; border-bottom: 3px solid var(--sm-soft); }
.sm-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; margin: 0 0 1rem; color: var(--sm-navy); }
.sm-hero p { color: var(--sm-muted); max-width: 55ch; }
/* Hero con foto: card bianca traslucida sopra l'immagine, banda rossa sotto */
.sm-hero--media { position: relative; overflow: hidden; padding: 0; border-bottom: 0; }
.sm-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.sm-hero__inner { position: relative; min-height: 82vh; min-height: 82svh; display: flex; align-items: center; padding-top: 4rem; padding-bottom: 4rem; }
.sm-hero__card { max-width: 600px; background: rgba(255,255,255,0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 28px 72px 28px 28px; padding: 2.5rem 3rem 2.5rem 2.25rem; box-shadow: 0 12px 40px rgba(31,53,95,0.18); }
.sm-hero__band { background: var(--sm-red); height: 14px; }
.sm-hero__ctas { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.sm-cta--ghost { background: #fff; color: var(--sm-navy) !important; border: 2px solid var(--sm-navy); padding: calc(0.6rem - 2px) calc(1.1rem - 2px); }
.sm-cta--ghost:hover { background: var(--sm-navy); color: #fff !important; }
@media (max-width: 860px) { .sm-hero__card { border-radius: 22px; padding: 1.75rem 1.5rem; } }

/* Slider struttura: altezza vincolata, cover, swipe */
.sm-slider { position: relative; overflow: hidden; border-radius: var(--sm-radius); border: 1px solid var(--sm-line); touch-action: pan-y; background: var(--sm-soft); cursor: grab; margin-top: 1.5rem; }
.sm-slider.is-drag { cursor: grabbing; }
.sm-slider.is-drag img { pointer-events: none; }
.sm-slider__track { display: flex; transition: transform 0.5s ease; will-change: transform; }
.sm-slider.is-drag .sm-slider__track { transition: none; }
.sm-slider__slide { min-width: 100%; }
.sm-slider__slide img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.sm-slider__dots { position: absolute; left: 0; right: 0; bottom: 0.7rem; display: flex; gap: 0.45rem; justify-content: center; }
.sm-slider__dots button { width: 0.7rem; height: 0.7rem; border-radius: 999px; border: 1px solid #fff; background: rgba(255,255,255,0.5); cursor: pointer; padding: 0; }
.sm-slider__dots button[aria-selected="true"] { background: #fff; }
/* Struttura: testo a sinistra, slider compatto a destra */
.sm-struttura-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 1.5rem; }
.sm-struttura-grid .sm-slider { margin-top: 0; }
@media (max-width: 860px) { .sm-struttura-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sm-slider__track { transition: none; } }

/* Grid card */
.sm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.sm-card { border: 1px solid var(--sm-line); border-top: 3px solid var(--sm-blue); border-radius: var(--sm-radius); padding: 1.25rem; background: #fff; }
.sm-card:nth-child(3n+2) { border-top-color: var(--sm-red); }
.sm-card:nth-child(3n) { border-top-color: var(--sm-navy); }
.sm-card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--sm-navy); }
/* Fix comunicazioni: titoli linkati ereditano il colore, niente blu/sottolineato browser */
.sm-card h3 a { color: inherit; text-decoration: none; }
.sm-card h3 a:hover { color: var(--sm-blue); text-decoration: underline; text-underline-offset: 3px; }
.sm-card p { margin: 0; color: var(--sm-muted); font-size: 0.95rem; }
.sm-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 0.8rem; }
.sm-doctor-fallback { width: 100%; height: 180px; border-radius: 10px; margin-bottom: 0.8rem; background: var(--sm-soft); color: var(--sm-blue); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.sm-more { margin-top: 1.25rem; }
.sm-more a { color: var(--sm-blue); font-weight: 700; text-decoration: none; }
.sm-more a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sm-badge { display: inline-block; background: var(--sm-blue); color: #fff; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-radius: 999px; padding: 0.25rem 0.8rem; margin: 0 0 0.6rem; }

/* Professionisti: testata con frecce + riga orizzontale scroll-snap */
.sm-sect-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sm-sect-head .sm-h2 { margin: 0; }
.sm-rail-nav { display: flex; gap: 0.5rem; }
.sm-rail-nav button { width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid var(--sm-line); background: #fff; color: var(--sm-navy); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.sm-rail-nav button:hover { border-color: var(--sm-blue); color: var(--sm-blue); }
.sm-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 290px); gap: 1.25rem; overflow-x: auto; scroll-snap-type: x proximity; margin-top: 1.5rem; padding-bottom: 0.5rem; cursor: grab; scrollbar-width: none; -ms-overflow-style: none; }
.sm-rail::-webkit-scrollbar { display: none; }
.sm-rail.is-drag { cursor: grabbing; scroll-snap-type: none; user-select: none; }

/* Prestazioni raggruppate */
.sm-cat { font-size: 1.25rem; color: var(--sm-navy); margin: 2rem 0 0; }
.sm-card--min { padding: 1rem 1.1rem; }
.sm-card--min h3 { font-size: 1rem; }
.sm-card--min h3:last-child { margin: 0; }
/* Elenco prestazioni compatto */
.sm-list { list-style: none; margin: 1.25rem 0 0; padding: 0; columns: 3; column-gap: 2.5rem; }
.sm-list li { break-inside: avoid; display: flex; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--sm-line); font-size: 0.95rem; color: var(--sm-navy); font-weight: 600; }
.sm-list li::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--sm-blue); flex-shrink: 0; transform: translateY(-1px); }
.sm-list li:nth-child(3n+2)::before { background: var(--sm-red); }
.sm-list li:nth-child(3n)::before { background: var(--sm-navy); }
.sm-list li strong { color: var(--sm-navy); font-weight: 650; }
.sm-list li span { color: var(--sm-muted); }
@media (max-width: 1000px) { .sm-list { columns: 2; } }
@media (max-width: 640px) { .sm-list { columns: 1; } }
.sm-rail > * { scroll-snap-align: start; }
.sm-rail.is-drag { cursor: grabbing; user-select: none; }
.sm-rail img { -webkit-user-drag: none; user-select: none; }
/* Card rail: colonna flessibile, bottone sempre in fondo alla stessa altezza */
.sm-rail { align-items: stretch; }
.sm-rail .sm-card, .sm-rail .sm-doc { display: flex; flex-direction: column; height: 100%; }
.sm-card__cta { margin-top: auto; padding-top: 0.9rem; }
/* Fix disallineamento Prenota con nomi lunghi: titolo e ruolo riservano 2 righe (line-height 1.6) */
.sm-rail .sm-card h3, .sm-rail .sm-doc h3 { min-height: 3.2em; text-wrap: balance; }
.sm-doc .sm-card__cta { width: 100%; display: flex; justify-content: center; }
/* Vista compatta: cerchio + nome + ruolo */
.sm-doc { text-align: center; padding: 1rem 0.5rem; }
.sm-doc__avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 0.7rem; background: var(--sm-soft); }
img.sm-doc__avatar { object-fit: cover; display: block; }
span.sm-doc__avatar { display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: var(--sm-blue); }
.sm-doc h3 { margin: 0 0 0.25rem; font-size: 1.02rem; color: var(--sm-navy); }
.sm-doc a { color: inherit; text-decoration: none; }
.sm-doc a:hover h3 { color: var(--sm-blue); text-decoration: underline; text-underline-offset: 3px; }
.sm-doc p { margin: 0; color: var(--sm-muted); font-size: 0.9rem; }
.sm-doc__role { min-height: 3.2em; }

/* Prenota: due colonne su desktop, widget a destra */
.sm-prenota-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; align-items: start; margin-top: 1.5rem; }
.sm-prenota-info { position: sticky; top: 84px; }
.sm-prenota-steps { margin: 1rem 0; padding-left: 1.2rem; color: var(--sm-muted); }
.sm-widget-box { border: 1px solid var(--sm-line); border-radius: var(--sm-radius); background: #fff; padding: 1.25rem; min-height: 320px; }
@media (max-width: 860px) { .sm-prenota-grid { grid-template-columns: 1fr; } .sm-prenota-info { position: static; } }

/* Contatti: due colonne + mappa con consenso */
.sm-contatti-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; align-items: start; margin-top: 1.5rem; }
.sm-map-ph { border: 1px dashed var(--sm-blue); border-radius: 14px; background: var(--sm-soft); padding: 2rem 1.5rem; text-align: center; color: var(--sm-navy); }
@media (max-width: 860px) { .sm-contatti-grid { grid-template-columns: 1fr; } }
.sm-map iframe { width: 100%; height: 300px; border: 0; border-radius: 14px; display: block; }

/* Singola / archivio */
.sm-meta { color: var(--sm-muted); font-size: 0.9rem; margin: 0 0 1rem; }
.sm-content a { color: var(--sm-blue); }
.sm-content img { max-width: 100%; height: auto; border-radius: 10px; }
.sm-cover { margin: 0 0 1.25rem; }
.sm-cover img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--sm-radius); display: block; }

/* Footer */
.sm-footer { border-top: 1px solid var(--sm-line); padding: 2.5rem 0; color: var(--sm-muted); font-size: 0.92rem; }
.sm-footer a { color: var(--sm-navy); }
.sm-footer a:hover { color: var(--sm-blue); }

/* Cookie banner */
.sm-cookie { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 100; background: var(--sm-navy); color: #fff; border-radius: 12px; padding: 1rem 1.25rem; display: none; max-width: 720px; margin: 0 auto; }
.sm-cookie.is-visible { display: block; }
.sm-cookie a { color: #fff; }
.sm-cookie__actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.sm-cookie button { border: 0; border-radius: 999px; padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; }
#sm-cookie-ok { background: #fff; color: var(--sm-navy); }
#sm-cookie-no { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6); }

/* Hero payoff: prima riga in evidenza */
.sm-hero__payoff { color: var(--sm-navy); }

/* Evidenza: card editoriale con immagine contenuta + testo centrato (diversa da .sm-pat full-bleed) */
.sm-evidenza .sm-card.sm-ev { border-top: 1px solid var(--sm-line); padding: 1.25rem 1.25rem 1.5rem; text-align: center; border-radius: 22px; box-shadow: 0 1px 2px rgba(31,53,95,0.06); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.sm-evidenza .sm-card.sm-ev:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,53,95,0.12); border-color: var(--sm-blue); }
.sm-evidenza .sm-card.sm-ev:nth-child(3n+2):hover { border-color: var(--sm-red); }
.sm-evidenza .sm-card.sm-ev:nth-child(3n):hover { border-color: var(--sm-navy); }
.sm-ev__media { overflow: hidden; border-radius: 14px; margin-bottom: 1rem; background: var(--sm-soft); }
.sm-ev__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.sm-evidenza .sm-card.sm-ev h3 { font-size: 1.15rem; text-align: center; }
.sm-evidenza .sm-card.sm-ev p { text-align: center; }
@media (prefers-reduced-motion: reduce) { .sm-evidenza .sm-card.sm-ev, .sm-evidenza .sm-card.sm-ev:hover { transform: none; } }

/* Patologie: binario a due righe, card con immagine di sfondo + titolo overlay stile hero */
.sm-rail--rows { grid-template-rows: repeat(2, auto); }
.sm-pat { position: relative; min-height: 150px; border-radius: var(--sm-radius); overflow: hidden; background: var(--sm-soft); display: flex; align-items: flex-end; font: inherit; border: 0; padding: 0; cursor: pointer; text-align: left; width: 100%; }
.sm-pat__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-pat__label { position: relative; margin: 0.6rem; padding: 0.45rem 0.7rem; font-size: 0.95rem; font-weight: 700; color: var(--sm-navy); background: rgba(255,255,255,0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 10px; }
.sm-pat:hover .sm-pat__label { color: var(--sm-blue); }
.sm-pat:focus-visible { outline: 3px solid var(--sm-blue); outline-offset: 2px; }

/* Dialog area specialistica: card supercerciata, foto in alto con sfumatura al bianco */
.sm-dialog { border: 0; padding: 0; border-radius: 28px; max-width: min(560px, calc(100vw - 2rem)); width: 560px; box-shadow: 0 24px 80px rgba(31,53,95,0.35); }
.sm-dialog::backdrop { background: rgba(31,53,95,0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sm-dialog[open] { animation: sm-dialog-in 0.28s ease; }
@keyframes sm-dialog-in { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sm-dialog[open] { animation: none; } }
.sm-dialog__media { position: relative; min-height: 120px; background: var(--sm-soft); }
.sm-dialog__media img { width: 100%; height: 220px; object-fit: cover; display: block; }
.sm-dialog__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); }
.sm-dialog__x { position: absolute; top: 0.8rem; right: 0.8rem; z-index: 2; width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 0; background: rgba(255,255,255,0.92); color: var(--sm-navy); font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(31,53,95,0.2); }
.sm-dialog__x:hover { background: var(--sm-navy); color: #fff; }
.sm-dialog__body { padding: 0 1.75rem 1.75rem; margin-top: -1.5rem; position: relative; }
.sm-dialog__body h3 { margin: 0 0 0.6rem; font-size: 1.4rem; color: var(--sm-navy); }
.sm-dialog__text { color: var(--sm-muted); }
.sm-dialog__text p { margin: 0 0 0.8rem; }
.sm-dialog__text p:last-child { margin-bottom: 0; }

/* Partner: box bianchi con logo, autoplay ciclico via partners.js */
.sm-partners { grid-auto-columns: minmax(150px, 200px); }
.sm-partners.is-few { display: flex; flex-wrap: wrap; justify-content: center; overflow: visible; cursor: default; }
.sm-partners.is-few .sm-partner { flex: 0 1 200px; }
.sm-partner { background: #fff; border: 1px solid var(--sm-line); border-radius: var(--sm-radius); display: flex; align-items: center; justify-content: center; padding: 0.5rem; min-height: 110px; }
.sm-partner img { width: 100%; height: 110px; object-fit: contain; pointer-events: none; -webkit-user-drag: none; user-select: none; }

/* Header: tasto WhatsApp + icone social */
.sm-wa { display: inline-flex; align-items: center; gap: 0.45rem; border: 2px solid #1faa55; color: #1faa55 !important; padding: calc(0.6rem - 2px) calc(1.1rem - 2px); border-radius: 999px; }
.sm-wa:hover { background: #1faa55; color: #fff !important; }
.sm-soc { display: inline-flex; align-items: center; }
.sm-wa svg, .sm-soc svg { width: 1.15em; height: 1.15em; flex-shrink: 0; display: block; }
