/* Teknet Bergamo — stili di base. I design token stanno in theme.json. */

:root {
	--tk-ease: cubic-bezier(.2, .75, .1, 1);
	--tk-line: rgba(255, 255, 255, .14);
	--tk-line-dark: rgba(11, 11, 12, .16);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Lenis (scroll fluido). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
body { overflow-x: clip; }

::selection { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink); }

:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; }

/* Sezioni chiare: testi e linee si invertono automaticamente. */
.has-paper-background-color,
.has-paper-2-background-color,
.has-white-background-color { color: var(--wp--preset--color--ink); }

/* Titoli gonfi: Boldonse ha metriche alte, niente sillabazione, a capo bilanciato. */
h1, h2, h3, .tk-display {
	hyphens: none;
	text-wrap: balance;
	overflow-wrap: normal;
}
.tk-display {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	text-transform: uppercase;
	line-height: 1.3;
	letter-spacing: -.015em;
}
.tk-accent { color: var(--wp--preset--color--accent); }

/* Etichetta sopra i titoli. */
.tk-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* Pulsante secondario: contorno. Classe "is-style-outline" del blocco Pulsante. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: currentColor;
	border: 1px solid currentColor;
}
.wp-block-button__link { transition: background-color .35s var(--tk-ease), color .35s var(--tk-ease), transform .35s var(--tk-ease); }

/* ---- Animazioni GSAP ----
 * html.tk-anim viene aggiunta in <head> solo se l'utente non ha chiesto movimento ridotto:
 * nasconde gli elementi prima che GSAP li animi (niente lampeggio).
 * Se GSAP non parte entro 3s la classe viene tolta e tutto resta visibile. */
.tk-anim .tk-reveal,
.tk-anim .tk-split,
.tk-anim .tk-stagger > * { visibility: hidden; }

.tk-split .tk-line { will-change: transform, opacity; }

/* Marquee orizzontale. */
.tk-marquee { overflow: hidden; white-space: nowrap; }
.tk-marquee__inner { display: inline-flex; will-change: transform; }
.tk-marquee__track { display: inline-flex; gap: 3rem; padding-right: 3rem; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---- Scrollbar tratteggiata (assets/js/scrollbar.js) ----
 * Verde con contorno nero sottile: leggibile sia sulla carta sia sul nero. */
.tk-arrowbar {
	position: fixed; z-index: 90; bottom: 10px; height: 30px;
	left: max(clamp(20px, 4.2vw, 72px), 84px); right: clamp(20px, 4.2vw, 72px);
	cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.tk-arrowbar:focus-visible { outline: 2px dashed var(--wp--preset--color--accent); outline-offset: 2px; border-radius: 6px; }
.tk-arrowbar__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tk-arrowbar__track { stroke: rgba(161, 161, 166, .45); stroke-width: 1.5; stroke-dasharray: 2 8; stroke-linecap: round; }
.tk-arrowbar__outline { stroke: var(--wp--preset--color--ink); stroke-width: 6; stroke-dasharray: 12 8; stroke-linecap: round; }
.tk-arrowbar__fill { stroke: var(--wp--preset--color--accent); stroke-width: 3.5; stroke-dasharray: 12 8; stroke-linecap: round; }
.tk-arrowbar:hover .tk-arrowbar__track { stroke: rgba(161, 161, 166, .8); }
.tk-arrowbar__fill, .tk-arrowbar__outline { transition: stroke-width .3s; }
.tk-arrowbar:hover .tk-arrowbar__fill, .tk-arrowbar.is-dragging .tk-arrowbar__fill { stroke-width: 4.5; }
.tk-arrowbar:hover .tk-arrowbar__outline, .tk-arrowbar.is-dragging .tk-arrowbar__outline { stroke-width: 7; }
@media (max-width: 600px) {
	.tk-arrowbar { bottom: 6px; height: 24px; left: 76px; right: 16px; }
}

/* ---- Banner cookie (plugin CookieAdmin) nei colori del sito ----
 * Sovrascritto dal tema, non nel plugin: gli aggiornamenti del plugin non lo annullano. */
.cookieadmin_re_consent {
	background: var(--wp--preset--color--accent) !important; color: var(--wp--preset--color--ink) !important;
	box-shadow: 0 0 0 1.5px var(--wp--preset--color--ink), 0 10px 24px -8px rgba(11, 11, 12, .45) !important;
}
.cookieadmin_re_consent svg, .cookieadmin_re_consent svg * { fill: var(--wp--preset--color--ink) !important; color: var(--wp--preset--color--ink) !important; }
.cookieadmin_re_consent img { filter: brightness(0); }
.cookieadmin_consent_inside, .cookieadmin_cookie_modal { font-family: var(--wp--preset--font-family--sans) !important; border-radius: 18px !important; }
.cookieadmin_btn { border-radius: 999px !important; font-weight: 600 !important; }
.cookieadmin_accept_btn, .cookieadmin_save_btn {
	background: var(--wp--preset--color--accent) !important; color: var(--wp--preset--color--ink) !important; border-color: var(--wp--preset--color--accent) !important;
}
.cookieadmin_accept_btn:hover, .cookieadmin_save_btn:hover { background: var(--wp--preset--color--ink) !important; color: var(--wp--preset--color--accent) !important; }

/* ---- Pulsante "torna in cima" (assets/js/ui.js) ---- */
.tk-totop {
	position: fixed; z-index: 91; right: clamp(16px, 4.2vw, 72px); bottom: 56px; width: 52px; height: 52px; border-radius: 50%;
	display: grid; place-items: center; cursor: pointer; border: 1.5px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--ink); color: var(--wp--preset--color--accent);
	box-shadow: 0 12px 28px -10px rgba(11, 11, 12, .55);
	opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
	transition: opacity .35s, visibility .35s, transform .45s cubic-bezier(.2, .75, .1, 1), background-color .3s, color .3s;
}
.tk-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.tk-totop:hover, .tk-totop:focus-visible { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink); }
.tk-totop:hover svg { animation: tk-up .8s cubic-bezier(.2, .75, .1, 1); }
@keyframes tk-up { 40% { transform: translateY(-5px); } }
@media (max-width: 600px) { .tk-totop { width: 46px; height: 46px; bottom: 44px; } }

/* Banner cookie (plugin) sugli schermi molto grandi: cresce come il resto del sito. */
@media (min-width: 2400px) { .cookieadmin_law_container, .cookieadmin_cookie_modal, .cookieadmin_re_consent { zoom: 1.35; } }
@media (min-width: 3200px) { .cookieadmin_law_container, .cookieadmin_cookie_modal, .cookieadmin_re_consent { zoom: 1.8; } }

/* Freccia proporzionata al pulsante a ogni risoluzione. */
.tk-totop svg { width: 22px; height: 22px; }

/* ---- Barra di scorrimento a destra (assets/js/ui.js, scrollThumb) ----
 * Con il mouse la barra del browser è nascosta e sostituita da un pallino verde che galleggia sul bordo,
 * senza striscia di sfondo. Bordo scuro sottile: resta visibile anche sulle sezioni verdi. */
html.tk-has-thumb { scrollbar-width: none; }
html.tk-has-thumb::-webkit-scrollbar { display: none; }
.tk-thumbbar { position: fixed; top: 6px; right: 0; bottom: 6px; width: 16px; z-index: 9990; cursor: pointer; }
.tk-thumbbar__thumb {
	position: absolute; top: 0; right: 4px; width: 6px; border-radius: 6px; cursor: grab;
	background: var(--wp--preset--color--accent); box-shadow: 0 0 0 1px rgba(11, 11, 12, .45);
	transition: width .25s, right .25s;
}
.tk-thumbbar:hover .tk-thumbbar__thumb, .tk-thumbbar.is-drag .tk-thumbbar__thumb { width: 9px; right: 3px; }
.tk-thumbbar.is-drag .tk-thumbbar__thumb { cursor: grabbing; }
html.hp-menu-open .tk-thumbbar { display: none; }
@media print { .tk-thumbbar { display: none; } }
.hp-nw { white-space: nowrap; }

/* ---------- Confronto versioni A / B (pulsante in basso a sinistra) ---------- */
.tk-ab { position: fixed; left: 16px; bottom: 16px; z-index: 9990; display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: #0B0B0C; color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); font: 600 .78rem/1 var(--wp--preset--font-family--sans), system-ui, sans-serif; }
.tk-ab__label { padding: 0 8px 0 10px; font-family: var(--mono, monospace); font-weight: 400; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.tk-ab a { display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 14px; border-radius: 999px; color: #fff; text-decoration: none; transition: background .25s, color .25s; }
.tk-ab a small { font-weight: 400; font-size: .7rem; opacity: .7; }
.tk-ab a:hover { background: rgba(255, 255, 255, .12); }
.tk-ab a[aria-current] { background: #C8FF2E; color: #0B0B0C; }
@media (max-width: 600px) { .tk-ab { left: 10px; bottom: 10px; } .tk-ab a small { display: none; } .tk-ab__label { display: none; } }
.tk-ab { background: rgba(11, 11, 12, .94); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body .tk-ab a:not([aria-current]) { color: #fff; }

/* Niente scorrimento orizzontale: ciò che sporge ai lati (corda degli strumenti, card che entrano di lato)
 * viene tagliato al bordo della sezione. "clip" non crea un contenitore di scorrimento: sezioni bloccate e sticky restano intatte. */
html { overflow-x: clip; }
main .hp-sec, .hp-footer-wrap { overflow-x: clip; }

/* Contorno di focus: WordPress ne disegna uno nero su ogni elemento attivo (:where(.wp-site-blocks :focus)), anche al tocco
   o al clic. Lo togliamo quando l'elemento è stato toccato o cliccato; da tastiera resta il contorno verde (:focus-visible). */
.wp-site-blocks :focus:not(:focus-visible),
:root .wp-element-button:focus:not(:focus-visible),
:root .wp-block-button__link:focus:not(:focus-visible) { outline: none; }
/* Niente riquadro grigio/azzurro dei telefoni sugli elementi toccati: il sito ha già le sue reazioni al tocco. */
html { -webkit-tap-highlight-color: transparent; }

/* Senza il pulsante dei cookie (nascosto da browser come Brave) la barra parte dal margine sinistro, come a destra. */
.tk-arrowbar.is-full { left: clamp(20px, 4.2vw, 72px); }
@media (max-width: 600px) { .tk-arrowbar.is-full { left: 16px; } }
