/* ==========================================================
 * NT Punti di Ritiro — v1.0.0
 * ======================================================= */

.ntpr {
	--ntpr-accent: #0a66c2;
	--ntpr-bg: #ffffff;
	--ntpr-border: #e3e7ee;
	--ntpr-radius: 14px;
	--ntpr-time: #16213a;
	--ntpr-badge-bg: #e6f0fb;
	--ntpr-badge-text: #16213a;
	--ntpr-name: #16213a;
	--ntpr-address: #5b6578;
	--ntpr-dot: 12px;
	--ntpr-gap: 12px;

	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}

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

/* ---------- Intestazione ---------- */
.ntpr__head {
	margin: 0 0 18px;
}

.ntpr__title {
	margin: 0 0 6px;
	font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
	line-height: 1.2;
	font-weight: 700;
	color: var(--ntpr-name);
}

.ntpr__subtitle {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--ntpr-address);
	max-width: 62ch;
}

/* ---------- Lista ---------- */
.ntpr__list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--ntpr-bg);
	border: 1px solid var(--ntpr-border);
	border-radius: var(--ntpr-radius);
	overflow: hidden;
}

.ntpr__item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) auto;
	grid-template-areas: "when where maps";
	align-items: center;
	column-gap: 24px;
	row-gap: 10px;
	margin: 0;
	padding: 18px 22px;
	overflow: hidden; /* taglia la linea timeline al bordo della riga */
	transition: background-color .2s ease;
}

.ntpr__item + .ntpr__item {
	border-top: 1px solid var(--ntpr-border);
}

.ntpr__item:hover {
	background: color-mix(in srgb, var(--ntpr-accent) 4%, transparent);
}

/* ---------- Orario + badge ---------- */
.ntpr__when {
	grid-area: when;
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	column-gap: var(--ntpr-gap);
	row-gap: 8px;
	min-width: 0;
}

.ntpr__dot {
	display: none;
	position: relative;
	width: var(--ntpr-dot);
	height: var(--ntpr-dot);
	border-radius: 50%;
	background: var(--ntpr-bg);
	border: 2px solid var(--ntpr-accent);
	flex: 0 0 auto;
}

.ntpr--timeline .ntpr__dot {
	display: block;
}

/* linea verticale: sopra e sotto il pallino, tagliata dalla riga */
.ntpr--timeline .ntpr__dot::before,
.ntpr--timeline .ntpr__dot::after {
	content: "";
	position: absolute;
	left: 50%;
	width: 2px;
	height: 600px;
	transform: translateX(-50%);
	background: color-mix(in srgb, var(--ntpr-accent) 28%, transparent);
	pointer-events: none;
}

.ntpr--timeline .ntpr__dot::before {
	bottom: calc(100% + 2px);
}

.ntpr--timeline .ntpr__dot::after {
	top: calc(100% + 2px);
}

.ntpr--timeline .ntpr__item:first-child .ntpr__dot::before,
.ntpr--timeline .ntpr__item:last-child .ntpr__dot::after {
	display: none;
}

.ntpr__time {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	justify-self: start;
	min-width: 66px;
	padding: 7px 12px;
	border: 1px solid var(--ntpr-border);
	border-radius: 8px;
	background: var(--ntpr-bg);
	color: var(--ntpr-time);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
	letter-spacing: .01em;
}

.ntpr__badge {
	grid-column: 1 / -1;
	justify-self: start;
	display: inline-block;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--ntpr-badge-bg);
	color: var(--ntpr-badge-text);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.35;
}

.ntpr--timeline .ntpr__badge {
	grid-column: 2;
}

/* ---------- Luogo ---------- */
.ntpr__where {
	grid-area: where;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ntpr__name {
	color: var(--ntpr-name);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.ntpr__address {
	color: var(--ntpr-address);
	font-size: 0.85rem;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* ---------- Link mappa ---------- */
.ntpr__maps {
	grid-area: maps;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-self: end;
	padding: 8px 14px;
	min-height: 40px;
	border: 1px solid var(--ntpr-accent);
	border-radius: 999px;
	color: var(--ntpr-accent);
	background: transparent;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease;
}

.ntpr__maps:hover,
.ntpr__maps:focus-visible {
	background: var(--ntpr-accent);
	color: #fff !important;
}

.ntpr__maps:focus-visible {
	outline: 2px solid var(--ntpr-accent);
	outline-offset: 2px;
}

.ntpr__maps svg {
	flex: 0 0 auto;
}

/* ---------- Punto all'inizio attività ---------- */
.ntpr__item--start {
	background: color-mix(in srgb, var(--ntpr-accent) 6%, transparent);
}

.ntpr__item--start .ntpr__dot {
	background: var(--ntpr-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ntpr-accent) 18%, transparent);
}

.ntpr__item--start .ntpr__time {
	border-color: var(--ntpr-accent);
	color: var(--ntpr-accent);
}

.ntpr__item--start .ntpr__badge {
	background: var(--ntpr-accent);
	color: #fff;
}

/* ==========================================================
 * Tablet
 * ======================================================= */
@media (max-width: 1024px) {
	.ntpr__item {
		grid-template-columns: minmax(200px, 250px) minmax(0, 1fr) auto;
		column-gap: 18px;
	}
}

/* ==========================================================
 * Mobile grande / tablet verticale
 * ======================================================= */
@media (max-width: 767px) {
	.ntpr {
		--ntpr-indent: calc(var(--ntpr-dot) + var(--ntpr-gap));
	}

	.ntpr__item {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"when  when"
			"where maps";
		align-items: center;
		padding: 16px 18px;
		row-gap: 12px;
		column-gap: 12px;
	}

	.ntpr__when {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px var(--ntpr-gap);
	}

	.ntpr__badge {
		margin: 0;
	}

	.ntpr--timeline .ntpr__where,
	.ntpr--timeline .ntpr__maps {
		margin-left: var(--ntpr-indent);
	}

	.ntpr--timeline .ntpr__maps {
		margin-left: 0;
	}
}

/* ==========================================================
 * Smartphone
 * ======================================================= */
@media (max-width: 480px) {
	.ntpr__item {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"when"
			"where"
			"maps";
		padding: 14px 16px;
		row-gap: 10px;
	}

	.ntpr__when {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: 8px var(--ntpr-gap);
	}

	.ntpr__time {
		min-width: 60px;
		padding: 6px 10px;
		font-size: 0.9rem;
	}

	.ntpr__badge {
		font-size: 0.72rem;
	}

	.ntpr__name {
		font-size: 0.97rem;
	}

	.ntpr__address {
		font-size: 0.82rem;
	}

	.ntpr__maps {
		justify-self: start;
		min-height: 38px;
		padding: 7px 12px;
		font-size: 0.8rem;
	}

	.ntpr--timeline .ntpr__maps {
		margin-left: var(--ntpr-indent);
	}
}

/* ==========================================================
 * Accessibilità
 * ======================================================= */
@media (prefers-reduced-motion: reduce) {
	.ntpr__item,
	.ntpr__maps {
		transition: none;
	}
}

@media print {
	.ntpr__maps {
		display: none;
	}
	.ntpr__item {
		break-inside: avoid;
	}
}
