/**
 * Blastertheme - Stili base ispirati a Flatsome
 * Reset, typography, entry-content, single, page
 */
@charset "utf-8";

/* Reset base */
*, *::before, *::after { box-sizing: border-box; }
html { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; line-height: 1.6; color: #4a4a4a; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Contenuti che si riducono senza uscire dai bordi */
.bt-wrapper { max-width: 100%; }
.bt-content { min-width: 0; }
.bt-feed { min-width: 0; overflow-wrap: break-word; }
.bt-card { max-width: 100%; min-width: 0; overflow: hidden; }
.bt-card-body { min-width: 0; overflow-wrap: break-word; }
.bt-card-title { overflow-wrap: break-word; word-wrap: break-word; }

/* Titoli */
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; font-weight: 600; line-height: 1.3; color: #555; }
h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }

/* Entry content - stile Flatsome per contenuto articoli/pagine */
.entry-content,
.bt-entry-content {
	font-size: 1.0625em;
	line-height: 1.7;
}
.entry-content p,
.bt-entry-content p { margin: 0 0 1em; }
.entry-content p:last-child,
.bt-entry-content p:last-child { margin-bottom: 0; }

.entry-content img,
.bt-entry-content img { max-width: 100%; height: auto; margin: 1em 0; border-radius: 4px; }
.entry-content img.aligncenter,
.bt-entry-content img.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content img.alignleft,
.bt-entry-content img.alignleft { float: left; margin: 0 1em 1em 0; }
.entry-content img.alignright,
.bt-entry-content img.alignright { float: right; margin: 0 0 1em 1em; }

.entry-content ul,
.entry-content ol,
.bt-entry-content ul,
.bt-entry-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.entry-content li,
.bt-entry-content li { margin-bottom: 0.5em; }

.entry-content blockquote,
.bt-entry-content blockquote {
	margin: 1.5em 0;
	padding: 1em 1.5em;
	border-left: 4px solid currentColor;
	background: rgba(0,0,0,.03);
	font-style: italic;
	color: #555;
}

.entry-content pre,
.entry-content code,
.bt-entry-content pre,
.bt-entry-content code {
	font-family: "Consolas", "Monaco", monospace;
	font-size: 0.9em;
}
.entry-content pre,
.bt-entry-content pre {
	margin: 1em 0;
	padding: 1em;
	background: #f5f5f5;
	border-radius: 4px;
	overflow-x: auto;
}
.entry-content code,
.bt-entry-content code { padding: 0.2em 0.4em; background: #f5f5f5; border-radius: 3px; }

.entry-content table,
.bt-entry-content table { width: 100%; margin: 1em 0; border-collapse: collapse; }
.entry-content th,
.entry-content td,
.bt-entry-content th,
.bt-entry-content td { padding: 0.5em 0.75em; border: 1px solid #ddd; text-align: left; }
.entry-content th,
.bt-entry-content th { background: #f5f5f5; font-weight: 600; }

.entry-content hr,
.bt-entry-content hr { margin: 2em 0; border: none; border-top: 1px solid #e0e0e0; }

.entry-content .wp-block-gallery,
.bt-entry-content .wp-block-gallery { margin: 1.5em 0; }
.entry-content .wp-block-image,
.bt-entry-content .wp-block-image { margin: 1em 0; }
.entry-content figcaption,
.bt-entry-content figcaption { font-size: 0.9em; color: #777; text-align: center; margin-top: 0.5em; }

/* Articolo singolo */
.bt-single-article { padding: 2em 0; }
.bt-single-article .bt-entry-header { margin-bottom: 1.5em; text-align: center; }
.bt-single-article .bt-entry-title { font-size: 2.25em; margin-bottom: 0.5em; }
.bt-single-article .bt-entry-meta { font-size: 0.9em; color: #777; }
.bt-single-article .bt-entry-meta span { margin-right: 1em; }
.bt-single-article .bt-entry-meta a { color: inherit; }
.bt-single-article .bt-entry-meta a:hover { text-decoration: underline; }
.bt-single-article .bt-entry-image { margin: 0 0 1.5em; border-radius: 8px; overflow: hidden; }
.bt-single-article .bt-entry-image img { width: 100%; margin: 0; }
.bt-single-article .bt-entry-content { max-width: 720px; margin: 0 auto 2em; }
.bt-single-article .bt-entry-footer { padding-top: 1em; border-top: 1px solid #eee; font-size: 0.9em; color: #777; }
.bt-single-article .bt-author-box {
	display: flex;
	gap: 1.5em;
	align-items: flex-start;
	padding: 1.5em;
	background: #f9f9f9;
	border-radius: 8px;
	margin: 2em 0;
}
.bt-single-article .bt-author-avatar img { border-radius: 50%; }
.bt-single-article .bt-author-info h5 { margin: 0 0 0.5em; }
.bt-single-article .bt-author-info p { margin: 0; font-size: 0.95em; color: #666; }
.bt-single-article .bt-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	margin-top: 2em;
	padding-top: 1.5em;
	border-top: 1px solid #eee;
	font-size: 0.95em;
}
.bt-single-article .bt-post-nav a { font-weight: 500; }
.bt-single-article .bt-post-next { text-align: right; }

/* Pagina */
.bt-page-article .bt-entry-content { max-width: 720px; margin: 0 auto; }
.bt-entry-header .bt-entry-title { margin-bottom: 0.5em; }

/* Card feed home - design curato con bordo, ombra, font grandi */
.bt-card {
	background: #fff;
	border-radius: 12px;
	margin-bottom: 28px;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,.06);
	box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
	transition: box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.bt-card:hover {
	box-shadow: 0 12px 28px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
	border-color: rgba(68, 96, 132, .15);
	transform: translateY(-2px);
}
.bt-card-image {
	line-height: 0;
	overflow: hidden;
	background: #f0f0f0;
}
.bt-card-image img {
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform .4s ease;
}
.bt-card:hover .bt-card-image img { transform: scale(1.03); }
.bt-card-body { padding: 3px 1.75em 1.75em; }
.bt-card-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 0.6em;
	line-height: 1.35;
	letter-spacing: -0.02em;
}
.bt-card-title a {
	color: #1a1a2e;
	text-decoration: none;
	transition: color .2s ease;
}
.bt-card-title a:hover {
	color: var(--bt-color-primary, #446084);
}
.bt-card-meta {
	font-size: 0.875rem;
	color: #6b7280;
	margin-bottom: 1em;
}
.bt-card-meta a { color: inherit; }
.bt-card-meta a:hover { color: var(--bt-color-primary, #446084); }
.bt-card-excerpt {
	font-size: 1.0625rem;
	line-height: 1.65;
	color: #4b5563;
}
.bt-card-excerpt p { margin: 0; }
.bt-feed .bt-card:first-child .bt-card-title { font-size: 1.625rem; }

/* Modalità "una card alla volta" tipo Instagram/TikTok - scroll gestito da JS, no scroll-snap CSS per evitare conflitti */
html.bt-snap-mode,
body.bt-snap-mode {
	overscroll-behavior: contain;
}
.bt-snap-mode .bt-feed .bt-card {
	transform-origin: center center;
}
.bt-snap-mode .bt-feed .bt-card.is-active {
	animation: bt-card-bounce-in 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes bt-card-bounce-in {
	0% {
		transform: translateY(18px) scale(0.96);
		opacity: 0;
	}
	40% {
		transform: translateY(-6px) scale(1.02);
		opacity: 1;
	}
	70% {
		transform: translateY(3px) scale(0.995);
	}
	100% {
		transform: translateY(0) scale(1);
	}
}

/* Affinamento layout \"una card per volta\" */
.bt-snap-mode .bt-feed .bt-card {
	min-height: calc(100vh - var(--bt-header-height, 40px) - var(--bt-footer-bar-height, 40px) - 24px);
	display: flex;
	flex-direction: column;
}
.bt-snap-mode .bt-feed .bt-card-image {
	flex: 0 0 auto;
}
.bt-snap-mode .bt-feed .bt-card-body {
	flex: 1 1 auto;
}

/* Desktop: colonna feed più stretta, stile app centrata */
@media (min-width: 992px) {
	.bt-main-and-sidebar .bt-content {
		display: flex;
		justify-content: center;
	}
	.bt-main-and-sidebar .bt-content .bt-feed {
		width: 100%;
		max-width: 760px;
	}
	.bt-feed .bt-card-excerpt {
		font-size: 0.95rem;
	}
}

/* Override altezza card: piena altezza viewport, corpo senza scroll interno */
.bt-snap-mode .bt-feed .bt-card {
	height: calc(100vh - var(--bt-header-height, 40px) - var(--bt-footer-bar-height, 40px) - 24px);
}
.bt-snap-mode .bt-feed .bt-card-body {
	overflow: hidden;
}
/* Anteprima excerpt: max 4 righe, resto nascosto */
.bt-snap-mode .bt-feed .bt-card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Content area */
.bt-content { padding: 2em 0 3em; min-height: 50vh; }
.page-wrapper { background: #fff; }

/* Layout colonne - dinamico: centro max spazio, sx/dx limitate, fluttuano verso esterno */
/* Main full screen: niente box, niente bordo */
.bt-main .bt-wrapper { max-width: none; width: 100%; padding: 0; margin: 0; }
/* Home: contenitore allineato all'header (right bar non flottante a destra) */
.home .bt-main .bt-wrapper { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 15px; padding-right: 15px; }
.bt-header .bt-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.bt-footer .bt-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

.bt-layout {
	display: grid;
	grid-template-columns: 0 1fr;
	gap: 0 28px;
	align-items: start;
	max-width: 100%;
	width: 100%;
	position: relative;
	padding-left: min(160px, max(60px, 10%));
}
/* Wrapper centro + destra: scroll parallelo su mobile, due colonne su desktop */
.bt-main-and-sidebar {
	display: flex;
	gap: 28px;
	min-width: 0;
	align-items: start;
}
/* Linea verticale sinistra (bordo leftbar fissa) */
.bt-layout::before {
	content: "";
	position: fixed;
	left: min(160px, max(60px, 10%));
	top: var(--bt-header-height, 40px);
	bottom: var(--bt-footer-bar-height, 40px);
	width: 1px;
	background: #000;
	pointer-events: none;
	z-index: 99;
}
.bt-main-and-sidebar { grid-column: 2; }
/* Centro: occupa tutto lo spazio possibile, padding colonna centrale (più spazio in alto dal header) */
.bt-layout .bt-content,
.bt-layout .bt-main-col { min-width: 0; flex: 1 1 auto; padding: 1.25em 20px 0; }
/* Leftbar: sempre fissa (non scorre con il contenuto) */
.bt-sidebar-left {
	position: fixed;
	left: 0;
	top: var(--bt-header-height, 40px);
	bottom: var(--bt-footer-bar-height, 40px);
	width: max(60px, 10%);
	min-width: 60px;
	max-width: 160px;
	z-index: 100;
	border-right: 1px solid #000;
	box-sizing: border-box;
	padding-right: 12px;
	overflow-y: auto;
}
/* Colonna destra: larga quanto basta per i widget (min 300px, max 380px) */
.bt-sidebar-right {
	flex-shrink: 0;
	position: sticky;
	top: 20px;
	min-width: 300px;
	max-width: 380px;
}
/* Rightbar: su desktop solo il panel visibile, strip nascosta */
.bt-rightbar__strip { display: none; }
.bt-rightbar__panel { display: block; }
/* Single e page: senza leftbar, niente padding-left */
.bt-layout-single,
.bt-layout-page {
	grid-template-columns: 1fr minmax(300px, 380px);
	gap: 0 28px;
	padding-left: 0;
}
.bt-layout-single .bt-main-col,
.bt-layout-page .bt-main-col { min-width: 0; }
.bt-layout-single .bt-sidebar-right,
.bt-layout-page .bt-sidebar-right { justify-self: end; min-width: 300px; max-width: 380px; }
.bt-layout-single::before,
.bt-layout-page::before { display: none; }

.bt-sidebar .widget { margin-bottom: 1.5em; padding: 1.25em; background: #f9f9f9; border-radius: 8px; }
.bt-sidebar .widget:last-child { margin-bottom: 0; }
.bt-sidebar .widget-title { margin: 0 0 1em; font-size: 1em; font-weight: 600; padding-bottom: 0.5em; border-bottom: 2px solid var(--bt-color-primary, #446084); }

/* Colonna sinistra: navigatore categorie + slot menu */
.bt-nav-left { display: flex; flex-direction: column; height: 100%; min-height: 200px; }
.bt-nav-left__categories { flex: 1 1 auto; }
.bt-nav-left__list { list-style: none; margin: 0; padding: 0; }
.bt-nav-left__item { margin: 0; }
.bt-nav-left__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 8px 10px 0;
	color: #374151;
	text-decoration: none;
	font-size: 0.9rem;
	border-radius: 0 8px 8px 0;
	transition: background 0.2s ease, color 0.2s ease;
}
.bt-nav-left__link:hover { background: rgba(68, 96, 132, 0.08); color: var(--bt-color-primary, #446084); }
.bt-nav-left__icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #6b7280; }
.bt-nav-left__link:hover .bt-nav-left__icon { color: var(--bt-color-primary, #446084); }
.bt-nav-left__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-nav-left__count {
	flex-shrink: 0;
	font-size: 0.75rem;
	color: #9ca3af;
	background: rgba(0,0,0,.06);
	padding: 2px 6px;
	border-radius: 10px;
}
.bt-nav-left__empty { margin: 0; padding: 8px 0; font-size: 0.85rem; color: #6b7280; }
.bt-nav-left__menu-slot { flex-shrink: 0; padding-top: 16px; margin-top: 16px; border-top: 1px solid rgba(0,0,0,.08); }
.bt-nav-left__menu-slot .menu,
.bt-nav-left__menu-slot .bt-nav-left__menu { list-style: none; margin: 0; padding: 0; }
.bt-nav-left__menu-slot .menu li,
.bt-nav-left__menu-slot .bt-nav-left__menu li { margin: 0 0 4px; }
.bt-nav-left__menu-slot .menu a,
.bt-nav-left__menu-slot .bt-nav-left__menu a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #6b7280; text-decoration: none; font-size: 0.85rem; }
.bt-nav-left__menu-slot .menu a:hover,
.bt-nav-left__menu-slot .bt-nav-left__menu a:hover { color: var(--bt-color-primary, #446084); }
.bt-nav-left__menu-placeholder { margin: 0; font-size: 0.8rem; color: #9ca3af; font-style: italic; }

@media (max-width: 992px) {
	.bt-main .bt-wrapper { padding: 0; }
	.bt-layout {
		grid-template-columns: 0 1fr;
		grid-template-rows: 1fr;
		gap: 0 0;
		padding-left: 28px;
	}
	.bt-layout::before { left: 27px; top: var(--bt-header-height, 40px); bottom: var(--bt-footer-bar-height, 40px); }
	.bt-main-and-sidebar {
		grid-column: 2;
		grid-row: 1;
		display: flex;
		flex-direction: row;
		gap: 0;
		min-width: 0;
		overflow: hidden;
		max-width: 100%;
	}
	.bt-content { flex: 1 1 auto; min-width: 0; overflow-x: hidden; max-width: 100%; padding: 1.25em 8px 0; }
	.bt-feed { min-width: 0; max-width: 100%; }
	/* Rightbar: su smartphone non mostrare (no strip/toggle, no blocco) */
	.bt-sidebar-right.bt-rightbar { display: none !important; }
	/* Rightbar strip/panel non più usati su mobile (blocco nascosto) */
	.bt-sidebar-right {
		flex: 0 0 auto;
		width: auto;
		min-width: 0;
	}
	.bt-sidebar-left {
		position: fixed;
		left: 0;
		top: var(--bt-header-height, 40px);
		bottom: var(--bt-footer-bar-height, 40px);
		width: 28px;
		min-width: 28px;
		max-width: 28px;
		padding: 12px 0;
		z-index: 100;
		grid-column: 1;
		grid-row: 1;
	}
	.bt-sidebar-left .bt-nav-left__label,
	.bt-sidebar-left .bt-nav-left__count,
	.bt-sidebar-left .bt-nav-left__menu-slot { display: none !important; }
	.bt-sidebar-left .bt-nav-left__link { padding: 12px 0; justify-content: center; border-radius: 0; }
	.bt-sidebar-left .bt-nav-left__icon { margin: 0; }
	.bt-sidebar-left .bt-nav-left__list { display: flex; flex-direction: column; align-items: center; gap: 0; }
	.bt-rightbar__strip { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 80px; padding-bottom: 6px; }
	.bt-rightbar__toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 24px; height: 24px; padding: 0; border: none; background: rgba(0,0,0,.06);
		color: #333; cursor: pointer; border-radius: 4px;
	}
	.bt-rightbar__panel { display: none; }
	.bt-layout-single,
	.bt-layout-page { grid-template-columns: 1fr; }
	.bt-layout-single .bt-main-and-sidebar,
	.bt-layout-page .bt-main-and-sidebar { flex-wrap: wrap; }
	.bt-layout-single .bt-sidebar-left,
	.bt-layout-page .bt-sidebar-left { display: none; }
	.bt-layout-single .bt-sidebar-right,
	.bt-layout-page .bt-sidebar-right { flex: 1 1 100%; min-width: 0; width: auto; }
	.bt-layout-single .bt-rightbar__strip,
	.bt-layout-page .bt-rightbar__strip { display: none; }
	.bt-layout-single .bt-rightbar__panel,
	.bt-layout-page .bt-rightbar__panel { display: block; }
}

/* No results */
.bt-no-results { padding: 3em 2em; text-align: center; }
.bt-no-results h2 { margin-bottom: 0.5em; }
.bt-no-results p { margin-bottom: 1em; color: #666; }
.bt-no-results .search-form { max-width: 400px; margin: 0 auto; }

/* Responsive */
@media (max-width: 768px) {
	.bt-single-article .bt-entry-title { font-size: 1.75em; }
	.bt-single-article .bt-author-box { flex-direction: column; align-items: center; text-align: center; }
	.bt-single-article .bt-post-nav { flex-direction: column; }
	.bt-single-article .bt-post-next { text-align: left; }
}
