/*
 * Teknet Spotify Podcast (RSS)
 * Grafica dal Figma ANIE SMG "Podcast Spotify". Il font è quello del tema (Spline Sans).
 * Colori e misure sono custom properties, personalizzabili dal Customizer YOOtheme, es.:
 *   .tkspod { --tkspod-hero-from: #001e48; --tkspod-cols: 3; }
 */

.tkspod {
	--tkspod-gap: 1.5rem;
	--tkspod-radius: 8px;
	--tkspod-accent: #1db954;
	--tkspod-accent-contrast: #000;
	--tkspod-muted: rgba(0, 0, 0, 0.62);
	--tkspod-border: rgba(0, 0, 0, 0.12);
	--tkspod-player-bg: #fff;
	--tkspod-sticky-top: 1rem;

	/* Fascia di intestazione */
	--tkspod-hero-from: #001e48;
	--tkspod-hero-to: #0048ae;
	--tkspod-hero-heading: #f7f7f7;
	--tkspod-hero-text: #fff;
	--tkspod-hero-author: #abceff;
	--tkspod-hero-line: rgba(255, 255, 255, 0.45);
	--tkspod-hero-button-text: #00419d;
	--tkspod-hero-width: 1429px;
	--tkspod-hero-min-height: clamp(0px, calc(48.4vw - 250px), 680px); /* 930px di fascia a 1920px. */

	/* Griglia episodi */
	--tkspod-cols: 4;
	--tkspod-col-gap: 15px;
	--tkspod-row-gap: 75px;
	--tkspod-meta: #a5a5a5;
	--tkspod-title: #232422;
	--tkspod-text: #706f6e;
}
.tkspod img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Elenco podcast */

.tkspod-list {
	display: grid;
	gap: calc(var(--tkspod-gap) * 1.5);
}

.tkspod-podcast {
	display: grid;
	grid-template-columns: minmax(120px, 220px) 1fr;
	gap: var(--tkspod-gap);
	align-items: start;
	padding-bottom: calc(var(--tkspod-gap) * 1.5);
	border-bottom: 1px solid var(--tkspod-border);
}

.tkspod-podcast:last-child {
	border-bottom: 0;
}

.tkspod-podcast__cover img,
.tkspod-show__cover {
	border-radius: var(--tkspod-radius);
	aspect-ratio: 1;
	object-fit: cover;
}

.tkspod-podcast__title,
.tkspod-show__title {
	margin: 0 0 0.25rem;
}

.tkspod-podcast__title a {
	color: inherit;
	text-decoration: none;
}

.tkspod-podcast__title a:hover {
	text-decoration: underline;
}

.tkspod-podcast__publisher {
	margin: 0 0 0.75rem;
	color: var(--tkspod-muted);
	font-size: 0.9em;
}

.tkspod-podcast__description,
.tkspod-show__description {
	margin: 0 0 1rem;
}

/* Azioni */

.tkspod-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.tkspod-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 52px;
	padding: 10px 28px;
	border: 1px solid var(--tkspod-hero-button-text);
	border-radius: 7px;
	background: transparent;
	color: var(--tkspod-hero-button-text);
	font: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tkspod-button:hover,
.tkspod-button:focus {
	background: var(--tkspod-hero-button-text);
	color: #fff;
	text-decoration: none;
}

.tkspod-button--primary {
	background: var(--tkspod-hero-button-text);
	color: #fff;
}

.tkspod-button--primary:hover,
.tkspod-button--primary:focus {
	background: var(--tkspod-hero-from);
	border-color: var(--tkspod-hero-from);
}

.tkspod-link-spotify {
	font-size: 0.9em;
}

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

/* Fascia di intestazione (gradiente blu) */

.tkspod-hero {
	background: linear-gradient(119deg, var(--tkspod-hero-from) 12%, var(--tkspod-hero-to) 108%);
	color: var(--tkspod-hero-text);
}

.tkspod-hero__inner {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: var(--tkspod-hero-min-height);
	box-sizing: content-box;
	max-width: var(--tkspod-hero-width);
	margin: 0 auto;
	padding: clamp(56px, 6.5vw, 125px) clamp(16px, 4vw, 40px);
}

.tkspod-hero__heading,
.tkspod-hero__title,
.tkspod-hero__author,
.tkspod-hero__description,
.tkspod-episode__meta,
.tkspod-episode__title,
.tkspod-episode__excerpt {
	text-box: trim-both cap alphabetic; /* Spaziature come in Figma (Chrome, Safari). */
	font-family: inherit;
	text-transform: none;
}

.tkspod-hero__heading {
	margin: 0 0 clamp(40px, 3.9vw, 75px);
	color: var(--tkspod-hero-heading);
	font-size: clamp(2.6rem, 5.73vw, 110px);
	font-weight: 500;
	line-height: 0.9;
	letter-spacing: -0.02em;
}

.tkspod-hero__show {
	display: grid;
	grid-template-columns: minmax(0, 335px) minmax(0, 1fr);
	gap: 36px;
	align-items: start;
}

.tkspod-hero__cover {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 7px;
}

.tkspod-hero__titles {
	padding-bottom: 30px;
	margin-bottom: 30px;
	border-bottom: 1px solid var(--tkspod-hero-line);
}

.tkspod-hero__title {
	margin: 0;
	color: var(--tkspod-hero-text);
	font-size: clamp(1.6rem, 1.875vw, 36px);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.02em;
}

.tkspod-hero__author {
	margin: 20px 0 0;
	color: var(--tkspod-hero-author);
	font-size: clamp(1.35rem, 1.5625vw, 30px);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.02em;
}

.tkspod-hero__description {
	margin: 0 0 30px;
	color: var(--tkspod-hero-text);
	font-size: clamp(1.05rem, 1.15vw, 22px);
	line-height: 1.55;
	letter-spacing: -0.02em;
	text-wrap: pretty;
}

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

.tkspod-hero__button:hover,
.tkspod-hero__button:focus {
	background: #e6efff;
	color: var(--tkspod-hero-button-text);
	text-decoration: none;
}

.tkspod-hero a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/*
 * Fascia a tutta larghezza anche se lo shortcode è dentro un contenitore.
 * --tkspod-vw è la larghezza della finestra senza barra di scorrimento (impostata da tkspod.js).
 */
.tkspod-hero--full {
	position: relative;
	left: 50%;
	width: var(--tkspod-vw, 100vw);
	max-width: none;
	margin-left: calc(var(--tkspod-vw, 100vw) / -2);
}

/* Spazio tra la fascia e la griglia quando sono nello stesso shortcode. */
.tkspod-hero + .tkspod-show {
	margin-top: clamp(56px, 5.2vw, 100px);
}

/* Player */

.tkspod-player {
	margin-top: var(--tkspod-gap);
	padding: 0.75rem 1rem;
	border: 1px solid var(--tkspod-border);
	border-radius: var(--tkspod-radius);
	background: var(--tkspod-player-bg);
}

.tkspod-player__title {
	margin: 0 0 0.5rem;
	font-weight: 500;
	font-size: 0.95em;
}

.tkspod-audio {
	display: block;
	width: 100%;
}

.tkspod-show .tkspod-player {
	margin: 0 0 40px;
}

/* Nella pagina episodi il player resta visibile mentre si scorre la griglia. */
.tkspod-player--sticky {
	position: sticky;
	top: var(--tkspod-sticky-top);
	z-index: 10;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Griglia episodi */

.tkspod-grid {
	display: grid;
	grid-template-columns: repeat(var(--tkspod-cols), minmax(0, 1fr));
	gap: var(--tkspod-row-gap) var(--tkspod-col-gap);
}

.tkspod-episode {
	display: flex;
	flex-direction: column;
}

.tkspod-episode__media {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--tkspod-radius);
	overflow: hidden;
	background: #000;
	aspect-ratio: 1;
	cursor: pointer;
}

.tkspod-episode__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.tkspod-episode__media:hover img {
	transform: scale(1.04);
}

.tkspod-play-icon {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--tkspod-accent);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.tkspod-episode__media:hover .tkspod-play-icon {
	transform: scale(1.08);
}

/* Triangolo play 16×18 disegnato in CSS, nessuna immagine da caricare. */
.tkspod-play-icon::after {
	content: "";
	position: absolute;
	top: 15px;
	left: 18px;
	border-style: solid;
	border-width: 9px 0 9px 16px;
	border-color: transparent transparent transparent var(--tkspod-accent-contrast);
}

/* Icona pausa quando l'episodio è in riproduzione. */
.is-playing .tkspod-play-icon::after {
	top: 15px;
	left: 16px;
	width: 16px;
	height: 18px;
	border-width: 0 5px;
	border-color: transparent var(--tkspod-accent-contrast);
	background: transparent;
	box-sizing: border-box;
}

.tkspod-episode__media.is-active {
	outline: 3px solid var(--tkspod-accent);
	outline-offset: 2px;
}

.tkspod-episode__body {
	max-width: 384px;
	padding-top: 35px;
}

.tkspod-episode__meta {
	margin: 0 0 15px;
	color: var(--tkspod-meta);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.55;
	text-transform: uppercase;
}

.tkspod-episode__meta > * + *::before {
	content: "•";
	margin: 0 10px;
}

.tkspod-episode__title {
	margin: 0 0 25px;
	color: var(--tkspod-title);
	font-size: clamp(1.25rem, 1.25vw, 24px);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -0.02em;
}

.tkspod-episode__excerpt {
	margin: 0;
	color: var(--tkspod-text);
	font-size: 16px;
	line-height: 1.55;
	letter-spacing: -0.01em;
}

/* Vecchia etichetta (usata dal singolo episodio) */
.tkspod-episode__number {
	margin: 0 0 15px;
	color: var(--tkspod-meta);
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
}

/* Singolo episodio */

.tkspod-single {
	display: grid;
	grid-template-columns: minmax(120px, 200px) 1fr;
	gap: var(--tkspod-gap);
	align-items: start;
	margin: var(--tkspod-gap) 0;
}

.tkspod-single__body .tkspod-episode__number {
	margin-top: 0;
}

.tkspod-single__body .tkspod-episode__excerpt {
	margin-bottom: 1rem;
}

/* Paginazione */

.tkspod-pagination {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: var(--tkspod-row-gap);
}

.tkspod-pagination [rel="next"] {
	margin-left: auto;
}

/* Utility */

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

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

@media (max-width: 1200px) {
	.tkspod {
		--tkspod-cols: 3;
		--tkspod-row-gap: 56px;
	}
}

@media (max-width: 900px) {
	.tkspod {
		--tkspod-cols: 2;
		--tkspod-col-gap: 20px;
		--tkspod-row-gap: 48px;
	}

	.tkspod-hero__show {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.tkspod .tkspod-hero__cover {
		max-width: 260px;
	}

	.tkspod-episode__body {
		padding-top: 24px;
	}
}

@media (max-width: 540px) {
	.tkspod {
		--tkspod-cols: 1;
	}

	.tkspod-hero__button {
		height: 52px;
		padding: 10px 28px;
		font-size: 18px;
	}
}

@media (max-width: 640px) {
	.tkspod-podcast,
	.tkspod-show__header,
	.tkspod-single {
		grid-template-columns: 1fr;
	}

	.tkspod-single__media {
		max-width: 220px;
	}

	.tkspod-podcast__cover img,
	.tkspod-show__cover {
		max-width: 220px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tkspod-episode__media img,
	.tkspod-play-icon {
		transition: none;
	}
}
