/* ============================================================
   bering — бренд-токены. Меняете цвета здесь — перекрашивается
   вся тема. Подобрано по kamgu.ru / edu.kamgu.ru.
   ============================================================ */
:root {
  --brand-primary: #16235c;   /* тёмно-синий: шапка, футер, заголовки */
  --brand-primary-2: #0e1a45; /* глубокий синий: футер, градиенты */
  --brand-accent:  #2bb3a3;   /* бирюзовый: кнопки, hover, активные пункты */
  --brand-bg:      #f5f6fa;   /* фон страницы */
  --text:          #1f2430;
  --muted:         #5c6472;
  --border:        #e2e5ee;
  --radius:        12px;
  --container:     1160px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background: var(--brand-bg); font-size: 16px; line-height: 1.55;
}
a { color: var(--brand-primary); }
img { max-width: 100%; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand-accent);
  color: #fff; padding: 8px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.btn {
  display: inline-block; background: var(--brand-accent); color: #fff;
  padding: 12px 24px; border-radius: 10px; text-decoration: none; font-weight: 500;
}
.btn:hover { filter: brightness(1.08); }

/* ---------- topbar ---------- */
.topbar { background: var(--brand-primary-2); color: #cdd3e6; font-size: 13px; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; flex-wrap: wrap; }
.topbar a, .topbar__link { color: #cdd3e6; text-decoration: none; background: none; border: none; cursor: pointer; font-size: 13px; padding: 0; }
.topbar a:hover, .topbar__link:hover { color: #fff; }
.topbar__contacts, .topbar__links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---------- header ---------- */
.header { background: #fff; border-bottom: 1px solid var(--border); }
.header__in { display: flex; align-items: center; gap: 24px; padding: 16px 20px; }
.header__brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text); flex: 1; min-width: 0; }
.header__logo { flex: none; }
.header__names { min-width: 0; }
.header__name { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; color: var(--brand-primary); }
.header__sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.header__search { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex: none; }
.header__search input { border: none; outline: none; padding: 9px 12px; width: 200px; font-size: 14px; }
.header__search button { border: none; background: var(--brand-primary); color: #fff; padding: 0 14px; font-size: 18px; cursor: pointer; }
.header__search button:hover { background: var(--brand-accent); }

/* ---------- nav ---------- */
.nav { background: #fff; border-bottom: 1px solid var(--border); position: relative; }
.nav__in { display: flex; align-items: center; }
.nav__toggle { display: none; }
.nav__burger { display: none; flex-direction: column; gap: 4px; padding: 14px 0; cursor: pointer; }
.nav__burger span { width: 22px; height: 2px; background: var(--brand-primary); border-radius: 2px; }
.nav__list { display: flex; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }
.nav__link {
  display: block; padding: 14px 16px; color: var(--text); text-decoration: none; font-size: 15px;
  border-bottom: 3px solid transparent;
}
.nav__link:hover { color: var(--brand-primary); background: var(--brand-bg); }
.nav__caret { font-size: 11px; color: var(--muted); }
.nav__sub {
  position: absolute; top: 100%; left: 0; min-width: 260px; list-style: none; margin: 0; padding: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 12px 28px rgba(14, 26, 69, .12); display: none; z-index: 20;
}
.nav__sub a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.nav__sub a:hover { background: var(--brand-bg); color: var(--brand-primary); }
.nav__item:hover .nav__sub, .nav__item:focus-within .nav__sub { display: block; }
.nav__item:hover .nav__link { border-bottom-color: var(--brand-accent); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand-primary-2), var(--brand-primary));
  background-size: cover; background-position: center; color: #fff;
}
.hero__in { padding: 72px 20px; }
.hero__title { margin: 0 0 8px; font-size: 34px; font-weight: 600; max-width: 720px; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.hero__sub { margin: 0 0 24px; font-size: 17px; max-width: 560px; opacity: .92; text-shadow: 0 1px 8px rgba(0,0,0,.45); }

/* ---------- sections ---------- */
.section { padding: 40px 0; }
.section--muted { background: #fff; }
.section h2 { margin: 0 0 20px; font-size: 24px; color: var(--brand-primary); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.section__all { font-size: 14px; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; color: var(--text); font-weight: 500;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--brand-accent); transform: translateY(-2px); color: var(--brand-primary); }

/* ---------- cards ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__img { width: 100%; height: 170px; object-fit: cover; }
.card__body { padding: 16px 18px 18px; }
.card__meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.card__tag { background: color-mix(in srgb, var(--brand-accent) 14%, #fff); color: var(--brand-primary); padding: 2px 10px; border-radius: 6px; }
.card__title { margin: 0 0 8px; font-size: 17px; line-height: 1.3; }
.card__title a { text-decoration: none; color: var(--text); }
.card__title a:hover { color: var(--brand-primary); }
.card__sum { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- page ---------- */
.page { padding: 32px 20px 48px; max-width: 880px; }
.page h1 { font-size: 28px; color: var(--brand-primary); margin: 16px 0; }
.page__img { border-radius: var(--radius); margin: 12px 0; }
.page-list { line-height: 2; }
.breadcrumbs { padding-top: 16px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-primary); }

/* ---------- footer ---------- */
.footer { background: var(--brand-primary-2); color: #b9c0d8; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding: 40px 20px; }
.footer__title { color: #fff; font-weight: 600; margin-bottom: 12px; }
.footer a { color: #b9c0d8; text-decoration: none; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; line-height: 2; }
.footer p { font-size: 14px; line-height: 1.8; margin: 0; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 0; font-size: 13px; }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .header__search { display: none; }
  .header__name { font-size: 16px; }
  .nav__burger { display: flex; }
  .nav__list { display: none; flex-direction: column; width: 100%; padding: 8px 0 16px; }
  .nav__toggle:checked ~ .nav__list { display: flex; }
  .nav__sub { position: static; box-shadow: none; border: none; border-left: 2px solid var(--border); border-radius: 0; margin-left: 16px; }
  .nav__item:hover .nav__sub { display: none; }
  .nav__item:focus-within .nav__sub { display: block; }
  .hero__in { padding: 48px 20px; }
  .hero__title { font-size: 26px; }
}

/* ---------- версия для слабовидящих ---------- */
.a11y body, .a11y { font-size: 19px; }
.a11y body { background: #fff; }
.a11y .hero__title, .a11y .hero__sub { text-shadow: none; }
.a11y .card__sum, .a11y .footer, .a11y .topbar { color: #000; }
.a11y .card, .a11y .tile, .a11y .header__search { border: 2px solid #000; }
.a11y a { text-decoration: underline; }
