/**
 * Videos Page Template Styles
 *
 * @package Plastpro
 * @since 1.0.0
 */

/* Hero: same structure as Hero Template (.hero-section, .hero-overlay, .hero-container) */
.videos-page .videos-hero {
	min-height: clamp(280px, 50vw, var(--plastpro-hero-min-height));
}

/* Description section */
.videos-description {
	background: #e8e8e8;
	padding: 2.5rem 1.5rem;
}

.videos-description__content {
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-h6);
	font-weight: 400;
	line-height: 1.6;
	color: #1D252D;
}

.videos-description__content p {
	margin: 0 0 1rem 0;
}

.videos-description__content p:last-child {
	margin-bottom: 0;
}

@media (min-width: 768px) {
	.videos-description {
		padding: 3.5rem 2rem;
	}
	.videos-description__content {
		font-size: var(--font-size-large);
		line-height: 1.65;
	}
}

/* ============================================
   Featured Video – two columns (image left, content right)
   ============================================ */

.videos-featured {
	background: #E8E8E8;
	padding: 3rem 0;
}

.videos-featured__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

.videos-featured__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	background: #E8E8E8;
	overflow: hidden;
}

@media (min-width: 768px) {
	.videos-featured__grid {
		grid-template-columns: 1fr 1fr;
		min-height: 360px;
	}
}

/* Left: thumbnail on black */
.videos-featured__media {
	background: #000000;
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

@media (min-width: 768px) {
	.videos-featured__media {
		aspect-ratio: auto;
		min-height: 360px;
	}
}

/* Video not available placeholder (featured) */
.videos-featured__unavailable {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
	color: rgba(255, 255, 255, 0.85);
}

.videos-featured__unavailable-icon {
	width: 64px;
	height: 64px;
	color: rgba(255, 255, 255, 0.5);
}

.videos-featured__unavailable-text {
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-h6);
	font-weight: 500;
	line-height: 1.3;
}

.videos-featured__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.3s ease;
}

.videos-featured__media[data-video-url] {
	cursor: pointer;
}

/* Centered play badge on featured thumbnail (not the .videos-featured__play button in the column) */
.videos-featured__media-play {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	width: clamp(3.5rem, 10vw, 5rem);
	height: clamp(3.5rem, 10vw, 5rem);
	transform: translate(-50%, -50%);
	pointer-events: none;
	color: var(--plastpro-orange, #E87722);
	opacity: 1;
	/* Shadow only; no opacity on the button itself */
	filter: drop-shadow(0 4px 12px rgb(0 0 0 / 0.45));
	transition: transform 0.3s ease;
}

.videos-featured__media-play-icon {
	display: block;
	width: 100%;
	height: 100%;
}

.videos-featured__media:hover .videos-featured__media-play {
	transform: translate(-50%, -50%) scale(1.08);
}

.videos-featured__media:hover .videos-featured__img {
	transform: scale(1.03);
}

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

	.videos-featured__media-play {
		transition: none;
	}

	.videos-featured__media:hover .videos-featured__media-play {
		transform: translate(-50%, -50%);
	}

	.videos-featured__media:hover .videos-featured__img {
		transform: none;
	}
}

/* Right: label, title, description, Play Video */
.videos-featured__content {
	background: #E8E8E8;
	padding: 2rem 1.5rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

@media (min-width: 768px) {
	.videos-featured__content {
		padding: 2.5rem 3rem;
	}
}

.videos-featured__label {
	display: inline-block;
	background: #C65A0F;
	color: #ffffff;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-xs);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 0.4rem 0.75rem;
	margin-bottom: 1rem;
	width: fit-content;
}

.videos-featured__title {
	margin: 0 0 1rem 0;
	font-family: 'Gilda Display', serif;
	font-size: var(--font-size-h2);
	font-weight: 400;
	line-height: 1.25;
	color: #1D252D;
}

@media (min-width: 768px) {
	.videos-featured__title {
		font-size: var(--font-size-h2);
	}
}

.videos-featured__excerpt {
	margin: 0 0 1.5rem 0;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-body);
	font-weight: 400;
	line-height: 1.5;
	color: #1D252D;
}

.videos-featured__play {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-small);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #C65A0F;
	width: fit-content;
	transition: color 0.2s ease;
}

.videos-featured__play:hover {
	color: #a04a0c;
}

.videos-featured__play-chevron {
	display: inline-flex;
	align-items: center;
}

.videos-featured__play-arrow {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
}

/* ============================================
   Video modal (popup) – smooth open/close animation
   ============================================ */

.videos-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	pointer-events: none;
}

.videos-modal:not([hidden]) {
	pointer-events: auto;
}

.videos-modal[hidden] {
	display: none !important;
}

.videos-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.videos-modal--open .videos-modal__backdrop {
	opacity: 1;
}

.videos-modal__box {
	position: relative;
	width: 100%;
	max-width: 900px;
	max-height: 90vh;
	background: #000;
	z-index: 1;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
	transform: scale(0.95);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.videos-modal--open .videos-modal__box {
	transform: scale(1);
	opacity: 1;
}

.videos-modal__close {
	position: absolute;
	top: -2.5rem;
	right: 0;
	width: 2rem;
	height: 2rem;
	background: none;
	border: none;
	color: #fff;
	font-size: var(--font-size-h2);
	line-height: 1;
	cursor: pointer;
	padding: 0;
	z-index: 2;
	transition: opacity 0.2s ease;
}

.videos-modal__close:hover {
	opacity: 0.8;
}

.videos-modal__player {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
}

.videos-modal__player video,
.videos-modal__player .videos-modal__embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.videos-modal__player video {
	object-fit: contain;
}

.videos-modal__player .videos-modal__embed {
	border: 0;
}

.videos-modal__player .videos-modal__embed.hidden {
	display: none !important;
}

.videos-modal__player.hidden,
.videos-modal__unavailable.hidden {
	display: none !important;
}

/* Modal: video not found state */
.videos-modal__unavailable {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 3rem 2rem;
	text-align: center;
	background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
	color: #fff;
	min-height: 280px;
}

.videos-modal__unavailable-icon {
	width: 64px;
	height: 64px;
	color: rgba(255, 255, 255, 0.6);
}

.videos-modal__unavailable-text {
	margin: 0;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-h4);
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.videos-modal__unavailable-subtext {
	margin: 0;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-body);
	font-weight: 400;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.75);
	max-width: 320px;
}

/* ============================================
   Videos filter bar (category tabs + title)
   ============================================ */

/* Tabs and results use wide container */
.videos-page .videos-archive-content .site-container {
	max-width: var(--site-container-max-wide);
	width: 100%;
	box-sizing: border-box;
}

.videos-filter {
	margin-bottom: 2rem;
}

.videos-filter__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
}

.videos-filter__tab {
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #7C878E;
	text-decoration: none;
	padding: 0.5rem 0;
	position: relative;
	transition: color 0.2s ease;
}

.videos-filter__tab:hover {
	color: #1D252D;
}

.videos-filter__tab.is-active {
	color: var(--plastpro-orange, #E87722);
}

.videos-filter__tab.is-active::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1rem;
	height: 2px;
	background-color: var(--plastpro-orange, #E87722);
}

/* H1 – category title */
.videos-filter__title {
	margin: 0 0 1.5rem 0;
	color: #000;
	font-family: Montserrat, sans-serif;
	font-size: var(--font-size-display);
	font-style: normal;
	font-weight: 300;
	line-height: 40px;
}

@media (min-width: 768px) {
	.videos-filter__title {
		margin-bottom: 2rem;
	}
}

/* Skeleton loading (AJAX filter / pagination) */
.videos-grid-container--loading {
	opacity: 0.95;
}

.videos-grid--skeleton {
	pointer-events: none;
}

.video-card-skeleton {
	width: 100%;
	background: #fff;
	border: 1px solid #e0e0e0;
	overflow: hidden;
}

.video-card-skeleton__media {
	aspect-ratio: 16 / 9;
	background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
	background-size: 200% 100%;
	animation: video-skeleton-shine 1.2s ease-in-out infinite;
}

.video-card-skeleton__content {
	padding: 1.25rem 1.25rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.video-card-skeleton__line {
	height: 0.875rem;
	border-radius: 4px;
	background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
	background-size: 200% 100%;
	animation: video-skeleton-shine 1.2s ease-in-out infinite;
}

.video-card-skeleton__line--title {
	height: 1.125rem;
	width: 75%;
}

.video-card-skeleton__line--short {
	width: 100%;
}

.video-card-skeleton__line--short:last-child {
	width: 90%;
}

@keyframes video-skeleton-shine {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Grid + cards (redesign: white card, border, thumbnail + content) */
.videos-grid--featured {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	max-width: 900px;
	margin: 0 auto;
}

/* Card shell: orange accent line on hover (same pattern as .blog-card on blog listing) */
.video-card {
	position: relative;
	width: 100%;
}

.video-card::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	height: 4px;
	background-color: var(--plastpro-orange, #E87722);
	width: 0;
	transition: width 0.3s ease;
	z-index: 2;
	pointer-events: none;
}

.video-card:hover::after {
	width: 100%;
}

.video-card__link {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 0;
	overflow: visible;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.video-card__link:hover {
	transform: translateY(-4px);
	box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.15);
	border-color: var(--plastpro-gray-6, #F5F5F5);
	background-color: var(--plastpro-gray-6, #F5F5F5);
}

.video-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #1D252D;
}

/* Video not available placeholder (card) */
.video-card__unavailable {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1rem;
	background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
	color: rgba(255, 255, 255, 0.7);
}

.video-card__unavailable-icon {
	width: 48px;
	height: 48px;
	color: rgba(255, 255, 255, 0.5);
}

.video-card__unavailable-text {
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-small);
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
}

.video-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.3s ease;
}

.video-card__link:hover .video-card__img {
	transform: scale(1.05);
}

/* Play control on thumbnail — well left of center (decorative; whole card link opens video) */
.video-card__play {
	position: absolute;
	left: 12%;
	top: 50%;
	z-index: 2;
	width: clamp(3rem, 12vw, 4rem);
	height: clamp(3rem, 12vw, 4rem);
	transform: translate(-50%, -50%);
	pointer-events: none;
	color: var(--plastpro-orange, #E87722);
	opacity: 1;
	/* Shadow only; play icon stays fully opaque */
	filter: drop-shadow(0 4px 12px rgb(0 0 0 / 0.45));
	transition: transform 0.3s ease;
}

.video-card__play-icon {
	display: block;
	width: 100%;
	height: 100%;
}

.video-card__link:hover .video-card__play {
	transform: translate(-50%, -50%) scale(1.08);
}

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

	.video-card__link:hover .video-card__play {
		transform: translate(-50%, -50%);
	}
}

.video-card__category {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 3;
	padding: 0.35rem 0.75rem;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-small);
	font-weight: 600;
	color: #ffffff;
	background: var(--plastpro-orange, #E87722);
	border-radius: 4px;
}

.video-card__media-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 1rem 1.25rem;
	display: flex;
	align-items: flex-end;
}

.video-card__media-title {
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-h6);
	font-weight: 600;
	line-height: 1.35;
	color: #ffffff;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.video-card__content {
	padding: 1.25rem 1.25rem 1.5rem;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 0;
	transition: background-color 0.3s ease;
}

.video-card__link:hover .video-card__content {
	background-color: var(--plastpro-gray-6, #F5F5F5);
}

.video-card__title {
	margin: 0;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-large);
	font-weight: 700;
	line-height: 1.3;
	color: #1D252D;
}

.video-card__excerpt {
	margin: 0;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-small);
	font-weight: 400;
	line-height: 1.45;
	color: #7C878E;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.video-card--featured .video-card__link {
	min-height: 0;
}

.video-card--featured .video-card__media {
	aspect-ratio: 16 / 9;
}

.videos-pagination {
	margin-top: 2rem;
	text-align: center;
}

.videos-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	margin: 0 0.25rem;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-h6);
	text-decoration: none;
	color: #1D252D;
	background: #fff;
	border: 1px solid #ddd;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.videos-pagination .page-numbers:hover,
.videos-pagination .page-numbers.current {
	background: #1D252D;
	color: #fff;
	border-color: #1D252D;
}

.videos-pagination .page-numbers.dots {
	border: none;
	background: transparent;
}

.videos-none {
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: var(--font-size-large);
	color: #7C878E;
}

@media (min-width: 768px) {
	.videos-featured {
		padding: 3rem 0;
	}
}

@media (min-width: 1024px) {
	.videos-page .series-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 2rem;
	}
	.video-card__content {
		padding: 1.5rem 1.5rem 2rem;
	}
	.video-card__title {
		font-size: var(--font-size-h4);
	}
	.video-card__excerpt {
		-webkit-line-clamp: 4;
	}
}
