/**
 * Стили ниже первого экрана (и общие блоки контента).
 * Подключается с отложенной активацией: media="print" onload="this.media='all'"
 */
/* ========== О школе ========== */
.about__grid {
  display: grid;
  gap: 32px;
  margin-bottom: 40px;
}

.about__text {
  font-size: 1rem;
  color: var(--color-text);
}

.about__lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.about__license-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.about__license-img a {
  display: block;
  line-height: 0;
}

.about__license-img img {
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: top;
}

.about__license-num {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  text-align: center;
  font-weight: 500;
}

.about__features {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.about__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.about__feature-icon {
  font-size: 1.5rem;
  color: var(--color-accent);
}

.about__feature-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.about__feature-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ========== Новости ========== */
.news__carousel {
  position: relative;
  overflow: hidden;
}

.news__track-wrap {
  width: 100%;
  overflow: hidden;
}

.news__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.news__track::-webkit-scrollbar {
  height: 8px;
}

.news__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.news__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.news__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
}

.news__item--no-photo .news__body {
  flex: 1 1 100%;
}

.news__item--no-photo .news__img {
  display: none;
}

.news__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  order: 2;
}

.news__img {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 400 / 280;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  order: 1;
}

.news__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news__img-placeholder {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.news__date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: block;
}

.news__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
}

.news__text {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}

.news__text p {
  margin: 0 0 0.5em;
}

.news__text p:last-child {
  margin-bottom: 0;
}

.news__arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.news__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

.news__bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.news__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.news__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}

.news__dot:hover {
  background: var(--color-text-muted);
}

.news__dot--active {
  background: var(--color-accent);
  transform: scale(1.2);
}

@media (min-width: 768px) {
  .news__item {
    flex-direction: row;
  }
  .news__item .news__body {
    flex: 1 1 50%;
    padding: 20px;
    order: 1;
  }
  .news__item .news__img {
    flex: 0 0 50%;
    width: 50%;
    max-width: 540px;
    aspect-ratio: 400 / 280;
    height: auto;
    min-height: 0;
    order: 2;
  }
  .news__item .news__img img {
    min-height: 0;
  }
}

/* ========== Карточки (преимущества, услуги) ========== */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(232, 167, 53, 0.15);
  color: var(--color-accent);
  font-size: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.card__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.card__title--small {
  font-size: 1.125rem;
}

.card__meta {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.card__text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.card__btn {
  margin-top: 20px;
}

.card__avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  flex-shrink: 0;
}

.card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.card__avatar-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.card__avatar-fallback--show {
  display: flex;
}

.card__review-meta {
  margin-bottom: 8px;
}

.card__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.card__stars {
  color: var(--color-accent);
  letter-spacing: 2px;
}

.card__rating-num {
  font-weight: 600;
  color: var(--color-text);
}

/* Преимущества — сетка */
.advantages__grid {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.advantages__card {
  text-align: center;
}

/* ========== Фотогалерея ========== */
.gallery__intro {
  text-align: center;
  color: var(--color-text-muted);
  margin: 0 0 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.gallery__subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 48px 0 12px;
  text-align: center;
}

.gallery__intro--narrow {
  margin-bottom: 24px;
}

.gallery__slider {
  position: relative;
  overflow: hidden;
}

.gallery__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 0 0 16px;
  -webkit-overflow-scrolling: touch;
}

.gallery__track::-webkit-scrollbar {
  height: 8px;
}

.gallery__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.gallery__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.gallery__item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gallery__item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.gallery__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.gallery__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.gallery__arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.gallery__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Услуги — сетка */
.services__grid {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card--service {
  display: flex;
  flex-direction: column;
}

.card--service .card__text {
  flex-grow: 1;
}


/* ========== Отзывы (источник: Яндекс.Карты) ========== */
.reviews__source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.reviews__rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 12px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: var(--radius);
}

.reviews__source-text a {
  color: var(--color-primary);
  font-weight: 500;
}

.reviews__source-text a:hover {
  color: var(--color-accent);
}

.reviews__source-footer {
  text-align: center;
  margin: 24px 0 0;
  font-size: 0.9375rem;
}

.reviews__source-footer a {
  color: var(--color-primary);
  font-weight: 500;
}

.reviews__source-footer a:hover {
  color: var(--color-accent);
}

.reviews__slider {
  position: relative;
  overflow: hidden;
}

.reviews__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.reviews__track::-webkit-scrollbar {
  height: 8px;
}

.reviews__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.card--review {
  flex: 0 0 100%;
  scroll-snap-align: start;
  text-align: center;
}

.reviews__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.reviews__arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.reviews__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ========== Контакты ========== */
.contacts__grid {
  display: grid;
  gap: 32px;
}

.contacts__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contacts__item {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.contacts__item i {
  width: 24px;
  color: var(--color-accent);
}

.contacts__item a {
  color: var(--color-text);
}

.contacts__item a:hover {
  color: var(--color-accent);
}

.contacts__item:has(.contacts__phones) {
  align-items: flex-start;
}

.contacts__phones {
  line-height: 1.6;
}

.contacts__phones a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.contacts__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.contacts__actions .btn:hover {
  transform: scale(1.06);
  color: #fff;
}

.contacts__actions .btn--primary:hover {
  background: var(--color-accent);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.contacts__actions .btn--whatsapp:hover {
  background: #25d366;
  color: #fff;
}

.contacts__actions .btn--telegram:hover {
  background: #0088cc;
  color: #fff;
}

.contacts__actions .btn--vk:hover {
  background: #0077ff;
  color: #fff;
}

.contacts__map {
  min-height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-bg-alt);
}

.contacts__map iframe {
  display: block;
  width: 100%;
  max-width: 560px;
  height: 400px;
  margin-left: auto;
  margin-right: auto;
  border: 0;
}

/* ========== Футер ========== */
.footer {
  background: var(--color-primary);
  color: #fff;
  padding: 32px 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.9);
}

.footer a:hover {
  color: #a5d8f3;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 1.25rem;
  transition: background var(--transition);
}

.footer__social-link:hover {
  background: #a5d8f3;
  color: var(--color-primary);
}

/* ========== Модальное окно ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.modal__close:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.modal__title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* Модалка с виджетом Яндекс.Форм — шире, чтобы форма помещалась */
.modal__box:has(.form--ya-widget) {
  max-width: min(680px, 100vw - 40px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.form--ya-widget {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form--ya-widget iframe {
  width: 100%;
  max-width: 650px;
  height: 520px;
  min-height: 320px;
  border: 0;
  border-radius: var(--radius);
}

@media (max-width: 767px) {
  /* На мобильных даём прокрутку всему оверлею, чтобы форма всегда была доступна */
  .modal {
    align-items: flex-start;
    padding: 8px 0;
    overflow-y: auto;
  }

  .modal__box {
    max-height: none;
    height: auto;
    border-radius: 0;
  }

  .modal__box:has(.form--ya-widget) {
    padding: 12px;
    max-height: none;
  }

  .form--ya-widget iframe {
    height: 60vh;
    min-height: 320px;
  }
}

/* Форма */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form__label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.form__label em {
  font-weight: 400;
  color: var(--color-text-muted);
}

.form__input,
.form__select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color var(--transition);
}

.form__input:focus,
.form__select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7c8f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ========== Планшеты (768px+) ========== */
@media (min-width: 768px) {
  .section {
    padding: 64px 0;
  }

  .section__title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .burger {
    display: none;
  }

  .nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header__cta {
    display: inline-flex;
  }

  body.menu-open .nav__list,
  body.menu-open .header__cta {
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin: 0;
    width: auto;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__subtitle {
    font-size: 1.25rem;
  }

  .about__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .advantages__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__item {
    flex: 0 0 calc(50% - 12px);
  }

  .gallery__item img {
    height: 260px;
  }

  .service-page__slider .service__item {
    flex: 0 0 calc(50% - 6px);
  }

  .service-page__slider .service__item img {
    height: 260px;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card--wide {
    grid-column: 1 / -1;
  }

  .card--review {
    flex: 0 0 calc(50% - 12px);
  }

  .contacts__grid {
    grid-template-columns: 1fr 1fr;
  }

  .contacts__map {
    min-height: 400px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ========== Десктоп (1024px+) ========== */
@media (min-width: 1024px) {
  .section__title {
    font-size: 2.25rem;
  }

  .hero__title {
    font-size: 2.75rem;
  }

  .about__features {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 32px;
  }

  .advantages__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .advantages__card:hover {
    transform: translateY(-4px);
  }

  .gallery__item {
    flex: 0 0 calc(33.333% - 16px);
  }

  .gallery__item img {
    height: 280px;
  }

  .service-page__slider .service__item {
    flex: 0 0 calc(33.333% - 8px);
  }

  .service-page__slider .service__item img {
    height: 280px;
  }

  .services__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .card--wide {
    grid-column: span 1;
  }

  .card--review {
    flex: 0 0 calc(33.333% - 16px);
  }

  .contacts__map {
    min-height: 400px;
  }
}
