/* =========================================================
   Версия для слабовидящих — accessible-mode.css
   Соответствует рекомендациям ГОСТ Р 52872-2019
   3 цветовых схемы: светлая / тёмная / жёлтая
   ========================================================= */

/* ── Переменные: светлая схема (по умолчанию) ── */
:root {
  --a-bg:           #ffffff;
  --a-surface:      #f2f2f0;
  --a-text:         #000000;
  --a-muted:        #222222;
  --a-accent:       #0e4b00;
  --a-accent-soft:  #dff0d8;
  --a-border:       #000000;
  --a-focus:        #0050a0;
  --a-font-scale:   1;
  --a-line-height:  1.6;
  --a-letter-space: 0;
  --a-images:       1;            /* 1 = показывать, 0 = скрывать */
}

/* ── Тёмная схема ── */
html.accessible-mode.a-scheme-dark {
  --a-bg:           #000000;
  --a-surface:      #1c1c1c;
  --a-text:         #ffffff;
  --a-muted:        #cccccc;
  --a-accent:       #7ad46a;
  --a-accent-soft:  #0b2405;
  --a-border:       #ffffff;
  --a-focus:        #ffcc00;
}

/* ── Жёлтая схема ── */
html.accessible-mode.a-scheme-yellow {
  --a-bg:           #f5e634;
  --a-surface:      #ede02a;
  --a-text:         #000000;
  --a-muted:        #1a1a00;
  --a-accent:       #002200;
  --a-accent-soft:  #d4cc00;
  --a-border:       #000000;
  --a-focus:        #0050a0;
}

/* ── Базовые стили ── */
html.accessible-mode {
  font-size: calc(18px * var(--a-font-scale));
  scroll-behavior: smooth;
}

html.accessible-mode body {
  margin: 0;
  font-family: Arial, "Segoe UI", Helvetica, system-ui, sans-serif;
  line-height: var(--a-line-height);
  letter-spacing: var(--a-letter-space);
  color: var(--a-text);
  background: var(--a-bg);
}

/* ── Ссылки ── */
html.accessible-mode a:not(.a-btn):not(.a-nav__link):not(.a-brand) {
  color: var(--a-accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

html.accessible-mode a.a-btn { color: var(--a-text); }
html.accessible-mode a.a-btn--accent,
html.accessible-mode button.a-btn--accent { color: var(--a-bg); }

html.accessible-mode a:focus-visible,
html.accessible-mode button:focus-visible {
  outline: 4px solid var(--a-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Скрыть изображения ── */
html.accessible-mode.a-no-images img {
  opacity: 0.04;
  filter: grayscale(1);
}

/* ── Skip-link ── */
.a-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.85rem 1.25rem;
  background: var(--a-text);
  color: var(--a-bg);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.a-skip:focus { left: 1rem; top: 1rem; }

/* ── Шапка ── */
/* ── Шапка — всегда тёмно-зелёная, независимо от цветовой схемы ── */
.a-header {
  background: #1b3a10;
  border-bottom: 3px solid #c9a84c;
  font-size: 15px;
  color: #fff;
}

/* Верхняя строка: логотип + навигация + кнопка «Настройки» */
.a-header__top {
  padding: 0.6rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 66rem;
  margin: 0 auto;
}

/* Панель настроек — скрыта по умолчанию */
.a-header__controls {
  display: none;
  border-top: 1px solid rgba(201,168,76,0.35);
  background: #142c0c;
}

.a-header__controls.is-open {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.65rem 1.1rem;
  max-width: 66rem;
  margin: 0 auto;
}

/* Кнопка «Настройки» */
.a-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid rgba(201,168,76,0.55);
  background: rgba(201,168,76,0.12);
  color: #f0d890;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
  transition: background 0.15s;
}

.a-settings-toggle:hover { background: rgba(201,168,76,0.22); }
.a-settings-toggle[aria-expanded="true"] {
  background: rgba(201,168,76,0.28);
  border-color: #c9a84c;
  color: #f5e0a0;
}

.a-header__inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

/* Логотип */
.a-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  line-height: 1.25;
}

.a-brand__cross {
  display: block;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  /* крест светлый на тёмном фоне — инвертируем + золотим */
  filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(2deg);
  opacity: 0.92;
}

.a-brand__text { display: block; }

.a-brand__line {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
}

.a-brand__line + .a-brand__line {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
}

/* Навигация */
.a-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.a-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.28rem 0.9rem;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.15s;
}

.a-nav__link.is-active {
  background: rgba(201,168,76,0.22);
  border-color: #c9a84c;
  color: #f5e0a0;
}

.a-nav__link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Панель настроек ── */
.a-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.a-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.a-toolbar-sep {
  width: 1px;
  height: 1.6rem;
  background: rgba(255,255,255,0.2);
  margin: 0 0.15rem;
}

.a-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-right: 0.1rem;
  white-space: nowrap;
}

/* Кнопки */
.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--a-border);
  background: var(--a-bg);
  color: var(--a-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.a-btn:hover { background: var(--a-surface); }

.a-btn--accent {
  background: var(--a-accent);
  border-color: var(--a-accent);
  color: var(--a-bg);
}

.a-btn--accent:hover {
  filter: brightness(1.12);
  color: var(--a-bg);
}

.a-btn--wide {
  width: 100%;
  min-height: 3.5rem;
  font-size: 1.05rem;
  justify-content: flex-start;
  padding-inline: 1.1rem;
}

.a-btn--active {
  background: var(--a-accent-soft);
  border-color: var(--a-accent);
  color: var(--a-accent);
}

/* Схема: кружки с буквами */
.a-scheme-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.a-scheme-btn--white  { background: #fff;    color: #000; border-color: rgba(255,255,255,0.6); }
.a-scheme-btn--dark   { background: #000;    color: #fff; border-color: rgba(255,255,255,0.4); }
.a-scheme-btn--yellow { background: #f5e634; color: #000; border-color: rgba(255,255,255,0.4); }

.a-scheme-btn.a-btn--active {
  outline: 2px solid #c9a84c;
  outline-offset: 2px;
}

/* Кнопки шрифта и схемы — внутри панели настроек (тёмный фон) */
.a-font-btn {
  padding: 0.3rem 0.65rem;
  min-height: 30px;
  font-size: 13px;
  letter-spacing: 0;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.a-font-btn:hover {
  background: rgba(255,255,255,0.18);
}

.a-font-btn.a-btn--active {
  background: rgba(201,168,76,0.3);
  border-color: #c9a84c;
  color: #f5e0a0;
}

/* Кнопка "вернуться" */
.a-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0.28rem 0.75rem;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.a-back-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Контент ── */
.a-main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

.a-page-title {
  margin: 0 0 0.6rem;
  font-size: 1.85rem;
  line-height: 1.2;
  font-weight: 900;
}

.a-lead {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  color: var(--a-muted);
  max-width: 48rem;
}

/* Карточки */
.a-card {
  border: 3px solid var(--a-border);
  background: var(--a-surface);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
  border-radius: 0.35rem;
}

.a-card--highlight {
  background: var(--a-accent-soft);
  border-color: var(--a-accent);
  border-width: 3px;
}

.a-card__label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--a-muted);
}

.a-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.2;
}

.a-card__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: var(--a-line-height);
}

/* Действия */
.a-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

/* Службы */
.a-service {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 0;
  border-bottom: 2px solid var(--a-border);
  opacity: 0.85;
}

.a-service:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.a-service__time {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--a-accent);
}

.a-service__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.a-service__desc {
  margin: 0;
  font-size: 1rem;
  color: var(--a-muted);
}

/* Навигация по дням недели */
.a-week-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.a-week-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--a-border);
  background: var(--a-bg);
  text-decoration: none;
  color: var(--a-text);
  font-weight: 700;
  border-radius: 0.25rem;
}

.a-week-list a.is-active {
  background: var(--a-accent-soft);
  border-color: var(--a-accent);
  color: var(--a-accent);
}

.a-week-list a:hover { background: var(--a-surface); }

/* Навигация день назад / вперёд */
.a-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.25rem;
}

/* Телефон */
.a-phone {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.a-phone a {
  color: var(--a-accent);
  text-decoration: underline;
}

/* Новости */
.a-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.a-news-list .a-card__title a {
  color: var(--a-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.a-news-list .a-card__title a:hover { color: var(--a-accent); }

/* Статья */
.a-article-body {
  font-size: 1.1rem;
  line-height: var(--a-line-height);
  color: var(--a-text);
}

.a-article-body p { margin: 0 0 1rem; }

/* Изображения в статье */
.a-figure {
  margin: 1.1rem 0 0;
  border: 2px solid var(--a-border);
  background: var(--a-surface);
  padding: 0.65rem;
  border-radius: 0.25rem;
}

.a-figure__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 28rem;
  object-fit: contain;
  background: var(--a-surface);
}

.a-figure__caption {
  margin: 0.65rem 0 0;
  font-size: 1rem;
  color: var(--a-muted);
}

/* Галерея */
.a-gallery-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

.a-gallery-item {
  margin: 0;
  border: 2px solid var(--a-border);
  background: var(--a-surface);
  padding: 0.75rem;
  border-radius: 0.25rem;
}

.a-gallery-item__img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 10rem;
  max-height: 30rem;
  object-fit: contain;
  background: var(--a-surface);
}

.a-gallery-item__caption {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.a-gallery-item__caption strong {
  font-size: 1.1rem;
}

/* Подвал */
.a-footer {
  border-top: 4px solid var(--a-border);
  background: var(--a-surface);
  color: var(--a-text);
  padding: 1.5rem 1.25rem 2rem;
}

.a-footer__inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 2.5rem;
  align-items: flex-start;
}

.a-footer p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  width: 100%;
}

.a-footer a {
  color: var(--a-accent);
  font-weight: 700;
}

/* ── Адаптив ── */
@media (min-width: 640px) {
  .a-nav { flex: 1; justify-content: center; }
  .a-header__inner { flex-wrap: nowrap; }
  .a-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .a-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .a-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ── Авт. уменьшение движения ── */
@media (prefers-reduced-motion: reduce) {
  html.accessible-mode { scroll-behavior: auto; }
}
