/*
 * Case library, front end.
 *
 * Uses the theme's tokens rather than its own palette, so a case page is the
 * same site as the page that linked to it. The only rules here are ones the
 * theme does not already provide.
 *
 * Logical properties throughout (margin-inline, padding-inline, border-inline)
 * rather than left/right: Arabic is one of the three languages this library
 * commits to, and a right-to-left case page mirrors correctly only if the
 * stylesheet never hard-codes a side.
 */

/* ─────────────────────────────  CARDS  ───────────────────────────── */

.dv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: 32px;
}

.dv-card {
	border: 1px solid var(--line);
	background: var(--white);
	transition: box-shadow .25s ease, border-color .25s ease;
}

.dv-card:hover {
	box-shadow: 0 20px 44px -26px rgba(8, 26, 50, .38);
	border-color: var(--line-strong);
}

.dv-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.dv-card__link:focus-visible {
	outline: 3px solid var(--teal);
	outline-offset: 3px;
}

.dv-card__frame {
	position: relative;
	aspect-ratio: 3 / 2;
	background: var(--soft);
	overflow: hidden;
}

.dv-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dv-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 26px 26px 28px;
}

.dv-card__kind {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--teal);
	margin-bottom: 12px;
}

.dv-card__body .h3 { margin-bottom: 10px; }

.dv-card__body p {
	font-size: 14px;
	line-height: 1.65;
	color: var(--slate);
}

.dv-card__action {
	display: inline-block;
	align-self: flex-start;
	margin-top: auto;
	padding-top: 22px;
	font-size: 13px;
	font-weight: 600;
	color: var(--teal);
}

.dv-card__link:hover .dv-card__action { color: var(--navy); }

.dv-treatment-cases .dv-card { max-width: 540px; }

.dv-treatment-cases .eyebrow,
.dv-treatment-cases .link-arrow { color: #0d6f7c; }

.dv-treatment-cases__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px 32px;
	margin-top: 30px;
}

.dv-treatment-cases__footer .note { margin: 0; max-width: 58ch; }

/* ─────────────────────────────  CASE HEADER  ───────────────────────────── */

.dv-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	margin-top: 28px;
}

.dv-meta__label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted-on-dark);
	margin-bottom: 5px;
}

.dv-meta__terms a {
	font-size: 13.5px;
	color: var(--on-dark);
	text-decoration: none;
	border-bottom: 1px solid rgba(188, 200, 216, .4);
}

.dv-meta__terms a:hover { color: var(--white); }

.dv-langs {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 24px;
	font-size: 13.5px;
}

.dv-langs__current { color: var(--white); font-weight: 600; }
.dv-langs a { color: var(--on-dark-soft); }

/* ─────────────────────────────  CASE BODY  ───────────────────────────── */

.dv-block { margin-bottom: 44px; }
.dv-block .h2 { margin-bottom: 16px; }

.dv-prose p {
	font-size: 16px;
	line-height: 1.75;
	color: var(--slate-dark);
	margin-bottom: 16px;
	max-width: 68ch;
}

.dv-prose p:last-child { margin-bottom: 0; }

.dv-callout {
	margin: 0 0 44px;
	padding: 22px 26px;
	background: var(--soft);
	border-inline-start: 3px solid var(--teal);
}

.dv-callout__label {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--teal);
	margin-bottom: 10px;
}

.dv-callout--warning { border-inline-start-color: #B4552A; }
.dv-callout--warning .dv-callout__label { color: #B4552A; }

.dv-callout--critical-point { border-inline-start-color: var(--navy); }
.dv-callout--critical-point .dv-callout__label { color: var(--navy); }

.dv-callout--followup-result { border-inline-start-color: var(--slate); }
.dv-callout--followup-result .dv-callout__label { color: var(--slate); }

.dv-figure { margin: 0 0 28px; }

.dv-img {
	display: block;
	width: 100%;
	height: auto;
	background: var(--soft);
}

.dv-image-link {
	position: relative;
	display: block;
	color: inherit;
	text-decoration: none;
	cursor: zoom-in;
}

.dv-image-link:focus-visible {
	outline: 3px solid var(--teal);
	outline-offset: 3px;
}

.dv-image-link__hint {
	position: absolute;
	inset-inline-end: 10px;
	bottom: 10px;
	padding: 6px 9px;
	background: rgba(14, 33, 73, .9);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	pointer-events: none;
}

.dv-lightbox {
	width: min(96vw, 1600px);
	height: min(94vh, 1000px);
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: #0e2149;
	color: #fff;
	direction: ltr;
}

.dv-lightbox::backdrop { background: rgba(4, 12, 27, .9); }

.dv-lightbox__inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.dv-lightbox__toolbar {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 10px;
	background: #0e2149;
}

.dv-lightbox__button {
	min-width: 42px;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, .45);
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.dv-lightbox__button:hover,
.dv-lightbox__button:focus-visible { background: rgba(255, 255, 255, .16); }

.dv-lightbox__viewport {
	flex: 1;
	min-height: 0;
	overflow: auto;
}

.dv-lightbox__stage {
	display: grid;
	place-items: center;
	min-width: 100%;
	min-height: 100%;
	width: 100%;
	height: 100%;
}

.dv-lightbox__stage.is-zoomed {
	width: max-content;
	height: max-content;
}

.dv-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: min(calc(94vh - 64px), 936px);
	object-fit: contain;
}

.dv-lightbox__image.is-zoomed {
	max-width: none;
	max-height: none;
}

.dv-figcaption {
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--muted);
}

.dv-figcaption__phase {
	display: inline-block;
	margin-inline-end: 8px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--teal);
}

.dv-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	gap: 24px;
}

.dv-figcaption__date {
	display: inline-block;
	margin-inline-start: 8px;
	font-variant-numeric: tabular-nums;
	color: var(--slate);
}

/* ─────────────────────────────  VIDEO  ───────────────────────────── */

.dv-video {
	display: block;
	width: 100%;
	height: auto;
	background: var(--navy);
}

.dv-video__title {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--navy);
}

.dv-video-notes {
	margin-top: 12px;
	padding-inline-start: 14px;
	border-inline-start: 2px solid var(--line);
}

.dv-video-notes__item {
	margin: 0 0 8px;
	font-size: 14px;
	line-height: 1.65;
	color: var(--slate);
}

.dv-video-notes__item:last-child { margin-bottom: 0; }

.dv-video-notes__label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--teal);
}

.dv-video-steps {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: dv-video-step;
}

.dv-video-steps__step {
	position: relative;
	counter-increment: dv-video-step;
	padding-inline-start: 34px;
	margin-bottom: 32px;
}

.dv-video-steps__step:last-child { margin-bottom: 0; }

.dv-video-steps__step::before {
	content: counter(dv-video-step);
	position: absolute;
	inset-inline-start: 0;
	top: 2px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--soft);
	color: var(--navy);
	font-size: 11px;
	font-weight: 600;
	line-height: 22px;
	text-align: center;
}

.dv-compare {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 1px;
	background: var(--line);
}

.dv-compare__side {
	position: relative;
	margin: 0;
	background: var(--white);
	min-width: 0;
}

.dv-compare__tag {
	position: absolute;
	top: 10px;
	inset-inline-start: 10px;
	z-index: 2;
	pointer-events: none;
	background: rgba(14, 33, 73, .86);
	color: var(--white);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 4px 9px;
}

.dv-compare__side .dv-figcaption { padding: 0 12px 12px; }

.dv-disclaimer {
	margin-top: 8px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
	font-size: 13px;
	line-height: 1.7;
	color: var(--muted);
	max-width: 68ch;
}

.dv-next { margin-top: 28px; }

/* ─────────────────────────────  RIGHT TO LEFT  ───────────────────────────── */

.dv-dir-rtl .dv-prose p,
.dv-dir-rtl .dv-disclaimer { text-align: right; }

.dv-dir-rtl .hero__back::before { content: ""; }

@media (max-width: 720px) {
	.dv-compare { grid-template-columns: minmax(0, 1fr); }
	.dv-video-steps__step { padding-inline-start: 0; }
	.dv-video-steps__step::before { position: static; display: inline-block; margin-bottom: 8px; }
	.dv-card__body { padding: 22px 20px 24px; }
	.dv-meta { gap: 12px 20px; }
}
