/**
 * Postshow – tendina destra per lettura articolo (caricamento AJAX).
 * Sempre sotto il top menu; su mobile non copre la colonna sinistra (solo icone).
 *
 * @package blastertheme
 */

:root {
	--bt-postshow-duration: 0.38s;
	--bt-postshow-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
	--bt-postshow-width: 65vw; /* desktop: pannello bianco almeno 65% del monitor */
}

/* Contenitore fisso: da sotto l'header in giù (z-index sotto .bt-header) */
/* Desktop e mobile: sempre allineato subito sotto header, standard o sticky */
.bt-postshow {
	position: fixed;
	top: var(--bt-header-height, 40px);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	pointer-events: none;
	visibility: hidden;
}
/* Header in sticky: tendina segue l'altezza ridotta */
body.bt-header-stuck .bt-postshow {
	top: var(--bt-header-height-sticky, 70px);
}
body.bt-header-stuck.admin-bar .bt-postshow {
	top: calc(var(--bt-header-height-sticky, 70px) + 32px);
}
body.admin-bar .bt-postshow {
	top: calc(var(--bt-header-height, 40px) + 32px);
}

.bt-postshow.is-open {
	pointer-events: auto;
	visibility: visible;
}

/* Sfondo semi-trasparente (sotto header) */
.bt-postshow__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity var(--bt-postshow-duration) var(--bt-postshow-easing);
}

.bt-postshow.is-open .bt-postshow__backdrop {
	opacity: 1;
}

/* Pannello bianco che entra da destra (sotto header) */
.bt-postshow__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--bt-postshow-width);
	min-width: 65vw;
	max-width: 95vw;
	background: #fff;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform var(--bt-postshow-duration) var(--bt-postshow-easing);
	overflow: hidden;
}

.bt-postshow.is-open .bt-postshow__panel {
	transform: translateX(0);
}

/* Barra superiore con pulsante chiudi: X a sinistra, più piccola, sempre visibile */
.bt-postshow__header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	min-height: 48px;
	padding: 12px 16px 10px 12px;
	padding-top: max(12px, env(safe-area-inset-top, 0px));
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	background: #fff;
	overflow: visible;
}

.bt-postshow__header-inner {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.bt-postshow__title {
	margin-left: 10px;
	font-size: 0.95rem;
	font-weight: 700;
	color: #111827;
	letter-spacing: 0.2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
/* Meta in header: views + share */
.bt-postshow__meta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}
.bt-postshow__views {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.85rem;
	font-weight: 700;
	color: #111827;
	background: rgba(17, 24, 39, 0.08);
	padding: 4px 10px;
	border-radius: 999px;
}
.bt-postshow__views svg { width: 16px; height: 16px; fill: currentColor; display: block; opacity: 0.85; }
/* Share in header */
.bt-postshow__share {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.bt-postshow__share .bt-share__btn {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(17, 24, 39, 0.08);
	color: #111827;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}
.bt-postshow__share .bt-share__btn:hover {
	background: rgba(17, 24, 39, 0.14);
	transform: translateY(-1px);
}
.bt-postshow__share .bt-share__btn:active { transform: translateY(0); }
.bt-postshow__share .bt-share__btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }
/* Share a fine contenuto (scrolla con l'articolo) */
.bt-postshow__share-footer {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
}
.bt-postshow__share-footer .bt-share__btn {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(17, 24, 39, 0.08);
	color: #111827;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}
.bt-postshow__share-footer .bt-share__btn:hover {
	background: rgba(17, 24, 39, 0.14);
	transform: translateY(-1px);
}
.bt-postshow__share-footer .bt-share__btn:active { transform: translateY(0); }
.bt-postshow__share-footer .bt-share__btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }

.bt-postshow__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: #333;
	cursor: pointer;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

.bt-postshow__close:hover,
.bt-postshow__close:focus {
	background: rgba(0, 0, 0, 0.06);
	color: #000;
}

.bt-postshow__close svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* Area contenuto scrollabile */
.bt-postshow__content {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 24px;
	min-height: 0;
	-webkit-overflow-scrolling: touch;
}

/* Loader durante il caricamento */
.bt-postshow__loader {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	color: #666;
}

.bt-postshow__loader.is-hidden {
	display: none;
}

/* Contenuto articolo dentro postshow (stili coerenti con single) */
.bt-postshow__content .bt-single-article {
	max-width: 100%;
}

/* Mobile: tendina non a tutta larghezza, lascia visibile colonna sx (28px) */
@media (max-width: 992px) {
	.bt-postshow {
		left: 28px;
	}
	.bt-postshow__panel {
		width: calc(100% - 28px);
		max-width: none;
	}
	.bt-postshow__content {
		padding: 16px;
	}
	.bt-postshow__header-inner {
		flex-wrap: wrap;
	}
	.bt-postshow__views {
		font-size: 0.8rem;
		padding: 3px 8px;
	}
	.bt-postshow__views svg { width: 14px; height: 14px; }
	.bt-postshow__share .bt-share__btn {
		width: 28px;
		height: 28px;
	}
	.bt-postshow__share .bt-share__btn svg { width: 16px; height: 16px; }
	.bt-postshow__share-footer {
		margin-top: 20px;
		padding-top: 16px;
	}
	.bt-postshow__share-footer .bt-share__btn {
		width: 36px;
		height: 36px;
	}
	.bt-postshow__share-footer .bt-share__btn svg { width: 18px; height: 18px; }
}
