/**
 * Videothek hundeallerlei
 * Ausschließlich für die Ausgabe aus page-videos.php
 */


/* =========================================================
   GRUNDLAYOUT
   ========================================================= */

.ha-videos {
	--ha-video-accent: #6f8055;
	--ha-video-accent-dark: #4e5f3a;
	--ha-video-accent-soft: #eef2e8;
	--ha-video-text: #252a22;
	--ha-video-muted: #697064;
	--ha-video-border: #dfe4da;
	--ha-video-background: #ffffff;
	--ha-video-shadow: 0 10px 28px rgba(35, 43, 30, 0.09);
	--ha-video-shadow-hover: 0 16px 36px rgba(35, 43, 30, 0.16);

	width: 100%;
	margin: 0;
	padding: 0;
	color: var(--ha-video-text);
}


/* =========================================================
   EINLEITUNG
   ========================================================= */

.ha-videos__intro {
	max-width: 820px;
	margin: 0 0 34px;
}

.ha-videos__eyebrow {
	margin: 0 0 8px;
	color: var(--ha-video-accent-dark);
	font-size: 0.82rem;
	font-weight: 750;
	line-height: 1.4;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.ha-videos__heading {
	margin: 0 0 14px;
	color: var(--ha-video-text);
	font-size: clamp(1.65rem, 3vw, 2.6rem);
	font-weight: 750;
	line-height: 1.12;
	letter-spacing: -0.025em;
}

.ha-videos__description {
	max-width: 720px;
	margin: 0;
	color: var(--ha-video-muted);
	font-size: clamp(1rem, 1.5vw, 1.12rem);
	line-height: 1.65;
}


/* =========================================================
   FILTER
   ========================================================= */

.ha-video-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 18px;
}

.ha-video-filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	margin: 0;
	padding: 9px 14px;
	border: 1px solid var(--ha-video-border);
	border-radius: 999px;
	background: var(--ha-video-background);
	color: var(--ha-video-text);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition:
		background-color 180ms ease,
		border-color 180ms ease,
		color 180ms ease,
		box-shadow 180ms ease,
		transform 180ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.ha-video-filter:hover {
	border-color: var(--ha-video-accent);
	background: var(--ha-video-accent-soft);
	color: var(--ha-video-accent-dark);
	transform: translateY(-1px);
}

.ha-video-filter:focus-visible {
	outline: 3px solid rgba(111, 128, 85, 0.28);
	outline-offset: 2px;
}

.ha-video-filter.is-active {
	border-color: var(--ha-video-accent-dark);
	background: var(--ha-video-accent-dark);
	color: #ffffff;
	box-shadow: 0 5px 14px rgba(78, 95, 58, 0.2);
}

.ha-video-filter__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--ha-video-accent-soft);
	color: var(--ha-video-accent-dark);
	font-size: 0.76rem;
	font-weight: 750;
	line-height: 1;
}

.ha-video-filter.is-active .ha-video-filter__count {
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
}


/* =========================================================
   ERGEBNISANZEIGE
   ========================================================= */

.ha-video-results {
	margin: 0 0 16px;
	color: var(--ha-video-muted);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.4;
}


/* =========================================================
   VIDEO-GITTER
   ========================================================= */

.ha-video-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	width: 100%;
}

.ha-video-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--ha-video-border);
	border-radius: 17px;
	background: var(--ha-video-background);
	box-shadow: var(--ha-video-shadow);
	transition:
		border-color 200ms ease,
		box-shadow 200ms ease,
		transform 200ms ease;
}

.ha-video-card:hover {
	border-color: rgba(111, 128, 85, 0.48);
	box-shadow: var(--ha-video-shadow-hover);
	transform: translateY(-3px);
}

.ha-video-card[hidden] {
	display: none !important;
}


/* =========================================================
   VORSCHAUBILD UND PLAYER
   ========================================================= */

.ha-video-card__media {
	position: relative;
	width: 100%;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background:
		linear-gradient(
			135deg,
			#dfe5d7 0%,
			#eef1e9 48%,
			#d6ddce 100%
		);
}

.ha-video-card__play {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ha-video-card__play::after {
	position: absolute;
	inset: 0;
	content: "";
	background:
		linear-gradient(
			to top,
			rgba(17, 21, 14, 0.28) 0%,
			rgba(17, 21, 14, 0.02) 55%,
			rgba(17, 21, 14, 0.05) 100%
		);
	transition: background-color 180ms ease;
}

.ha-video-card__play:hover::after {
	background-color: rgba(20, 27, 16, 0.08);
}

.ha-video-card__play:focus-visible {
	outline: 4px solid var(--ha-video-accent);
	outline-offset: -4px;
}

.ha-video-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition:
		opacity 180ms ease,
		transform 400ms ease;
}

.ha-video-card__play:hover .ha-video-card__image {
	transform: scale(1.035);
}

.ha-video-card__play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: block;
	width: 66px;
	height: 66px;
	filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.28));
	transform: translate(-50%, -50%);
	transition:
		filter 180ms ease,
		transform 180ms ease;
	pointer-events: none;
}

.ha-video-card__play:hover .ha-video-card__play-icon {
	filter: drop-shadow(0 9px 16px rgba(0, 0, 0, 0.38));
	transform: translate(-50%, -50%) scale(1.08);
}

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

.ha-video-card__play-icon circle {
	fill: rgba(255, 255, 255, 0.94);
	stroke: rgba(255, 255, 255, 0.65);
	stroke-width: 2;
}

.ha-video-card__play-icon path {
	fill: var(--ha-video-accent-dark);
}


/* Fehlendes Vorschaubild bis Schritt 3 */

.ha-video-card__media.is-missing-image::before {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 17px;
	content: "Vorschaubild wird geladen";
	color: var(--ha-video-accent-dark);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-align: center;
}

.ha-video-card__media.is-missing-image .ha-video-card__image {
	opacity: 0;
}


/* Erst nach Klick erzeugter YouTube-Nocookie-Player */

.ha-video-card__media.is-playing {
	background: #000000;
}

.ha-video-card__player {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000000;
}


/* =========================================================
   KARTENTEXT
   ========================================================= */

.ha-video-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 17px 18px 20px;
}

.ha-video-card__category {
	margin: 0 0 7px;
	color: var(--ha-video-accent-dark);
	font-size: 0.72rem;
	font-weight: 750;
	line-height: 1.35;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.ha-video-card__title {
	margin: 0;
	color: var(--ha-video-text);
	font-size: clamp(1rem, 1.5vw, 1.16rem);
	font-weight: 720;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.ha-video-card__noscript {
	margin: 0;
	padding: 0 18px 18px;
	font-size: 0.88rem;
	line-height: 1.5;
}

.ha-video-card__noscript a {
	color: var(--ha-video-accent-dark);
	font-weight: 650;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

	.ha-video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 21px;
	}

}


/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 680px) {

	.ha-videos__intro {
		margin-bottom: 26px;
	}

	.ha-video-filters {
		flex-wrap: nowrap;
		gap: 8px;
		margin-right: -16px;
		margin-bottom: 16px;
		padding-right: 16px;
		padding-bottom: 6px;
		overflow-x: auto;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.ha-video-filter {
		flex: 0 0 auto;
		min-height: 40px;
		padding: 8px 13px;
		font-size: 0.86rem;
	}

	.ha-video-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 19px;
	}

	.ha-video-card {
		border-radius: 15px;
	}

	.ha-video-card:hover {
		transform: none;
	}

	.ha-video-card__play-icon {
		width: 60px;
		height: 60px;
	}

	.ha-video-card__body {
		padding: 15px 16px 18px;
	}

}


/* =========================================================
   REDUZIERTE BEWEGUNG
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

	.ha-video-filter,
	.ha-video-card,
	.ha-video-card__image,
	.ha-video-card__play-icon {
		transition: none;
	}

	.ha-video-card:hover,
	.ha-video-filter:hover {
		transform: none;
	}

	.ha-video-card__play:hover .ha-video-card__image {
		transform: none;
	}

}


/* === HA VIDEO REDESIGN V2 START === */


/* =========================================================
   KOMPAKTER EINSTIEGSBEREICH
   ========================================================= */

.ha-videos__intro {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: none;
	margin: 0 0 30px;
	padding: 28px 30px 30px;
	border: 1px solid #dfe5d8;
	border-radius: 18px;
	background:
		linear-gradient(
			135deg,
			#f4f7f0 0%,
			#ffffff 62%,
			#f7f8f4 100%
		);
}

.ha-videos__intro > * {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.ha-videos__eyebrow {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: 29px;
	padding: 6px 11px;
	border-radius: 999px;
	background: #e5ebdd;
	color: #4e5f3a;
	font-size: 0.73rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.08em;
}

.ha-videos__heading {
	max-width: 820px;
	color: #263225;
	font-size: clamp(2rem, 3vw, 2.85rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.025em;
}

.ha-videos__description {
	max-width: 760px;
	color: #667062;
	font-size: 1.05rem;
	line-height: 1.6;
}


/* =========================================================
   KLAR GEORDNETE FILTER
   ========================================================= */

.ha-video-filters {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 16px;
}

.ha-video-filter {
	display: flex;
	justify-content: space-between;
	width: 100%;
	min-height: 54px;
	padding: 10px 12px 10px 15px;
	border: 1px solid #dce2d7;
	border-radius: 12px;
	background: #ffffff;
	box-shadow: none;
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: left;
}

.ha-video-filter:hover {
	border-color: #7b8c62;
	background: #f4f7f0;
	transform: none;
}

.ha-video-filter.is-active {
	border-color: #52633f;
	background: #52633f;
	box-shadow: 0 6px 16px rgba(63, 78, 45, 0.17);
	color: #ffffff;
}

.ha-video-filter__count {
	flex: 0 0 auto;
	min-width: 25px;
	height: 25px;
	padding: 0 7px;
}

.ha-video-results {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	margin: 2px 0 17px;
	padding: 5px 11px;
	border-radius: 999px;
	background: #eef2e9;
	color: #536047;
	font-size: 0.82rem;
	font-weight: 750;
}


/* =========================================================
   GRÖSSERE VIDEOKARTEN
   ========================================================= */

.ha-video-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.ha-video-card {
	border: 1px solid #dfe4da;
	border-radius: 16px;
	box-shadow: 0 7px 20px rgba(35, 43, 30, 0.08);
}

.ha-video-card:hover {
	border-color: #b5c0a6;
	box-shadow: 0 13px 28px rgba(35, 43, 30, 0.14);
	transform: translateY(-3px);
}

.ha-video-card[data-video-category="besondere-videos"] {
	border-color: #b9c6aa;
	background:
		linear-gradient(
			to bottom,
			#ffffff 0%,
			#f5f8f1 100%
		);
}

.ha-video-card__media {
	aspect-ratio: 16 / 9;
	background: #e8ede3;
}

.ha-video-card__play-icon {
	width: 56px;
	height: 56px;
}

.ha-video-card__play::after {
	background:
		linear-gradient(
			to top,
			rgba(19, 25, 15, 0.22) 0%,
			rgba(19, 25, 15, 0.02) 58%,
			rgba(19, 25, 15, 0.04) 100%
		);
}

.ha-video-card__body {
	padding: 16px 18px 19px;
}

.ha-video-card__category {
	display: inline-flex;
	align-self: flex-start;
	width: fit-content;
	margin: 0 0 9px;
	padding: 4px 8px;
	border-radius: 999px;
	background: #edf2e8;
	color: #52633f;
	font-size: 0.67rem;
	line-height: 1.25;
	letter-spacing: 0.055em;
}

.ha-video-card__title {
	font-size: clamp(1.05rem, 1.5vw, 1.2rem);
	font-weight: 700;
	line-height: 1.35;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1080px) {

	.ha-video-filters {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

}


/* =========================================================
   KLEINERE TABLETS
   ========================================================= */

@media (max-width: 780px) {

	.ha-videos__intro {
		padding: 24px 22px 25px;
	}

	.ha-video-filters {
		display: flex;
		flex-wrap: nowrap;
		gap: 8px;
		margin-right: -16px;
		padding-right: 16px;
		overflow-x: auto;
		scrollbar-width: thin;
	}

	.ha-video-filter {
		flex: 0 0 auto;
		width: auto;
		min-height: 43px;
		padding: 8px 11px 8px 13px;
		border-radius: 999px;
	}

	.ha-video-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

}


/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 520px) {

	.ha-videos__intro {
		gap: 10px;
		margin-bottom: 24px;
		padding: 21px 18px 22px;
		border-radius: 15px;
	}

	.ha-videos__heading {
		font-size: 1.85rem;
		line-height: 1.12;
	}

	.ha-videos__description {
		font-size: 0.98rem;
		line-height: 1.55;
	}

	.ha-video-card__play-icon {
		width: 52px;
		height: 52px;
	}

}


/* === HA VIDEO REDESIGN V2 ENDE === */


/* === HA VIDEO GRID PANEL V3 START === */


/* Sanfte Salbeifläche hinter allen Videokarten */

.ha-video-grid {
	padding: 24px;
	border: 1px solid #dfe6d9;
	border-radius: 22px;
	background:
		radial-gradient(
			circle at 8% 0%,
			rgba(255, 255, 255, 0.82) 0%,
			rgba(255, 255, 255, 0) 34%
		),
		linear-gradient(
			145deg,
			#f3f6f0 0%,
			#eaf0e5 100%
		);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.9),
		0 9px 30px rgba(49, 62, 40, 0.055);
}


/* Weiße Karten mit ruhigerer, hochwertigerer Tiefe */

.ha-video-card {
	border-color: #d9e1d3;
	background: #ffffff;
	box-shadow:
		0 7px 18px rgba(43, 55, 35, 0.085),
		0 1px 2px rgba(43, 55, 35, 0.04);
}

.ha-video-card:hover {
	border-color: #aebba1;
	box-shadow:
		0 14px 30px rgba(43, 55, 35, 0.14),
		0 2px 5px rgba(43, 55, 35, 0.06);
}


/* Die besonderen Videos bleiben leicht hervorgehoben,
   aber ohne deutlich andere Kartenfarbe */

.ha-video-card[data-video-category="besondere-videos"] {
	border-color: #bdc9b2;
	background: #ffffff;
}


/* Tablet */

@media (max-width: 780px) {

	.ha-video-grid {
		padding: 17px;
		border-radius: 18px;
	}

}


/* Smartphone */

@media (max-width: 520px) {

	.ha-video-grid {
		gap: 16px;
		padding: 12px;
		border-radius: 16px;
	}

}


/* === HA VIDEO GRID PANEL V3 ENDE === */


/* === HA VIDEO GRID PANEL V4 START === */

.ha-video-grid {
	gap: 28px;
	padding: 30px;
	border: 1px solid #cbd7c1;
	border-radius: 24px;
	background: #e5ecdf;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.8),
		0 10px 30px rgba(52, 66, 43, 0.08);
}

.ha-video-card {
	overflow: hidden;
	border: 1px solid #d2ddca;
	background: #ffffff;
	box-shadow:
		0 8px 20px rgba(45, 57, 37, 0.11),
		0 2px 4px rgba(45, 57, 37, 0.05);
}

.ha-video-card:hover {
	border-color: #9eae91;
	box-shadow:
		0 16px 32px rgba(45, 57, 37, 0.17),
		0 3px 6px rgba(45, 57, 37, 0.06);
}

.ha-video-card[data-video-category="besondere-videos"] {
	border-color: #aebda2;
	background: #ffffff;
}

.ha-video-card__body {
	background: #ffffff;
}

@media (max-width: 780px) {

	.ha-video-grid {
		gap: 20px;
		padding: 20px;
		border-radius: 19px;
	}

}

@media (max-width: 520px) {

	.ha-video-grid {
		gap: 16px;
		padding: 13px;
		border-radius: 16px;
	}

}

/* === HA VIDEO GRID PANEL V4 ENDE === */


/* === HA VIDEO TITLE CLAMP V5 START === */

/*
 * Lange YouTube-Titel auf maximal drei sichtbare Zeilen begrenzen.
 * Der vollständige Titel bleibt im HTML erhalten.
 */

.ha-video-card__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	text-overflow: ellipsis;
}

/* Rückfalllösung für Browser ohne mehrzeiliges Line-Clamp */

@supports not (-webkit-line-clamp: 3) {

	.ha-video-card__title {
		max-height: 4.05em;
	}

}

/* === HA VIDEO TITLE CLAMP V5 ENDE === */
