/* "Ansicht anpassen" panel (block dvkzwi/view-settings) + the modes it sets.
   Colours fall back to the brand values when the theme's variables are absent. */

.dvkzwi-view {
	position: relative;
	font-family: var(--wp--preset--font-family--heading, inherit);
}

.dvkzwi-view__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.85rem;
	border: 2px solid var(--dvkzwi-blue, #2515aa);
	border-radius: 999px;
	background: #fff;
	color: var(--dvkzwi-blue, #2515aa);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.dvkzwi-view__toggle:hover,
.dvkzwi-view__toggle[aria-expanded="true"] {
	background: var(--dvkzwi-blue, #2515aa);
	color: #fff;
}

.dvkzwi-view__toggle svg {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

@media (max-width: 600px) {
	.dvkzwi-view__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	.dvkzwi-view__toggle {
		padding: 0.45rem;
	}
}

.dvkzwi-view__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 0.6rem);
	z-index: 1000;
	width: min(19rem, calc(100vw - 2rem));
	padding: 1.25rem;
	background: #fff;
	color: var(--dvkzwi-ink, #231f20);
	border-top: 4px solid var(--dvkzwi-flamingo, #ed532f);
	border-radius: 0 var(--dvkzwi-arc, 2.5rem) 0 0;
	box-shadow: 0 12px 32px rgba(35, 31, 32, 0.18);
	font-size: 1rem;
}

.dvkzwi-view__panel[hidden] {
	display: none;
}

.dvkzwi-view__panel,
.dvkzwi-view__panel * {
	box-sizing: border-box;
}

/* Phones: a sheet along the bottom edge, so it fits at every text size */
@media (max-width: 600px) {
	.dvkzwi-view__panel {
		position: fixed;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-height: 85vh;
		overflow-y: auto;
		border-radius: var(--dvkzwi-arc, 2.5rem) var(--dvkzwi-arc, 2.5rem) 0 0;
		box-shadow: 0 -8px 32px rgba(35, 31, 32, 0.25);
	}
}

.dvkzwi-view__title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.dvkzwi-view__panel fieldset {
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
}

.dvkzwi-view__panel legend {
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.dvkzwi-view__sizes {
	display: flex;
	gap: 0.5rem;
}

.dvkzwi-view__panel button {
	font: inherit;
	cursor: pointer;
}

.dvkzwi-view__sizes button {
	flex: 1;
	min-height: 2.75rem;
	border: 2px solid var(--dvkzwi-blue, #2515aa);
	border-radius: 0.5rem;
	background: #fff;
	color: var(--dvkzwi-blue, #2515aa);
	font-weight: 700;
	line-height: 1;
}

.dvkzwi-view__sizes [data-size="125"] {
	font-size: 1.2em;
}

.dvkzwi-view__sizes [data-size="150"] {
	font-size: 1.45em;
}

.dvkzwi-view__sizes button[aria-pressed="true"] {
	background: var(--dvkzwi-blue, #2515aa);
	color: #fff;
}

.dvkzwi-view__switch,
.dvkzwi-view__read {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 2.75rem;
	margin-bottom: 0.75rem;
	padding: 0.5rem 0.75rem;
	border: 2px solid var(--dvkzwi-blue, #2515aa);
	border-radius: 0.5rem;
	background: #fff;
	color: var(--dvkzwi-ink, #231f20);
	font-weight: 600;
	text-align: left;
}

.dvkzwi-view__read[hidden] {
	display: none;
}

/* On/off track for the contrast switch */
.dvkzwi-view__track {
	position: relative;
	flex: none;
	width: 2.75rem;
	height: 1.5rem;
	border-radius: 999px;
	background: #8a8687;
	transition: background 0.2s ease;
}

.dvkzwi-view__track::after {
	content: "";
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s ease;
}

[aria-checked="true"] > .dvkzwi-view__track {
	background: var(--dvkzwi-blue, #2515aa);
}

[aria-checked="true"] > .dvkzwi-view__track::after {
	transform: translateX(1.25rem);
}

.dvkzwi-view__read[aria-pressed="true"] {
	background: var(--dvkzwi-blue, #2515aa);
	color: #fff;
}

.dvkzwi-view__reset {
	padding: 0;
	border: 0;
	background: none;
	color: var(--dvkzwi-blue, #2515aa);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dvkzwi-view__stop {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	border: 0;
	border-radius: 999px;
	background: var(--dvkzwi-blue, #2515aa);
	color: #fff;
	font: inherit;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(35, 31, 32, 0.3);
	cursor: pointer;
}

.dvkzwi-view__stop[hidden] {
	display: none;
}

.dvkzwi-view :focus-visible {
	outline: 3px solid var(--dvkzwi-flamingo, #ed532f);
	outline-offset: 2px;
}

/* Paragraph currently being read aloud */
.dvkzwi-reading {
	background: #fff3cd;
	box-shadow: 0 0 0 0.35rem #fff3cd;
	color: #231f20 !important;
}

/* ---------- High contrast mode ---------- */

html.dvkzwi-contrast body {
	color: #000;
}

html.dvkzwi-contrast a {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* Light surfaces: black text, darker accent tones */
html.dvkzwi-contrast .has-surface-background-color,
html.dvkzwi-contrast .dvkzwi-card {
	background: #fff !important;
	outline: 2px solid #000;
}

html.dvkzwi-contrast .dvkzwi-eyebrow,
html.dvkzwi-contrast .dvkzwi-meta,
html.dvkzwi-contrast .has-accent-color,
html.dvkzwi-contrast .has-secondary-color {
	color: #000 !important;
}

html.dvkzwi-contrast .has-primary-color {
	color: #160b6e !important;
}

/* Blue sections: pure white text */
html.dvkzwi-contrast .has-primary-background-color,
html.dvkzwi-contrast .has-primary-background-color * {
	color: #fff !important;
}

html.dvkzwi-contrast .has-primary-background-color {
	background-color: #160b6e !important;
}

/* The navigation carries its (blue) mobile-overlay colour class even when it
   sits closed in the white header — keep it black on white there. */
html.dvkzwi-contrast .wp-block-navigation__responsive-container:not(.is-menu-open),
html.dvkzwi-contrast .wp-block-navigation__responsive-container:not(.is-menu-open) * {
	background-color: transparent !important;
	color: #000 !important;
}

/* Orange band: black text stays, buttons get a hard edge */
html.dvkzwi-contrast .wp-element-button,
html.dvkzwi-contrast .wp-block-button__link {
	outline: 2px solid #000;
	outline-offset: 0;
}

html.dvkzwi-contrast :focus-visible {
	outline: 4px solid #000 !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 7px #fff;
}
