/* =========================================================
   responsive.css — все значения в rem/em
   Breakpoints (em, базируется на 16px = 1em):
   lg  ≤ 80em   (1280px)
   md+ ≤ 64em   (1024px)
   md  ≤ 53.75em (860px)
   sm  ≤ 48em   (768px)
   xs  ≤ 37.5em (600px)
   xxs ≤ 23.75em (380px)
   ========================================================= */

/* ---------- lg ≤ 1280 ---------- */
@media (max-width: 80em) {
  :root { --section-y: 5.25rem; }
  .container { width: 92%; }
  .news--four { gap: 1.25rem; }
}

/* ---------- md+ ≤ 1024 ---------- */
@media (max-width: 64em) {
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .about-stat { border-right: 1px solid rgba(255,255,255,0.10); }
  .about-stat:nth-child(2) { border-right: 0; }
  .about-stat:nth-child(3) { border-top: 1px solid rgba(255,255,255,0.10); }
  .dir-cards { grid-template-columns: repeat(2, 1fr); }
  .ref-quick { grid-template-columns: repeat(2, 1fr); }
  .ref-steps { grid-template-columns: repeat(2, 1fr); }
  .about-cta { flex-direction: column; align-items: flex-start; padding: 2rem; }
  .chess-grid { grid-template-columns: repeat(2, 1fr); }
  .chess-card { min-height: 11rem; }
  :root { --section-y: 4.5rem; }
  .nav__link { padding: 0 0.625rem; font-size: 0.875rem; }
  .header__phone span { display: none; }
  .header__phone { width: 3rem; padding: 0; justify-content: center; border-radius: 50%; }
  .hero__inner { padding: 4rem 3rem 3.5rem; min-height: 33.75rem; }
  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__grid--reverse .about__media { order: -1; }
  .about__media { aspect-ratio: 16/10; max-height: 28.75rem; }
  .about__content { max-width: none; }
  .news--four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem; }
  .gallery--mosaic { grid-auto-rows: 12.5rem; gap: 0.875rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
  /* Shared (other pages) */
  .feature { grid-template-columns: 1fr; padding: 3rem; gap: 2.5rem; }
  .feature__media { aspect-ratio: 16/10; }
  .tcards, .programs, .news { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tcard, .ncard { grid-column: span 3; }
  .tcard--featured, .ncard--featured { grid-column: span 6; }
  .pcard,
  .pcard:nth-child(1),
  .pcard:nth-child(2),
  .pcard:nth-child(3),
  .pcard:nth-child(4),
  .pcard:nth-child(5),
  .pcard:nth-child(6) { grid-column: span 3; }
  .quick__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- md ≤ 860 ---------- */
@media (max-width: 53.75em) {
  .nav { display: none; }
  .nav--compact { display: none; }
  .header__middle { display: flex; min-width: 0; overflow: hidden; }
  .burger { display: inline-flex; }
  .header__inner { gap: 0.75rem; height: 4.5rem; }
  .header.is-stuck .header__inner { height: 4rem; }
  .header__phone { display: none; }
  .header__social { display: none; }
  .header__actions { margin-left: 0; flex-shrink: 0; }
  .header__logo img { width: 3rem; height: auto; }
}

/* ---------- sm ≤ 768 ---------- */
@media (max-width: 48em) {
  .chess-grid { grid-template-columns: 1fr; border-radius: var(--radius-lg); }
  .chess-card { min-height: 9rem; }
  :root { --section-y: 3rem; }
  .container { width: 92%; }
  .contacts-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .contacts-map { aspect-ratio: 16/9; }
  .news-article { padding-inline: 0; }
  .adjacent { grid-template-columns: 1fr; }
  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .section__head--center { align-items: center; }
  .section__title--nowrap { white-space: normal; }
  .hero { border-radius: 1.5rem; }
  .hero__inner { padding: 3rem 1.5rem 2.75rem; min-height: 30rem; }
  .hero__title { font-size: clamp(3rem, 14vw, 5rem); max-width: none; }
  .hero__lead { padding-left: 1.375rem; }
  .gallery--mosaic { grid-auto-rows: 11.25rem; gap: 0.75rem; }
  .gallery--mosaic .gallery__item,
  .gallery--mosaic .gallery__item:nth-child(n+4) { grid-column: span 6; }
  .news__cta { margin-top: 2.25rem; }
  .news__cta .btn { width: 100%; min-width: 0; }
  .footer { padding: 3.5rem 0 1.5rem; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; gap: 0.5rem; }
  /* Shared */
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .about-stat:nth-child(3),
  .about-stat:nth-child(4) { border-top: 1px solid rgba(255,255,255,0.10); }
  .dir-cards { grid-template-columns: 1fr; }
  .ref-quick { grid-template-columns: 1fr; }
  .ref-steps { grid-template-columns: 1fr; }
  .person-cards { grid-template-columns: 1fr; }
  .about-cta__actions { flex-direction: column; width: 100%; }
  .about-cta__actions .btn { width: 100%; text-align: center; }
  .quick__grid { grid-template-columns: repeat(2, 1fr); padding: 0.875rem; gap: 0.625rem; border-radius: 1.25rem; }
  .quick__card { min-height: 8.875rem; padding: 1.125rem 1rem; }
  .feature { padding: 2.25rem 1.75rem; border-radius: 1.25rem; }
  .tcards, .programs, .news { grid-template-columns: 1fr; gap: 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .tcard, .tcard--featured,
  .ncard, .ncard--featured,
  .pcard,
  .pcard:nth-child(1),
  .pcard:nth-child(2),
  .pcard:nth-child(3),
  .pcard:nth-child(4),
  .pcard:nth-child(5),
  .pcard:nth-child(6),
  .stat, .stat:nth-child(1), .stat:nth-child(6) { grid-column: auto; }
  .about__summary { grid-template-columns: 1fr; }
  .about__summary div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .about__summary div:last-child { border-bottom: 0; }
  .bigcta { grid-template-columns: 1fr; padding: 2.5rem 1.75rem; border-radius: 1.25rem; }
  .bigcta__actions { flex-direction: row; }
  .bigcta__actions .btn { flex: 1; }
  .entry-content { padding: 1.5rem; }
  .article-layout--full .entry-content { padding: 1.75rem; }
  .gallery-lightbox {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 2.25rem;
  }
  .gallery-lightbox__nav--prev { left: 1rem; }
  .gallery-lightbox__nav--next { right: 1rem; }
}

/* ---------- xs ≤ 600 ---------- */
@media (max-width: 37.5em) {
  :root { --section-y: 2.5rem; }
  .news--four { grid-template-columns: 1fr; }
  .gallery--mosaic { grid-auto-rows: 13.75rem; }
  .gallery--mosaic .gallery__item,
  .gallery--mosaic .gallery__item:nth-child(n+4) { grid-column: span 12; }
  .about__title { font-size: clamp(2.125rem, 9vw, 3rem); }
  .about__text { font-size: 1rem; }
  /* Shared */
  .quick__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .about__facts { grid-template-columns: 1fr; }
  .about__badge { left: 1rem; bottom: 1rem; padding: 0.875rem 1rem; font-size: 1.125rem; }
  .bigcta__actions { flex-direction: column; }
}

/* ---------- xxs ≤ 380 ---------- */
@media (max-width: 23.75em) {
  .container { width: 94%; }
  .header__inner { height: 4rem; }
  .header.is-stuck .header__inner { height: 3.75rem; }
  .header__logo img { width: 2.75rem; height: 2.75rem; }
  .hero__inner { padding: 2.5rem 1.25rem 2.25rem; }
  .hero__title { font-size: clamp(2.5rem, 13vw, 3.5rem); }
  .ncard__body { padding: 1.25rem 1.25rem 1.5rem; }
}
