/* Scoped Dasein corrections. Keep CMS content, spacing and typography intact. */
.dg-page {
	--dg-heading: #ffffff;
	--dg-contact: #ffffff;
}

html.light .dg-page {
	--dg-heading: #1a1a1a;
	--dg-contact: #000000;
}

.dg-page[data-dg-category="75"] > article > h1 {
	color: #fe7442;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin-top: 0;
}

.dg-page[data-dg-category="75"] article h2,
.dg-page[data-dg-category="75"] article h3,
.dg-page[data-dg-category="75"] article h4,
.dg-page[data-dg-category="75"] article .text-foreground {
	color: var(--dg-heading) !important;
}

.dg-page[data-dg-category="75"] article div[style*="border-top"] > h2,
.dg-page[data-dg-category="75"] article a[href^="mailto:"],
.dg-page[data-dg-category="75"] article a[href*="facebook.com"],
.dg-page[data-dg-category="75"] article a[href^="mailto:"] *,
.dg-page[data-dg-category="75"] article a[href*="facebook.com"] *,
.dg-page[data-dg-category="75"] section[aria-labelledby="contact-heading"] h2,
.dg-page[data-dg-category="75"] section[aria-labelledby="contact-heading"] a,
.dg-page[data-dg-category="75"] section[aria-labelledby="contact-heading"] a * {
	color: var(--dg-contact) !important;
}

/* More specific than the !important rule embedded in the CMS FAQ article. */
html .dg-page[data-dg-category="305"] .dasein-faqs .dasein-faq-question {
	color: var(--dg-heading) !important;
}

.dg-page[data-dg-category="305"] > article > h1,
.dg-contact-heading {
	color: #fe7442;
}

/* The bars below the home talks and in the privacy navigation. */
.dg-home-talks,
.dg-carousel-track,
html.dark .dg-page[data-dg-category="120"] .dp-nav,
html.dark .dg-page[data-dg-category="120"] .dp-table-scroll {
	scrollbar-color: #666666 #171717;
	scrollbar-width: thin;
}

.dg-home-talks::-webkit-scrollbar,
.dg-carousel-track::-webkit-scrollbar,
html.dark .dg-page[data-dg-category="120"] .dp-nav::-webkit-scrollbar,
html.dark .dg-page[data-dg-category="120"] .dp-table-scroll::-webkit-scrollbar {
	width: 8px;
	height: 8px;
	background: #171717;
}

.dg-home-talks::-webkit-scrollbar-thumb,
.dg-carousel-track::-webkit-scrollbar-thumb,
html.dark .dg-page[data-dg-category="120"] .dp-nav::-webkit-scrollbar-thumb,
html.dark .dg-page[data-dg-category="120"] .dp-table-scroll::-webkit-scrollbar-thumb {
	background: #666666;
	border-radius: 8px;
}

.dg-talks-section + .dg-talks-section {
	margin-top: 64px;
}

.dg-carousel {
	min-width: 0;
	margin-top: 16px;
}

.dg-carousel-controls {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 16px;
}

.dg-carousel-controls button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid hsl(var(--border) / 0.6);
	border-radius: 50%;
	color: hsl(var(--foreground) / 0.7);
	background: transparent;
	transition: color 0.2s, border-color 0.2s;
}

.dg-carousel-controls button:hover,
.dg-carousel-controls button:focus-visible {
	color: #fe7442;
	border-color: #fe7442;
}

.dg-carousel-controls button:disabled {
	opacity: 0.3;
	cursor: default !important;
}

.dg-carousel-track {
	display: flex;
	gap: 24px;
	max-width: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 24px;
}

.dg-carousel-track > [data-card] {
	flex: 0 0 min(85vw, 340px);
	min-width: 0;
	scroll-snap-align: start;
}

.dg-carousel-track:focus-visible,
.dg-consent-card:focus-visible {
	outline: 2px solid #fe7442;
	outline-offset: 3px;
}

.dg-consent-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dg-consent-card {
	display: block;
	min-width: 0;
	overflow: hidden;
	border: 1px solid hsl(var(--border) / 0.5);
	border-radius: 12px;
	background: hsl(var(--card));
	transition: border-color 0.2s;
}

.dg-consent-card:hover {
	border-color: #fe7442;
}

.dg-consent-card > img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.dg-download-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	color: #fe7442;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.dg-carousel-track > .dg-sponsor-card {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 200px;
	min-width: 0;
	height: 120px;
	padding: 20px;
	border: 1px solid hsl(var(--border) / 0.5);
	border-radius: 12px;
	background: #ffffff;
	scroll-snap-align: start;
}

.dg-sponsor-card img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

@media (max-width: 640px) {
	.dg-consent-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dg-talks-section + .dg-talks-section {
		margin-top: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dg-carousel-track {
		scroll-behavior: auto;
	}
}

/* Long privacy titles must wrap inside their container at every breakpoint. */
html .dg-page[data-dg-category="120"] > article > h1 {
	white-space: normal !important;
	overflow-wrap: anywhere;
}

/* Some CMS questions have no toggle span; retain the same orange + / − cue. */
.dg-page[data-dg-category="305"] .dasein-faqs summary:not(:has(.dasein-faq-toggle))::after {
	content: "+";
	color: #fe7442;
	font-family: Arial, sans-serif;
	font-size: 26px;
	font-weight: 300;
	line-height: 1;
	flex-shrink: 0;
}

.dg-page[data-dg-category="305"] .dasein-faqs details[open] > summary:not(:has(.dasein-faq-toggle))::after {
	content: "−";
}

html.dark:has(.dg-page[data-dg-category="120"]) {
	scrollbar-color: #666666 #171717;
}

html.dark:has(.dg-page[data-dg-category="120"])::-webkit-scrollbar {
	width: 8px;
	background: #171717;
}

html.dark:has(.dg-page[data-dg-category="120"])::-webkit-scrollbar-thumb {
	background: #666666;
	border-radius: 8px;
}
