/* ==========================================================================
   BVI (Blind & Visually Impaired) Accessibility Stylesheet
   ГОСТ Р 52872-2019 / WCAG 2.1 for sch613.ru
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Control Panel Toolbar (Фиксированные размеры и изоляция)
   -------------------------------------------------------------------------- */
.bvi-panel,
.bvi-panel * {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  letter-spacing: normal !important;
  line-height: 1.35 !important;
  text-transform: none !important;
  box-sizing: border-box !important;
}

.bvi-panel {
  display: none;
  background-color: #f1f5f9;
  border-bottom: 2px solid #334155;
  padding: 8px 0;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100000;
}

html.bvi-active .bvi-panel {
  display: block;
}

.bvi-panel-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 14px;
}

.bvi-block {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.bvi-label {
  font-weight: 700 !important;
  font-size: 12.5px !important;
  color: inherit;
  margin-right: 2px;
}

.bvi-group {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.bvi-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px 8px !important;
  min-height: 28px !important;
  height: 28px !important;
  background-color: #ffffff;
  color: #0f172a !important;
  border: 1.5px solid #64748b !important;
  border-radius: 4px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.bvi-btn:hover {
  background-color: #e2e8f0;
  border-color: #0f172a !important;
}

.bvi-btn.active {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Theme Icons / Buttons in Panel */
.bvi-theme-btn-white { background-color: #ffffff !important; color: #000000 !important; border-color: #000000 !important; }
.bvi-theme-btn-black { background-color: #000000 !important; color: #ffffff !important; border-color: #ffffff !important; }
.bvi-theme-btn-blue  { background-color: #c7e4ff !important; color: #063462 !important; border-color: #063462 !important; }
.bvi-theme-btn-brown { background-color: #f7f3d6 !important; color: #4d4b43 !important; border-color: #4d4b43 !important; }
.bvi-theme-btn-green { background-color: #3b2716 !important; color: #a9e44d !important; border-color: #a9e44d !important; }

.bvi-btn-close {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #ef4444 !important;
  font-weight: 700 !important;
  margin-left: auto;
}

.bvi-btn-close:hover {
  background-color: #fca5a5 !important;
  color: #7f1d1d !important;
  border-color: #b91c1c !important;
}

/* --------------------------------------------------------------------------
   2. Font Scaling (Влияет только на контент сайта, не затрагивая панель)
   -------------------------------------------------------------------------- */
html.bvi-font-small body { font-size: 16px !important; }
html.bvi-font-medium body { font-size: 20px !important; }
html.bvi-font-large body { font-size: 24px !important; }

html.bvi-font-small h1, html.bvi-font-small .page-header-title { font-size: 28px !important; }
html.bvi-font-medium h1, html.bvi-font-medium .page-header-title { font-size: 34px !important; }
html.bvi-font-large h1, html.bvi-font-large .page-header-title { font-size: 40px !important; }

html.bvi-font-small h2, html.bvi-font-small .section-title-wrap h2 { font-size: 24px !important; }
html.bvi-font-medium h2, html.bvi-font-medium .section-title-wrap h2 { font-size: 28px !important; }
html.bvi-font-large h2, html.bvi-font-large .section-title-wrap h2 { font-size: 34px !important; }

html.bvi-font-small h3, html.bvi-font-small .tile-title, html.bvi-font-small .news-title { font-size: 20px !important; }
html.bvi-font-medium h3, html.bvi-font-medium .tile-title, html.bvi-font-medium .news-title { font-size: 24px !important; }
html.bvi-font-large h3, html.bvi-font-large .tile-title, html.bvi-font-large .news-title { font-size: 28px !important; }

html.bvi-active body *:not(.bvi-panel):not(.bvi-panel *) p,
html.bvi-active body *:not(.bvi-panel):not(.bvi-panel *) li,
html.bvi-active body *:not(.bvi-panel):not(.bvi-panel *) td,
html.bvi-active body *:not(.bvi-panel):not(.bvi-panel *) th {
  font-size: 1em !important;
  line-height: 1.6 !important;
}

/* --------------------------------------------------------------------------
   3. Font Family
   -------------------------------------------------------------------------- */
html.bvi-family-sans body *:not(.bvi-panel):not(.bvi-panel *) {
  font-family: Arial, "Helvetica Neue", sans-serif !important;
}

html.bvi-family-serif body *:not(.bvi-panel):not(.bvi-panel *) {
  font-family: "Times New Roman", Times, Georgia, serif !important;
}

/* --------------------------------------------------------------------------
   4. Letter Spacing (Kerning)
   -------------------------------------------------------------------------- */
html.bvi-spacing-normal body *:not(.bvi-panel):not(.bvi-panel *) { letter-spacing: normal !important; }
html.bvi-spacing-medium body *:not(.bvi-panel):not(.bvi-panel *) { letter-spacing: 1.5px !important; }
html.bvi-spacing-large body *:not(.bvi-panel):not(.bvi-panel *)  { letter-spacing: 3px !important; }


/* --------------------------------------------------------------------------
   5. Image Modes (Действует автоматически на ВСЕ изображения сайта)
   -------------------------------------------------------------------------- */
/* Ч/Б режим: переводит все фото, картинки, SVG и медиа в оттенки серого */
html.bvi-images-bw img,
html.bvi-images-bw picture,
html.bvi-images-bw figure,
html.bvi-images-bw video,
html.bvi-images-bw canvas,
html.bvi-images-bw .news-img,
html.bvi-images-bw .tile-icon,
html.bvi-images-bw svg:not(.bvi-panel *) {
  filter: grayscale(100%) !important;
}

/* Режим 'Выкл': скрывает все изображения, баннеры и медиа (кроме логотипа) */
html.bvi-images-off img:not(.brand-logo-img),
html.bvi-images-off picture,
html.bvi-images-off figure,
html.bvi-images-off video,
html.bvi-images-off canvas,
html.bvi-images-off .news-img-wrap,
html.bvi-images-off .tile-icon,
html.bvi-images-off .hero-section::before,
html.bvi-images-off [style*="background-image"]:not(.brand-logo) {
  display: none !important;
}


/* --------------------------------------------------------------------------
   6. High-Contrast Color Themes
   -------------------------------------------------------------------------- */

/* --- Theme 1: White (Чёрным по белому) --- */
html.bvi-theme-white body {
  background-color: #ffffff !important;
  color: #000000 !important;
}
html.bvi-theme-white .top-bar,
html.bvi-theme-white .main-header,
html.bvi-theme-white .main-nav,
html.bvi-theme-white .page-header,
html.bvi-theme-white .hero-section,
html.bvi-theme-white .content-card,
html.bvi-theme-white .sidebar,
html.bvi-theme-white .news-card,
html.bvi-theme-white .tile-card,
html.bvi-theme-white .main-footer,
html.bvi-theme-white .dropdown-menu {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #000000 !important;
  box-shadow: none !important;
}
html.bvi-theme-white a {
  color: #0000ee !important;
  text-decoration: underline !important;
}
html.bvi-theme-white a:hover {
  color: #000088 !important;
}
html.bvi-theme-white .btn,
html.bvi-theme-white .mobile-toggle,
html.bvi-theme-white .sidebar-item a,
html.bvi-theme-white .nav-link,
html.bvi-theme-white .dropdown-link {
  border: 2px solid #000000 !important;
  color: #000000 !important;
  background: #ffffff !important;
  text-decoration: none !important;
}
html.bvi-theme-white .btn:hover,
html.bvi-theme-white .mobile-toggle:hover,
html.bvi-theme-white .sidebar-item.active > a,
html.bvi-theme-white .nav-item.active > .nav-link {
  background: #000000 !important;
  color: #ffffff !important;
}

/* --- Theme 2: Black (Белым по чёрному / Инверсия) --- */
html.bvi-theme-black body {
  background-color: #000000 !important;
  color: #ffffff !important;
}
html.bvi-theme-black .bvi-panel {
  background-color: #1e293b !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}
html.bvi-theme-black .top-bar,
html.bvi-theme-black .main-header,
html.bvi-theme-black .main-nav,
html.bvi-theme-black .page-header,
html.bvi-theme-black .hero-section,
html.bvi-theme-black .content-card,
html.bvi-theme-black .sidebar,
html.bvi-theme-black .news-card,
html.bvi-theme-black .tile-card,
html.bvi-theme-black .main-footer,
html.bvi-theme-black .dropdown-menu {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
}
html.bvi-theme-black a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}
html.bvi-theme-black a:hover {
  color: #ffea70 !important;
}
html.bvi-theme-black .btn,
html.bvi-theme-black .mobile-toggle,
html.bvi-theme-black .sidebar-item a,
html.bvi-theme-black .nav-link,
html.bvi-theme-black .dropdown-link {
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  background: #000000 !important;
  text-decoration: none !important;
}
html.bvi-theme-black .btn:hover,
html.bvi-theme-black .mobile-toggle:hover,
html.bvi-theme-black .sidebar-item.active > a,
html.bvi-theme-black .nav-item.active > .nav-link {
  background: #ffffff !important;
  color: #000000 !important;
}

/* --- Theme 3: Blue (Тёмно-синим по голубому) --- */
html.bvi-theme-blue body {
  background-color: #c7e4ff !important;
  color: #063462 !important;
}
html.bvi-theme-blue .bvi-panel {
  background-color: #9fd2ff !important;
  border-color: #063462 !important;
  color: #063462 !important;
}
html.bvi-theme-blue .top-bar,
html.bvi-theme-blue .main-header,
html.bvi-theme-blue .main-nav,
html.bvi-theme-blue .page-header,
html.bvi-theme-blue .hero-section,
html.bvi-theme-blue .content-card,
html.bvi-theme-blue .sidebar,
html.bvi-theme-blue .news-card,
html.bvi-theme-blue .tile-card,
html.bvi-theme-blue .main-footer,
html.bvi-theme-blue .dropdown-menu {
  background: #c7e4ff !important;
  color: #063462 !important;
  border-color: #063462 !important;
  box-shadow: none !important;
}
html.bvi-theme-blue a {
  color: #002244 !important;
  text-decoration: underline !important;
}
html.bvi-theme-blue .btn,
html.bvi-theme-blue .mobile-toggle,
html.bvi-theme-blue .sidebar-item a,
html.bvi-theme-blue .nav-link,
html.bvi-theme-blue .dropdown-link {
  border: 2px solid #063462 !important;
  color: #063462 !important;
  background: #c7e4ff !important;
  text-decoration: none !important;
}
html.bvi-theme-blue .btn:hover,
html.bvi-theme-blue .mobile-toggle:hover,
html.bvi-theme-blue .sidebar-item.active > a,
html.bvi-theme-blue .nav-item.active > .nav-link {
  background: #063462 !important;
  color: #ffffff !important;
}

/* --- Theme 4: Brown (Коричневым по бежевому) --- */
html.bvi-theme-brown body {
  background-color: #f7f3d6 !important;
  color: #4d4b43 !important;
}
html.bvi-theme-brown .bvi-panel {
  background-color: #eae3be !important;
  border-color: #4d4b43 !important;
  color: #4d4b43 !important;
}
html.bvi-theme-brown .top-bar,
html.bvi-theme-brown .main-header,
html.bvi-theme-brown .main-nav,
html.bvi-theme-brown .page-header,
html.bvi-theme-brown .hero-section,
html.bvi-theme-brown .content-card,
html.bvi-theme-brown .sidebar,
html.bvi-theme-brown .news-card,
html.bvi-theme-brown .tile-card,
html.bvi-theme-brown .main-footer,
html.bvi-theme-brown .dropdown-menu {
  background: #f7f3d6 !important;
  color: #4d4b43 !important;
  border-color: #4d4b43 !important;
  box-shadow: none !important;
}
html.bvi-theme-brown a {
  color: #2b1d0c !important;
  text-decoration: underline !important;
}
html.bvi-theme-brown .btn,
html.bvi-theme-brown .mobile-toggle,
html.bvi-theme-brown .sidebar-item a,
html.bvi-theme-brown .nav-link,
html.bvi-theme-brown .dropdown-link {
  border: 2px solid #4d4b43 !important;
  color: #4d4b43 !important;
  background: #f7f3d6 !important;
  text-decoration: none !important;
}
html.bvi-theme-brown .btn:hover,
html.bvi-theme-brown .mobile-toggle:hover,
html.bvi-theme-brown .sidebar-item.active > a,
html.bvi-theme-brown .nav-item.active > .nav-link {
  background: #4d4b43 !important;
  color: #f7f3d6 !important;
}

/* --- Theme 5: Green (Зелёным по тёмно-коричневому) --- */
html.bvi-theme-green body {
  background-color: #3b2716 !important;
  color: #a9e44d !important;
}
html.bvi-theme-green .bvi-panel {
  background-color: #28190d !important;
  border-color: #a9e44d !important;
  color: #a9e44d !important;
}
html.bvi-theme-green .top-bar,
html.bvi-theme-green .main-header,
html.bvi-theme-green .main-nav,
html.bvi-theme-green .page-header,
html.bvi-theme-green .hero-section,
html.bvi-theme-green .content-card,
html.bvi-theme-green .sidebar,
html.bvi-theme-green .news-card,
html.bvi-theme-green .tile-card,
html.bvi-theme-green .main-footer,
html.bvi-theme-green .dropdown-menu {
  background: #3b2716 !important;
  color: #a9e44d !important;
  border-color: #a9e44d !important;
  box-shadow: none !important;
}
html.bvi-theme-green a {
  color: #d2ff7b !important;
  text-decoration: underline !important;
}
html.bvi-theme-green .btn,
html.bvi-theme-green .mobile-toggle,
html.bvi-theme-green .sidebar-item a,
html.bvi-theme-green .nav-link,
html.bvi-theme-green .dropdown-link {
  border: 2px solid #a9e44d !important;
  color: #a9e44d !important;
  background: #3b2716 !important;
  text-decoration: none !important;
}
html.bvi-theme-green .btn:hover,
html.bvi-theme-green .mobile-toggle:hover,
html.bvi-theme-green .sidebar-item.active > a,
html.bvi-theme-green .nav-item.active > .nav-link {
  background: #a9e44d !important;
  color: #3b2716 !important;
}

/* --------------------------------------------------------------------------
   7. Form Inputs & Tables High Contrast Overrides
   -------------------------------------------------------------------------- */
html.bvi-active input,
html.bvi-active select,
html.bvi-active textarea {
  border: 2px solid currentColor !important;
  background: transparent !important;
  color: inherit !important;
  font-size: 1em !important;
  padding: 8px 12px !important;
}

html.bvi-active table,
html.bvi-active th,
html.bvi-active td {
  border: 1.5px solid currentColor !important;
}


/* --------------------------------------------------------------------------
   8. BVI Mobile Navigation Toggle
   -------------------------------------------------------------------------- */
html.bvi-active .mobile-toggle {
  display: none;
  font-weight: 700 !important;
  font-size: 1.1em !important;
  padding: 8px 16px !important;
  margin: 6px 0 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

@media (max-width: 768px) {
  html.bvi-active .mobile-toggle {
    display: inline-block !important;
  }
}
html.bvi-images-off .news-article-thumb {
  display: none !important;
}
