/* Dossier Theme — main.css
 * Le CSS var --mt-color-* sono pilotate dalla palette configurabile dal plugin Dossier
 * (Impostazioni → Colori del portale). Se il plugin non è attivo, i fallback qui sotto
 * mantengono l'aspetto default.
 */

/* -----------------------------
 * Design tokens (pilotati dalle var Dossier con fallback)
 * ----------------------------- */
:root {
	--mt-color-bg:            var(--dossier-bg,            #151b25);
	--mt-color-bg-alt:        var(--dossier-bg-alt,        #1e2733);
	--mt-color-text:          var(--dossier-text,          #eef1f5);
	--mt-color-text-muted:    var(--dossier-muted,         #9aa4b2);
	--mt-color-border:        var(--dossier-border,        #323e4d);
	--mt-color-accent:        var(--dossier-primary,       #5b8def);
	--mt-color-accent-dark:   var(--dossier-primary-hover, #7aa8f2);
	--mt-color-accent-light:  #eaf1fb;
	--mt-radius: 8px;
	--mt-radius-sm: 4px;
	--mt-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
	--mt-shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08);
	--mt-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--mt-container: 1080px;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var( --mt-font-sans );
	font-size: 16px;
	line-height: 1.6;
	color: var( --mt-color-text );
	background: var( --mt-color-bg );
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var( --mt-color-accent );
	text-decoration: none;
}

a:hover,
a:focus {
	color: var( --mt-color-accent-dark );
	text-decoration: none; /* niente underline hover — richiesta esplicita */
}

img {
	max-width: 100%;
	height: auto;
}

.screen-reader-text {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mt-skip-link:focus {
	position: fixed;
	left: 8px;
	top: 8px;
	width: auto;
	height: auto;
	padding: 8px 12px;
	background: var( --mt-color-accent );
	color: #fff;
	border-radius: var( --mt-radius-sm );
	z-index: 9999;
}

/* -----------------------------
 * Container
 * ----------------------------- */
.mt-container {
	max-width: var( --mt-container );
	margin: 0 auto;
	padding: 0 24px;
}

/* -----------------------------
 * Header
 * ----------------------------- */
.mt-site-header {
	background: var( --mt-color-bg );
	border-bottom: 1px solid var( --mt-color-border );
	box-shadow: var( --mt-shadow-sm );
}

.mt-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 18px 24px;
}

.mt-branding img,
.mt-branding .md-site-logo,
.mt-branding .custom-logo {
	max-height: 56px;
	width: auto;
	display: block;
}

.mt-branding .site-title-link {
	font-size: 1.25rem;
	font-weight: 700;
	color: var( --mt-color-text );
	text-decoration: none;
}

.mt-primary-nav {
	display: flex;
	align-items: center;
	gap: 20px;
}

.mt-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 20px;
}

.mt-menu a {
	color: var( --mt-color-text );
	font-weight: 500;
	padding: 6px 2px;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.mt-menu a:hover,
.mt-menu .current-menu-item > a {
	color: var( --mt-color-accent );
	border-bottom-color: var( --mt-color-accent );
}

.mt-account {
	padding: 8px 14px;
	background: var( --mt-color-accent );
	color: #fff;
	border-radius: var( --mt-radius-sm );
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
}

.mt-account:hover,
.mt-account:focus {
	background: var( --mt-color-accent-dark );
	color: #fff;
	text-decoration: none;
}

/* -----------------------------
 * Main
 * ----------------------------- */
.mt-main {
	padding: 40px 0 60px;
	min-height: calc( 100vh - 240px );
}

.mt-content {
	max-width: 900px;
	margin: 0 auto;
}

/* -----------------------------
 * Page header
 * ----------------------------- */
.mt-page-header {
	margin-bottom: 32px;
	padding-bottom: 20px;
	border-bottom: 1px solid var( --mt-color-border );
}

.mt-page-title {
	margin: 0 0 8px;
	font-size: 2rem;
	line-height: 1.2;
	color: var( --mt-color-text );
}

.mt-page-lead {
	margin: 0;
	color: var( --mt-color-text-muted );
	font-size: 1.05rem;
}

/* -----------------------------
 * Article
 * ----------------------------- */
.mt-article {
	background: var( --mt-color-bg );
}

.mt-article-header {
	margin-bottom: 24px;
}

.mt-article-title {
	margin: 0;
	font-size: 1.8rem;
}

.mt-article-body {
	color: var( --mt-color-text );
}

.mt-article-body h2 {
	margin-top: 32px;
	font-size: 1.5rem;
}

.mt-article-body h3 {
	margin-top: 24px;
	font-size: 1.25rem;
}

.mt-article-body p {
	margin: 0 0 1em;
}

/* -----------------------------
 * Manuale singolo
 * ----------------------------- */
.mt-manuale-header {
	margin-bottom: 24px;
}

.mt-back {
	display: inline-block;
	margin-bottom: 12px;
	font-size: 0.9rem;
	color: var( --mt-color-text-muted );
}

.mt-back:hover {
	color: var( --mt-color-accent );
}

.mt-manuale-title {
	margin: 0 0 8px;
	font-size: 1.9rem;
	color: var( --mt-color-text );
	line-height: 1.2;
}

/* -----------------------------
 * Footer
 * ----------------------------- */
.mt-site-footer {
	background: var( --mt-color-bg-alt );
	border-top: 1px solid var( --mt-color-border );
	padding: 24px 0;
	color: var( --mt-color-text-muted );
	font-size: 0.9rem;
}

.mt-copy {
	margin: 0;
	text-align: center;
}

/* -----------------------------
 * Empty state
 * ----------------------------- */
.mt-empty {
	padding: 40px;
	background: var( --mt-color-bg-alt );
	border: 1px dashed var( --mt-color-border );
	border-radius: var( --mt-radius );
	text-align: center;
	color: var( --mt-color-text-muted );
}

/* -----------------------------
 * Responsive
 * ----------------------------- */
@media ( max-width: 768px ) {
	.mt-header-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 16px 20px;
	}

	.mt-primary-nav {
		width: 100%;
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.mt-page-title {
		font-size: 1.6rem;
	}

	.mt-manuale-title {
		font-size: 1.5rem;
	}

	.mt-main {
		padding: 24px 0 40px;
	}
}

@media ( max-width: 480px ) {
	.mt-container {
		padding: 0 16px;
	}
	body {
		font-size: 15px;
	}
}

/* ==============================
 * V2 — Prodotti / Documenti
 * ============================== */

/* Contenitore largo per pagina documento (PDF/manuale) */
.mt-content-wide { max-width: 1200px; }

/* Meta box in cima al prodotto */
.md-prodotto-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	padding: 14px 18px;
	background: var( --mt-color-bg-alt );
	border: 1px solid var( --mt-color-border );
	border-radius: 6px;
	margin-bottom: 24px;
	font-size: 0.95rem;
}
.md-meta-label { color: var( --mt-color-text-muted ); font-weight: 500; margin-right: 4px; }
.md-meta-value { font-weight: 600; color: var( --mt-color-text ); }

.md-section-title {
	font-size: 1.4rem;
	margin: 28px 0 16px;
	font-weight: 600;
	color: var( --mt-color-text );
}

/* Card documenti nella pagina prodotto */
.md-doc-cards {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.md-doc-card {
	background: var( --mt-color-bg-alt );
	border: 1px solid var( --mt-color-border );
	border-radius: 8px;
	overflow: hidden;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.md-doc-card:hover {
	border-color: var( --mt-color-accent );
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
}
.md-doc-card-link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
	text-decoration: none;
	color: inherit;
}
.md-doc-card-icon {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.5px;
}
.md-doc-card-pdf .md-doc-card-icon { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.md-doc-card-zip .md-doc-card-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.md-doc-card .md-doc-card-icon { background: #9ca3af; }
.md-doc-card-body { flex: 1; min-width: 0; }
.md-doc-card-title {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 600;
	color: var( --mt-color-text );
	line-height: 1.3;
}
.md-doc-card-meta {
	display: flex;
	gap: 10px;
	font-size: 0.85rem;
	color: var( --mt-color-text-muted );
}
.md-doc-card-lang {
	padding: 1px 8px;
	background: #ecfccb;
	color: #3f6212;
	border-radius: 3px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Header documento (breadcrumb + badge) */
.md-doc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding-bottom: 14px;
	margin-bottom: 20px;
	border-bottom: 1px solid var( --mt-color-border );
}
.md-breadcrumb a {
	color: var( --mt-color-text-muted );
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
}
.md-breadcrumb a:hover { color: var( --mt-color-accent ); }
.md-doc-badges { display: flex; gap: 6px; }
.md-badge {
	display: inline-block;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 4px;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.md-badge-tipo { background: #f3f4f6; color: #374151; }
.md-badge-lang { background: #ecfccb; color: #3f6212; }

/* Notice generico frontend */
.md-notice {
	padding: 14px 18px;
	border-radius: 6px;
	margin: 20px 0;
	font-size: 0.95rem;
}
.md-notice-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Contenuto del manuale ZIP */
.md-manuale-content {
	background: #fff;
	padding: 24px;
	border: 1px solid #e5e9ef;
	border-radius: 6px;
}
