/* =========================================================================
   SmartMedia Theme — foglio di stile principale
   Le custom properties (:root) sono generate dinamicamente in wp_head()
   da inc/customizer.php a partire dai valori del Customizer.
   ========================================================================= */

/* ---------- Base ---------- */

body.smartmedia {
	font-family: 'Manrope', system-ui, sans-serif;
	background: #fff;
	color: var(--navy);
	-webkit-font-smoothing: antialiased;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	background: #fff;
	color: var(--navy);
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(12, 20, 40, 0.2);
}

/* ---------- Utility del mockup ---------- */

.card {
	transition: all 0.25s ease;
}

.card:hover {
	transform: translateY(-5px);
	box-shadow: 0 18px 40px rgba(12, 20, 40, 0.14);
}

.btn {
	transition: all 0.2s ease;
}

.btn:hover {
	transform: translateY(-2px);
}

.btn-p {
	transition: all 0.2s ease;
	text-decoration: none;
}

.btn-p:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(12, 20, 40, 0.16);
	color: #fff;
}

.prod-card {
	transition: all 0.25s ease;
}

.prod-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 18px 40px rgba(12, 20, 40, 0.13);
}

.pdf-link:hover {
	background: rgba(26, 95, 168, 0.14) !important;
}

.dcard {
	transition: all 0.25s ease;
}

.dcard:hover {
	transform: translateY(-4px);
	border-color: var(--blue);
	box-shadow: 0 14px 34px rgba(12, 20, 40, 0.12);
}

.bando-row {
	transition: background 0.18s ease;
}

.bando-row:hover {
	background: rgba(26, 95, 168, 0.05);
}

.doc-link {
	transition: background 0.18s ease;
	text-decoration: none;
}

.doc-link:hover {
	background: rgba(26, 95, 168, 0.05);
}

/* ---------- Header / mega menu ---------- */

.gh-ni {
	position: relative;
}

.gh-ni:hover .gh-dd,
.gh-ni.is-open .gh-dd {
	display: flex !important;
}

.gh-dd {
	display: none !important;
	position: absolute;
	top: 100%;
	margin-top: 0;
	left: 0;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(20px);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 14px;
	z-index: 999;
	box-shadow: 0 20px 60px rgba(12, 20, 40, 0.12);
	min-width: 210px;
	flex-direction: column;
	gap: 2px;
}

.gh-dd-mega {
	min-width: 460px;
}

.gh-dd-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px;
}

.gh-dd-item {
	padding: 9px 14px;
	border-radius: 10px;
	color: var(--muted);
	font-size: 13.5px;
	font-weight: 500;
	transition: all 0.18s;
	white-space: nowrap;
	text-decoration: none;
	display: block;
}

.gh-dd-item:hover {
	background: rgba(26, 95, 168, 0.07);
	color: var(--blue);
}

.gh-dd-item-current {
	background: rgba(26, 95, 168, 0.07);
	color: var(--blue);
	font-weight: 700;
}

.gh-nav-a-current {
	color: var(--navy) !important;
}

.sm-gallery {
	position: relative;
}

.sm-gallery-radio {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.sm-gallery-main img[data-sm-gallery-idx] {
	opacity: 0;
}

.sm-gallery-main:hover .sm-gallery-img {
	transform: scale(1.12);
}

.sm-gallery-thumb {
	transition: border-color 0.18s ease, opacity 0.18s ease;
	opacity: 0.75;
}

.sm-gallery-thumb:hover {
	opacity: 1;
}

.gh-nav-a {
	transition: color 0.18s;
	text-decoration: none;
}

.gh-nav-a:hover {
	color: var(--navy) !important;
}

.gh-social {
	transition: all 0.2s;
}

.gh-social:hover {
	background: var(--blue) !important;
	border-color: var(--blue) !important;
	color: #fff !important;
}

.gh-fl {
	transition: color 0.2s;
	text-decoration: none;
}

.gh-fl:hover {
	color: var(--blue) !important;
}

.gh-btn-p {
	transition: all 0.2s;
}

.gh-btn-p:hover {
	transform: translateY(-2px);
}

header nav a[href*="pnrr"],
header nav a[href*="PNRR"] {
	white-space: nowrap !important;
	flex-shrink: 0 !important;
}

/* ---------- FAQ accordion nativo ---------- */

.faq-item > summary {
	list-style: none;
	cursor: pointer;
}

.faq-item > summary::-webkit-details-marker {
	display: none;
}

.faq-item[open] .faq-arr {
	transform: rotate(45deg);
	background: var(--blue) !important;
	color: #fff !important;
}

.faq-arr {
	transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

/* ---------- Form ---------- */

.sm-form label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--navy);
	margin-bottom: 6px;
}

.sm-form input[type="text"],
.sm-form input[type="email"],
.sm-form input[type="tel"],
.sm-form textarea,
.sm-form select {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	padding: 13px 15px;
	border: 1.5px solid var(--border);
	border-radius: 12px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 14px;
	color: var(--navy);
	background: #fff;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sm-form input:focus,
.sm-form textarea:focus,
.sm-form select:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.12);
}

.sm-form textarea {
	min-height: 140px;
	resize: vertical;
}

.sm-form button {
	padding: 15px 30px;
	background: var(--blue);
	color: #fff;
	border: none;
	border-radius: 12px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.sm-form button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(26, 95, 168, 0.3);
}

.sm-notice {
	padding: 14px 18px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 20px;
}

.sm-notice-ok {
	background: rgba(22, 163, 74, 0.1);
	border: 1px solid rgba(22, 163, 74, 0.3);
	color: #12803a;
}

.sm-notice-err {
	background: rgba(232, 150, 26, 0.1);
	border: 1px solid rgba(232, 150, 26, 0.3);
	color: #B0710A;
}

/* ---------- Contenuto pagina generico (editor WP) ---------- */

.sm-page-content > p {
	font-size: 15.5px;
	color: #2A3A5C;
	line-height: 1.85;
	margin-bottom: 18px;
}

.sm-page-content h2 {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 24px;
	font-weight: 600;
	color: var(--navy);
	letter-spacing: -0.02em;
	margin: 34px 0 16px;
}

.sm-page-content h3 {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 18px;
	font-weight: 600;
	color: var(--navy);
	margin: 26px 0 12px;
}

.sm-page-content ul,
.sm-page-content ol {
	margin: 0 0 18px 20px;
	font-size: 15px;
	color: var(--muted);
	line-height: 1.8;
}

.sm-page-content img {
	max-width: 100%;
	height: auto;
	border-radius: 16px;
}

.sm-specs-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	white-space: nowrap;
}

.sm-specs-table caption,
.sm-specs-table p:first-child {
	padding: 14px 18px 0;
	font-weight: 700;
	color: var(--navy);
}

.sm-specs-table th,
.sm-specs-table td {
	padding: 12px 18px;
	text-align: left;
	border-bottom: 1px solid var(--border);
	color: var(--muted);
}

.sm-specs-table th {
	color: var(--navy);
	font-weight: 700;
	background: var(--gray);
}

.sm-specs-table tr:last-child th,
.sm-specs-table tr:last-child td {
	border-bottom: none;
}

/* ---------- WhatsApp FAB ---------- */

@keyframes wa-pulse {
	0%, 100% {
		box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
	}
	50% {
		box-shadow: 0 8px 24px rgba(37, 211, 102, 0.7), 0 0 0 8px rgba(37, 211, 102, 0.15);
	}
}

/* ---------- Quickbar mobile: icona telefono che "squilla" ---------- */

@keyframes sm-ring {
	0%, 82%, 100% {
		transform: rotate(0deg);
	}
	84% {
		transform: rotate(-16deg);
	}
	86% {
		transform: rotate(14deg);
	}
	88% {
		transform: rotate(-12deg);
	}
	90% {
		transform: rotate(9deg);
	}
	92% {
		transform: rotate(-6deg);
	}
	94% {
		transform: rotate(3deg);
	}
	96% {
		transform: rotate(0deg);
	}
}

.sm-ring-icon {
	transform-origin: 50% 50%;
	animation: sm-ring 2.8s ease-in-out infinite;
}

/* ---------- Mobile ---------- */

.mob-toggle {
	display: none;
}

#mob-drawer {
	display: none;
}

@media (max-width: 900px) {

	.site-header > div {
		padding: 0 16px !important;
		height: 60px !important;
	}

	.site-header nav.gh-mainnav {
		display: none !important;
	}

	.desktop-lang {
		display: none !important;
	}

	.mob-toggle {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border-radius: 10px;
		background: rgba(12, 20, 40, 0.06);
		border: none;
		cursor: pointer;
		flex-shrink: 0;
		margin-left: auto;
	}

	#mob-drawer {
		position: fixed;
		inset: 0;
		z-index: 1000;
		pointer-events: none;
	}

	#mob-drawer.open {
		display: block;
		pointer-events: auto;
	}

	#mob-drawer .mob-scrim {
		position: absolute;
		inset: 0;
		background: rgba(7, 15, 36, 0.55);
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	#mob-drawer.open .mob-scrim {
		opacity: 1;
	}

	#mob-drawer .mob-panel {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 86%;
		max-width: 380px;
		background: #fff;
		box-shadow: -16px 0 50px rgba(12, 20, 40, 0.25);
		transform: translateX(100%);
		transition: transform 0.35s cubic-bezier(.2, .9, .2, 1);
		display: flex;
		flex-direction: column;
	}

	#mob-drawer.open .mob-panel {
		transform: translateX(0);
	}

	.mob-panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 18px;
		border-bottom: 1px solid var(--border);
		flex-shrink: 0;
	}

	.mob-close {
		width: 38px;
		height: 38px;
		border-radius: 10px;
		background: rgba(12, 20, 40, 0.06);
		border: none;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	.mob-nav-scroll {
		flex: 1;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 8px 10px 24px;
	}

	.mob-item {
		display: block;
	}

	.mob-item > summary {
		list-style: none;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 15px 12px;
		font-size: 15.5px;
		font-weight: 700;
		color: var(--navy);
		cursor: pointer;
		border-radius: 10px;
	}

	.mob-item > summary::-webkit-details-marker {
		display: none;
	}

	.mob-item[open] > summary svg {
		transform: rotate(180deg);
	}

	.mob-item > summary svg {
		transition: transform 0.2s ease;
		flex-shrink: 0;
	}

	.mob-item > summary:active {
		background: rgba(12, 20, 40, 0.04);
	}

	.mob-sub {
		display: flex;
		flex-direction: column;
		padding: 2px 8px 10px 16px;
	}

	.mob-sub a {
		padding: 12px 14px;
		font-size: 14px;
		font-weight: 500;
		color: var(--muted);
		border-radius: 9px;
		text-decoration: none;
	}

	.mob-sub a:active {
		background: rgba(26, 95, 168, 0.07);
		color: var(--blue);
	}

	.mob-flat {
		display: block;
		padding: 15px 12px;
		font-size: 15.5px;
		font-weight: 700;
		color: var(--navy);
		border-radius: 10px;
		text-decoration: none;
	}

	.mob-footer-actions {
		padding: 14px 16px 20px;
		border-top: 1px solid var(--border);
		flex-shrink: 0;
		display: flex;
		flex-direction: column;
		gap: 9px;
	}

	#wa-fab {
		display: none !important;
	}

	#wa-bubble {
		display: none !important;
	}

	#mob-quickbar {
		display: flex !important;
	}
}

@media (min-width: 901px) {

	#mob-quickbar {
		display: none !important;
	}

	#mob-drawer {
		display: none !important;
	}

	#mob-wa-bubble {
		display: none !important;
	}
}

/* ---------- Griglie responsive (targeting dell'elemento che porta grid-template-columns) ---------- */

@media (max-width: 1024px) {

	section[style*="grid-template-columns:1fr 1fr"],
	div[style*="grid-template-columns:1fr 1fr"] {
		grid-template-columns: 1fr !important;
	}

	div[style*="repeat(3,1fr)"],
	section[style*="repeat(3,1fr)"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	div[style*="repeat(4,1fr)"],
	section[style*="repeat(4,1fr)"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	div[style*="grid-template-columns:1.3fr 1fr"] {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 900px) {

	section[style*="52%"] > div[style*="position:absolute;top:0;right:0"] {
		width: 100% !important;
		opacity: 0.18;
	}

	section[style*="52%"] {
		min-height: 0 !important;
		padding: 44px 20px 36px !important;
	}

	section[style*="52%"] > div[style*="max-width:1300px"] > div[style*="max-width:560px"] {
		max-width: 100% !important;
	}

	h1 {
		font-size: clamp(28px, 7.5vw, 40px) !important;
	}

	section[style*="border-top:1px solid rgba(255,255,255,0.1)"],
	div[style*="border-top:1px solid rgba(255,255,255,0.1)"] {
		grid-template-columns: repeat(2, 1fr) !important;
		width: 100% !important;
	}

	section[style*="border-top:1px solid rgba(255,255,255,0.1)"] > div,
	div[style*="border-top:1px solid rgba(255,255,255,0.1)"] > div {
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		min-width: 0;
	}

	section[style*="max-width:1300px"],
	div[style*="max-width:1300px"] {
		max-width: 100% !important;
	}

	main[style*="max-width"] {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}

	nav[aria-label="Breadcrumb"] {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}
}

@media (max-width: 768px) {

	section[style*="repeat(3,1fr)"],
	div[style*="repeat(3,1fr)"] {
		grid-template-columns: 1fr !important;
	}

	section[style*="repeat(4,1fr)"],
	div[style*="repeat(4,1fr)"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	section[style*="repeat(2,1fr)"],
	div[style*="repeat(2,1fr)"] {
		grid-template-columns: 1fr !important;
	}

	footer div[style*="1.5fr 1fr 1fr 1fr"] {
		grid-template-columns: 1fr !important;
		gap: 36px !important;
	}

	img[alt*="SmartMedia"] {
		height: 24px !important;
	}

	section {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}

	.sm-page-wrap > div[style*="padding"] {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}
}

@media (max-width: 560px) {

	section[style*="repeat(4,1fr)"],
	div[style*="repeat(4,1fr)"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	a[style*="aspect-ratio:3/4"] {
		aspect-ratio: 1/1 !important;
	}

	.sm-gallery-thumb {
		width: 52px !important;
		height: 52px !important;
	}
}

.sm-scheda-card:hover,
.sm-risorsa-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(12, 20, 40, 0.1);
}

/* =========================================================================
   Mobile premium — rifinitura percettiva della sola esperienza mobile.
   Nessuna struttura/contenuto toccato: solo spaziature, dimensionamento,
   touch target, feedback al tocco e micro-animazioni, dentro i breakpoint
   già esistenti (≤900px) o un nuovo ≤600px per lo smartphone puro.
   ========================================================================= */

/* ---------- Fix reali: zoom iOS sui form + paginazione nativa non stilizzata ---------- */

@media (max-width: 600px) {
	.sm-form input[type="text"],
	.sm-form input[type="email"],
	.sm-form input[type="tel"],
	.sm-form textarea,
	.sm-form select {
		font-size: 16px;
	}
}

nav.navigation .nav-links,
nav.pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 44px;
}

.page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	border: 1.5px solid var(--border);
	border-radius: 10px;
	color: var(--navy);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.18s ease, background 0.18s ease;
}

.page-numbers.current {
	background: var(--blue);
	border-color: var(--blue);
	color: #fff;
}

.page-numbers.dots {
	border: none;
	color: var(--muted);
}

@media (max-width: 600px) {
	.page-numbers {
		min-width: 44px;
		height: 44px;
	}
}

/* ---------- Touch feedback: sostituisce l'hover inerte su mobile ---------- */

@media (max-width: 900px) {
	.card:active,
	.prod-card:active,
	.dcard:active {
		transform: scale(0.98);
		box-shadow: 0 4px 14px rgba(12, 20, 40, 0.1);
	}

	.btn:active,
	.btn-p:active,
	.pdf-link:active,
	.sm-form button:active,
	.mob-flat:active,
	.mob-footer-actions a:active,
	#mob-quickbar a:active {
		transform: scale(0.97);
		opacity: 0.9;
	}
}

/* ---------- Touch target: quickbar + bottoni card prodotto ---------- */

@media (max-width: 900px) {
	#mob-quickbar a {
		min-height: 50px;
	}

	#mob-quickbar {
		border-radius: 18px 18px 0 0;
	}
}

@media (max-width: 600px) {
	.prod-card a[style*="padding:9px"] {
		padding: 12px !important;
		font-size: 13px !important;
	}
}

/* ---------- Drawer: profondità dello scrim + ingresso graduale delle voci ---------- */

@media (max-width: 900px) {
	#mob-drawer .mob-scrim {
		backdrop-filter: blur(2px);
	}

	.mob-nav-scroll > * {
		opacity: 0;
		transform: translateX(14px);
		transition: opacity 0.28s ease, transform 0.28s ease;
	}

	#mob-drawer.open .mob-nav-scroll > *:nth-child(1) { transition-delay: 0.03s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(2) { transition-delay: 0.06s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(3) { transition-delay: 0.09s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(4) { transition-delay: 0.12s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(5) { transition-delay: 0.15s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(6) { transition-delay: 0.18s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(7) { transition-delay: 0.21s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(8) { transition-delay: 0.24s; }
	#mob-drawer.open .mob-nav-scroll > *:nth-child(n+9) { transition-delay: 0.26s; }

	#mob-drawer.open .mob-nav-scroll > * {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ---------- Respiro: pannelli overlay cramped su schermi stretti ---------- */

@media (max-width: 600px) {
	div[style*="width:70%;padding:32px"] {
		padding: 18px !important;
	}

	div[style*="width:70%;padding:32px"] h3[style*="font-size:24px"] {
		font-size: 19px !important;
	}

	div[style*="position:absolute;bottom:0;left:0;right:0;padding:26px;"] {
		padding: 18px !important;
	}

	div[style*="position:absolute;bottom:0;left:0;right:0;padding:26px;"] h3[style*="font-size:22px"] {
		font-size: 18px !important;
	}
}

/* ---------- Pagina Contatti: card form troppo stretta con padding pieno su mobile ---------- */

@media (max-width: 600px) {
	div[style*="padding:36px;box-shadow:0 10px 32px"] {
		padding: 22px !important;
	}
}
