/**
 * Node Theme — base: reset leggero, tipografia, pagine senza Elementor (pagine legali,
 * articoli, archivi, ricerca, 404), header e footer di riserva, cursore.
 *
 * Specificita' bassa (:where) dove serve, cosi' Elementor e i widget Node vincono sempre.
 */

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: #fff;
	color: var(--nt-text);
	font-family: var(--nt-font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

:where(img, svg, video, canvas, iframe) { max-width: 100%; }
:where(img, video) { height: auto; }
:where(img) { vertical-align: middle; border-style: none; }
:where(figure) { margin: 0; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(table) { border-collapse: collapse; }

:where(a) { color: var(--color-link, var(--nt-ink)); text-decoration: none; transition: color 0.2s ease; }
:where(a:hover, a:focus-visible) { color: var(--color-link-hover, var(--nt-accent-dark)); }
:focus-visible { outline: 2px solid var(--nt-accent); outline-offset: 3px; }

/* ==========================================================================
   Titoli (scala del design system; i widget Node la sovrascrivono con le loro classi)
   ========================================================================== */

:where(h1, h2, h3, h4, h5, h6) { margin: 0 0 0.5em; color: var(--nt-ink); }
:where(h1, h2, h3, h4) { font-family: var(--nt-font-display); }
:where(h1) { font-size: 104px; line-height: 0.95; font-weight: 800; letter-spacing: -0.02em; }
:where(h2) { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
:where(h3) { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
:where(h4) { font-size: 22px; line-height: 1.3; font-weight: 700; }
:where(h5) { font-family: var(--nt-font-body); font-size: 16px; line-height: 1.4; font-weight: 800; }
:where(h6) { font-family: var(--nt-font-body); font-size: 12px; line-height: 1; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nt-muted); }
:where(p) { margin: 0 0 1em; }

@media (max-width: 1024px) {
	:where(h1) { font-size: 72px; }
	:where(h2) { font-size: 48px; }
	:where(h3) { font-size: 24px; }
	:where(h4) { font-size: 20px; }
}
@media (max-width: 767px) {
	:where(h1) { font-size: 46px; }
	:where(h2) { font-size: 36px; }
	:where(h3) { font-size: 22px; }
	:where(h4) { font-size: 19px; }
	:where(h6) { font-size: 11px; }
}

:where(.nt-dark) :where(h5, h6) { color: #fff; }

/* ==========================================================================
   Accessibilita'
   ========================================================================== */

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.nt-skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 100000;
	padding: 12px 18px;
	border-radius: 999px;
	background: var(--nt-accent);
	color: var(--nt-ink);
	font-weight: 800;
}
.nt-skip-link:focus { top: 16px; color: var(--nt-ink); }

/* ==========================================================================
   Contenitore e testata delle pagine senza Elementor
   ========================================================================== */

.nt-container { width: min(100% - 32px, 1240px); margin-inline: auto; }
.nt-container--narrow { width: min(100% - 32px, 860px); }

.nt-page-hero {
	position: relative;
	padding: calc(var(--nt-header-h) + 72px) 0 72px;
	background-color: var(--nt-ink);
	color: var(--nt-text-dark);
	overflow: hidden;
}
.nt-page-hero__label { margin-bottom: 20px; }
.nt-page-hero__title {
	margin: 0;
	color: #fff;
	font: 800 clamp(40px, 6vw, 88px)/0.98 var(--nt-font-display);
	font-stretch: 125%;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}
.nt-page-hero__meta { margin: 20px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 15px; }
.nt-page-hero__meta a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.nt-classic-main { padding: 72px 0 96px; }

/* Testo lungo: pagine legali, articoli. */
.nt-prose { color: var(--nt-text); font-size: 17px; line-height: 1.7; }
.nt-prose > * + * { margin-top: 1em; }
.nt-prose :where(h2) { margin: 2em 0 0.6em; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.02em; font-stretch: 112%; }
.nt-prose :where(h3) { margin: 1.8em 0 0.5em; font-size: 22px; font-stretch: 112%; }
.nt-prose :where(h4) { margin: 1.6em 0 0.4em; font-size: 18px; }
.nt-prose :where(h2, h3, h4):first-child { margin-top: 0; }
.nt-prose :where(ul, ol) { padding-left: 1.3em; }
.nt-prose :where(li) { margin: 0.3em 0; }
.nt-prose :where(li)::marker { color: var(--nt-accent-dark); }
.nt-prose :where(a) { color: var(--nt-ink); text-decoration: underline; text-decoration-color: var(--nt-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.nt-prose :where(a:hover) { color: var(--nt-accent-dark); }
.nt-prose :where(strong, b) { color: var(--nt-ink); font-weight: 800; }
.nt-prose :where(blockquote) { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--nt-accent); color: var(--nt-ink); font-size: 20px; }
.nt-prose :where(table) { width: 100%; font-size: 15px; }
.nt-prose :where(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--nt-line); text-align: left; vertical-align: top; }
.nt-prose :where(th) { color: var(--nt-ink); font-weight: 800; }
.nt-prose :where(hr) { border: 0; border-top: 1px solid var(--nt-line); margin: 2.5em 0; }
.nt-prose :where(img) { border-radius: calc(var(--nt-radius) / 2); }
.nt-prose :where(code, kbd) { padding: 0.1em 0.35em; border-radius: 4px; background: var(--nt-paper); font-size: 0.9em; }
.nt-prose .alignwide { width: min(100vw - 32px, 1240px); margin-left: 50%; transform: translateX(-50%); }
.nt-prose .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.nt-prose .aligncenter { margin-inline: auto; }
.nt-prose .wp-caption-text, .nt-prose figcaption { margin-top: 8px; color: var(--nt-muted); font-size: 14px; }

.nt-thumb { margin: -24px 0 48px; border-radius: var(--nt-radius); overflow: hidden; }
.nt-thumb img { width: 100%; display: block; }

/* ==========================================================================
   Elenchi di articoli, paginazione, ricerca
   ========================================================================== */

.nt-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.nt-post-card { display: flex; flex-direction: column; border-radius: var(--nt-radius); background: var(--nt-paper); overflow: hidden; }
.nt-post-card__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--nt-ink); }
.nt-post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--nt-ease); }
.nt-post-card:hover .nt-post-card__img img { transform: scale(1.04); }
.nt-post-card__body { padding: 24px 26px 28px; }
.nt-post-card__meta { margin: 0 0 8px; color: var(--nt-muted); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.nt-post-card__title { margin: 0 0 10px; font-size: 24px; line-height: 1.15; }
.nt-post-card__title a { color: var(--nt-ink); }
.nt-post-card__title a:hover { color: var(--nt-accent-dark); }
.nt-post-card__excerpt { margin: 0; font-size: 15px; }

.nt-pagination { margin-top: 56px; }
.nt-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 48px; height: 48px; padding: 0 16px;
	border: 1px solid var(--nt-line); border-radius: 999px;
	color: var(--nt-ink); font-weight: 800;
}
.nt-pagination .page-numbers.current { background: var(--nt-ink); border-color: var(--nt-ink); color: #fff; }
.nt-pagination a.page-numbers:hover { border-color: var(--nt-ink); }

.nt-search-form { display: flex; gap: 10px; max-width: 560px; }
.nt-search-form input[type="search"] {
	flex: 1; min-width: 0; height: 56px; padding: 0 24px;
	border: 1px solid var(--nt-line); border-radius: 999px; background: #fff; color: var(--nt-ink);
}
.nt-search-form button {
	height: 56px; padding: 0 28px; border: 0; border-radius: 999px;
	background: var(--nt-accent); color: var(--nt-ink); font-weight: 800; cursor: pointer;
}
.nt-page-hero .nt-search-form { margin-top: 32px; }
.nt-page-hero .nt-search-form input[type="search"] { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.nt-page-hero .nt-search-form input::placeholder { color: rgba(255, 255, 255, 0.6); }

.nt-empty { padding: 40px 0; color: var(--nt-muted); }

/* 404 */
.nt-404 { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.nt-404__code {
	display: block;
	margin: 0 0 12px;
	color: transparent;
	-webkit-text-stroke: 1.5px var(--nt-accent);
	font: 800 clamp(120px, 22vw, 300px)/0.85 var(--nt-font-display);
	font-stretch: 125%;
	letter-spacing: -0.04em;
}
.nt-404__text { max-width: 560px; margin: 24px 0 36px; color: rgba(255, 255, 255, 0.72); font-size: 19px; }
.nt-404 .nt-btn { display: inline-flex; }

/* Commenti (articoli). */
.nt-comments { margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--nt-line); }
.nt-comments .comment-list { list-style: none; padding: 0; }
.nt-comments .comment-body { padding: 20px 0; border-bottom: 1px solid var(--nt-line); }
.nt-comments textarea, .nt-comments input[type="text"], .nt-comments input[type="email"], .nt-comments input[type="url"] {
	width: 100%; padding: 14px 18px; border: 1px solid var(--nt-line); border-radius: 14px;
}
.nt-comments .submit { padding: 14px 28px; border: 0; border-radius: 999px; background: var(--nt-ink); color: #fff; font-weight: 800; cursor: pointer; }

/* ==========================================================================
   Header e footer di riserva (senza layout Elementor)
   ========================================================================== */

.nt-dheader {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 900;
	background: color-mix(in srgb, var(--nt-ink) 92%, transparent);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	color: #fff;
}
.admin-bar .nt-dheader { top: 32px; }
@media (max-width: 782px) { .admin-bar .nt-dheader { top: 46px; } }
.nt-dheader__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--nt-header-h); }
.nt-dheader__brand { color: #fff; font: 800 22px/1 var(--nt-font-display); font-stretch: 112%; }
.nt-dheader__brand:hover { color: var(--nt-accent); }
.nt-dheader__brand img { max-height: 48px; width: auto; }
.nt-dheader__nav ul { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0; list-style: none; }
.nt-dheader__nav a { color: #fff; font-weight: 700; font-size: 15px; }
.nt-dheader__nav a:hover, .nt-dheader__nav .current-menu-item > a { color: var(--nt-accent); }
.nt-dheader__nav .sub-menu { display: none; }
.nt-dheader__toggle { display: none; }

@media (max-width: 900px) {
	.nt-dheader__toggle {
		display: inline-flex; align-items: center; gap: 8px;
		padding: 10px 18px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
		background: none; color: #fff; font-weight: 800; cursor: pointer;
	}
	.nt-dheader__nav { position: absolute; inset: 100% 0 auto 0; display: none; padding: 16px 16px 28px; background: var(--nt-ink); }
	.nt-dheader.is-open .nt-dheader__nav { display: block; }
	.nt-dheader__nav ul { flex-direction: column; gap: 14px; }
	.nt-dheader__nav a { font-size: 20px; }
}

.nt-dfooter { padding: 64px 0 40px; background: var(--nt-ink); color: rgba(255, 255, 255, 0.72); font-size: 15px; }
.nt-dfooter a { color: #fff; }
.nt-dfooter a:hover { color: var(--nt-accent); }
.nt-dfooter__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--nt-line-dark); }
.nt-dfooter__brand { color: #fff; font: 800 28px/1 var(--nt-font-display); font-stretch: 112%; }
.nt-dfooter__nav ul { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0; padding: 0; list-style: none; }
.nt-dfooter__bottom { padding-top: 24px; font-size: 13px; }

/* ==========================================================================
   Layout di Elementor dentro il tema
   ========================================================================== */

/* Il contenitore dell'header non occupa spazio: l'header Node e' fisso e sta sopra l'hero. */
.nt-layout--header { position: relative; z-index: 900; height: 0; }
.nt-layout--header > .elementor { height: 0; }

/* Anteprima dell'header nell'editor: serve un fondo per vedere il contenuto bianco. */
body.nt-layout-canvas { min-height: 100vh; background: #fff; }
body.nt-layout-canvas--header { background: var(--nt-ink) linear-gradient(180deg, #3a3f44, var(--nt-ink)); }

/* ==========================================================================
   Cursore personalizzato (nt-core.js)
   ========================================================================== */

.nt-cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100001;
	width: 0;
	height: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}
.nt-cursor.is-visible { opacity: 1; }
.nt-cursor::before {
	content: '';
	position: absolute;
	left: -16px;
	top: -16px;
	width: 32px;
	height: 32px;
	border: 1.5px solid var(--nt-accent);
	border-radius: 50%;
	mix-blend-mode: difference;
	transition: transform 0.35s var(--nt-ease), background-color 0.35s var(--nt-ease), border-color 0.35s ease;
}
.nt-cursor.is-hover::before { transform: scale(1.6); background-color: color-mix(in srgb, var(--nt-accent) 18%, transparent); }
.nt-cursor.is-down::before { transform: scale(0.8); }
.nt-cursor.has-label::before { transform: scale(2.9); background-color: var(--nt-accent); border-color: var(--nt-accent); mix-blend-mode: normal; }
.nt-cursor__label {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%) scale(0.6);
	color: var(--nt-ink);
	font: 800 12px/1 var(--nt-font-body);
	letter-spacing: 0.04em;
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.35s var(--nt-ease);
}
.nt-cursor.has-label .nt-cursor__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
	.nt-cursor { display: none; }
}

.nt-has-dheader.nt-elementor .nt-main { padding-top: var(--nt-header-h); }
