:root {
  --bg: #ffffff;
  --text: #222222;
  --accent-light: #4a7fbc;
  --logo-color: #1a3a5e;
  --menu-bg: #ffffff;
  --border: #e0e0e0;
  --menu-text: #334d66;
  --menu-hover: var(--accent-light);
  --card-overlay-dark: #1a3a5e;
  --overlay-bg: rgba(26, 58, 94, 0.85);
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

/* --- Шапка: единый блок по центру --- */
header.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--menu-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 14px 20px;
  box-sizing: border-box;
  white-space: nowrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--logo-color);
  text-decoration: none;
  white-space: nowrap;
}
.logo span.italic-solo {
  font-style: italic;
  font-weight: 600;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 26px;
  flex-wrap: nowrap;
}
nav a {
  text-decoration: none;
  color: var(--menu-text);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}
nav a:hover {
  color: var(--menu-hover);
}

/* --- Бургер: на ПК скрыт наглухо --- */
.burger {
  display: none !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin: 0;
  line-height: 0;
}

.mobile-title {
  display: none;
  padding: 20px 16px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--logo-color);
}
.mobile-title span.italic-solo {
  font-style: italic;
  font-weight: 600;
}

/* --- Отступ контента под фиксированной шапкой --- */
@media (min-width: 769px) {
  body {
    padding-top: 90px;
  }
}

/* --- Сетка карточек --- */
.grid-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 9 / 16;
  display: block;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.card-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  background: var(--overlay-bg);
  padding: 12px 12px;
  box-sizing: border-box;
  border-radius: 8px;
  width: calc(100% - 8px);
  max-width: 96%;
  margin: 0;
}

.card-overlay h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.card-overlay p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  opacity: 0.98;
  color: #ffffff;
}

/* СКРЫВАЕМ 9-Ю КАРТОЧКУ НА ПК */
.card:nth-child(9) {
  display: none;
}

/* --- Текстовые страницы --- */
.page-text {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}
.page-text h1 {
  color: var(--logo-color);
  font-size: 1.8rem;
  margin: 20px 0 16px;
}
.page-text p {
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

/* --- АДАПТИВ: МОБИЛЬНАЯ ВЕРСИЯ --- */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }

  /* шапка видима: лого слева, бургер справа */
  header.fixed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .burger {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
  }
  .burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--logo-color);
  }

  /* меню скрыто, по клику выезжает вниз */
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }
  nav.open {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  nav a {
    display: block;
    padding: 12px 20px;
    font-size: 1rem;
    white-space: normal;
  }

  /* старое дублирующее лого больше не нужно */
  .mobile-title {
    display: none;
  }

  .grid-container {
    margin-top: 16px;
    grid-template-columns: repeat(3, 1fr);
  }

  .card:nth-child(9) {
    display: block;
  }

  .card-overlay {
    padding: 14px 10px;
    width: calc(100% - 4px);
    max-width: 100%;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
  }

  .card-overlay h3 {
    font-size: 0.75rem;
    line-height: 1.1;
    letter-spacing: 0.2px;
    white-space: normal;
  }

  .card a[href="/onlineschool"] .card-overlay h3 {
    font-size: 0.65rem;
  }

  .card a[href="/tango"] .card-overlay h3 {
    font-size: 0.65rem;
  }

  .card-overlay p,
  .card a[href="/onlineschool"] .card-overlay p {
    display: none;
  }
}

/* --- Планшеты --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
.raspisanie-center {
  max-width: 900px;
  margin: 20px auto;
}
.raspisanie-frame {
  width: 100%;
  height: 750px;
  border: none;
  display: block;
}
