/**
 * PTA — Articoli Correlati (Related Carousel Articles)
 *
 * Widget mostrato in fondo a ogni articolo che appartiene alla categoria
 * del carosello homepage. Permette di scorrere tutti gli articoli in evidenza
 * e di accedere all'elenco completo via bottone "Tutti".
 *
 * @package  Templates.pta
 * @since    2026-03-16
 */

/* ── Contenitore principale ── */
.pta-related-articles {
	margin: 40px 0 0;
	padding: 24px 0 0;
	border-top: 2px solid #e5e7eb;
}

/* ── Riga di intestazione ── */
.pta-related-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	gap: 12px;
}

.pta-related-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	color: #1d2939;
	margin: 0;
}

.pta-related-title svg {
	flex-shrink: 0;
	color: #1565C0;
}

/* Bottone "Tutti" */
.pta-related-all-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 14px;
	border: 1.5px solid #1565C0;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: #1565C0;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, color .15s;
}

.pta-related-all-btn:hover,
.pta-related-all-btn:focus {
	background: #1565C0;
	color: #fff;
	text-decoration: none;
}

/* ── Scrollable band + nav arrows ── */
.pta-related-scroll-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0;
}

.pta-related-viewport {
	flex: 1;
	overflow-x: auto;
	overflow-y: hidden;
	/* Nascondi scrollbar ma mantieni funzionalità */
	scrollbar-width: none;         /* Firefox */
	-ms-overflow-style: none;      /* IE/Edge */
}

.pta-related-viewport::-webkit-scrollbar {
	display: none;                 /* Chrome/Safari */
}

/* Track (flex row di card) */
.pta-related-track {
	display: flex;
	flex-direction: row;
	gap: 12px;
	padding: 4px 2px 8px;
}

/* ── Card singola ── */
.pta-related-card {
	flex: 0 0 auto;
	width: 150px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: border-color .15s, box-shadow .15s, transform .15s;
	display: flex;
	flex-direction: column;
}

.pta-related-card:hover,
.pta-related-card:focus {
	border-color: #1565C0;
	box-shadow: 0 4px 14px rgba(21,101,192,.15);
	transform: translateY(-2px);
	text-decoration: none;
	color: inherit;
}

/* Card corrente (articolo che si sta leggendo) */
.pta-related-card--current {
	border-color: #1565C0;
	background: #eff6ff;
	box-shadow: 0 2px 10px rgba(21,101,192,.18);
}

.pta-related-card--current:hover {
	transform: none;
}

/* Immagine */
.pta-related-card-img {
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #e8edf3;
}

.pta-related-card-img img,
.pta-related-card-img svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .2s;
}

.pta-related-card:hover .pta-related-card-img img {
	transform: scale(1.05);
}

/* Corpo card */
.pta-related-card-body {
	padding: 8px 10px 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.pta-related-card-title {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #1d2939;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Badge "Stai leggendo" */
.pta-related-card-badge {
	display: inline-block;
	padding: 2px 7px;
	background: #1565C0;
	color: #fff;
	border-radius: 10px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .3px;
	white-space: nowrap;
	align-self: flex-start;
}

/* ── Pulsanti prev / next ── */
.pta-related-nav {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid #d0d5dd;
	border-radius: 50%;
	background: #fff;
	color: #344054;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
	padding: 0;
	z-index: 2;
}

.pta-related-nav:hover {
	background: #1565C0;
	border-color: #1565C0;
	color: #fff;
}

.pta-related-prev { margin-right: 8px; }
.pta-related-next { margin-left: 8px; }

/* ── Responsive ── */
@media (max-width: 600px) {
	.pta-related-card {
		width: 130px;
	}
	.pta-related-prev,
	.pta-related-next {
		display: none;
	}
}
