*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue: #3d7ec9;
  --blue-dark: #2563a8;
  --sunny: #f5b731;
  --sunny-soft: #fff8e6;
  --grass: #58b868;
  --coral: #e8784a;
  --bg: #f0f6fc;
  --surface: #ffffff;
  --ink: #1a2f4a;
  --muted: #5a7089;
  --line: #c8daf0;
  --footer: #1e3a5f;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37, 99, 168, 0.25);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
  color: #fff;
}

.brand-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sunny);
  color: var(--blue-dark);
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  opacity: 0.88;
  line-height: 1.3;
  max-width: 280px;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.primary-nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

.primary-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.site-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 28px) 24px;
}

.page { max-width: 880px; }
.page-home, .page-category, .page-service { max-width: 1160px; }

.page h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  margin: 0 0 22px;
  letter-spacing: -0.03em;
  color: var(--blue-dark);
}

.institution-banner {
  position: relative;
  padding: 28px 30px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #fff 0%, var(--sunny-soft) 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--sunny);
  border-radius: 0 16px 16px 0;
  box-shadow: 0 8px 28px rgba(61, 126, 201, 0.1);
}

.banner-lead {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
  max-width: 760px;
}

.home-sections { margin: 24px 0 28px; }

.section-title {
  margin: 0 0 16px;
  font-size: 24px;
  color: var(--blue-dark);
  letter-spacing: -0.02em;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.section-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 20px rgba(26, 47, 74, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 47, 74, 0.1);
}

.section-gallery-children { border-top-color: var(--grass); }
.section-gallery-interior { border-top-color: var(--blue); }
.section-gallery-konkurs { border-top-color: var(--coral); }
.section-gallery-employment { border-top-color: var(--sunny); }
.section-experts-logopedist { border-top-color: #9b6dd7; }
.section-experts-psychologist { border-top-color: #6db8d7; }
.section-news { border-top-color: var(--coral); }
.section-about-info { border-top-color: var(--blue-dark); }
.section-documents-parents { border-top-color: var(--grass); }

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--sunny-soft);
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.section-body strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--blue-dark);
}

.section-desc {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.article-grid > .section-title { grid-column: 1 / -1; }

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(26, 47, 74, 0.05);
  display: flex;
  flex-direction: column;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
}

.card h2 a {
  color: var(--blue-dark);
  text-decoration: none;
}

.card h2 a:hover { color: var(--blue); text-decoration: underline; }

.card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  flex-grow: 1;
}

.card-more {
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.card-more:hover { text-decoration: underline; }

.content {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.content > *:first-child { margin-top: 0; }
.content p { margin: 0 0 16px; }
.content h2 { margin: 28px 0 12px; font-size: 26px; color: var(--blue-dark); }
.content h3 { margin: 22px 0 10px; font-size: 21px; }
.content ul, .content ol { padding-left: 22px; margin: 0 0 18px; }
.content li { margin: 4px 0; }
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 10px 0 18px;
  box-shadow: 0 8px 24px rgba(26, 47, 74, 0.08);
}
.content table {
  max-width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  display: block;
  overflow-x: auto;
}
.content td, .content th {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px 0 8px;
}

.pagination a, .pagination span {
  display: inline-flex;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.pagination span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pagination a:hover { background: var(--sunny-soft); }

.related {
  max-width: 880px;
  margin: 36px auto 0;
  padding: 22px 26px;
  background: var(--sunny-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.related h2 { margin: 0 0 12px; font-size: 22px; color: var(--blue-dark); }
.related ul { margin: 0; padding-left: 20px; columns: 2; gap: 24px; }
.related a { color: var(--blue); font-weight: 600; }

.sitemap-list { columns: 2; gap: 28px; margin: 0; padding-left: 20px; }
.sitemap-list a { color: var(--blue); }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.gallery-item {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(26, 47, 74, 0.06);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.home-photos { margin: 28px 0 10px; }

.home-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-photos-grid img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(26, 47, 74, 0.08);
}

.home-photos-more {
  margin: 12px 0 0;
  text-align: center;
}

.home-photos-more a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.home-photos-more a:hover { text-decoration: underline; }

.news-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.news-photo {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(26, 47, 74, 0.06);
}

.news-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer {
  margin-top: 48px;
  padding: 32px clamp(16px, 4vw, 28px);
  background: var(--footer);
  color: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.footer-title {
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 8px;
  color: #fff;
}

.footer-col p { margin: 0 0 8px; font-size: 14px; }
.footer-links { text-align: right; }
.footer-links a { color: var(--sunny); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .site-header { position: static; }
  .header-inner { gap: 10px; }
  .brand { margin-right: 0; flex: 1 1 100%; }
  .brand-sub { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .primary-nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 10px 12px; }
  .site-main { padding: 24px 14px 18px; }
  .page h1 { font-size: 28px; }
  .institution-banner { padding: 20px; }
  .banner-lead { font-size: 16px; }
  .sections-grid, .article-grid { grid-template-columns: 1fr; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
  .home-photos-grid { grid-template-columns: repeat(2, 1fr); }
  .related ul, .sitemap-list { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { text-align: left; }
  .content { font-size: 16px; }
}
