/**
 * Editorial body v2
 * Desktop (1024px+): fixed 560 / 920 + lock JS complet (DPR / zoom, ex. Wacom)
 * Wacom fereastră îngustă: lock doar pe video (clasă html.ahdb-ed-lock-media)
 * Mobil: layout fluid, fără lock
 */

.ahdb-ed-v2,
.ahdb-ed-v2 * {
	box-sizing: border-box;
}

.ahdb-ed-v2 {
	--ed-copy-max: 560px;
	--ed-cards-max: 920px;
	--ed-inline: var(--layout-gutter);

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--rhythm-gap);
	width: 100%;
	max-width: 100%;
	background: var(--color-page-bg);
	color: #000000;
	font-family: var(--font-primary);
	padding: var(--rhythm-gap) 0 var(--rhythm-page-end);
	overflow-x: clip;
}

/* —— Desktop base (exact live sizes) —— */
.ahdb-ed-v2-copy-lock {
	width: 560px;
	max-width: 560px;
	margin: 0 auto;
	position: relative;
	overflow: visible;
}

.ahdb-ed-v2-copy-scale {
	width: 560px;
	transform-origin: top left;
	will-change: transform;
}

.ahdb-ed-v2-copy-wrap {
	text-align: center;
	width: 560px;
}

.ahdb-ed-v2-p {
	margin: 0 auto var(--rhythm-text);
	letter-spacing: 0;
	font-size: var(--font-size-body-l);
	line-height: 22px;
	font-family: var(--font-primary);
	font-weight: var(--font-weight-400);
	color: #000000;
}

.ahdb-ed-v2-h2 {
	margin: 0 0 var(--rhythm-text);
	font-family: var(--font-edito);
	font-size: var(--font-size-heading-xl);
	line-height: normal;
	font-style: italic;
	letter-spacing: 0;
	font-weight: var(--font-weight-500);
	text-transform: none;
	color: #000000;
}

.ahdb-ed-v2-image-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: var(--rhythm-gap) auto 0;
	text-decoration: none;
}

.ahdb-ed-v2-image-btn img {
	width: 60px;
	height: 60px;
	display: block;
	object-fit: contain;
}

/* Video + track: lipite de margini ca hero-ul (100vw breakout) */
.ahdb-ed-v2-media-lock,
.ahdb-ed-v2-track {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.ahdb-ed-v2-media-lock {
	align-self: stretch;
	margin-top: 0;
	margin-bottom: 0;
}

.ahdb-ed-v2-video-wrap {
	width: 100%;
	overflow: hidden;
	background: transparent;
}

.ahdb-ed-v2-video {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	background: #000000;
	border: 0;
	pointer-events: auto;
}

.ahdb-ed-v2-track {
	width: 100%;
	margin: 0.25rem auto 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.18);
	position: relative;
	height: 14px;
}

.ahdb-ed-v2-track::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	width: 110px;
	height: 2px;
	background: rgba(0, 0, 0, 0.55);
}

.ahdb-ed-v2-cards-lock {
	width: 920px;
	max-width: 920px;
	margin: 0 auto;
	position: relative;
	overflow: visible;
}

.ahdb-ed-v2-cards-scale {
	width: 920px;
	transform-origin: top left;
	will-change: transform;
}

.ahdb-ed-v2-card-grid {
	width: 920px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--rhythm-gap);
	align-items: start;
}

.ahdb-ed-v2-card {
	min-width: 0;
}

.ahdb-ed-v2-card-media {
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #e9e1d7;
	margin-bottom: 8px;
}

.ahdb-ed-v2-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ahdb-ed-v2-card-title {
	margin: 0 0 4px;
	font-family: var(--font-primary);
	font-size: 14px;
	line-height: 18px;
	letter-spacing: 0;
	font-weight: var(--font-weight-500);
	color: #000000;
}

.ahdb-ed-v2-card-text {
	margin: 0;
	font-family: var(--font-primary);
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0;
	font-weight: var(--font-weight-400);
	color: rgba(0, 0, 0, 0.82);
}

/* Card visuals */
.ahdb-ed-v2-card-media {
	position: relative;
	border-radius: 2px;
	overflow: hidden;
	background: #e9e1d7;
	box-shadow:
		0 18px 38px rgba(0, 0, 0, 0.18),
		0 8px 18px rgba(0, 0, 0, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
	transform: translateY(0);
	transition:
		transform 0.45s ease,
		box-shadow 0.45s ease,
		filter 0.45s ease;
}

.ahdb-ed-v2-card-media::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
		linear-gradient(315deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0) 45%);
	opacity: 0.75;
}

.ahdb-ed-v2-card-media img {
	position: relative;
	z-index: 1;
	filter: saturate(1.03) contrast(1.02);
	transition: transform 0.55s ease, filter 0.55s ease;
}

.ahdb-ed-v2-card:hover .ahdb-ed-v2-card-media {
	transform: translateY(-6px);
	box-shadow:
		0 28px 55px rgba(0, 0, 0, 0.24),
		0 12px 24px rgba(0, 0, 0, 0.16),
		inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.ahdb-ed-v2-card:hover .ahdb-ed-v2-card-media img {
	transform: scale(1.035);
	filter: saturate(1.06) contrast(1.04);
}

.ahdb-ed-v2-media-lock,
.ahdb-ed-v2-video-wrap,
.ahdb-ed-v2-video {
	box-shadow: none !important;
	filter: none !important;
}

.ahdb-ed-v2-media-lock::before,
.ahdb-ed-v2-media-lock::after,
.ahdb-ed-v2-video-wrap::before,
.ahdb-ed-v2-video-wrap::after {
	content: none !important;
	display: none !important;
	opacity: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

.ahdb-ed-v2-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ahdb-ed-v2-card-media-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ahdb-ed-v2-image-btn img {
	transition: transform 0.6s ease;
}

.ahdb-ed-v2-image-btn:hover img {
	animation: ahdb-icon-spin var(--ahdb-icon-spin-duration) linear infinite;
}

/* —— Tablet & below: fluid, fără lock JS —— */
@media (max-width: 1023px) {
	.ahdb-ed-v2-copy-lock {
		width: min(var(--ed-copy-max), calc(100% - 2 * var(--ed-inline)));
		max-width: calc(100% - 2 * var(--ed-inline));
		height: auto !important;
		min-height: 0 !important;
	}

	.ahdb-ed-v2-copy-scale,
	.ahdb-ed-v2-copy-wrap {
		width: 100% !important;
		max-width: 100%;
		transform: none !important;
	}

	.ahdb-ed-v2-cards-lock {
		width: min(var(--ed-cards-max), calc(100% - 2 * var(--ed-inline)));
		max-width: calc(100% - 2 * var(--ed-inline));
		height: auto !important;
		min-height: 0 !important;
	}

	.ahdb-ed-v2-cards-scale,
	.ahdb-ed-v2-card-grid {
		width: 100% !important;
		max-width: 100%;
		transform: none !important;
	}

	/* 4 coloane ca pe desktop, mai strânse */
	.ahdb-ed-v2-card-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 10px;
	}

	.ahdb-ed-v2-card-media {
		margin-bottom: 6px;
	}

	.ahdb-ed-v2-card-title {
		font-size: 11px;
		line-height: 14px;
		text-align: center;
	}

	.ahdb-ed-v2-card-text {
		font-size: 10px;
		line-height: 13px;
		text-align: center;
	}
}

/* —— Mobile —— */
@media (max-width: 767px) {
	.ahdb-ed-v2-copy-lock {
		width: calc(100% - 2 * var(--ed-inline));
		max-width: none;
	}

	.ahdb-ed-v2-p {
		font-size: var(--font-size-body-m);
		line-height: 20px;
	}

	.ahdb-ed-v2-h2 {
		font-size: var(--font-size-heading-m);
	}

	.ahdb-ed-v2-image-btn img {
		width: 52px;
		height: 52px;
	}

	.ahdb-ed-v2-track::before {
		width: 72px;
	}

	.ahdb-ed-v2-cards-lock {
		width: calc(100% - 2 * var(--ed-inline));
	}

	.ahdb-ed-v2-card-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 6px;
	}

	.ahdb-ed-v2-card-media {
		margin-bottom: 4px;
		box-shadow:
			0 8px 16px rgba(0, 0, 0, 0.12),
			0 3px 8px rgba(0, 0, 0, 0.08),
			inset 0 1px 0 rgba(255, 255, 255, 0.45);
	}

	.ahdb-ed-v2-card-title {
		font-size: 10px;
		line-height: 13px;
		text-align: center;
	}

	.ahdb-ed-v2-card-text {
		font-size: 9px;
		line-height: 12px;
		text-align: center;
	}

	.ahdb-ed-v2-card:hover .ahdb-ed-v2-card-media {
		transform: translateY(-3px);
	}
}

/* Telefoane foarte înguste */
@media (max-width: 390px) {
	.ahdb-ed-v2-card-grid {
		gap: 4px;
	}

	.ahdb-ed-v2-card-title {
		font-size: 9px;
		line-height: 12px;
	}

	.ahdb-ed-v2-card-text {
		font-size: 8px;
		line-height: 11px;
	}
}

/* Lock complet: desktop lat */
@media (min-width: 1024px) {
	.ahdb-ed-lock-full .ahdb-ed-v2-copy-scale,
	.ahdb-ed-lock-full .ahdb-ed-v2-cards-scale {
		will-change: transform;
	}
}

/* Wacom / lock media: text + carduri rămân fluide, video compensat de JS */
html.ahdb-ed-lock-media .ahdb-ed-v2-copy-lock,
html.ahdb-ed-lock-media .ahdb-ed-v2-cards-lock {
	width: min(var(--ed-cards-max), calc(100% - 2 * var(--ed-inline))) !important;
	max-width: calc(100% - 2 * var(--ed-inline)) !important;
	height: auto !important;
	min-height: 0 !important;
}

html.ahdb-ed-lock-media .ahdb-ed-v2-copy-scale,
html.ahdb-ed-lock-media .ahdb-ed-v2-copy-wrap,
html.ahdb-ed-lock-media .ahdb-ed-v2-cards-scale,
html.ahdb-ed-lock-media .ahdb-ed-v2-card-grid {
	width: 100% !important;
	transform: none !important;
}

html.ahdb-ed-lock-media .ahdb-ed-v2-media-lock,
html.ahdb-ed-lock-media .ahdb-ed-v2-track {
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
}

@media (prefers-reduced-motion: reduce) {
	.ahdb-ed-v2-card-media,
	.ahdb-ed-v2-card-media img,
	.ahdb-ed-v2-image-btn img {
		transition: none;
	}

	.ahdb-ed-v2-card:hover .ahdb-ed-v2-card-media,
	.ahdb-ed-v2-card:hover .ahdb-ed-v2-card-media img {
		transform: none;
	}

	.ahdb-ed-v2-image-btn:hover img {
		animation: none;
	}
}
