/* The Space Reviews: carosello, griglia, riepilogo. Colori dal pannello. */
.tsr {
	--tsr-accento: #4e0064;
	--tsr-stelle: #4e0064;
	--tsr-stelle-vuote: #d9cfdf;
	--tsr-sfondo: #f7f5f9;
	--tsr-bordo: #e8e3ec;
	--tsr-divisore: #e4dce9;
	--tsr-pillola: #ece4f0;
	--tsr-testo: #333;
	--tsr-titoli: #242424;
	--tsr-secondario: #5f5f5f;
	--tsr-raggio: 15px;
	--tsr-spazio: 14px;
	--tsr-righe: 5;
	color: var(--tsr-testo);
	font-family: inherit;
	box-sizing: border-box;
}
.tsr *, .tsr *::before, .tsr *::after { box-sizing: inherit; }
/* Largo quanto il contenitore della pagina in cui è messo. */
.tsr-dentro { max-width: none; margin: 0; }
.tsr--carosello { padding: 0; }
.tsr-titolo { text-align: center; margin: 0 0 18px; color: var(--tsr-titoli); }

/* Stelle disegnate da noi: una riga mascherata, riempita in proporzione al voto. */
.tsr-stelle {
	--tsr-voto: 5;
	display: inline-block;
	flex: none;
	width: 5.75em;
	height: 1em;
	font-size: 17px;
	vertical-align: middle;
	background: linear-gradient(90deg, var(--tsr-stelle) calc(var(--tsr-voto) / 5 * 100%), var(--tsr-stelle-vuote) 0);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27.6 24'%3E%3Cpath d='M12 2.6l2.75 5.8 6.35.85-4.65 4.4 1.2 6.3L12 16.9l-5.65 3.05 1.2-6.3L2.9 9.25l6.35-.85z' fill='%23000' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 1.15em 1em repeat-x;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27.6 24'%3E%3Cpath d='M12 2.6l2.75 5.8 6.35.85-4.65 4.4 1.2 6.3L12 16.9l-5.65 3.05 1.2-6.3L2.9 9.25l6.35-.85z' fill='%23000' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 1.15em 1em repeat-x;
}
.tsr-stelle--grandi { font-size: 24px; }
.tsr-stelle--media { font-size: 20px; }
.tsr-stelle-vuote { display: inline-block; height: 17px; }

/* Intestazione del carosello: titolo a sinistra, media unica a destra. */
.tsr-intesta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin: 0 0 22px; }
.tsr-intesta--centro { justify-content: center; }
/* Intestazione come il blocco storico del sito: stelle, titolo e testo al centro. */
.tsr-intesta--classica { display: block; text-align: center; margin: 0 0 24px; color: inherit; }
.tsr-intesta__stelle { margin: 0 0 12px; line-height: 1; }
/* Titolo e testo usano le classi del tema: qui solo i ripieghi per i siti senza WoodMart. */
:where(.tsr-intesta--classica) h4 { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.4; }
:where(.tsr-intesta--classica) p { margin: 0; }
.tsr-intesta__testi { min-width: 0; flex: 1 1 320px; }
.tsr-intesta__titolo { margin: 0 0 8px; color: var(--tsr-titoli); }
.tsr-intesta:not(.tsr-intesta--classica) .tsr-intesta__titolo { font-size: clamp(24px, 3vw, 30px); font-weight: 600; line-height: 1.2; }
.tsr-intesta__sotto { margin: 0; font-size: 15px; line-height: 1.5; color: var(--tsr-secondario); }
.tsr-media { display: flex; align-items: center; gap: 14px; max-width: 400px; }
.tsr-media__numero { font-size: 48px; font-weight: 700; line-height: 1; color: var(--tsr-titoli); letter-spacing: -.02em; }
.tsr-media__lato { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tsr-media__nota { margin: 0; font-size: 13px; line-height: 1.4; color: var(--tsr-secondario); }

/* Carta */
.tsr-carta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 16px 18px;
	background: var(--tsr-sfondo);
	border: 1px solid var(--tsr-bordo);
	border-radius: var(--tsr-raggio);
	scroll-snap-align: start;
	text-align: left;
}
.tsr-carta[hidden] { display: none; }
.tsr-carta__testa { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.tsr-fonte {
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--tsr-pillola);
	color: var(--tsr-accento);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}
.tsr-logo { flex: none; height: 20px; width: auto; max-width: 104px; object-fit: contain; }
.tsr-logo--google { height: 22px; }
.tsr--carosello .tsr-altro { margin-top: -6px; }
/* Card strette del carosello: stelle, loghi e pillola un po' più piccoli per stare su una riga. */
.tsr--carosello .tsr-carta .tsr-stelle { font-size: 15px; }
.tsr--carosello .tsr-logo { height: 16px; max-width: 76px; }
.tsr--carosello .tsr-logo--google { height: 20px; }
.tsr--carosello .tsr-fonte { min-width: 0; padding: 3px 8px; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.tsr-carta__titolo { margin: 0; font-weight: 700; line-height: 1.35; font-size: 15px; color: var(--tsr-titoli); }
.tsr-carta__testo {
	font-size: 15px;
	line-height: 1.55;
	color: var(--tsr-testo);
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--tsr-righe);
	line-clamp: var(--tsr-righe);
	overflow-wrap: anywhere;
}
.tsr-carta__testo p { margin: 0; }
.tsr-carta__testo p + p { margin-top: .5em; }
.tsr--carosello .tsr-carta__testo { --tsr-righe: 4; }
.tsr--carosello .tsr-carta__testo p { display: inline; }
.tsr--carosello .tsr-carta__testo p + p::before { content: " "; }
.tsr-carta.is-aperta .tsr-carta__testo { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.tsr .tsr-altro {
	align-self: flex-start;
	min-height: 0;
	padding: 0;
	margin: -4px 0 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--tsr-secondario);
	font: inherit;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.tsr .tsr-altro:hover, .tsr .tsr-altro:focus { background: none; color: var(--tsr-accento); }
.tsr-altro[hidden] { display: none; }
.tsr-carta__piede { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--tsr-divisore); font-size: 13px; }
.tsr-carta__chi { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tsr-nome { font-weight: 700; color: var(--tsr-titoli); }
.tsr-data { color: var(--tsr-secondario); white-space: nowrap; }
.tsr-carta__info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.tsr-verificata { display: inline-flex; align-items: center; gap: 6px; color: #0b7a22; }
.tsr-verificata svg { flex: none; width: 15px; height: 15px; }
.tsr-verificata circle { fill: #12ac31; }
.tsr-verificata path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tsr a.tsr-originale { display: inline-flex; align-items: center; gap: 5px; color: var(--tsr-accento); text-decoration: underline; text-underline-offset: 3px; }
.tsr-originale svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Carosello: scorrimento nativo (swipe), 4 card su desktop, la successiva intravista su mobile. */
.tsr-binario {
	display: flex;
	align-items: stretch;
	gap: var(--tsr-spazio);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.tsr-binario::-webkit-scrollbar { display: none; }
.tsr-binario:focus-visible { outline: 2px solid var(--tsr-accento); outline-offset: 4px; }
/* Desktop: 5 card intere e la sesta a metà, così si capisce che si scorre. */
.tsr-binario .tsr-carta { flex: 0 0 clamp(200px, calc((100% - 5 * var(--tsr-spazio)) / 5.5), 320px); }

.tsr-controlli { display: flex; align-items: center; gap: 24px; margin-top: 20px; }
.tsr-controlli[hidden] { display: none; }
.tsr-barra { flex: 1; height: 4px; border-radius: 4px; background: var(--tsr-divisore); overflow: hidden; }
.tsr-barra__piena { display: block; width: 25%; height: 100%; border-radius: 4px; background: var(--tsr-accento); transition: width .15s linear; }
.tsr-frecce { display: flex; gap: 10px; }
.tsr .tsr-freccia {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	border: 1px solid #cfc4d6;
	border-radius: 50%;
	background: #fff;
	color: var(--tsr-titoli);
	cursor: pointer;
	transition: background-color .15s, opacity .15s;
}
.tsr .tsr-freccia:hover:not(:disabled) { background: #f0e9f4; }
.tsr-freccia svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tsr .tsr-freccia:disabled { opacity: .4; cursor: default; }

/* Griglia: 4 / 2 / 1 colonne */
.tsr-griglia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tsr-spazio); align-items: stretch; }
.tsr-filtri { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; }
.tsr .tsr-filtro {
	min-height: 0;
	padding: 8px 16px;
	border: 1px solid #cfc4d6;
	border-radius: 999px;
	background: #fff;
	color: var(--tsr-titoli);
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	cursor: pointer;
}
.tsr .tsr-filtro.is-attivo { background: var(--tsr-accento); border-color: var(--tsr-accento); color: #fff; }

/* Riepilogo (griglia) e pulsanti */
.tsr-riepilogo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 22px; text-align: center; }
.tsr-riepilogo__totale { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 16px; }
.tsr-riepilogo__fonti { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tsr-chip { padding: 5px 12px; border: 1px solid var(--tsr-bordo); border-radius: 999px; font-size: 13px; color: inherit; text-decoration: none; }
.tsr-azioni { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
.tsr a.tsr-pulsante {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 999px;
	background: var(--tsr-accento);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}
.tsr a.tsr-pulsante:hover, .tsr a.tsr-pulsante:focus { color: #fff; opacity: .9; }
.tsr a.tsr-pulsante--chiaro { background: transparent; color: var(--tsr-accento); border: 1px solid var(--tsr-accento); }
.tsr a.tsr-pulsante--chiaro:hover, .tsr a.tsr-pulsante--chiaro:focus { color: var(--tsr-accento); }

/* Riquadro con la media, per le pagine */
.tsr-riquadro { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: inherit; text-decoration: none; }
.tsr-riquadro__titolo { font-size: 14px; }
.tsr-riquadro__numero { font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--tsr-titoli); }
.tsr-riquadro__numero small { font-size: 16px; font-weight: 400; color: var(--tsr-secondario); }
.tsr-riquadro__nota { max-width: 240px; font-size: 13px; line-height: 1.4; color: var(--tsr-secondario); }

/* Badge per l'header: prende il colore del testo dove viene messo (o quello dello shortcode). */
.tsr-badge { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; color: inherit; font-family: inherit; text-decoration: none; font-size: 13px; line-height: 1.3; }
.tsr-badge .tsr-stelle { font-size: 15px; }
.tsr-badge:hover .tsr-badge__testo { text-decoration: underline; }
/* Nell'header il tema distanzia gli elementi di 25px: tra stelle e testo se ne lasciano circa 10. */
.tsr-badge--stelle { display: inline-block; line-height: 1; vertical-align: middle; margin-right: -15px; }
@media (max-width: 576px) { .tsr-badge--stelle { margin-right: 0; } }
.tsr-badge--stelle .tsr-stelle { font-size: 15.6px; }

@media (max-width: 1024px) {
	.tsr-griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tsr-binario .tsr-carta { flex-basis: clamp(240px, calc((100% - 2 * var(--tsr-spazio)) / 2.5), 320px); }
}
@media (max-width: 640px) {
	.tsr-griglia { grid-template-columns: minmax(0, 1fr); }
	.tsr-binario .tsr-carta { flex-basis: min(280px, 80%); }
	.tsr-media__numero { font-size: 44px; }
	.tsr-controlli { gap: 16px; }
}
