@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/opendyslexic-regular-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html.darkmode, html.darkmode body {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

html.darkmode a {
  color: #90caf9 !important;
}

html.darkmode header,
html.darkmode footer,
html.darkmode main,
html.darkmode section,
html.darkmode article,
html.darkmode aside,
html.darkmode nav,
html.darkmode .wp-block-group,
html.darkmode .wp-block-cover,
html.darkmode .site,
html.darkmode .entry-content,
html.darkmode .container {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

html.darkmode .widget,
html.darkmode .wp-block-widget,
html.darkmode .wp-block-search,
html.darkmode .menu {
  background-color: #1e1e1e !important;
  color: #ccc !important;
}

html.darkmode body:not(.accessibility-widget) button:not(.accessibility-widget *),
html.darkmode body:not(.accessibility-widget) input:not(.accessibility-widget *),
html.darkmode body:not(.accessibility-widget) select:not(.accessibility-widget *),
html.darkmode body:not(.accessibility-widget) textarea:not(.accessibility-widget *) {

  background-color: #2c2c2c !important;
  color: #fff !important;
  border-color: #444 !important;
}

html.darkmode .button,
html.darkmode .btn,
html.darkmode .wp-block-button__link {
  background-color: #333 !important;
  color: #fff !important;
  border-color: #444 !important;
}

html.darkmode img,
html.darkmode video {
  opacity: 0.9;
  filter: brightness(0.9) contrast(1.05);
}

body.dyslexic-mode *:not(.accessibility-widget):not(.accessibility-widget *):not(#wcagWidgetPanel):not(#wcagWidgetPanel *):not(i):not([class*="icon"]):not([aria-hidden="true"]) {
  font-family: 'OpenDyslexic', Arial, sans-serif !important;
  letter-spacing: 0.08em !important;
  word-spacing: 0.16em !important;
  line-height: 1.7 !important;
  font-size: 1.05em !important;
}


body.high-contrast {
  background-color: #000 !important;
  color: #fff !important;
}

body.high-contrast a,
body.high-contrast a:visited {
  color: #0ff !important;
  text-decoration: underline !important;
}

body.high-contrast button:not(.accessibility-widget *):not(#wcagWidgetPanel *),
body.high-contrast input[type="submit"]:not(.accessibility-widget *):not(#wcagWidgetPanel *),
body.high-contrast .button:not(.accessibility-widget *):not(#wcagWidgetPanel *) {

  background-color: #222 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

body.high-contrast header,
body.high-contrast footer,
body.high-contrast section,
body.high-contrast div {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.high-contrast img {
  opacity: 1 !important;
  filter: none !important;
}

body.font-large p,
body.font-large li,
body.font-large h1,
body.font-large h2,
body.font-large h3,
body.font-large span,
body.font-large a {
  font-size: 110% !important;
}

body.font-xlarge p,
body.font-xlarge li,
body.font-xlarge h1,
body.font-xlarge h2,
body.font-xlarge h3,
body.font-xlarge span,
body.font-xlarge a {
  font-size: 125% !important;
}
.no-motion-wcag *, 
.no-motion-wcag *::before, 
.no-motion-wcag *::after {
  animation-duration: 0.01s !important;
  animation-delay: 0s !important;
  transition-duration: 0.01s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

body.show-links a {
  text-decoration: underline !important;
  background-color: #fffaa6 !important;
  color: #0000cc !important;
  padding: 2px 4px;
  border-radius: 4px;
}

body.show-links a:focus {
  outline: 2px dashed #0000cc !important;
  outline-offset: 2px;
}

/* Cursor mare */
body.cursor-big {
  cursor: url('../cursors/crs4.cur'), auto !important;
}

body.cursor-focus .focus-ring {
  position: absolute;
  z-index: 99999;
  border: 3px solid #00b7ff;
  border-radius: 6px;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 3px rgba(0,183,255,0.4);
}
.focus-ring {
  position: absolute;
  z-index: 99999;
  border: 3px solid #00b7ff;
  border-radius: 6px;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 3px rgba(0, 183, 255, 0.4);
}
.focus-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 3px; /* Poți schimba grosimea */
  background: red; /* Poți personaliza culoarea */
  pointer-events: none;
  z-index: 999999;
  transition: top 0.05s ease;
}
.focus-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999999;
  background: 
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.6) 0,
      rgba(0, 0, 0, 0.6) var(--focus-top),
      rgba(0, 0, 0, 0) var(--focus-top),
      rgba(0, 0, 0, 0) calc(var(--focus-top) + var(--focus-height)),
      rgba(0, 0, 0, 0.6) calc(var(--focus-top) + var(--focus-height)),
      rgba(0, 0, 0, 0.6) 100%
    );
  transition: background 0.05s ease-out;
}
body.show-structure h1 {
  outline: 3px solid #ff0000 !important;
  outline-offset: 2px;
}

body.show-structure h2 {
  outline: 3px solid #ff6600 !important;
  outline-offset: 2px;
}
body.text-left-align p,
body.text-left-align li,
body.text-left-align div,
body.text-left-align span {
  text-align: left !important;
}
body.show-tooltips abbr[title]::after {
  content: " (" attr(title) ")";
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}
body.readable-width main,
body.readable-width article,
body.readable-width .entry-content {
  max-width: 70ch !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.show-structure h3 {
  outline: 3px solid #ffcc00 !important;
  outline-offset: 2px;
}

body.show-structure main {
  outline: 3px solid #00ff00 !important;
  outline-offset: 2px;
}

body.show-structure nav {
  outline: 3px solid #0099ff !important;
  outline-offset: 2px;
}

body.show-structure header::before,
body.show-structure main::before,
body.show-structure footer::before,
body.show-structure nav::before {
  content: attr(role);
  position: absolute;
  top: -20px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 2px 8px;
  font-size: 11px;
  z-index: 99999;
}
body.line-height-increased p,
body.line-height-increased li,
body.line-height-increased span,
body.line-height-increased div {
  line-height: 2.2 !important;
}

body.letter-spacing-increased p,
body.letter-spacing-increased li,
body.letter-spacing-increased span,
body.letter-spacing-increased div {
  letter-spacing: 0.15em !important;
  word-spacing: 0.3em !important;
}
/* Stil focus clar – linie evidențiată albastră */
body.cursor-focus a:focus,
body.cursor-focus button:focus,
body.cursor-focus input:focus,
body.cursor-focus textarea:focus,
body.cursor-focus select:focus {
  outline: 4px solid #0094ff !important;
  outline-offset: 2px !important;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(0, 148, 255, 0.4) !important;
  transition: none !important;
}
body.cursor-focus *:focus::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 4px;
  background: #00ffae;
}
/* Ascunde complet imaginile */
body.hide-images img,
body.hide-images picture,
body.hide-images svg,
body.hide-images figure,
body.hide-images .wp-block-image,
body.hide-images [style*="background-image"] {
  display: none !important;
  visibility: hidden !important;
}
/* Reading Guide - linie orizontală de urmărire */

body.hide-images img::after {
  content: "Imagine ascunsă";
  display: block;
  color: #666;
  font-style: italic;
}

.accessibility-widget {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  justify-content: space-between;
  gap: 8px;
  width: 280px;
  font-family: 'Segoe UI', sans-serif;
}
.accessibility-widget button {
  flex: 1 1 48%;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease-in-out;
  justify-content: center;
}
.wcag-speak-selected {
  background: #0073aa;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.wcag-speak-selected:hover {
  background: #005f8d;
}
.wcag-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.wcag-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.wcag-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wcag-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
#wcagWidgetPanel button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#wcagWidgetPanel button .label {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
}

#wcagWidgetPanel button .shortcut {
  font-size: 10px;
  font-style: italic;
  color: #555;
  margin-top: 0px; 
  line-height: 1.1;
}
.wcag-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.wcag-switch input:checked + .slider {
  background-color: #0073aa;
}

.wcag-switch input:checked + .slider:before {
  transform: translateX(20px);
}

.accessibility-widget button:hover {
background: #dfeaff;
  border-color: #0077cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.accessibility-widget button:active {
 transform: scale(0.97);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.accessibility-widget .icon {
  font-size: 18px;
}
button:focus-visible {
  outline: 3px solid #0094ff;
  outline-offset: 2px;
  border-radius: 6px;
}
.accessibility-widget button:focus-visible {
  outline: 3px solid #0094ff;
  box-shadow: 0 0 0 4px rgba(0, 148, 255, 0.3);
  border-radius: 12px;
}
#accessibility-widget button.active {
  background-color: #0066cc !important;
  color: #fff !important;
  border: 1px solid #004080;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
}
#wcagWidgetPanel {
  pointer-events: auto !important;
  z-index: 9999 !important;
  opacity: 1 !important;
}

#wcagWidgetPanel button {
  pointer-events: auto !important;
  cursor: pointer;
}
.accessibility-widget .font-group {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.accessibility-widget .font-group button {
  flex: 1 1 50%;
}
.accessibility-widget button,
.accessibility-widget select {
	 z-index: 99999;
  position: relative
  flex: 1 1 45%;
  font-size: 14px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #999;
  background: #f5f5f5;
  cursor: pointer;
}

.accessibility-widget select {
  font-size: 13px;
}
html.grayscale img,
html.grayscale picture,
html.grayscale video,
html.grayscale svg,
html.grayscale figure,
html.grayscale input[type="image"],
html.grayscale a,
html.grayscale button,
html.grayscale header,
html.grayscale footer,
html.grayscale main,
html.grayscale section,
html.grayscale div[class*="bg"],
html.grayscale .wp-block-cover,
html.grayscale .wp-block-image {
  filter: grayscale(100%) !important;
  -webkit-filter: grayscale(100%) !important;
}

#wcag-credit {
  text-align: center;
  font-size: 11px;
  margin-top: 8px;
  color: #666;
  font-style: italic;
}

#wcag-credit a {
  color: #333;
  text-decoration: none;
  font-weight: bold;
}

#wcag-credit a:hover {
  text-decoration: underline;
}
#wcagWidgetToggle {
  animation: wcagPulse 2.5s infinite;
  transition: transform 0.2s ease;
}

#wcagWidgetToggle:hover {
  transform: scale(1.1);
}

@keyframes wcagPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 148, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 148, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 148, 255, 0);
  }
}
button small {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  font-style: italic;
  line-height: 1;
}
button .label {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  color: #000; /* poți schimba în #000 pentru contrast maxim */
}

button .shortcut {
  display: block;
  font-size: 12px;
  color: #444;
  font-style: italic;
  line-height: 1;
  margin-top: 2px;
}
button.active {
  background-color: #0066cc;
  color: #fff;
  border: 2px solid #003d80;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.settings-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-section h2 {
  margin-top: 0;
  font-size: 18px;
}

input[type="text"], select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  margin-top: 5px;
  margin-bottom: 15px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.valid-license {
  color: #1e7e34;
  font-weight: bold;
}

.invalid-license {
  color: #dc3545;
  font-weight: bold;
}
#wcagWidgetPanel {
  animation: fadeInScale 0.3s ease-out forwards;
  transform-origin: bottom right;
  opacity: 0;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 768px) {
  .accessibility-widget .shortcut {
    display: none !important;
  }
}
/* ==================== REDESIGN WIDGET v2.0 ==================== */

#wcagWidgetPanel {
    width: 340px;
    max-height: 85vh;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

/* Tab Navigation */
.wcag-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.wcag-tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wcag-tab-btn:hover {
    background: #e9ecef;
    color: #000;
}

.wcag-tab-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #fff;
}

.wcag-tab-btn .tab-icon {
    font-size: 18px;
}

.wcag-tab-btn .tab-label {
    font-size: 11px;
    line-height: 1;
}

/* Tab Content */
.wcag-tab-content {
    display: none;
}

.wcag-tab-content.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Button Redesign */
#wcagWidgetPanel button:not(.wcag-tab-btn) {
    min-height: 70px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
}

#wcagWidgetPanel button:not(.wcag-tab-btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    border-color: #0073aa;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
}

#wcagWidgetPanel button:not(.wcag-tab-btn).active {
    background: linear-gradient(135deg, #0073aa 0%, #005f8d 100%);
    color: #fff;
    border-color: #004d73;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#wcagWidgetPanel button:not(.wcag-tab-btn).active .label,
#wcagWidgetPanel button:not(.wcag-tab-btn).active .shortcut {
    color: #fff !important;
}

#wcagWidgetPanel button .btn-icon {
    font-size: 24px;
    line-height: 1;
}

#wcagWidgetPanel button .label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
    text-align: center;
}

#wcagWidgetPanel button .shortcut {
    font-size: 9px;
    color: #7f8c8d;
    font-style: italic;
    line-height: 1;
}

/* Full width buttons */
.wcag-full-width {
    grid-column: 1 / -1;
}

/* Toggle Switch Styling */
.wcag-toggle-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

.wcag-toggle-row .label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.wcag-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.wcag-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wcag-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}

.wcag-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wcag-switch input:checked + .slider {
    background-color: #0073aa;
}

.wcag-switch input:checked + .slider:before {
    transform: translateX(24px);
}

/* Footer Section */
.wcag-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e1e4e8;
}

#wcag-credit {
    text-align: center;
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.4;
    margin-bottom: 8px;
}

#wcag-credit a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

#wcag-credit a:hover {
    text-decoration: underline;
}

#wcag-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#wcag-links a {
    display: block;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #0073aa;
    text-decoration: none;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

#wcag-links a:hover {
    background: #e3f2fd;
    border-color: #0073aa;
    transform: translateX(2px);
}

/* Scrollbar styling */
#wcagWidgetPanel::-webkit-scrollbar {
    width: 8px;
}

#wcagWidgetPanel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#wcagWidgetPanel::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 10px;
}

#wcagWidgetPanel::-webkit-scrollbar-thumb:hover {
    background: #005f8d;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #wcagWidgetPanel {
        width: 95vw;
        max-width: 320px;
    }
    
    .wcag-tab-btn .tab-label {
        font-size: 10px;
    }
    
    #wcagWidgetPanel button .shortcut {
        display: none;
    }
    
    #wcagWidgetPanel button:not(.wcag-tab-btn) {
        min-height: 60px;
    }
}

/* Animation pentru tab switch */
.wcag-tab-content.active {
    animation: fadeInTab 0.3s ease-in-out;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ==================== READING GUIDE v2.0 - FIX COMPLET ==================== */

.reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(
        to right,
        rgba(255, 215, 0, 0) 0%,
        rgba(255, 215, 0, 1) 5%,
        rgba(255, 215, 0, 1) 95%,
        rgba(255, 215, 0, 0) 100%
    );
    pointer-events: none;
    z-index: 999998;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8),
                0 0 30px rgba(255, 215, 0, 0.4),
                0 2px 5px rgba(0, 0, 0, 0.3);
    will-change: top;
}

.reading-guide::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGuide 2s ease-in-out infinite;
}

@keyframes pulseGuide {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
}

.reading-guide-overlay-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 999997;
    background: rgba(0, 0, 0, 0.5);
    will-change: height;
}

.reading-guide-overlay-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 999997;
    background: rgba(0, 0, 0, 0.5);
    will-change: height;
}

/* Efect de trecere graduală între zonele obscurizate și zona clară */
.reading-guide-overlay-top::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}

.reading-guide-overlay-bottom::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

/* Dark Mode */
html.darkmode .reading-guide {
    background: linear-gradient(
        to right,
        rgba(255, 255, 0, 0) 0%,
        rgba(255, 255, 0, 1) 5%,
        rgba(255, 255, 0, 1) 95%,
        rgba(255, 255, 0, 0) 100%
    );
    box-shadow: 0 0 20px rgba(255, 255, 0, 1),
                0 0 40px rgba(255, 255, 0, 0.6);
}

html.darkmode .reading-guide-overlay-top,
html.darkmode .reading-guide-overlay-bottom {
    background: rgba(0, 0, 0, 0.7);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .reading-guide {
        height: 6px;
        background: yellow;
        box-shadow: 0 0 20px yellow;
    }
    
    .reading-guide-overlay-top,
    .reading-guide-overlay-bottom {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .reading-guide {
        height: 4px;
    }
    
    .reading-guide-overlay-top,
    .reading-guide-overlay-bottom {
        background: rgba(0, 0, 0, 0.4);
    }
}

/* Asigură că widget-ul rămâne deasupra overlay-ului */
#wcagWidgetPanel,
#wcagWidgetToggle {
    z-index: 999999 !important;
}
/* ==========================================================================
   v1.6.2 — Skip Links (CSP-safe, fără inline onfocus/onblur)
   ========================================================================== */
#wcag-skip-links {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100001;
}

.wcag-skip-link {
    position: absolute;
    top: -9999px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 10px 14px;
    z-index: 100001;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    transition: top 0.15s ease-out;
}

.wcag-skip-link:focus,
.wcag-skip-link:focus-visible {
    top: 10px;
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Al doilea skip link se poziționează lângă primul când primește focus */
.wcag-skip-link + .wcag-skip-link:focus,
.wcag-skip-link + .wcag-skip-link:focus-visible {
    left: 240px;
}

/* ==========================================================================
   v1.6.2 — Detectare panel deschis prin data-open (înlocuiește style.display)
   ========================================================================== */
#wcagWidgetPanel[data-open="false"] {
    display: none !important;
}

#wcagWidgetPanel[data-open="true"] {
    display: flex !important;
    flex-direction: column;
}

/* ==========================================================================
   v1.6.2 — Reading guide GPU-accelerat (transform în loc de height animat)
   ========================================================================== */
.reading-guide {
    position: fixed;
    top: 0; /* poziția reală controlată prin transform: translateY */
    left: 0;
    width: 100%;
    height: 80px;
    pointer-events: none;
    z-index: 99996;
    border-top: 2px solid rgba(0, 122, 204, 0.6);
    border-bottom: 2px solid rgba(0, 122, 204, 0.6);
    box-shadow: 0 0 12px rgba(0, 122, 204, 0.2);
    margin-top: -40px; /* centrarea pe punctul cursorului */
    background: transparent;
    transition: none; /* fără transition — folosim rAF */
    will-change: transform;
}

.reading-guide-overlay-top,
.reading-guide-overlay-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 99995;
    will-change: height;
    transition: none;
}

.reading-guide-overlay-top {
    top: 0;
}

.reading-guide-overlay-bottom {
    bottom: 0;
}

/* Override pentru orice ::before/::after care ar putea exista din versiuni vechi */
.reading-guide::before,
.reading-guide-overlay-top::after,
.reading-guide-overlay-bottom::before {
    content: none !important;
    display: none !important;
}
