/* ==========================================================================
   HITPDF Poster — scheda articolo
   Griglia a due colonne, nessuna altezza fissa, copertina a proporzione
   costante. Tutti i valori derivano dai token qui sotto: per cambiare la
   palette o le proporzioni si tocca solo questo blocco.
   ========================================================================== */

.hitpdf-poster,
.hitpdf-chapters {
	--hit-pink: #EA9EE4;
	--hit-magenta: #FE17D8;
	--hit-surface: #131118;
	--hit-surface-2: #1d1a24;
	--hit-border: rgba(255, 255, 255, 0.09);
	--hit-text: #ece9f0;
	--hit-muted: #8f8b99;

	--hit-radius: 12px;
	--hit-radius-sm: 6px;

	/* >>> LARGHEZZA DELLA COLONNA COPERTINA <<< */
	--hit-cover: clamp(230px, 26vw, 330px);
	/* >>> PROPORZIONE DELLA CORNICE COPERTINA (3/4 = verticale) <<< */
	--hit-cover-ratio: 3 / 4;

	--hit-gap: clamp(1.25rem, 3vw, 2.5rem);
	--hit-max: 1200px;
}

/* ---- Griglia ---- */
.hitpdf-poster {
	display: grid;
	grid-template-columns: var(--hit-cover) minmax(0, 1fr);
	gap: var(--hit-gap);
	align-items: start;

	max-width: var(--hit-max);
	width: 100%;
	margin-inline: auto;
	padding-block: clamp(1rem, 3vw, 2.25rem);

	color: var(--hit-text);
	font-size: 1rem;
	line-height: 1.6;
}

/* .entry-content con is-layout-constrained restringe i figli: qui serve
   la larghezza piena del nostro container. */
.entry-content .hitpdf-poster {
	max-width: var(--hit-max);
}

.hitpdf-poster img {
	max-width: 100%;
	height: auto;
}

/* ---- Copertina ---- */
.hitpdf-cover {
	position: relative;
	display: block;
	aspect-ratio: var(--hit-cover-ratio);
	border: 1px solid var(--hit-border);
	border-radius: var(--hit-radius);
	background: var(--hit-surface-2);
	overflow: hidden;
	cursor: zoom-in;
}

/* Riempimento: la stessa immagine, sfocata. Regge sia le copertine verticali
   sia i banner orizzontali senza deformare nulla. */
.hitpdf-cover__backdrop {
	position: absolute;
	inset: -8%;
	background-size: cover;
	background-position: center;
	filter: blur(26px) saturate(1.6) brightness(0.55);
	transform: scale(1.1);
}

.hitpdf-poster .hitpdf-cover__img {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.hitpdf-cover:focus-visible {
	outline: 2px solid var(--hit-pink);
	outline-offset: 3px;
}

/* ---- Striscia miniature (sostituisce Swiper) ---- */
.hitpdf-strip {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 23%;
	gap: 8px;
	margin: 8px 0 0;
	padding: 0 0 8px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--hit-border) transparent;
}

.hitpdf-strip__cell {
	margin: 0;
	scroll-snap-align: start;
}

.hitpdf-strip__item {
	display: block;
	aspect-ratio: var(--hit-cover-ratio);
	border: 1px solid transparent;
	border-radius: var(--hit-radius-sm);
	overflow: hidden;
	opacity: 0.5;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.hitpdf-poster .hitpdf-strip__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hitpdf-strip__item:hover,
.hitpdf-strip__item:focus-visible {
	opacity: 0.85;
}

.hitpdf-strip__item.is-active {
	opacity: 1;
	border-color: var(--hit-pink);
}

/* ---- Colonna informazioni ---- */
.hitpdf-poster__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 100%;
}

.hitpdf-eyebrow {
	margin: 0;
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hit-muted);
}

.hitpdf-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.hitpdf-eyebrow a:hover {
	color: var(--hit-pink);
}

.hitpdf-title {
	margin: 0.3rem 0 1.1rem;
	font-size: clamp(1.6rem, 3.4vw, 2.35rem);
	line-height: 1.12;
	color: #ffffff;
}

/* ---- Metadati ---- */
.hitpdf-meta {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.45rem 1.2rem;
	margin: 0 0 1.15rem;
}

.hitpdf-meta dt {
	color: var(--hit-muted);
}

.hitpdf-meta dd {
	margin: 0;
	min-width: 0;
}

.hitpdf-poster .hitpdf-link {
	color: var(--hit-pink);
	text-decoration: none;
}

.hitpdf-poster .hitpdf-link:hover {
	text-decoration: underline;
}

/* ---- Tag ---- */
.hitpdf-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1.35rem;
	padding: 0;
	list-style: none;
}

.hitpdf-tags li {
	margin: 0;
}

.hitpdf-tag {
	display: inline-block;
	padding: 0.2rem 0.75rem;
	border: 1px solid rgba(234, 158, 228, 0.32);
	border-radius: 999px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--hit-pink);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hitpdf-tag:hover,
.hitpdf-tag:focus-visible {
	background: var(--hit-pink);
	border-color: var(--hit-pink);
	color: #2a0f26;
}

/* Pillola "+N" aggiunta da poster.js quando i tag sono molti */
.hitpdf-tags__more {
	padding: 0.2rem 0.75rem;
	border: 1px solid var(--hit-border);
	border-radius: 999px;
	background: none;
	font: inherit;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--hit-muted);
	cursor: pointer;
}

.hitpdf-tags__more:hover {
	color: var(--hit-text);
	border-color: var(--hit-muted);
}

/* ---- CTA ---- */
.hitpdf-actions {
	margin: 0 0 1.5rem;
}

.hitpdf-poster .hitpdf-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	min-width: 12ch;
	padding: 0.55rem 2.4rem;

	font-family: 'Agency FB', 'Arial Narrow', Arial, sans-serif;
	font-size: 1.55rem;
	font-weight: normal;
	letter-spacing: 0.14em;

	background: var(--hit-magenta);
	color: #ffffff;
	text-decoration: none !important;

	/* Tacche poco profonde: il testo non ha bisogno di padding enorme per
	   restare dentro la forma. */
	clip-path: polygon(94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%, 6% 0);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hitpdf-poster .hitpdf-cta:hover,
.hitpdf-poster .hitpdf-cta:focus-visible {
	background: #ffffff;
	color: var(--hit-magenta);
}

/* Il clip-path ritaglia l'outline: l'anello di focus va all'interno. */
.hitpdf-poster .hitpdf-cta:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--hit-magenta);
}

/* ---- Footer ---- */
.hitpdf-foot {
	margin-top: auto;
	padding-top: 0.9rem;
	border-top: 1px solid var(--hit-border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	font-size: 0.9rem;
	color: var(--hit-muted);
}

.hitpdf-byline {
	margin: 0;
}

.hitpdf-byline a {
	color: var(--hit-text);
	text-decoration: none;
}

.hitpdf-byline a:hover {
	color: var(--hit-pink);
}

.hitpdf-stats {
	display: flex;
	align-items: center;
	gap: 1.1rem;
}

.hitpdf-comments {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

/* Galleria PhotoSwipe: presente nel DOM, mai visibile. */
.hitpdf-gallery {
	display: none;
}

/* ==========================================================================
   Capitoli — post con più immagini, ognuna col proprio bottone
   ========================================================================== */
.hitpdf-chapters {
	max-width: var(--hit-max);
	width: 100%;
	margin-inline: auto;
	padding-bottom: clamp(1rem, 3vw, 2.25rem);
	color: var(--hit-text);
}

.entry-content .hitpdf-chapters {
	max-width: var(--hit-max);
}

.hitpdf-chapters__title {
	margin: 0 0 0.9rem;
	font-size: 0.85rem;
	font-weight: normal;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hit-muted);
}

.hitpdf-chapters__grid {
	display: grid;
	/* auto-fill: quattro capitoli stanno su una riga, venti vanno a capo da soli */
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 1rem 0.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hitpdf-chapter {
	margin: 0;
}

.hitpdf-chapter__link {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: 8px;
}

.hitpdf-chapter__cover {
	position: relative;
	display: block;
	aspect-ratio: var(--hit-cover-ratio);
	border: 1px solid var(--hit-border);
	border-radius: 8px;
	background: var(--hit-surface-2);
	overflow: hidden;
	transition: border-color 0.15s ease;
}

.hitpdf-chapter__backdrop {
	position: absolute;
	inset: -8%;
	background-size: cover;
	background-position: center;
	filter: blur(18px) saturate(1.6) brightness(0.55);
	transform: scale(1.1);
}

.hitpdf-chapters .hitpdf-chapter__img {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.hitpdf-chapter__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.5rem;
	font-size: 0.9rem;
	color: var(--hit-text);
	transition: color 0.15s ease;
}

.hitpdf-chapter__text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Capitolo attualmente caricato nella scheda in alto */
.hitpdf-chapter.is-current .hitpdf-chapter__cover {
	border-color: var(--hit-pink);
}

.hitpdf-chapter.is-current .hitpdf-chapter__label {
	color: var(--hit-pink);
}

.hitpdf-chapter__link:hover .hitpdf-chapter__cover {
	border-color: var(--hit-pink);
}

.hitpdf-chapter__link:hover .hitpdf-chapter__label {
	color: var(--hit-pink);
}

.hitpdf-chapter__link:focus-visible {
	outline: 2px solid var(--hit-pink);
	outline-offset: 3px;
}

/* ==========================================================================
   Responsive — un solo punto di rottura
   ========================================================================== */
@media screen and (max-width: 860px) {
	.hitpdf-poster {
		grid-template-columns: minmax(0, 1fr);
		padding-inline: 1rem;
	}

	.hitpdf-poster__cover {
		width: 100%;
		max-width: 320px;
		margin-inline: auto;
	}

	.hitpdf-title {
		text-align: center;
	}

	.hitpdf-eyebrow {
		text-align: center;
	}

	.hitpdf-actions {
		margin-bottom: 1.25rem;
	}

	.hitpdf-poster .hitpdf-cta {
		width: 100%;
	}

	.hitpdf-chapters {
		padding-inline: 1rem;
	}

	.hitpdf-chapters__grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.hitpdf-poster * {
		transition: none !important;
	}

	.hitpdf-strip {
		scroll-behavior: auto;
	}
}
