/*
 * Modella Portfolio — pagina Video (spec 048): pulsante play sulle card (il resto della card è il
 * componente g-card di main.css) e player a schermo intero. Caricato solo sulla pagina Video.
 * Mobile-first.
 */

.v-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	padding-left: 3px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	box-shadow: var(--v-inset);
	color: var(--v-ink);
	transform: translate(-50%, -50%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
	transition: transform 260ms var(--v-ease), background 260ms ease, box-shadow 260ms ease;
}

.v-card:hover .v-card__play,
.v-card:focus-visible .v-card__play {
	background: linear-gradient(135deg, var(--v-hot), var(--v-hot-2));
	box-shadow: var(--v-glow);
	transform: translate(-50%, -50%) scale(1.08);
}

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

/* ---- Player ---- */

.v-player {
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	background: transparent;
	color: var(--v-ink);
	/* Spazio verticale riservato a pulsante chiudi (sopra) e titolo (sotto). */
	--v-player-chrome: calc(152px + env(safe-area-inset-bottom));
}

.v-player[open] {
	display: grid;
	grid-template-rows: 1fr auto;
	place-items: center;
}

.v-player::backdrop {
	background:
		radial-gradient(900px 600px at 50% 0%, color-mix(in srgb, var(--v-halo-1) 28%, transparent), transparent 65%),
		color-mix(in srgb, var(--v-scrim) 94%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.v-player__frame {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	box-sizing: border-box;
	padding: 72px 12px 8px;
}

/* Altezza legata allo schermo: un max-height in % dentro la griglia verrebbe ignorato e un video
   verticale uscirebbe dallo schermo, costringendo a scorrere. */
.v-player__video {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100dvh - var(--v-player-chrome));
	border-radius: var(--v-r-photo);
	background: #000;
	box-shadow: var(--v-shadow);
}

.v-player__title {
	max-width: calc(100vw - 32px);
	margin: 0 0 calc(20px + env(safe-area-inset-bottom));
	padding: 10px 18px;
	border: 1px solid var(--v-line);
	border-radius: var(--v-r-pill);
	background: var(--v-glass);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-align: center;
	text-transform: uppercase;
}

.v-player__title:empty {
	display: none;
}

.v-player__close {
	position: fixed;
	top: calc(12px + env(safe-area-inset-top));
	right: 12px;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 50%;
	color: var(--v-ink);
	cursor: pointer;
	transition: background 200ms ease, box-shadow 200ms ease;
}

.v-player__close:hover {
	background: linear-gradient(135deg, var(--v-hot), var(--v-hot-2));
	box-shadow: var(--v-glow);
}

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

body.is-player-open {
	overflow: hidden;
}

@media (min-width: 768px) {
	.v-card__play {
		width: 64px;
		height: 64px;
	}

	.v-player {
		--v-player-chrome: 168px;
	}

	.v-player__frame {
		padding: 80px 88px 12px;
	}

	.v-player__close {
		top: 20px;
		right: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.v-card__play {
		transition: none;
	}
}

/* =========================================================
   Gallery video (spec 054): sezioni della pagina Video, card
   delle gallery (componente g-card) e testata della gallery.
   ========================================================= */

.v-section + .v-section {
	margin-top: 36px;
}

.v-section__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	color: var(--v-ink-2);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.v-section__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--v-line);
}

.v-gallery-card:focus-visible {
	outline: 2px solid var(--v-accent);
	outline-offset: 3px;
}

@media (min-width: 768px) {
	.v-section + .v-section {
		margin-top: 56px;
	}
}

/* A long title never wraps over the picture: one line with an ellipsis (spec 096). */
.v-player__title {
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
