/*
 * Teknet Position Papers — accordion (Figma ANIE SMG, pagina "Contatori Esempio").
 * Il font è quello del tema (Spline Sans). Personalizzazione con le custom properties, es.:
 *   .tkpp { --tkpp-accent: #00419d; --tkpp-title-transform: none; }
 */

.tkpp {
	--tkpp-title: #232422;
	--tkpp-accent: #00419d;
	--tkpp-text: #5e5e5e;
	--tkpp-link: #3864a1;
	--tkpp-arrow: #0063a0;
	--tkpp-line: #d9d9d9;
	--tkpp-icon: #b3b3b3;
	--tkpp-space: 50px;       /* Tra una voce e l'altra e sopra il contenuto. */
	--tkpp-title-transform: uppercase;
}

.tkpp-item {
	margin: 0 0 var(--tkpp-space);
	padding: 0;
	border: 0;
}

.tkpp-item:last-child {
	margin-bottom: 0;
}

/* Intestazione cliccabile */

.tkpp-item__head {
	display: flex;
	align-items: flex-end;
	gap: 30px;
	padding: 0 0 30px;
	border-bottom: 1px solid var(--tkpp-line);
	list-style: none;
	cursor: pointer;
}

.tkpp-item__head::-webkit-details-marker,
.tkpp-item__head::marker {
	display: none;
	content: "";
}

.tkpp-item__titles {
	flex: 1 1 auto;
	min-width: 0;
}

.tkpp-item__title,
.tkpp-item__subtitle {
	text-box: trim-both cap alphabetic; /* Spaziature come in Figma (Chrome, Safari). */
}

.tkpp-item__title {
	margin: 0;
	color: var(--tkpp-title);
	font-family: inherit;
	font-size: clamp(1.5rem, 1.875vw, 36px);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.02em;
	text-transform: var(--tkpp-title-transform);
}

.tkpp-item__subtitle {
	display: block;
	margin-top: 20px;
	color: var(--tkpp-accent);
	font-size: clamp(1.2rem, 1.5625vw, 30px);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.02em;
}

.tkpp-item__icon {
	flex: 0 0 auto;
	width: 17px;
	height: 8px;
	color: var(--tkpp-icon);
	transition: transform 0.25s ease, color 0.2s ease;
}

/* Chiuso: freccia in giù; aperto: in su. */
.tkpp-item[open] > .tkpp-item__head .tkpp-item__icon {
	transform: scaleY(-1);
}

.tkpp-item__head:hover .tkpp-item__icon {
	color: var(--tkpp-accent);
}

.tkpp-item__head:focus-visible {
	outline: 2px solid var(--tkpp-accent);
	outline-offset: 6px;
}

/* Contenuto */

.tkpp-item__body {
	padding-top: var(--tkpp-space);
}

.tkpp-item__content {
	color: var(--tkpp-text);
	font-size: 20px;
	line-height: 1.55;
	letter-spacing: -0.02em;
	text-wrap: pretty;
}

.tkpp-item__content > * {
	margin: 0 0 10px;
}

.tkpp-item__content > :last-child {
	margin-bottom: 0;
}

.tkpp-item__content strong,
.tkpp-item__content b {
	color: inherit;
	font-weight: 600;
}

.tkpp-item__content a {
	color: var(--tkpp-link);
}

.tkpp-item__link a {
	color: var(--tkpp-link);
	font-weight: 600;
	text-decoration: none;
}

.tkpp-item__link a:hover,
.tkpp-item__link a:focus {
	color: var(--tkpp-accent);
	text-decoration: underline;
}

.tkpp-item__arrow {
	color: var(--tkpp-arrow);
}

.tkpp-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin: var(--tkpp-space) 0 0;
}

.tkpp-item__content + .tkpp-item__actions {
	margin-top: var(--tkpp-space);
}

.tkpp-item__body > .tkpp-item__actions:first-child {
	margin-top: 0;
}

.tkpp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 60px;
	padding: 10px 35px;
	border-radius: 7px;
	background: var(--tkpp-accent);
	color: #fff;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.tkpp-button:hover,
.tkpp-button:focus {
	background: #002f73;
	color: #fff;
	text-decoration: none;
}

.tkpp-button:focus-visible {
	outline: 2px solid var(--tkpp-accent);
	outline-offset: 3px;
}

/* Apertura animata dove supportata (Chrome 131+); altrove si apre di colpo. */
@supports (interpolate-size: allow-keywords) {
	.tkpp {
		interpolate-size: allow-keywords;
	}

	.tkpp-item::details-content {
		height: 0;
		overflow: clip;
		transition: height 0.35s ease, content-visibility 0.35s allow-discrete;
	}

	.tkpp-item[open]::details-content {
		height: auto;
	}
}

.tkpp .tkpp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tkpp-empty {
	padding: 0.75rem 1rem;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #1e1e1e;
	font-size: 0.9em;
}

@media (max-width: 640px) {
	.tkpp {
		--tkpp-space: 36px;
	}

	.tkpp-item__head {
		gap: 16px;
		padding-bottom: 22px;
	}

	.tkpp-item__subtitle {
		margin-top: 12px;
	}

	.tkpp-button {
		min-height: 52px;
		padding: 10px 24px;
		font-size: 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tkpp-item__icon,
	.tkpp-item::details-content {
		transition: none;
	}
}
