/* Zestrero Accessibility — stiluri widget (WCAG 2.2 AA + criterii AAA aplicabile) */

/* ---------- Buton flotant ---------- */

#zestrero-a11y-btn {
	position: fixed;
	z-index: 999999;
	width: 56px;
	height: 56px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 2px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	background-color: var(--zestrero-primary, #1e40af);
	color: #fff;
	transition: transform 0.15s ease;
}

#zestrero-a11y-btn:hover {
	transform: scale(1.06);
}

#zestrero-a11y-btn svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* Inel de focus în două tonuri: vizibil pe orice fundal (2.4.7 / 2.4.13). */
#zestrero-a11y-btn:focus-visible,
#zestrero-a11y-panel button:focus-visible,
#zestrero-a11y-panel a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #111;
}

.zestrero-pos-bottom-right { bottom: 20px; right: 20px; }
.zestrero-pos-bottom-left  { bottom: 20px; left: 20px; }
.zestrero-pos-top-right    { top: 20px; right: 20px; }
.zestrero-pos-top-left     { top: 20px; left: 20px; }

/* ---------- Panou ---------- */

#zestrero-a11y-panel {
	position: fixed;
	z-index: 999998;
	box-sizing: border-box;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 130px);
	max-height: calc(100dvh - 130px);
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #767676;
	border-radius: 18px;
	box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	letter-spacing: normal;
	word-spacing: normal;
	text-align: left;
	font-weight: 400;
}

#zestrero-a11y-panel[hidden] {
	display: none;
}

#zestrero-a11y-panel.zestrero-pos-bottom-right { bottom: 88px; right: 20px; }
#zestrero-a11y-panel.zestrero-pos-bottom-left  { bottom: 88px; left: 20px; }
#zestrero-a11y-panel.zestrero-pos-top-right    { top: 88px; right: 20px; }
#zestrero-a11y-panel.zestrero-pos-top-left     { top: 88px; left: 20px; }

/* Antet colorat (alb pe culoarea de brand are contrast ≥ 7:1). */
#zestrero-a11y-panel .zestrero-header {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 8px 10px 18px;
	background: var(--zestrero-primary, #1e40af);
	color: #fff;
	border-radius: 17px 17px 0 0;
}

#zestrero-a11y-panel h2 {
	margin: 0;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: none;
	border: 0;
}

#zestrero-a11y-panel .zestrero-close {
	min-width: 44px;
	min-height: 44px;
	background: rgba(255, 255, 255, 0.18);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	color: #fff;
}

#zestrero-a11y-panel .zestrero-close:hover {
	background: rgba(255, 255, 255, 0.32);
}

#zestrero-a11y-panel .zestrero-body {
	padding: 14px 16px 16px;
	background: #f6f7fb;
	border-radius: 0 0 17px 17px;
}

#zestrero-a11y-panel .zestrero-intro {
	margin: 0 0 10px;
	font-size: 14px;
	color: #333;
}

/* Protecție împotriva stilurilor temei (margini/padding/înălțimi puse global pe section, div, h3, p). */
#zestrero-a11y-panel section.zestrero-section {
	display: block !important;
	position: static !important;
	float: none !important;
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
}

#zestrero-a11y-panel .zestrero-grid,
#zestrero-a11y-panel .zestrero-size-row,
#zestrero-a11y-panel .zestrero-body {
	height: auto;
	min-height: 0;
	float: none;
}

#zestrero-a11y-panel .zestrero-grid {
	margin: 0;
	padding: 0;
}

#zestrero-a11y-panel p {
	max-width: none;
	text-indent: 0;
}

#zestrero-a11y-panel h3.zestrero-group-title {
	margin: 18px 0 8px;
	padding: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
	background: none;
	border: 0;
	text-transform: none;
	letter-spacing: normal;
}

#zestrero-a11y-panel .zestrero-status {
	margin: 0;
	padding: 8px 12px;
	min-height: 1.4em;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #c7cbd6;
	border-radius: 999px;
	font-size: 13px;
}

#zestrero-a11y-panel .zestrero-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

/* Carduri: pictogramă sus, text dedesubt, indicator de stare în colț. */
#zestrero-a11y-panel button.zestrero-option {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	min-height: 84px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 6px;
	margin: 0;
	padding: 10px 40px 10px 12px;
	background: #fff;
	color: #1a1a1a;
	border: 1.5px solid #6b7280;
	border-radius: 12px;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: background-color 0.15s ease, transform 0.1s ease;
}

#zestrero-a11y-panel button.zestrero-option:hover {
	background: #eef1fb;
	transform: translateY(-1px);
}

#zestrero-a11y-panel button.zestrero-option[aria-disabled="true"] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

#zestrero-a11y-panel .zestrero-profiles button.zestrero-option {
	min-height: 96px;
}

#zestrero-a11y-panel .zestrero-glyph {
	font-weight: 700;
	font-size: 22px;
	line-height: 1;
}

#zestrero-a11y-panel .zestrero-option-label {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

#zestrero-a11y-panel .zestrero-option-desc {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	font-weight: 400;
}

/* Indicator de stare care NU depinde doar de culoare (1.4.1): bifa apare când e activ. */
#zestrero-a11y-panel .zestrero-check {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	box-sizing: border-box;
	border: 2px solid currentColor;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

#zestrero-a11y-panel button.zestrero-active {
	background: var(--zestrero-primary, #1e40af);
	border-color: var(--zestrero-primary, #1e40af);
	color: #fff;
}

#zestrero-a11y-panel button.zestrero-active:hover {
	background: var(--zestrero-primary, #1e40af);
}

#zestrero-a11y-panel button.zestrero-active .zestrero-check {
	background: #fff;
	color: var(--zestrero-primary, #1e40af);
	border-color: #fff;
}

#zestrero-a11y-panel button.zestrero-active .zestrero-check::before {
	content: "\2713";
}

/* Rând pentru dimensiunea textului: A− [100%] A+ pe toată lățimea. */
#zestrero-a11y-panel .zestrero-size-row {
	grid-column: 1 / -1;
	display: flex;
	align-items: stretch;
	gap: 8px;
}

#zestrero-a11y-panel .zestrero-size-row button.zestrero-option {
	flex: 1 1 0;
	min-height: 64px;
	padding: 8px 12px;
}

#zestrero-a11y-panel .zestrero-size-level {
	flex: 0 0 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	font-weight: 700;
	color: #1a1a1a;
	background: #fff;
	border: 1.5px solid #6b7280;
	border-radius: 12px;
}

#zestrero-a11y-panel button.zestrero-option.zestrero-wide {
	margin-top: 18px;
	min-height: 48px;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 14px;
	text-align: center;
	background: #fff;
	border-radius: 999px;
}

#zestrero-a11y-panel button.zestrero-wide .zestrero-glyph {
	font-size: 18px;
}

#zestrero-a11y-panel button.zestrero-wide .zestrero-option-label {
	flex: 0 1 auto;
	font-weight: 700;
}

#zestrero-a11y-panel .zestrero-statement,
#zestrero-a11y-panel .zestrero-footer {
	margin: 12px 0 0;
	font-size: 13px;
	text-align: center;
}

#zestrero-a11y-panel .zestrero-footer {
	color: #4d4d4d;
}

#zestrero-a11y-panel a {
	color: #0b3d91;
	text-decoration: underline;
}

/* Telefon: panoul ocupă lățimea ecranului, ca o foaie de jos. */
@media (max-width: 480px) {
	#zestrero-a11y-panel,
	#zestrero-a11y-panel.zestrero-pos-bottom-right,
	#zestrero-a11y-panel.zestrero-pos-bottom-left,
	#zestrero-a11y-panel.zestrero-pos-top-right,
	#zestrero-a11y-panel.zestrero-pos-top-left {
		left: 8px;
		right: 8px;
		width: auto;
		max-width: none;
	}
}

/* Elementul focalizat nu trebuie ascuns de widget la derulare (2.4.11). */
html.zestrero-side-bottom { scroll-padding-bottom: 88px; }
html.zestrero-side-top    { scroll-padding-top: 88px; }

/* ---------- Mărire text (1.4.4) ---------- */

/* `zoom` scalează și textul definit în px (font-size pe <html> nu ar avea efect).
   Widgetul primește contra-zoom ca să rămână la dimensiunea lui normală. */
html.zestrero-fontsize-1 { zoom: 1.1 !important; }
html.zestrero-fontsize-2 { zoom: 1.2 !important; }
html.zestrero-fontsize-3 { zoom: 1.3 !important; }
html.zestrero-fontsize-4 { zoom: 1.4 !important; }

html.zestrero-fontsize-1 #zestrero-a11y-root { zoom: calc(1 / 1.1); }
html.zestrero-fontsize-2 #zestrero-a11y-root { zoom: calc(1 / 1.2); }
html.zestrero-fontsize-3 #zestrero-a11y-root { zoom: calc(1 / 1.3); }
html.zestrero-fontsize-4 #zestrero-a11y-root { zoom: calc(1 / 1.4); }

@supports not (zoom: 1) {
	html.zestrero-fontsize-1 { font-size: 110% !important; }
	html.zestrero-fontsize-2 { font-size: 120% !important; }
	html.zestrero-fontsize-3 { font-size: 130% !important; }
	html.zestrero-fontsize-4 { font-size: 140% !important; }
}

/* ---------- Contrast: întunecat / deschis / ridicat (widgetul propriu este exclus) ---------- */

body.zestrero-dark,
body.zestrero-dark *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) {
	background-color: #121212 !important;
	color: #f2f2f2 !important;
	border-color: #8c8c8c !important;
	text-shadow: none !important;
}

body.zestrero-dark a:not(#zestrero-a11y-root *),
body.zestrero-dark a:not(#zestrero-a11y-root *) * {
	color: #8ab4ff !important;
}

body.zestrero-dark *:focus-visible:not(#zestrero-a11y-root *) {
	outline: 3px solid #ffd54f !important;
	outline-offset: 2px !important;
}

body.zestrero-light,
body.zestrero-light *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) {
	background-color: #fff !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
}

body.zestrero-light a:not(#zestrero-a11y-root *),
body.zestrero-light a:not(#zestrero-a11y-root *) * {
	color: #0b3d91 !important;
}

body.zestrero-light *:focus-visible:not(#zestrero-a11y-root *) {
	outline: 3px solid #b30000 !important;
	outline-offset: 2px !important;
}

body.zestrero-contrast,
body.zestrero-contrast *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
}

body.zestrero-contrast a:not(#zestrero-a11y-root *),
body.zestrero-contrast a:not(#zestrero-a11y-root *) * {
	color: #ffe500 !important;
}

body.zestrero-contrast *:focus-visible:not(#zestrero-a11y-root *) {
	outline: 3px solid #ffe500 !important;
	outline-offset: 2px !important;
}

/* ---------- Saturație / monocrom (filtru pe <html>) ---------- */

html.zestrero-sathigh { filter: saturate(1.8); }
html.zestrero-satlow  { filter: saturate(0.4); }
html.zestrero-mono    { filter: grayscale(1); }

/* ---------- Evidențiere titluri și linkuri ---------- */

body.zestrero-titles :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#zestrero-a11y-root *) {
	outline: 3px solid #8a4b00 !important;
	outline-offset: 4px !important;
	background-color: #fff4cc !important;
	color: #1a1a1a !important;
}

body.zestrero-underline a:not(#zestrero-a11y-root *) {
	text-decoration: underline !important;
	text-decoration-thickness: 3px !important;
	text-underline-offset: 3px !important;
	background-color: #fff3a3 !important;
	color: #00205b !important;
}

/* ---------- Font pentru dislexie ---------- */

/* Se aplică pe elemente, cu excepția celor cu clase de iconițe, ca să nu se strice fonturile de iconițe. */
body.zestrero-dyslexia *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *):not([class*="icon"]):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons):not(.dashicons-before) {
	font-family: "OpenDyslexic", "Lexend", "Atkinson Hyperlegible", Verdana, Tahoma, sans-serif !important;
}

/* ---------- Spațiere litere, înălțime linie, grosime font (WCAG 1.4.8 / 1.4.12) ---------- */

body.zestrero-letterspacing *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) {
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}

body.zestrero-lineheight *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) {
	line-height: 1.8 !important;
}

body.zestrero-lineheight p:not(#zestrero-a11y-root *) {
	margin-bottom: 2em !important;
}

body.zestrero-bold :is(p, li, dd, dt, td, th, blockquote, figcaption, label, a, h1, h2, h3, h4, h5, h6, button, input, select, textarea, div):not(#zestrero-a11y-root):not(#zestrero-a11y-root *),
body.zestrero-bold span:not(#zestrero-a11y-root *):not([class*="icon"]):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons) {
	font-weight: 700 !important;
}

/* ---------- Aliniere text ---------- */

body.zestrero-align-left   *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) { text-align: left !important; }
body.zestrero-align-right  *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) { text-align: right !important; }
body.zestrero-align-center *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *) { text-align: center !important; }

/* ---------- Oprire animații (2.3.3) ---------- */

body.zestrero-motion *:not(#zestrero-a11y-root):not(#zestrero-a11y-root *),
body.zestrero-motion *:not(#zestrero-a11y-root *)::before,
body.zestrero-motion *:not(#zestrero-a11y-root *)::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* ---------- Cursor mare ---------- */

body.zestrero-cursor,
body.zestrero-cursor * {
	cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3v30l8-7 5 12 6-3-5-11h11z' fill='black' stroke='white' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

body.zestrero-cursor :is(a, button, [role="button"], input[type="submit"], input[type="button"], summary, select, label, [onclick]) {
	cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3v30l8-7 5 12 6-3-5-11h11z' fill='%23ffd400' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}

/* ---------- Ghid de citire ---------- */

#zestrero-guide {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	height: 52px;
	margin-top: -26px;
	box-sizing: border-box;
	pointer-events: none;
	z-index: 999990;
	background: rgba(255, 221, 0, 0.22);
	border-top: 3px solid #000;
	border-bottom: 3px solid #000;
	box-shadow: 0 0 0 1px #fff;
}

body.zestrero-guide #zestrero-guide {
	display: block;
}

/* ---------- Preferințe de sistem ---------- */

@media (prefers-reduced-motion: reduce) {
	#zestrero-a11y-btn {
		transition: none;
	}
	#zestrero-a11y-btn:hover,
	#zestrero-a11y-panel button.zestrero-option,
	#zestrero-a11y-panel button.zestrero-option:hover {
		transform: none;
		transition: none;
	}
}

@media (forced-colors: active) {
	#zestrero-a11y-btn,
	#zestrero-a11y-panel,
	#zestrero-a11y-panel button.zestrero-option {
		border: 2px solid CanvasText;
	}
	#zestrero-a11y-panel button.zestrero-active {
		background: Highlight;
		color: HighlightText;
	}
	#zestrero-a11y-panel .zestrero-header {
		background: Canvas;
		color: CanvasText;
		border-bottom: 2px solid CanvasText;
	}
	#zestrero-a11y-panel h2,
	#zestrero-a11y-panel .zestrero-close {
		color: CanvasText;
	}
	#zestrero-a11y-panel button.zestrero-active .zestrero-check {
		background: HighlightText;
		color: Highlight;
		border-color: HighlightText;
	}
	#zestrero-guide {
		border-color: CanvasText;
	}
}
