/* Cinema TMDB — frontend (mobile-first, nessuna dipendenza)
   I valori chiave sono custom properties: i layer di integrazione tema
   (es. theme-kicker.css) le rimappano sulle variabili della skin attiva. */

:root {
	--ctmdb-accent: #e50914;
	--ctmdb-accent-contrast: #fff;
	--ctmdb-radius: 8px;
	--ctmdb-gap: 16px;
	--ctmdb-card-bg: #f6f7f7;
	--ctmdb-muted: #646970;
	--ctmdb-border: #e5e5e5;
	--ctmdb-star: #ffd24d;
	--ctmdb-hero-link: #9ecbff;
}

.ctmdb-content {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 16px 32px;
}

.ctmdb-section {
	margin-top: 32px;
}

/* Tipografia (famiglia, dimensioni, pesi) SEMPRE ereditata dal tema:
   qui si azzera solo il margine superiore per non sommarlo alla sezione. */
.ctmdb-section > h2 {
	margin-top: 0;
}

/* ---------- Hero ---------- */

.ctmdb-hero {
	background-size: cover;
	background-position: center 20%;
	background-color: #14181d;
}

.ctmdb-hero-overlay {
	background: linear-gradient(to bottom, rgba(10, 14, 18, 0.75), rgba(10, 14, 18, 0.92));
}

.ctmdb-hero-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 32px 16px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	color: #fff;
}

.ctmdb-hero-poster img {
	width: 200px;
	height: auto;
	border-radius: var(--ctmdb-radius);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
	display: block;
}

.ctmdb-hero .ctmdb-title {
	color: #fff;
	margin: 0 0 4px;
}

.ctmdb-year {
	font-weight: 400;
	opacity: 0.75;
}

.ctmdb-hero a {
	color: var(--ctmdb-hero-link);
	text-decoration: none;
}

/* Riga fatti: data • generi • durata */
.ctmdb-facts {
	margin: 0 0 6px;
	opacity: 0.95;
}

.ctmdb-dot {
	opacity: 0.6;
	margin: 0 2px;
}

/* Punteggio utenti circolare (stile TMDB) */
.ctmdb-score-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 14px 0;
	flex-wrap: wrap;
}

.ctmdb-score {
	--ctmdb-score-color: #21d07a;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background:
		radial-gradient(closest-side, #081c22 79%, transparent 80% 100%),
		conic-gradient(var(--ctmdb-score-color) calc(var(--ctmdb-score) * 1%), rgba(255, 255, 255, 0.25) 0);
	display: grid;
	place-items: center;
	color: #fff;
	font-weight: 700;
	font-size: 1.05em;
	box-shadow: 0 0 0 4px #081c22;
	flex-shrink: 0;
}

.ctmdb-score.is-mid {
	--ctmdb-score-color: #d2d531;
}

.ctmdb-score.is-low {
	--ctmdb-score-color: #db2360;
}

.ctmdb-score sup {
	font-size: 0.5em;
}

.ctmdb-score-label {
	color: #fff;
	font-weight: 700;
	line-height: 1.15;
	font-size: 0.85em;
}

/* Tagline nell'hero */
.ctmdb-tagline {
	font-style: italic;
	opacity: 0.7;
	margin: 6px 0;
}

/* Crediti regia/ideatori */
.ctmdb-credits {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 48px;
	margin: 18px 0 0;
	padding: 0;
}

.ctmdb-credit {
	display: flex;
	flex-direction: column;
}

.ctmdb-credit a strong {
	color: #fff;
}

.ctmdb-credit span {
	font-size: 0.85em;
	opacity: 0.8;
}

.ctmdb-trailer-btn {
	display: inline-block;
	background: var(--ctmdb-accent);
	color: var(--ctmdb-accent-contrast) !important;
	padding: 10px 18px;
	border-radius: var(--ctmdb-radius);
	text-decoration: none;
	font-weight: 600;
}

.ctmdb-trailer-btn:hover {
	filter: brightness(0.85);
}

/* ---------- Video ---------- */

.ctmdb-video {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--ctmdb-radius);
	overflow: hidden;
}

.ctmdb-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Cast / Filmografia / Archivi ---------- */

/* Interpreti principali: fila a scorrimento orizzontale (stile TMDB) */
.ctmdb-cast-scroller {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 10px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.ctmdb-cast-scroller .ctmdb-person-card {
	flex: 0 0 140px;
}

.ctmdb-filmography,
.ctmdb-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: var(--ctmdb-gap);
}

.ctmdb-person-card,
.ctmdb-film-card,
.ctmdb-archive-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	background: var(--ctmdb-card-bg);
	border-radius: var(--ctmdb-radius);
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ctmdb-person-card:hover,
.ctmdb-film-card:hover,
.ctmdb-archive-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.ctmdb-person-card img,
.ctmdb-film-card img,
.ctmdb-archive-card img {
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	display: block;
}

.ctmdb-person-name,
.ctmdb-film-title {
	font-weight: 600;
	font-size: 0.85em;
	padding: 8px 10px 0;
	line-height: 1.25;
}

.ctmdb-person-role,
.ctmdb-film-meta {
	font-size: 0.75em;
	color: var(--ctmdb-muted);
	padding: 2px 10px 10px;
}

/* ---------- Tabs ---------- */

.ctmdb-tabs-nav {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid var(--ctmdb-border);
	flex-wrap: wrap;
}

/* I tab sono <button>: molti temi (Kicker incluso) stilano i button globalmente
   con font/uppercase/altezze proprie — qui si neutralizza tutto esplicitamente
   così i tab usano la tipografia del testo del tema. */
.ctmdb-tab-btn {
	background: none !important;
	border-style: solid;
	border-color: transparent;
	border-width: 0 0 3px !important;
	border-radius: 0;
	box-shadow: none;
	height: auto;
	min-height: 0;
	padding: 10px 16px;
	margin-bottom: -2px;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	color: var(--ctmdb-muted);
	cursor: pointer;
}

.ctmdb-tab-btn:hover {
	background: none !important;
	color: inherit;
}

.ctmdb-tab-btn.is-active {
	color: inherit;
	border-bottom-color: var(--ctmdb-accent) !important;
}

.ctmdb-tab-panel {
	display: none;
	padding-top: 16px;
}

.ctmdb-tab-panel.is-active {
	display: block;
}

/* ---------- Premi / Stagioni ---------- */

.ctmdb-awards-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: var(--ctmdb-gap);
	margin-bottom: 20px;
}

.ctmdb-award-card {
	background: var(--ctmdb-card-bg);
	border: 1px solid var(--ctmdb-border);
	border-radius: var(--ctmdb-radius);
	padding: 18px 14px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.ctmdb-award-card.has-wins {
	border-color: var(--ctmdb-accent);
	box-shadow: 0 0 0 1px var(--ctmdb-accent);
}

.ctmdb-awards-total {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 16px;
}

.ctmdb-awards-scope {
	display: block;
	font-size: 0.8em;
	font-weight: 400;
	color: var(--ctmdb-muted);
	margin: 0 0 6px;
}

.ctmdb-award-icon {
	display: block;
	line-height: 0;
}

.ctmdb-award-icon-svg {
	width: 42px;
	height: 42px;
	fill: #c8a24a;
	color: #c8a24a;
}

.ctmdb-award-name {
	font-weight: 700;
	line-height: 1.2;
}

.ctmdb-award-won {
	font-size: 2.2em;
	font-weight: 800;
	line-height: 1;
	color: var(--ctmdb-accent);
}

.ctmdb-award-won.is-nominee {
	color: var(--ctmdb-muted);
}

.ctmdb-award-line {
	font-size: 0.8em;
	color: var(--ctmdb-muted);
}

.ctmdb-awards-detail summary {
	cursor: pointer;
	font-weight: 600;
	margin: 6px 0 12px;
}

.ctmdb-award-group {
	margin: 0 0 18px;
}

.ctmdb-award-group h4 {
	margin: 0 0 8px;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--ctmdb-border);
}

.ctmdb-award-group ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ctmdb-award-group li {
	padding: 6px 0;
	border-bottom: 1px solid var(--ctmdb-border);
}

.ctmdb-badge-won,
.ctmdb-badge-nom {
	display: inline-block;
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 8px;
	border-radius: 999px;
	margin-right: 8px;
	vertical-align: middle;
}

.ctmdb-badge-won {
	background: #00a32a;
	color: #fff;
}

.ctmdb-badge-nom {
	background: var(--ctmdb-card-bg);
	color: var(--ctmdb-muted);
	border: 1px solid var(--ctmdb-border);
}

.ctmdb-award-year {
	color: var(--ctmdb-muted);
	font-size: 0.85em;
	margin-left: 4px;
}

.ctmdb-empty {
	color: var(--ctmdb-muted);
}

/* Segnaposto widget nell'editor Elementor (nessun contenuto valido). */
.ctmdb-elementor-placeholder {
	padding: 24px;
	text-align: center;
	color: var(--ctmdb-muted);
	border: 1px dashed var(--ctmdb-border);
	border-radius: var(--ctmdb-radius);
}

.ctmdb-awards-table,
.ctmdb-seasons-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.ctmdb-awards-table th,
.ctmdb-awards-table td,
.ctmdb-seasons-table th,
.ctmdb-seasons-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--ctmdb-border);
	vertical-align: top;
}

.ctmdb-awards-table small {
	display: block;
	color: var(--ctmdb-muted);
}

.ctmdb-awards-table .is-won {
	color: #00a32a;
	font-weight: 700;
}

.ctmdb-awards-table .is-nominee {
	color: #996800;
}

.ctmdb-awards-source {
	margin-top: 10px;
	font-size: 0.8em;
}

/* ---------- Articoli collegati ---------- */

.ctmdb-recensione {
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--ctmdb-border);
}

.ctmdb-articles {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ctmdb-articles li {
	padding: 10px 0;
	border-bottom: 1px solid var(--ctmdb-border);
}

.ctmdb-article-date {
	color: var(--ctmdb-muted);
	font-size: 0.85em;
	margin-left: 8px;
}

/* ---------- Persona ---------- */

.ctmdb-persona-name {
	margin: 24px 0 16px;
}

.ctmdb-persona-photo {
	margin-bottom: 18px;
}

.ctmdb-persona-photo img {
	width: 100%;
	max-width: 260px;
	height: auto;
	border-radius: var(--ctmdb-radius);
	display: block;
}

.ctmdb-persona-facts p {
	margin: 0 0 12px;
}

/* ---------- Archivio ---------- */

.ctmdb-archive-header {
	margin: 24px 0 16px;
}

.ctmdb-archive-filters {
	margin-bottom: 20px;
}

.ctmdb-filter-group {
	margin-bottom: 8px;
	line-height: 2;
}

.ctmdb-filter {
	display: inline-block;
	background: var(--ctmdb-card-bg);
	border-radius: 999px;
	padding: 2px 12px;
	margin: 0 4px 4px 0;
	text-decoration: none;
	color: inherit;
	font-size: 0.85em;
}

.ctmdb-filter.is-active,
.ctmdb-filter:hover {
	background: var(--ctmdb-accent);
	color: var(--ctmdb-accent-contrast);
}

.ctmdb-pagination-front {
	margin-top: 24px;
}

/* ---------- Cast tecnico (box sidebar) ---------- */

.ctmdb-crew-box {
	background: var(--ctmdb-card-bg);
	border: 1px solid var(--ctmdb-border);
	border-radius: var(--ctmdb-radius);
	padding: 28px;
	margin-bottom: 24px;
}

.ctmdb-crew-box h3 {
	margin: 0 0 14px;
}

/* Regista/ideatore in evidenza con foto */
.ctmdb-crew-director {
	display: flex;
	align-items: center;
	gap: 16px;
	text-decoration: none;
	color: inherit;
	margin-bottom: 18px;
}

.ctmdb-crew-director img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 50%;
	flex-shrink: 0;
}

.ctmdb-crew-director strong {
	display: block;
	line-height: 1.2;
}

.ctmdb-crew-director em {
	font-style: normal;
	color: var(--ctmdb-muted);
	font-size: 0.85em;
}

.ctmdb-crew-item {
	padding: 8px 0 0;
	margin: 8px 0 0;
	border-top: 1px solid var(--ctmdb-border);
	font-size: 0.9em;
}

.ctmdb-crew-item strong {
	display: block;
}

.ctmdb-crew-item span {
	color: var(--ctmdb-muted);
}

/* ---------- Box Office (box colorato) ---------- */

.ctmdb-boxoffice {
	background: linear-gradient(135deg, #0f5132, #198754);
	color: #fff;
	border-radius: var(--ctmdb-radius);
	padding: 18px 20px;
	margin-bottom: 24px;
	box-shadow: 0 4px 14px rgba(15, 81, 50, 0.3);
}

.ctmdb-boxoffice h3 {
	margin: 0 0 14px;
	color: #fff;
	font-size: 1.15em;
}

.ctmdb-bo-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 8px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ctmdb-bo-row:first-of-type {
	border-top: 0;
}

.ctmdb-bo-row span {
	opacity: 0.85;
}

.ctmdb-bo-row strong {
	font-size: 1.05em;
	white-space: nowrap;
}

.ctmdb-bo-profit {
	margin-top: 4px;
	border-top: 2px solid rgba(255, 255, 255, 0.35);
	font-weight: 700;
}

.ctmdb-bo-profit.is-positive strong {
	color: #7cf0b0;
}

.ctmdb-bo-profit.is-negative strong {
	color: #ffb3b3;
}

/* ---------- Colonna laterale fatti ---------- */

.ctmdb-col-side {
	margin-top: 32px;
}

.ctmdb-facts-box p {
	margin: 0 0 14px;
}

.ctmdb-widget-area {
	margin-top: 24px;
}

.ctmdb-widget {
	margin-bottom: 20px;
}

.ctmdb-widget-title {
	margin: 0 0 10px;
}

/* ---------- Attribuzione TMDB ---------- */

.ctmdb-attribution {
	margin-top: 40px;
	padding-top: 16px;
	border-top: 1px solid var(--ctmdb-border);
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.75em;
	color: var(--ctmdb-muted);
}

.ctmdb-tmdb-logo {
	display: inline-block;
	background: linear-gradient(90deg, #90cea1, #01b4e4);
	color: #0d253f;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 3px 10px;
	border-radius: 4px;
	text-decoration: none;
}

/* ---------- Desktop ---------- */

@media (min-width: 782px) {
	.ctmdb-hero-inner {
		flex-direction: row;
		align-items: stretch;
		padding: 48px 16px;
	}

	/* Poster: l'altezza gli viene assegnata via JS (= altezza colonna info),
	   la larghezza segue la proporzione naturale della locandina. */
	.ctmdb-hero-poster {
		flex: 0 0 auto;
		align-self: flex-start;
	}

	.ctmdb-hero-poster img {
		height: 100%;
		width: auto;
		max-width: none;
	}

	.ctmdb-filmography,
	.ctmdb-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}
}

/* Layout a due colonne solo con spazio sufficiente: sotto i 1000px la
   colonna principale prende tutta la larghezza (niente colonna compressa). */
@media (min-width: 1000px) {
	.ctmdb-main-cols {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 390px;
		gap: 40px;
		align-items: start;
	}

	/* Persona: foto/dati a sinistra, contenuto a destra (come TMDB). */
	.ctmdb-persona-cols {
		grid-template-columns: 300px minmax(0, 1fr);
	}

	/* Impedisce alla fila cast (scroller) di allargare la colonna
	   e la pagina oltre lo schermo: lo scorrimento resta interno. */
	.ctmdb-main-cols > * {
		min-width: 0;
	}

	.ctmdb-main-cols .ctmdb-col-side {
		margin-top: 0;
	}
}

/* Sotto i 1000px la sidebar scende sotto il contenuto. */
@media (max-width: 999px) {
	.ctmdb-col-side {
		margin-top: 28px;
	}

	/* Su persona la foto resta in alto anche impilata. */
	.ctmdb-persona-cols {
		display: flex;
		flex-direction: column;
	}

	.ctmdb-persona-cols .ctmdb-col-side {
		margin-top: 0;
		order: -1;
	}
}
