/*!
 * OZY Translate — language switcher styles.
 *
 * Every colour is read from a custom property so a site can retheme the
 * switcher without overriding a single rule. Defaults are the OZY brand.
 */

:root {
	--ozytr-primary: #cff023;
	--ozytr-on-primary: #0a1a2f;
	--ozytr-secondary: #0a1a2f;
	--ozytr-on-secondary: #ffffff;
	--ozytr-surface: #ffffff;
	--ozytr-surface-alt: #f8fafc;
	--ozytr-text: #0a1a2f;
	--ozytr-text-muted: #64748b;
	--ozytr-border: #e2e8f0;
	--ozytr-focus: #cff023;
	--ozytr-active-bg: rgba(207, 240, 35, 0.16);
	--ozytr-backdrop: rgba(10, 26, 47, 0.55);

	--ozytr-radius-sm: 8px;
	--ozytr-radius-md: 12px;
	--ozytr-radius-lg: 16px;
	--ozytr-radius-pill: 9999px;

	--ozytr-shadow-soft: 0 1px 2px rgba(10, 26, 47, 0.05);
	--ozytr-shadow-md: 0 4px 12px rgba(10, 26, 47, 0.08);
	--ozytr-shadow-lg: 0 20px 40px rgba(10, 26, 47, 0.15);

	--ozytr-duration: 220ms;
	--ozytr-ease: cubic-bezier(0.16, 1, 0.3, 1);

	--ozytr-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* -------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------- */

.ozytr-switcher {
	font-family: var(--ozytr-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--ozytr-text);
	position: relative;
	display: inline-block;
	max-width: 100%;
}

.ozytr-switcher *,
.ozytr-switcher *::before,
.ozytr-switcher *::after {
	box-sizing: border-box;
}

.ozytr-switcher--align-center { text-align: center; }
.ozytr-switcher--align-right { text-align: right; }

.ozytr-switcher a { text-decoration: none; }

.ozytr-switcher .screen-reader-text {
	position: absolute !important; /* Must beat theme resets to stay off-screen. */
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* A visible focus ring is never removed, only restyled. */
.ozytr-switcher a:focus-visible,
.ozytr-switcher button:focus-visible,
.ozytr-switcher input:focus-visible {
	outline: 3px solid var(--ozytr-focus);
	outline-offset: 2px;
	border-radius: var(--ozytr-radius-sm);
}

.ozytr-flag {
	display: inline-block;
	flex: 0 0 auto;
	object-fit: cover;
	vertical-align: middle;
	background: var(--ozytr-surface-alt);
}

.ozytr-flag--rounded { border-radius: 3px; }
.ozytr-flag--circle {
	border-radius: 50%;
	aspect-ratio: 1;
	height: auto;
}

.ozytr-flag--placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ozytr-text-muted);
	border: 1px solid var(--ozytr-border);
}

.ozytr-icon {
	flex: 0 0 auto;
	vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Theme isolation
 *
 * A theme styles the links and buttons inside post content, and a rule such
 * as `.entry-content a` outranks a single class, so it reaches into any
 * switcher placed with a shortcode and repaints it. Restating colour and
 * decoration with the block class in front keeps a switcher readable
 * wherever it is dropped, in light and dark alike.
 * ---------------------------------------------------------------------- */

.ozytr-switcher .ozytr-dropdown__link,
.ozytr-switcher .ozytr-fab__link,
.ozytr-switcher .ozytr-pill,
.ozytr-switcher .ozytr-flags__link,
.ozytr-switcher .ozytr-mega__link,
.ozytr-modal .ozytr-lang-card,
.ozytr-panel .ozytr-panel__link {
	color: var(--ozytr-text);
	text-decoration: none;
	box-shadow: none;
}

.ozytr-switcher .ozytr-toggle__side { color: var(--ozytr-text-muted); }
.ozytr-switcher .ozytr-toggle__side.is-current { color: var(--ozytr-on-primary); }

.ozytr-switcher .ozytr-dropdown__list,
.ozytr-switcher .ozytr-fab__list,
.ozytr-modal .ozytr-modal__panel,
.ozytr-panel .ozytr-panel__inner {
	color: var(--ozytr-text);
	background: var(--ozytr-surface);
}

.ozytr-switcher .ozytr-switcher__trigger,
.ozytr-switcher .ozytr-dropdown__trigger,
.ozytr-switcher .ozytr-panel__trigger,
.ozytr-switcher .ozytr-mega__trigger {
	color: var(--ozytr-text);
	background: var(--ozytr-surface);
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.ozytr-switcher .ozytr-switcher__trigger--minimal { background: transparent; }

.ozytr-switcher .ozytr-fab__trigger {
	color: var(--ozytr-on-primary);
	background: var(--ozytr-primary);
	font: inherit;
}

/* A language carries its own direction so its name reads correctly, but
   that direction belongs to the name alone: isolating it keeps the flag,
   the label and the tick in the order the rest of the list uses. */
.ozytr-switcher [dir],
.ozytr-modal [dir],
.ozytr-panel [dir] {
	direction: inherit;
	unicode-bidi: isolate;
}

/* -------------------------------------------------------------------------
 * Shared control surfaces
 * ---------------------------------------------------------------------- */

.ozytr-switcher__trigger,
.ozytr-dropdown__trigger,
.ozytr-panel__trigger,
.ozytr-mega__trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	font: inherit;
	color: var(--ozytr-text);
	background: var(--ozytr-surface);
	border: 1.5px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-sm);
	cursor: pointer;
	transition: border-color var(--ozytr-duration) var(--ozytr-ease), box-shadow var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-switcher__trigger:hover,
.ozytr-dropdown__trigger:hover,
.ozytr-panel__trigger:hover,
.ozytr-mega__trigger:hover {
	border-color: var(--ozytr-primary);
	box-shadow: var(--ozytr-shadow-soft);
}

.ozytr-switcher__trigger--pill { border-radius: var(--ozytr-radius-pill); }

.ozytr-switcher__trigger--minimal {
	background: transparent;
	border-color: transparent;
	padding: 6px 8px;
}

.ozytr-icon--chevron {
	transition: transform var(--ozytr-duration) var(--ozytr-ease);
}

[aria-expanded="true"] .ozytr-icon--chevron { transform: rotate(180deg); }

/* -------------------------------------------------------------------------
 * Dropdown
 * ---------------------------------------------------------------------- */

.ozytr-dropdown__list {
	position: absolute;
	z-index: 999;
	min-width: 200px;
	margin: 6px 0 0;
	padding: 6px;
	list-style: none;
	background: var(--ozytr-surface);
	border: 1px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-md);
	box-shadow: var(--ozytr-shadow-md);
}

/* Closed by default; script and :focus-within both reveal it, so the
   control still works with JavaScript disabled. */
.ozytr-switcher--dropdown .ozytr-dropdown__list {
	display: none;
}

.ozytr-switcher--dropdown:focus-within .ozytr-dropdown__list,
.ozytr-switcher--dropdown.is-open .ozytr-dropdown__list {
	display: block;
}

.ozytr-switcher--align-right .ozytr-dropdown__list { right: 0; }

.ozytr-dropdown__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	color: var(--ozytr-text);
	border-radius: var(--ozytr-radius-sm);
	transition: background-color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-dropdown__link:hover { background: var(--ozytr-surface-alt); }

.ozytr-dropdown__item.is-current .ozytr-dropdown__link {
	background: var(--ozytr-active-bg);
	font-weight: 600;
}

.ozytr-dropdown__check { margin-inline-start: auto; }

/* -------------------------------------------------------------------------
 * Modal grid
 * ---------------------------------------------------------------------- */

.ozytr-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ozytr-modal[hidden] { display: none; }

.ozytr-modal__backdrop {
	position: absolute;
	inset: 0;
	background: var(--ozytr-backdrop);
	animation: ozytr-fade var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1000px, 100%);
	max-height: min(760px, 90vh);
	background: var(--ozytr-surface);
	border-radius: var(--ozytr-radius-lg);
	box-shadow: var(--ozytr-shadow-lg);
	overflow: hidden;
	animation: ozytr-rise var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--ozytr-border);
}

.ozytr-modal__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ozytr-text);
}

.ozytr-modal__close,
.ozytr-panel__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--ozytr-text);
	background: transparent;
	border: 1.5px solid transparent;
	border-radius: var(--ozytr-radius-sm);
	cursor: pointer;
	transition: background-color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-modal__close:hover,
.ozytr-panel__close:hover { background: var(--ozytr-surface-alt); }

.ozytr-modal__search {
	position: relative;
	padding: 16px 24px;
	border-bottom: 1px solid var(--ozytr-border);
}

.ozytr-icon--search {
	position: absolute;
	top: 50%;
	inset-inline-start: 38px;
	transform: translateY(-50%);
	color: var(--ozytr-text-muted);
	pointer-events: none;
}

.ozytr-modal__search-input,
.ozytr-panel__search-input {
	width: 100%;
	padding: 12px 16px 12px 44px;
	font: inherit;
	color: var(--ozytr-text);
	background: var(--ozytr-surface-alt);
	border: 1.5px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-sm);
}

.ozytr-panel__search-input { padding-inline-start: 16px; }

.ozytr-modal__search-input:focus,
.ozytr-panel__search-input:focus {
	border-color: var(--ozytr-primary);
	outline: none;
	box-shadow: 0 0 0 3px var(--ozytr-active-bg);
}

.ozytr-modal__body,
.ozytr-panel__body {
	flex: 1 1 auto;
	padding: 20px 24px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ozytr-modal__region + .ozytr-modal__region { margin-top: 24px; }

.ozytr-modal__region-title,
.ozytr-panel__section-title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ozytr-text-muted);
}

.ozytr-grid {
	display: grid;
	grid-template-columns: repeat(var(--ozytr-grid-columns, 5), minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ozytr-lang-card {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	padding: 12px 14px;
	color: var(--ozytr-text);
	background: var(--ozytr-surface);
	border: 1px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-md);
	transition: transform var(--ozytr-duration) var(--ozytr-ease), border-color var(--ozytr-duration) var(--ozytr-ease), box-shadow var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-lang-card:hover {
	transform: scale(1.02);
	border-color: var(--ozytr-primary);
	box-shadow: var(--ozytr-shadow-soft);
}

.ozytr-grid__item.is-current .ozytr-lang-card {
	background: var(--ozytr-active-bg);
	border-color: var(--ozytr-primary);
	font-weight: 600;
}

.ozytr-lang-card__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}

.ozytr-lang-card__native {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ozytr-lang-card__label {
	font-size: 12.5px;
	font-weight: 400;
	color: var(--ozytr-text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ozytr-lang-card__check {
	margin-inline-start: auto;
	color: var(--ozytr-secondary);
}

.ozytr-modal__empty,
.ozytr-panel__empty {
	margin: 24px 0 0;
	text-align: center;
	color: var(--ozytr-text-muted);
}

/* -------------------------------------------------------------------------
 * Sliding panel
 * ---------------------------------------------------------------------- */

.ozytr-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.ozytr-panel[hidden] { display: none; }

.ozytr-panel__backdrop {
	position: absolute;
	inset: 0;
	background: var(--ozytr-backdrop);
	animation: ozytr-fade var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-panel__inner {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(380px, 90vw);
	background: var(--ozytr-surface);
	box-shadow: var(--ozytr-shadow-lg);
}

.ozytr-panel--right .ozytr-panel__inner {
	right: 0;
	animation: ozytr-slide-in-right var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-panel--left .ozytr-panel__inner {
	left: 0;
	animation: ozytr-slide-in-left var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px;
	border-bottom: 1px solid var(--ozytr-border);
}

.ozytr-panel__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ozytr-panel__search { padding: 16px 20px 0; }

.ozytr-panel__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ozytr-panel__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	color: var(--ozytr-text);
	border-radius: var(--ozytr-radius-sm);
	transition: background-color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-panel__link:hover { background: var(--ozytr-surface-alt); }

.ozytr-panel__item.is-current .ozytr-panel__link {
	background: var(--ozytr-active-bg);
	font-weight: 600;
}

.ozytr-panel__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}

.ozytr-panel__label {
	font-size: 12.5px;
	font-weight: 400;
	color: var(--ozytr-text-muted);
}

.ozytr-panel__check { margin-inline-start: auto; }

.ozytr-panel__recent { margin-bottom: 8px; }

/* -------------------------------------------------------------------------
 * Floating button
 * ---------------------------------------------------------------------- */

.ozytr-switcher--floating-fab {
	position: fixed;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.ozytr-fab__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	color: var(--ozytr-on-primary);
	background: var(--ozytr-primary);
	border: none;
	border-radius: 50%;
	box-shadow: var(--ozytr-shadow-md);
	cursor: pointer;
	transition: transform var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-fab__trigger:hover { transform: scale(1.05); }

.ozytr-fab__list {
	display: none;
	flex-direction: column;
	gap: 4px;
	min-width: 190px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--ozytr-surface);
	border: 1px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-md);
	box-shadow: var(--ozytr-shadow-md);
	animation: ozytr-rise var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-switcher--floating-fab.is-open .ozytr-fab__list,
.ozytr-switcher--floating-fab:focus-within .ozytr-fab__list {
	display: flex;
}

/* Anchored to the top of the viewport, the list belongs below the button. */
.ozytr-switcher--floating-fab[style*="top"] { flex-direction: column-reverse; }

.ozytr-fab__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	color: var(--ozytr-text);
	border-radius: var(--ozytr-radius-sm);
}

.ozytr-fab__link:hover { background: var(--ozytr-surface-alt); }

/* -------------------------------------------------------------------------
 * Inline pills
 * ---------------------------------------------------------------------- */

.ozytr-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ozytr-switcher--align-center .ozytr-pills { justify-content: center; }
.ozytr-switcher--align-right .ozytr-pills { justify-content: flex-end; }

.ozytr-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	font-size: 14px;
	color: var(--ozytr-text);
	background: var(--ozytr-surface);
	border: 1.5px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-pill);
	transition: background-color var(--ozytr-duration) var(--ozytr-ease), border-color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-pill:hover { border-color: var(--ozytr-primary); }

.ozytr-pills--filled .ozytr-pill.is-current {
	color: var(--ozytr-on-primary);
	background: var(--ozytr-primary);
	border-color: var(--ozytr-primary);
	font-weight: 600;
}

.ozytr-pills--outline .ozytr-pill.is-current {
	border-color: var(--ozytr-secondary);
	background: var(--ozytr-active-bg);
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Compact flags
 * ---------------------------------------------------------------------- */

.ozytr-flags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ozytr-flags__link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px;
	border: 2px solid transparent;
	border-radius: var(--ozytr-radius-pill);
	opacity: 0.65;
	transition: opacity var(--ozytr-duration) var(--ozytr-ease), border-color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-flags__link:hover { opacity: 1; }

.ozytr-flags__link.is-current {
	opacity: 1;
	border-color: var(--ozytr-primary);
}

.ozytr-flags__code {
	font-size: 12px;
	font-weight: 600;
	color: var(--ozytr-text);
}

/* -------------------------------------------------------------------------
 * Toggle
 * ---------------------------------------------------------------------- */

.ozytr-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 3px;
	background: var(--ozytr-surface-alt);
	border: 1.5px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-pill);
}

.ozytr-toggle__side {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--ozytr-text-muted);
	border-radius: var(--ozytr-radius-pill);
	transition: color var(--ozytr-duration) var(--ozytr-ease);
}

.ozytr-toggle__side.is-current {
	color: var(--ozytr-on-primary);
	font-weight: 600;
}

.ozytr-toggle__thumb {
	position: absolute;
	z-index: 0;
	top: 3px;
	bottom: 3px;
	width: calc(50% - 3px);
	background: var(--ozytr-primary);
	border-radius: var(--ozytr-radius-pill);
	transition: transform var(--ozytr-duration) var(--ozytr-ease);
}

/* The thumb sits under whichever side is active. */
.ozytr-toggle__side:first-of-type.is-current ~ .ozytr-toggle__thumb,
.ozytr-toggle:has(.ozytr-toggle__side:first-of-type.is-current) .ozytr-toggle__thumb {
	transform: translateX(0);
}

.ozytr-toggle:has(.ozytr-toggle__side:last-of-type.is-current) .ozytr-toggle__thumb {
	transform: translateX(100%);
}

.ozytr-toggle--small .ozytr-toggle__side { padding: 5px 12px; font-size: 13px; }
.ozytr-toggle--large .ozytr-toggle__side { padding: 10px 22px; font-size: 15px; }

/* -------------------------------------------------------------------------
 * Mega menu
 * ---------------------------------------------------------------------- */

.ozytr-mega__panel {
	position: absolute;
	z-index: 999;
	display: none;
	grid-template-columns: repeat(var(--ozytr-mega-columns, 4), minmax(150px, 1fr));
	gap: 20px 28px;
	min-width: 620px;
	max-width: min(90vw, 900px);
	margin-top: 6px;
	padding: 22px 24px;
	background: var(--ozytr-surface);
	border: 1px solid var(--ozytr-border);
	border-radius: var(--ozytr-radius-md);
	box-shadow: var(--ozytr-shadow-md);
}

.ozytr-switcher--mega-menu.is-open .ozytr-mega__panel,
.ozytr-switcher--mega-menu:focus-within .ozytr-mega__panel { display: grid; }

.ozytr-mega--hover:hover .ozytr-mega__panel { display: grid; }

.ozytr-switcher--align-right .ozytr-mega__panel { right: 0; }

.ozytr-mega__region-title {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ozytr-text-muted);
}

.ozytr-mega__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ozytr-mega__link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	font-size: 14px;
	color: var(--ozytr-text);
	border-radius: var(--ozytr-radius-sm);
}

.ozytr-mega__link:hover { background: var(--ozytr-surface-alt); }

.ozytr-mega__item.is-current .ozytr-mega__link {
	background: var(--ozytr-active-bg);
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Animation
 * ---------------------------------------------------------------------- */

@keyframes ozytr-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ozytr-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes ozytr-slide-in-right {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

@keyframes ozytr-slide-in-left {
	from { transform: translateX(-100%); }
	to { transform: translateX(0); }
}

.ozytr-switcher--anim-none *,
.ozytr-switcher--anim-none {
	animation: none !important; /* An explicit opt-out must win over the design default. */
	transition: none !important;
}

/* -------------------------------------------------------------------------
 * Right to left
 * ---------------------------------------------------------------------- */

[dir="rtl"] .ozytr-modal__search-input { padding: 12px 44px 12px 16px; }
[dir="rtl"] .ozytr-icon--search { inset-inline-start: auto; inset-inline-end: 38px; }
[dir="rtl"] .ozytr-toggle:has(.ozytr-toggle__side:last-of-type.is-current) .ozytr-toggle__thumb { transform: translateX(-100%); }

/* -------------------------------------------------------------------------
 * Small screens
 * ---------------------------------------------------------------------- */

@media (max-width: 900px) {
	.ozytr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ozytr-mega__panel {
		grid-template-columns: repeat(2, minmax(140px, 1fr));
		min-width: 0;
	}
}

@media (max-width: 600px) {
	.ozytr-modal { padding: 0; }

	.ozytr-modal__panel {
		width: 100%;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}

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

	.ozytr-modal__header,
	.ozytr-modal__search { padding-inline: 16px; }

	.ozytr-modal__body { padding: 16px; }

	.ozytr-mega__panel { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------------------
 * Dark mode
 * ---------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	:root:not([data-ozytr-theme="light"]) {
		--ozytr-surface: #142338;
		--ozytr-surface-alt: #0a1a2f;
		--ozytr-text: #f8fafc;
		--ozytr-text-muted: #94a3b8;
		--ozytr-border: #1e293b;
		--ozytr-secondary: #f8fafc;
		--ozytr-on-secondary: #0a1a2f;
		--ozytr-active-bg: rgba(207, 240, 35, 0.2);
		--ozytr-backdrop: rgba(2, 6, 12, 0.7);
	}
}

[data-ozytr-theme="dark"] {
	--ozytr-surface: #142338;
	--ozytr-surface-alt: #0a1a2f;
	--ozytr-text: #f8fafc;
	--ozytr-text-muted: #94a3b8;
	--ozytr-border: #1e293b;
	--ozytr-secondary: #f8fafc;
	--ozytr-on-secondary: #0a1a2f;
	--ozytr-active-bg: rgba(207, 240, 35, 0.2);
	--ozytr-backdrop: rgba(2, 6, 12, 0.7);
}

/* -------------------------------------------------------------------------
 * Motion and contrast preferences
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.ozytr-switcher *,
	.ozytr-modal *,
	.ozytr-panel * {
		animation-duration: 0.01ms !important; /* Overrides every design's own timing. */
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.ozytr-lang-card:hover,
	.ozytr-fab__trigger:hover { transform: none; }
}

@media (prefers-contrast: more) {
	.ozytr-switcher {
		--ozytr-border: currentColor;
		--ozytr-text-muted: var(--ozytr-text);
	}

	.ozytr-lang-card,
	.ozytr-pill,
	.ozytr-dropdown__list { border-width: 2px; }
}

/* -------------------------------------------------------------------------
 * Language suggestion prompt
 *
 * Printed hidden and revealed by script, so a visitor without JavaScript
 * never sees a banner they cannot dismiss.
 * ---------------------------------------------------------------------- */

.ozytr-suggestion {
	position: fixed;
	z-index: 99999;
	right: 24px;
	bottom: 24px;
	max-width: 340px;
	padding: 16px;
	border: 1px solid rgba(10, 26, 47, 0.12);
	border-radius: 12px;
	background: #fff;
	color: #0a1a2f;
	box-shadow: 0 8px 32px rgba(10, 26, 47, 0.16);
	font-size: 14px;
	line-height: 1.5;
}

.ozytr-suggestion[hidden] {
	display: none;
}

.ozytr-suggestion__text {
	margin: 0 0 12px;
}

.ozytr-suggestion__actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ozytr-suggestion__accept {
	padding: 8px 16px;
	border-radius: 8px;
	background: #cff023;
	color: #0a1a2f;
	font-weight: 600;
	text-decoration: none;
}

.ozytr-suggestion__accept:hover,
.ozytr-suggestion__accept:focus-visible {
	background: #bcdc1f;
}

.ozytr-suggestion__dismiss {
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.ozytr-suggestion__accept:focus-visible,
.ozytr-suggestion__dismiss:focus-visible {
	outline: 2px solid #0a1a2f;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
	.ozytr-suggestion {
		transition: opacity 200ms ease, transform 200ms ease;
		opacity: 0;
		transform: translateY(8px);
	}

	.ozytr-suggestion.is-visible {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 480px) {
	.ozytr-suggestion {
		right: 12px;
		left: 12px;
		bottom: 12px;
		max-width: none;
	}
}
