/*
 * Landing TrafficLoop sul design 2026 (tema-landing.php, inc/landing2026.php).
 * Solo le sezioni proprie delle landing; il resto viene da assets/page/.
 * I testi sono quelli dei campi della landing, spesso lunghi: titoli un po'
 * più piccoli delle pagine interne e colonne di lettura strette.
 */

/* Titoli di sezione: frasi intere, non slogan */
.landing-2026 .tl-h2 { font-size: clamp(2rem, 3.6vw, 3.6rem); line-height: 1.02; text-wrap: balance; }

/* ---------- Introduzione ---------- */
.tl-intro .pg-intro__copy .h2 { margin-bottom: 24px; }
.tl-sub {
  font-family: var(--f-serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.2; letter-spacing: -0.01em;
  color: var(--brand); max-width: 30em; margin-bottom: 36px; text-wrap: pretty;
}

/* Testo della landing (HTML dei campi) */
.tl-prose { display: grid; gap: 20px; max-width: 40em; justify-items: start; }
.tl-prose > p, .tl-prose > ul, .tl-prose > ol { color: var(--muted); font-size: 1.1rem; line-height: 1.65; }
.tl-prose strong, .tl-prose b { color: var(--fg); font-weight: 560; }
.tl-prose a {
  color: var(--fg); text-decoration: underline; text-decoration-color: var(--human);
  text-underline-offset: 3px; transition: color .25s var(--ease-out);
}
.tl-prose a:hover { color: var(--human); }
.tl-prose ul, .tl-prose ol { padding-left: 1.2em; display: grid; gap: 8px; }

/* ---------- Problemi e soluzioni: griglia numerata ---------- */
.tl-list { position: relative; isolation: isolate; overflow: hidden; overflow: clip; /* clip: taglia la foto senza bloccare lo sticky della testata */ padding-block: clamp(100px, 12vw, 180px); }
.tl-list__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.tl-list__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; opacity: .5; filter: saturate(.85); }
.tl-list__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(10,6,18,.55) 18%, rgba(10,6,18,.7) 60%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10,6,18,.5) 0%, rgba(10,6,18,.35) 35%, rgba(10,6,18,.88) 62%, rgba(10,6,18,.92) 100%);
}
.tl-list__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.tl-list__head { position: sticky; top: calc(var(--nav-h) + 48px); align-self: start; }
.tl-list__head .h2 { margin-bottom: 32px; }
.tl-list__action--end { display: none; }

/* Card: entrano a scalare (landing2026.js), goccia al passaggio */
.tl-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.tl-card {
  --acc: var(--human);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(24px, 2.4vw, 36px); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .7s cubic-bezier(.22, 1, .36, 1), border-color .5s ease, box-shadow .7s ease, background-color .5s ease;
}
.tl-list[data-bg="light"] .tl-card { --acc: var(--brand); background: #fff; border-color: rgba(10, 6, 18, .08); }
.tl-list.has-bg .tl-card { background: rgba(18, 11, 31, .62); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }

/* entrata */
.tl-cards.is-armed .tl-card {
  opacity: 0; transform: translateY(70px) scale(.97);
  transition: opacity .9s ease calc(var(--i, 0) * .11s), transform 1.1s cubic-bezier(.16, 1, .3, 1) calc(var(--i, 0) * .11s), border-color .5s ease, box-shadow .7s ease;
}
.tl-cards.is-armed .tl-card.is-in-view { opacity: 1; transform: none; }
.tl-cards.is-armed .tl-card.is-in-view.is-hover { transition-delay: 0s; }

/* goccia che si allarga dal punto d'ingresso */
.tl-card__drop { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.tl-card__drop i {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 260%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(98, 37, 157, .22), rgba(252, 106, 58, .12) 65%, rgba(252, 106, 58, .04));
  transform: translate(-50%, -50%) scale(0); transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}
.tl-list[data-bg="light"] .tl-card__drop i { background: radial-gradient(closest-side, rgba(98, 37, 157, .08), rgba(252, 106, 58, .07) 65%, rgba(252, 106, 58, .03)); }
.tl-card.is-hover .tl-card__drop i { transform: translate(-50%, -50%) scale(1); transition-duration: 1.1s; }
.tl-card.is-hover { border-color: color-mix(in oklab, var(--acc) 55%, transparent); box-shadow: 0 30px 60px -34px rgba(10, 6, 18, .55); }
.tl-cards.is-armed .tl-card.is-in-view.is-hover, .tl-cards:not(.is-armed) .tl-card.is-hover { transform: translateY(-6px); }

/* numero in pillola che si riempie dal basso */
.tl-card__top { display: flex; align-items: center; justify-content: space-between; }
.tl-card__n {
  position: relative; overflow: hidden; isolation: isolate; display: inline-grid; place-items: center;
  min-width: 46px; height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid color-mix(in oklab, var(--acc) 60%, transparent); color: var(--acc);
  transition: color .5s ease, border-color .5s ease;
}
.tl-card__n b { position: absolute; left: 50%; top: 100%; width: 160%; aspect-ratio: 1; border-radius: 50%; background: var(--acc); z-index: -1; transform: translate(-50%, 0) scale(.2); transition: transform .7s cubic-bezier(.22, 1, .36, 1); }
.tl-card.is-hover .tl-card__n { color: #fff; border-color: var(--acc); }
.tl-card.is-hover .tl-card__n b { transform: translate(-50%, -60%) scale(1); }
.tl-card__count { color: var(--faint); }

.tl-card__title { font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 560; text-wrap: balance; }
.tl-card__text { display: grid; gap: 14px; }
.tl-card__text p { color: var(--muted); font-size: 1rem; line-height: 1.62; }
.tl-card__text strong, .tl-card__text b { color: var(--fg); font-weight: 560; }
.tl-card__text a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--human); text-underline-offset: 3px; }

/* filo in fondo che si riempie al passaggio */
.tl-card__line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--acc); transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.tl-card.is-hover .tl-card__line { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-card__drop i, .tl-card__n b, .tl-card__line { transition: none; }
}

@media (max-width: 1000px) {
  .tl-list__grid { grid-template-columns: 1fr; gap: 12px; }
  .tl-list__head { position: static; }
  .tl-list__head .h2 { margin-bottom: 8px; }
  .tl-list__head .tl-list__action { display: none; }
  .tl-list__action--end { display: block; margin-top: 16px; }
}
@media (max-width: 700px) {
  .tl-list { padding-block: 72px; }
  .tl-cards { grid-template-columns: 1fr; }
}

/* ---------- Esperti: sezione "anni di esperienza" delle pagine interne ---------- */
.tl-years .pg-years__copy { max-width: 40em; gap: 22px; }
.tl-years .pg-years__copy .eyebrow { color: rgba(243, 239, 232, .8); }
.tl-years .tl-h2 { font-size: clamp(2rem, 3.4vw, 3.4rem); }
.tl-years .tl-years__lead { margin: -6px 0 0; color: #fff; font-size: clamp(1.15rem, 1.5vw, 1.4rem); line-height: 1.45; text-wrap: pretty; }
.tl-years .tl-h2--split { font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1.08; }
.tl-years .tl-prose { gap: 14px; }
.tl-years .tl-prose > p { color: rgba(243, 239, 232, .8); font-size: 1.05rem; line-height: 1.6; }
.tl-years .tl-prose strong, .tl-years .tl-prose b, .tl-years .tl-prose a { color: #fff; }
@media (min-width: 1101px) { .tl-years .pg-years__content { flex-wrap: nowrap; align-items: flex-end; } .tl-years .pg-years__num { flex: none; } }
@media (max-width: 900px) { .tl-years { min-height: auto; padding-top: 38svh; } }

/* ---------- Blocchi aggiuntivi ("Approfondimento"): una lettura ---------- */
.tl-read { padding-block: clamp(100px, 12vw, 170px); }
.tl-read__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(40px, 7vw, 130px); align-items: start; }
.tl-read__head { position: sticky; top: calc(var(--nav-h) + 48px); display: grid; gap: 28px; justify-items: start; }
.tl-read__head .section-head { margin-bottom: 0; }
.tl-read__title { font-size: clamp(1.9rem, 3vw, 3rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 540; text-wrap: balance; }

/* avanzamento della lettura */
.tl-read__meter { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: min(100%, 360px); color: var(--muted); }
.tl-read__bar { position: relative; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tl-read__bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--grad-hybrid); }
.tl-read__pct { min-width: 3.4ch; text-align: right; color: var(--brand); font-variant-numeric: tabular-nums; }

/* colonna di lettura: paragrafi numerati, il primo come attacco */
.tl-read__body { counter-reset: tl-par; gap: 0; max-width: 44em; }
.tl-read__body > p {
  position: relative; counter-increment: tl-par;
  padding: 26px 0 26px clamp(56px, 5vw, 76px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 1.08rem; line-height: 1.7;
  transition: color .6s ease, opacity .6s ease;
}
.tl-read__body > p::before {
  content: counter(tl-par, decimal-leading-zero); position: absolute; left: 0; top: 30px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; color: var(--faint);
  transition: color .5s ease;
}
.tl-read__body > p::after {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform 1s cubic-bezier(.22, 1, .36, 1);
}
.tl-read__body > p:first-child {
  border-top: 0; padding-top: 0; color: var(--fg);
  font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.45; letter-spacing: -0.02em;
}
.tl-read__body > p:first-child::before { top: 8px; }
.tl-read__body > p:first-child::after { display: none; }
/* con JavaScript: i paragrafi già letti o sotto gli occhi sono accesi, gli altri attenuati */
.tl-read.is-live .tl-read__body > p:not(:first-child) { opacity: .42; }
.tl-read.is-live .tl-read__body > p.is-read { opacity: 1; }
.tl-read.is-live .tl-read__body > p.is-read::before { color: var(--brand); }
.tl-read.is-live .tl-read__body > p.is-read::after { transform: scaleX(1); }
.tl-read.is-live .tl-read__body > p.is-read:not(:first-child) { color: color-mix(in oklab, var(--fg) 78%, transparent); }

@media (max-width: 1000px) {
  .tl-read__grid { grid-template-columns: 1fr; gap: 36px; }
  .tl-read__head { position: static; gap: 20px; }
  .tl-read__meter { display: none; }
}
@media (max-width: 700px) {
  .tl-read { padding-block: 72px; }
  .tl-read__body > p { padding-left: 40px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .tl-read__body > p, .tl-read__body > p::after { transition: none; } }

/* ---------- Altre landing: testata ferma con la ricerca, gruppi o risultati a destra ---------- */
.tl-related__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.tl-related__head { position: sticky; top: calc(var(--nav-h) + 48px); align-self: start; display: grid; gap: 20px; justify-items: start; }
.tl-related__head .section-head { margin-bottom: 0; }
.tl-related__head .pg-sectors__title { margin-top: 0; max-width: 12em; }

.tl-related__body { min-width: 0; }
.tl-related .pg-sectors__list { justify-content: flex-start; }

@media (max-width: 1000px) {
  .tl-related__grid { grid-template-columns: 1fr; gap: 36px; }
  .tl-related__head { position: static; }
}
