/* ═══════════════════════════════════════════════════════════════════════
   Blocco «Testata pagina» (page builder, testata_pagina, dalla 1.3.297).
   Partial: views/partials/_testata_pagina.twig.
   Briciole, occhiello col trattino colorato, titolo grande e frase; a destra
   un riquadro verde chiaro con il riquadro bianco dell'icona, titolo, righe
   e un arco sottile; sotto le schede di navigazione con quella della pagina
   sottolineata (e l'ultima più leggera se scelto).
   Colori dal pannello in variabili solo se scelti: --tsp-scuro (titoli,
   scheda attiva), --tsp-linea (trattino e arco), --tsp-verde (riquadro).
   Titoli col carattere dei titoli del tema. Classi tsp-.
   ═══════════════════════════════════════════════════════════════════════ */

.tsp {
    --tsp-scuro: #0b1530;
    --tsp-linea: #b9e03f;
    --tsp-verde: #f3f8e8;
    --tsp-grigio: #5b6474;
    --tsp-tenue: #6b7280;
    --tsp-bordo: #e5e7eb;
    padding: clamp(20px, 2.4vw, 34px) 0 clamp(20px, 2.6vw, 40px);
    color: var(--tsp-scuro);
}
.tsp *, .tsp *::before, .tsp *::after { box-sizing: border-box; }
.tsp-dentro {
    width: 100%;
    max-width: var(--container-max-width, 1280px);
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Briciole ─── */
.tsp-briciole ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 clamp(22px, 2.6vw, 38px);
    padding: 0;
    list-style: none;
    font-size: .92rem;
    line-height: 1.5;
    color: var(--tsp-tenue);
}
.tsp-briciole li + li::before {
    content: "/";
    margin: 0 .9em;
    color: var(--tsp-tenue);
}
.tsp-briciole a { color: var(--tsp-grigio); text-decoration: none; }
.tsp-briciole a:hover { color: var(--tsp-scuro); text-decoration: underline; text-underline-offset: .2em; }
.tsp-briciole [aria-current] { color: var(--tsp-tenue); }

/* ─── Testo e riquadro ─── */
.tsp-corpo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(20px, 3vw, 48px);
}
.tsp-corpo--solo { grid-template-columns: minmax(0, 1fr); }
.tsp-occhiello {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .18em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--tsp-scuro);
}
.tsp-occhiello::before {
    content: "";
    flex: none;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--tsp-linea);
}
.tsp-titolo {
    margin: 0;
    font-family: var(--font-heading, inherit);
    font-size: clamp(2.2rem, 4.1vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1.05;
    color: var(--tsp-scuro);
}
.tsp-frase {
    max-width: 44em;
    margin: clamp(10px, 1vw, 16px) 0 0;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.5;
    color: var(--tsp-grigio);
}

.tsp-riquadro {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: clamp(240px, 22vw, 300px);
    min-height: 120px;
    padding: 24px 28px;
    overflow: hidden;
    border-radius: 18px;
    background: var(--tsp-verde);
}
/* L'arco sottile che attraversa il riquadro */
.tsp-riquadro::after {
    content: "";
    position: absolute;
    top: -62px;
    left: 44%;
    width: 170px;
    height: 170px;
    border: 1.5px solid var(--tsp-linea);
    border-radius: 50%;
    pointer-events: none;
}
.tsp-tessera {
    position: relative;
    z-index: 1;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
}
.tsp-tessera img { display: block; width: 64%; height: 64%; max-width: none; object-fit: contain; }
.tsp-icona { width: 34px; height: 34px; color: var(--tsp-scuro); }
.tsp-riq-testo {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tsp-riq-titolo {
    margin-bottom: 3px;
    font-family: var(--font-heading, inherit);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tsp-scuro);
}
.tsp-riq-riga {
    font-size: .78rem;
    line-height: 1.45;
    color: var(--tsp-grigio);
}

/* ─── Schede di navigazione ─── */
.tsp-schede {
    margin-top: clamp(26px, 3.4vw, 48px);
    border-bottom: 1px solid var(--tsp-bordo);
}
.tsp-schede ul {
    display: flex;
    gap: clamp(22px, 2.4vw, 34px);
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}
.tsp-schede ul::-webkit-scrollbar { display: none; }
.tsp-scheda {
    position: relative;
    display: block;
    padding: 4px 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tsp-scuro);
    text-decoration: none;
    white-space: nowrap;
}
.tsp-scheda::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 2px;
    background: transparent;
    transition: background-color .2s ease;
}
.tsp-scheda.is-attiva::after { background: var(--tsp-scuro); }
.tsp-scheda:hover::after { background: color-mix(in srgb, var(--tsp-scuro) 30%, transparent); }
.tsp-scheda.is-attiva:hover::after { background: var(--tsp-scuro); }
.tsp-schede--ultima-tenue li:last-child .tsp-scheda:not(.is-attiva) { font-weight: 400; color: var(--tsp-tenue); }
.tsp-scheda:focus-visible { outline: 2px solid var(--tsp-scuro); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 860px) {
    .tsp-corpo { grid-template-columns: minmax(0, 1fr); }
    .tsp-riquadro { width: 100%; max-width: 380px; }
}
@media (prefers-reduced-motion: reduce) {
    .tsp-scheda::after { transition: none; }
}
