/* ==========================================================================
   YouTube / ΟΛΑ ΑΝΟΙΧΤΑ — homepage section
   Upload to: /assets/templates/css/youtube-feed.css
   Uses the theme tokens from custom.css (:root).
   ========================================================================== */

.amx-yt-section {
	padding: 120px 0 0;
}

.amx-yt-section .section-title p {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Card ---------- */
.amx-yt-item {
	height: 100%;
}

.amx-yt-card {
	position: relative;
	display: flex;
	flex-direction: column;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 20px;
	background-color: var(--primary-color);
	color: var(--white-color);
	text-decoration: none;
	isolation: isolate;
	box-shadow: 0 10px 30px rgba(32, 32, 32, 0.08);
	transition: box-shadow 0.4s ease, transform 0.4s ease;
}


.amx-yt-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.6s ease;
	z-index: -2;
}

/* gradient overlay */
.amx-yt-card::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(32, 32, 32, 0) 30%, rgba(32, 32, 32, 0.55) 62%, rgba(32, 32, 32, 0.92) 100%);
	transition: background-color 0.4s ease;
}

/* play icon: centred in the space above the title, so they never overlap */
.amx-yt-play {
	position: relative;
	flex: none;
	margin: auto;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--accent-color);
	color: var(--white-color);
	font-size: 22px;
	box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.18);
	transition: transform 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.amx-yt-play i {
	margin-left: 4px; /* optical centre of the triangle */
}

/* title + date */
.amx-yt-info {
	position: relative;
	flex: none;
	padding: 16px 22px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.amx-yt-title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--white-color);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.amx-yt-date {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.75);
}

/* badge (Podcast / Shorts) */
.amx-yt-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 100px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: var(--white-color);
	background-color: rgba(32, 32, 32, 0.6);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.amx-yt-badge.is-podcast {
	background-color: var(--accent-secondary-color);
	color: var(--primary-color);
}

/* hover / focus */
.amx-yt-card:hover,
.amx-yt-card:focus-visible {
	color: var(--white-color);
	box-shadow: 0 18px 40px rgba(32, 32, 32, 0.18);
}

.amx-yt-card:hover .amx-yt-thumb,
.amx-yt-card:focus-visible .amx-yt-thumb {
	transform: scale(1.06);
}

.amx-yt-card:hover .amx-yt-play,
.amx-yt-card:focus-visible .amx-yt-play {
	transform: scale(1.1);
	background-color: var(--accent-secondary-color);
	color: var(--primary-color);
	box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.22);
}

.amx-yt-card:focus-visible {
	outline: 3px solid var(--accent-secondary-color);
	outline-offset: 4px;
}

/* CTA icon spacing */
.amx-yt-section .section-footer-text {
	margin-top: 50px;
}

/* ---------- Modal ---------- */
/* keep the 16:9 player inside the viewport height */
.amx-yt-modal .modal-dialog {
	max-width: min(1140px, calc((100vh - 170px) * 16 / 9));
	margin-left: auto;
	margin-right: auto;
}

/* the site's scroll-to-top button (z-index 9999) must not cover the modal */
body.modal-open #scrollTopBtn {
	display: none !important;
}

.amx-yt-modal .modal-content {
	background-color: var(--primary-color);
	color: var(--white-color);
	border: 0;
	border-radius: 20px;
	overflow: hidden;
}

.amx-yt-modal .modal-header,
.amx-yt-modal .modal-footer {
	border-color: var(--dark-divider-color);
	padding: 16px 24px;
}

.amx-yt-modal .modal-title {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--white-color);
	margin: 0;
	padding-right: 16px;
}

.amx-yt-modal .modal-body {
	padding: 0;
	background-color: #000;
}

.amx-yt-modal .modal-footer {
	justify-content: center;
}

.amx-yt-fallback {
	color: rgba(255, 255, 255, 0.8);
	font-size: 15px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.amx-yt-fallback:hover,
.amx-yt-fallback:focus {
	color: var(--accent-secondary-color);
}

.amx-yt-fallback i {
	margin-right: 6px;
}

.amx-yt-player iframe {
	border: 0;
}

/* vertical player for YouTube Shorts */
.amx-yt-modal.is-short .modal-dialog {
	max-width: min(420px, calc((100vh - 280px) * 9 / 16));
	margin-left: auto;
	margin-right: auto;
}

.amx-yt-modal.is-short .amx-yt-player {
	--bs-aspect-ratio: 177.78%;
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 991px) {
	.amx-yt-section {
		padding: 60px 0 0;
	}

	.amx-yt-section .section-footer-text {
		margin-top: 40px;
	}
}

@media only screen and (max-width: 767px) {
	.amx-yt-title {
		font-size: 16px;
	}

	.amx-yt-info {
		padding: 16px 20px;
	}

	.amx-yt-play {
		width: 56px;
		height: 56px;
		font-size: 18px;
	}

	.amx-yt-modal .modal-dialog {
		margin: 12px;
	}

	.amx-yt-modal.is-short .modal-dialog {
		margin-left: auto;
		margin-right: auto;
		max-width: min(360px, calc(100vw - 24px), calc((100vh - 180px) * 9 / 16));
	}
}

@media (prefers-reduced-motion: reduce) {
	.amx-yt-card,
	.amx-yt-thumb,
	.amx-yt-play {
		transition: none;
	}

	.amx-yt-card:hover .amx-yt-thumb,
	.amx-yt-card:focus-visible .amx-yt-thumb {
		transform: none;
	}
}
