/* Movie Modal Specific Styles */

html:has(dialog[open]) {
	overflow: hidden;
	scrollbar-gutter: stable;
}

@keyframes modal-fade-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.movie-modal[open] .modal-content {
	animation: modal-fade-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-poster {
	display: flex;
	justify-content: center;
	align-self: start;
}

.modal-poster-frame {
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	width: min(300px, 88vw);
}

.modal-fallback-title {
	position: absolute;
	left: 1.25rem;
	right: 1.25rem;
	top: 50%;
	color: #fff;
	font-size: clamp(1.8rem, 4.4vw, 2.85rem);
	font-weight: 900;
	line-height: 0.95;
	text-align: center;
	text-shadow: 0 3px 18px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.7);
	text-transform: uppercase;
	transform: translateY(-50%);
	z-index: 2;
}

.modal-poster img {
	width: min(300px, 88vw);
	display: block;
	height: auto;
	aspect-ratio: 2 / 3;
	max-height: min(450px, 72vh);
	border-radius: 12px;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.06),
		0 16px 40px rgba(12, 83, 116, 0.18);
	object-fit: cover;
	object-position: 22%;
}

.modal-poster--empty {
	align-items: center;
	aspect-ratio: 2 / 3;
	background:
		linear-gradient(135deg, rgba(12, 83, 116, 0.96), rgba(10, 61, 86, 0.9)),
		linear-gradient(160deg, rgba(248, 220, 49, 0.35), rgba(255, 255, 255, 0) 48%);
	border-radius: 12px;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.06),
		0 16px 40px rgba(12, 83, 116, 0.18);
	color: var(--giallo);
	display: flex;
	font-size: clamp(1.05rem, 2vw, 1.45rem);
	font-weight: 700;
	justify-content: center;
	line-height: 1.12;
	min-height: 420px;
	padding: 2rem;
	text-align: center;
	text-transform: uppercase;
	width: min(300px, 88vw);
}

.modal-poster--empty::before {
	content: "Arena Italia";
	position: absolute;
	top: 1.35rem;
	left: 1.35rem;
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.modal-poster--empty::after {
	content: "Castenaso";
	position: absolute;
	right: 1.35rem;
	bottom: 1.35rem;
	color: rgba(255, 255, 255, 0.58);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.btn-trailer {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(12, 83, 116, 0.92);
	color: #fff;
	border: none;
	padding: 0.65rem 1.35rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
	backdrop-filter: blur(4px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-trailer:hover {
	background: #0a3d56;
	transform: translate(-50%, -50%) scale(1.03);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.btn-trailer:focus-visible {
	outline: 3px solid var(--giallo);
	outline-offset: 3px;
}

.btn-trailer::before {
	content: "▶";
	margin-right: 0.45rem;
}

.modal-info {
	min-width: 0;
	min-height: 0;
	max-height: calc(90vh - 10.5rem);
	max-height: calc(90dvh - 10.5rem);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 0.5rem;
	overscroll-behavior-y: contain;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.modal-title {
	font-size: clamp(1.65rem, 2.5vw, 2.35rem);
	font-weight: 700;
	margin: 0 0 1.1rem;
	color: #0c3d52;
	line-height: 1.2;
	letter-spacing: -0.02em;
	padding-bottom: 0.85rem;
	border-bottom: 2px solid rgba(248, 220, 49, 0.65);
}

.movie-details {
	padding: 0 0 1.15rem;
	margin-bottom: 1rem;
	border-bottom: 1px solid rgba(12, 83, 116, 0.1);
}

.movie-details p {
	margin: 0 0 0.55rem;
	font-size: 0.98rem;
	line-height: 1.5;
	color: #4a5568;
}

.movie-details p:last-child {
	margin-bottom: 0;
}

.movie-details strong {
	color: #1a2b33;
	font-weight: 600;
}

.movie-tags {
	margin: 0 0 1.35rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.5rem;
}

.movie-tag {
	display: inline-block;
	background: rgba(12, 83, 116, 0.08);
	color: #0c5374;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	border: 1px solid rgba(12, 83, 116, 0.14);
}

.movie-tag.family-friendly {
	background: rgba(248, 220, 49, 0.25);
	color: #5c4d00;
	border-color: rgba(248, 220, 49, 0.45);
}

.movie-tag.animation {
	background: rgba(255, 152, 0, 0.12);
	color: #c65f00;
	border-color: rgba(255, 152, 0, 0.25);
}

.movie-tag.thriller {
	background: rgba(183, 28, 92, 0.08);
	color: #9a1454;
	border-color: rgba(183, 28, 92, 0.18);
}

.movie-tag.comedy {
	background: rgba(248, 220, 49, 0.18);
	color: #4a3f08;
	border-color: rgba(248, 220, 49, 0.35);
}

.movie-tag.biographical {
	background: rgba(123, 31, 162, 0.08);
	color: #6a1b9a;
	border-color: rgba(123, 31, 162, 0.2);
}

.movie-tag.classic {
	background: rgba(93, 64, 55, 0.08);
	color: #5d4037;
	border-color: rgba(93, 64, 55, 0.18);
}

.movie-tag.music {
	background: rgba(0, 105, 92, 0.1);
	color: #00695c;
	border-color: rgba(0, 105, 92, 0.22);
}

.movie-plot {
	margin-bottom: 1.75rem;
}

.movie-plot__text {
	font-size: 0.98rem;
	line-height: 1.75;
	color: #3d4f5c;
	margin: 0;
}

.movie-plot__toggle {
	display: none;
}

@media (min-width: 769px) {
	.movie-plot__chk,
	.movie-plot__toggle {
		display: none !important;
	}

	.movie-plot__text {
		display: block !important;
		overflow: visible !important;
		-webkit-line-clamp: unset !important;
		line-clamp: unset !important;
	}
}

.screening-info {
	background: linear-gradient(180deg, #f2f7fa 0%, #fafcfd 100%);
	padding: 1.35rem 1.5rem;
	border-radius: 14px;
	margin-bottom: 0.5rem;
	border: 1px solid rgba(12, 83, 116, 0.1);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.screening-info--list {
	display: grid;
	gap: 1rem;
}

.screening-summary {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid rgba(12, 83, 116, 0.12);
}

.screening-summary-item {
	display: grid;
	gap: 0.15rem;
	min-width: 0;
}

.screening-summary-label {
	color: #64748b;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.screening-summary-value {
	color: #0c3d52;
	font-size: 1rem;
	line-height: 1.2;
}

.screening-summary-meta {
	color: #64748b;
	font-size: 0.9rem;
	font-weight: 600;
}

.screening-rows {
	display: grid;
	gap: 0.65rem;
}

.screening-row {
	align-items: center;
	display: grid;
	grid-template-columns: minmax(6rem, auto) 1fr;
	gap: 1rem;
}

.screening-row-time {
	color: var(--celeste);
	font-size: 1.55rem;
	font-weight: 700;
	line-height: 1;
}

.screening-ticket {
	justify-self: start;
	background: var(--celeste);
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 4px 14px rgba(12, 83, 116, 0.25);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1;
	padding: 0.75rem 1rem;
	text-decoration: none;
}

.screening-ticket:hover {
	background: #094661;
}

.screening-ticket--empty {
	background: transparent;
	border: 1px solid rgba(12, 83, 116, 0.18);
	box-shadow: none;
	color: #64748b;
}

.screening-ticket--free {
	background: var(--giallo);
	box-shadow: none;
	color: #111;
}

.screening-details {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 1.5rem 2rem;
	align-items: center;
}

.screening-time {
	text-align: center;
	min-width: 7.5rem;
}

.screening-time .day {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	color: #334155;
	text-transform: capitalize;
	line-height: 1.35;
}

.screening-time .time {
	display: block;
	font-size: 1.65rem;
	font-weight: 700;
	color: var(--celeste);
	margin-top: 0.35rem;
	letter-spacing: 0.02em;
}

.screening-venue {
	text-align: center;
	padding: 0 0.5rem;
	border-left: 1px solid rgba(12, 83, 116, 0.12);
	border-right: 1px solid rgba(12, 83, 116, 0.12);
}

.screening-venue .venue {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: #0c3d52;
	letter-spacing: 0.02em;
}

.screening-venue .location {
	display: block;
	font-size: 0.875rem;
	color: #64748b;
	margin-top: 0.35rem;
	font-weight: 500;
}

.screening-price {
	text-align: center;
	background: var(--celeste);
	color: #fff;
	padding: 0.85rem 1.35rem;
	font-weight: 700;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: 12px;
	box-shadow: 0 4px 14px rgba(12, 83, 116, 0.35);
	min-height: 3.25rem;
}

.screening-price .ticket-icon {
	fill: currentColor;
	flex-shrink: 0;
}

.screening-price.clickable {
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.screening-price.clickable:hover {
	background: #094661;
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(12, 83, 116, 0.4);
}

.screening-price.clickable:focus-visible {
	outline: 3px solid var(--giallo);
	outline-offset: 3px;
}

.movie-links {
	text-align: left;
	margin-top: 0.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.btn-imdb {
	background: var(--giallo);
	color: #1a1a1a;
	font-weight: 700;
	padding: 0.65rem 1.5rem;
	text-decoration: none;
	border-radius: 10px;
	display: inline-block;
	transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-imdb:hover {
	background: #e8cc2a;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-imdb:focus-visible {
	outline: 3px solid var(--celeste);
	outline-offset: 2px;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
	.modal-info {
		max-height: none;
		overflow: visible;
		padding-right: 0;
	}

	.modal-title {
		font-size: 1.65rem;
		padding-right: 2.75rem;
	}

	.screening-details {
		grid-template-columns: 1fr;
		gap: 1.25rem;
		text-align: center;
	}

	.screening-summary {
		grid-template-columns: 1fr;
	}

	.screening-row {
		grid-template-columns: 1fr;
		gap: 0.55rem;
	}

	.screening-time {
		min-width: 0;
	}

	.screening-time .time {
		font-size: 1.35rem;
	}

	.screening-venue {
		text-align: center;
		padding: 1rem 0;
		border-left: none;
		border-right: none;
		border-top: 1px solid rgba(12, 83, 116, 0.1);
		border-bottom: 1px solid rgba(12, 83, 116, 0.1);
	}

	.btn-trailer {
		position: static;
		transform: none;
		margin-top: 1rem;
		width: 100%;
	}

	.btn-trailer:hover {
		transform: scale(1.02);
	}

	.modal-poster img {
		width: auto;
		height: min(42vh, 320px);
		max-width: min(220px, 72vw);
		aspect-ratio: 2 / 3;
		object-fit: cover;
	}

	.modal-poster-frame {
		width: auto;
		height: min(42vh, 320px);
		max-width: min(220px, 72vw);
		aspect-ratio: 2 / 3;
	}

	.modal-fallback-title {
		left: 0.75rem;
		right: 0.75rem;
		font-size: 1rem;
	}

	.movie-plot__text {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 6;
		line-clamp: 6;
		overflow: hidden;
	}

	.movie-plot__chk:checked + .movie-plot__text {
		display: block;
		-webkit-line-clamp: unset;
		line-clamp: unset;
		overflow: visible;
	}

	.movie-plot__toggle {
		display: inline-block;
		margin-top: 0.65rem;
		font-size: 0.9rem;
		font-weight: 600;
		color: var(--celeste);
		text-decoration: underline;
		text-underline-offset: 3px;
		cursor: pointer;
	}

	.movie-plot__toggle--less {
		display: none;
	}

	.movie-plot__chk:checked ~ .movie-plot__toggle--more {
		display: none;
	}

	.movie-plot__chk:checked ~ .movie-plot__toggle--less {
		display: inline-block;
	}
}

@media (max-width: 480px) {
	.modal-body {
		padding: 3.25rem 0.875rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
		max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 5.5rem);
		max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 5.5rem);
	}

	.modal-title {
		font-size: 1.4rem;
	}

	.movie-details {
		font-size: 0.9rem;
	}

	.movie-plot__text {
		font-size: 0.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.movie-modal[open] .modal-content {
		animation: none;
	}
}
