/* ════════════════════════════════════════════════════
   ДИЗАЙН-СИСТЕМА: ПЛИТКИ
   Фон: --periwinkle (rgb 230 240 254)
   Плитки: --surface (#fff) с --tile-r: 32px
   Шапка: плитка высотой 64px → radius = 32px = полуокружность
   ════════════════════════════════════════════════════ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --surface:       #ffffff;
  --periwinkle:    rgb(230, 240, 254);   /* основной фон */
  --text:          #1e293b;
  --muted:         #64748b;
  --border:        #cbd5e1;
  --danger-bg:     #fee2e2;
  --danger-text:   #dc2626;

  --tile-r:   32px;   /* = nav height / 2 → идеальная полуокружность */
  --gap:      18px;   /* отступ между плитками */
  --page-w:   1242px; /* макс. ширина контента */
  --tile-shadow: 0 2px 16px rgba(37,99,235,.10);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scrollbar-gutter: stable;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--periwinkle);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }

/* ── Nav ─────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: transparent;   /* только белая плитка, без фона */
  padding: var(--gap) var(--gap) 0;
}

.nav-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  height: 64px;
  background: var(--surface);
  border-radius: var(--tile-r);
  box-shadow: var(--tile-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 28px;
  gap: 12px;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 800;
  color: #393bb9;   /* rgb 57 59 185 */
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  position: relative;   /* для .nav-pill */
}

/* Скользящая «таблетка» для анимации навигации */
.nav-pill {
  position: absolute;
  background: var(--primary-light);
  border-radius: 100px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: left .28s cubic-bezier(.4,0,.2,1),
              top  .28s cubic-bezier(.4,0,.2,1),
              width  .28s cubic-bezier(.4,0,.2,1),
              height .28s cubic-bezier(.4,0,.2,1),
              opacity .15s ease;
}

.nav-links li { position: relative; z-index: 1; }

.nav-links a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 100px;
  font-size: .84rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s;
  position: relative;
  z-index: 1;
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); background: transparent; }
.nav-links a.active { font-weight: 700; }

.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  border-radius: 12px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;   /* убираем серую подсветку тапа */
}
/* Голубой фон — только пока меню раскрыто */
.nav-toggle.is-open {
  background: var(--primary-light);
}
/* Кольцо фокуса для клавиатуры (не появляется при тапе) */
.nav-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* mobile nav drop */
.nav-links.open {
  display: flex;
}

/* ── Page wrapper & tile grid ─────────────────────── */
.page {
  max-width: calc(var(--page-w) + 2 * var(--gap));
  margin: 0 auto;
  padding: 0 var(--gap) var(--gap);
}

.tiles {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-top: var(--gap);
}

/* ── Tile ─────────────────────────────────────────── */
.tile {
  background: var(--surface);
  border-radius: var(--tile-r);
  box-shadow: var(--tile-shadow);
}

.tile-body {
  padding: 48px 44px;
}

/* Последняя плитка «входит» в подвал — только верхние углы */
.tile-into-footer {
  border-radius: var(--tile-r) var(--tile-r) 0 0;
}

/* ── Tile header ──────────────────────────────────── */
.tile-header { margin-bottom: 28px; }
.tile-title  { font-size: 1.55rem; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.tile-sub    { color: var(--muted); font-size: .92rem; }

/* ── Footer ──────────────────────────────────────── */
footer {
  background: var(--text);
  color: rgba(255,255,255,.6);
  border-radius: 0 0 var(--tile-r) var(--tile-r);
  padding: 21px 44px 32px;
  font-size: .82rem;
}
footer a { color: rgba(255,255,255,.85); text-decoration: none; }
footer a:hover { color: #fff; }

/* ── Inner cards (вложенные плитки) ─────────────── */
.inner-card {
  background: var(--surface);
  border-radius: var(--tile-r);
  padding: 22px 26px;
  box-shadow: 0 2px 14px rgba(37,99,235,.09);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.inner-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 100px;    /* pill */
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
  font-family: inherit;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--periwinkle); color: var(--text); }
.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-sm { padding: 7px 16px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Кнопка "Запись закрыта" — полностью неинтерактивна */
.course-cta-closed {
  pointer-events: none;
  cursor: default !important;
  opacity: 1 !important;
  color: var(--muted) !important;
  border-color: var(--border) !important;
  background: transparent !important;
}

/* ── Homepage blocks ──────────────────────────────── */
.no-copy {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.hp-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.hp-block-text {
  color: var(--text);
  line-height: 1.75;
  font-size: .97rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.hp-image-wrap {
  display: flex;
  gap: 32px;
  align-items: stretch;
  flex-wrap: wrap;
}
.hp-image-left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hp-image-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  width: 100%;
}
.hp-image-left .hp-section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0;
}
.hp-image-left .hp-block-text {
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
}
.hp-contact-pill {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 14px rgba(37,99,235,.09);
  align-items: center;
}
.hp-contact-pill-btn {
  width: 44px;
  height: 44px;
  padding: 7px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
  cursor: pointer;
  box-sizing: border-box;
}
.hp-contact-pill-btn:hover {
  background: var(--primary-light);
}
.hp-contact-pill-btn img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}
.hp-main-img {
  width: 50%;
  max-width: 100%;
  border-radius: 16px;
  flex-shrink: 0;
  align-self: flex-start;
  object-fit: cover;
}

.hp-gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.hp-gallery-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.hp-gallery-item {
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
}
.hp-gallery-grid--thumbnails {
  flex-direction: row;
  flex-wrap: wrap;
}
.hp-gallery-grid--thumbnails .hp-gallery-item {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  height: 250px;
  width: auto;
  border-radius: 10px;
  overflow: hidden;
}
.hp-gallery-grid--thumbnails .hp-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hp-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: default;
  display: block;
}

/* Show-more pill button */
.show-more-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 10px 28px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  display: block;
  margin: 20px auto 0;
  transition: background .15s, color .15s, border-color .15s;
}
.show-more-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;      /* pill inputs */
  font-size: .9rem;
  color: var(--text);
  background: var(--periwinkle);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-group textarea {
  border-radius: 18px;       /* textarea — скруглённый прямоугольник */
  resize: vertical;
  min-height: 110px;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Alert ───────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: 16px;
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error   { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #fecaca; }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 12px 20px;
  border-radius: 100px;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  z-index: 9999;
  animation: toastUp .25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.toast-success { background: #16a34a; }
.toast-error   { background: var(--danger-text); }
@keyframes toastUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Badge / Tag ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
}
/* Статусы курсов */
.badge-open     { background: #dcfce7; color: #16a34a; }
.badge-ongoing  { background: #ffedd5; color: #ea580c; }
.badge-finished { background: #f1f5f9; color: #64748b; }
.badge-upcoming { background: var(--primary-light); color: var(--primary); }
.badge-custom   { background: var(--primary-light); color: var(--primary); }
.badge-closed   { background: #f1f5f9; color: #64748b; }

/* Progress (используется в админке) */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s; }
.progress-fill.full { background: var(--danger-text); }

/* ── Hero tile ───────────────────────────────────── */
.hero-logo {
  max-width: 570px;   /* 380px × 1.5 */
  width: 80%;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}
.hero-text {
  text-align: center;
}
.hero-text p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 28px;
}
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Teacher ─────────────────────────────────────── */
.teacher-wrap {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.teacher-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
}
.teacher-avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-name  { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.teacher-role  { color: var(--primary); font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.info-list     { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.info-list li  { display: flex; gap: 10px; font-size: .875rem; color: var(--muted); align-items: flex-start; }
.info-list .ico { flex-shrink: 0; }

/* ── Vertical course card ────────────────────────── */
#courses-grid,
#courses-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.course-card-v {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  height: 100%;
  box-sizing: border-box;
}
.course-card-spacer { flex: 1; }

/* Только бейдж статуса — по ширине текста */
.course-card-v > .badge {
  align-self: flex-start;
}

.course-title-v {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.course-desc-v {
  font-size: .95rem;
  color: var(--text);
  line-height: 1.78;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-top: -10px;
}

.course-info-blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-info-block {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #eff6ff;
  border-radius: 16px;
  padding: 14px 18px;
}

.course-info-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.course-info-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.course-info-label {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1;
}

.course-info-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.course-price-section {
  display: flex;
  align-items: baseline;
  padding: 4px 0;
}

.course-price-num,
.course-price-rub {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.course-price-suffix {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

/* «Бесплатно» — слово длиннее цифры цены, поэтому делаем мельче (ПК и моб.) */
.course-price-free {
  font-size: 1.55rem;
}

.course-cta-btn {
  width: 100%;
  justify-content: center;
  padding: 18px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-cta-arrow {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ── Review inner card ───────────────────────────── */
.review-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-name { font-weight: 700; font-size: .95rem; }
.review-text {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.review-row  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.review-date { font-size: .75rem; color: var(--border); }
.review-img-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  font-family: inherit;
  transition: background .15s;
}
.review-img-btn:hover { background: var(--primary-light); }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--tile-r);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop .2s ease;
}
@keyframes modalPop {
  from { transform: scale(.96); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Modal header strip */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  border-radius: var(--tile-r) var(--tile-r) 0 0;
  z-index: 1;
}
.modal-header-title { font-weight: 700; font-size: .95rem; }
.modal-close-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--periwinkle);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.modal-close-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.modal-body { padding: 24px; }
.modal-body img { width: 100%; border-radius: 18px; margin-bottom: 16px; }
.modal-body h3 { margin-bottom: 16px; font-size: 1.05rem; padding-right: 0; }

/* Legacy support for old close button */
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--periwinkle);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; color: var(--muted);
  transition: all .15s;
}
.modal-close:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ── FAQ ─────────────────────────────────────────── */
.faq-item {
  background: var(--periwinkle);   /* синяя плитка в закрытом виде */
  border-radius: var(--tile-r);
  overflow: hidden;
  transition: background .35s ease, box-shadow .35s ease;
}

.faq-item.open {
  background: var(--surface);      /* белая карточка в открытом виде */
  box-shadow: 0 4px 28px rgba(37,99,235,.13);
}

.faq-q {
  width: 100%;
  padding: 18px 24px;
  background: transparent;         /* берёт цвет от faq-item */
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  line-height: 1.4;
  transition: background .35s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Когда карточка открыта — вопрос получает явный синий фон */
.faq-item.open .faq-q {
  background: var(--periwinkle);
}

.faq-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform .3s;
  color: var(--primary);
}
.faq-q.open .faq-icon { transform: rotate(45deg); }

/* Анимированный контейнер ответа */
.faq-a-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
}

.faq-a {
  display: block;
  padding: 20px 24px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.7;
  opacity: 0;
  transition: opacity .25s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── News inner card ─────────────────────────────── */
.news-inner img {
  width: 100%;
  height: auto;              /* натуральная высота */
  display: block;
  border-radius: 20px;
  margin-bottom: 14px;
}
.news-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.news-text  {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.news-date  { font-size: .75rem; color: var(--muted); margin-top: 8px; }

/* ── Contact form ────────────────────────────────── */
.contact-wrap { max-width: 580px; margin: 0 auto; }

/* Карточки выбора способа связи */
.contact-method-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.contact-method-card input[type="radio"] { display: none; }

.contact-method-card > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--periwinkle);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}

.contact-method-card > span img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  margin: 0;
}

.contact-method-card > span:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.contact-method-card input:checked + span {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ── Loader / Empty ──────────────────────────────── */
.loader, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: .9rem;
}
/* Единая плоская заглушка для всех пустых состояний.
   font-size:0 прячет эмодзи из разметки (на iOS они были «гиперреалистичными»),
   а фоном подставляется один аккуратный SVG-значок в тон дизайну. */
.empty-icon {
  font-size: 0;
  line-height: 0;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── Tile footer (show more area) ────────────────── */
.tile-show-more {
  text-align: center;
  padding-top: 8px;
}

/* ── Page hero (for pages without big hero) ──────── */
.page-hero-inner {
  text-align: center;
  padding-bottom: 4px;
}
.page-hero-inner h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.page-hero-inner p  { color: var(--muted); font-size: .95rem; margin-bottom: 0; }

/* ── Divider inside tile ─────────────────────────── */
.tile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Project cards ──────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ── Project blocks (новая структура) ─────────── */
.project-block {
  padding: 0;
  overflow: hidden;
}

.project-block-header {
  padding: 26px 26px 20px;
}

.project-block-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 6px;
}

.project-block-desc {
  font-size: .95rem;
  color: var(--text);
  line-height: 1.78;
}

.project-block-lectures {
  padding: 18px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lectures-empty-pub {
  color: var(--muted);
  font-size: .9rem;
  padding: 16px 0;
  text-align: center;
}

/* ── Lecture card ─────────────────────────────── */
.lecture-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--tile-r);
  box-shadow: var(--tile-shadow);
  padding: 20px;
}

.lecture-card > .badge {
  align-self: flex-start;
}

.lecture-card-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.lecture-col-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.lecture-photo-wrap {
  width: 67%;
  margin: 0;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--periwinkle);
}

.lecture-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.lecture-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.lecture-lecturer-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.lecture-lecturer-bio {
  font-size: .95rem;
  color: var(--text);
  line-height: 1.78;
}

.lecture-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lecture-info-blocks {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lecture-price-wrap {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lecture-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lecture-desc {
  font-size: .95rem;
  color: var(--text);
  line-height: 1.78;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 700px) {
  .lecture-card-body {
    grid-template-columns: 1fr;
  }
  /* ФИО и биография под фото */
  .lecture-col-left {
    display: block;
  }
  /* Фото лектора — 67% ширины колонки, текст под ним остаётся полным */
  .lecture-photo-wrap {
    width: 67%;
    margin: 0 0 12px;
    aspect-ratio: 2 / 3;
  }
  .lecture-photo-wrap img {
    height: 100%;
    object-fit: cover;
  }
  .lecture-title { font-size: 1.3rem; }
  .lecture-col-left > * { min-width: 0; }
  .project-block-header,
  .project-block-lectures {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ── Photo grid ─────────────────────────────────── */
/* Колонки строятся в JS (photos.js) — обе начинаются строго сверху */
.photos-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.photos-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.photos-grid > .empty-state { flex: 1 1 100%; }

.photo-card {
  border-radius: var(--tile-r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 14px rgba(37,99,235,.09);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,99,235,.16);
}

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

.photo-meta {
  padding: 10px 14px 12px;
}

.photo-date {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.photo-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
  mask-image: linear-gradient(to right, black 70%, transparent 100%);
}

/* ── Обрезка длинного текста + кнопка «Показать полностью» ───────────────
   Сама обрезка включается только на мобильном (см. медиазапрос ниже).
   На десктопе .clamp-text ведёт себя как обычный текст, кнопка скрыта. */
.clamp-toggle {
  display: none;            /* показывается только при .show на мобильном */
  width: fit-content;      /* размер по тексту, не растягивается */
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;     /* пилюля — как кнопки в материалах */
  padding: 6px 14px;
  margin: 8px auto 0;      /* auto = по центру */
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background .15s;
}
.clamp-toggle:hover { background: var(--primary-light); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  :root { --tile-r: 22px; --gap: 12px; }

  /* Текст обрезается по высоте ~7 строк. Вместо многоточия — плавное
     затухание в прозрачность (mask), как в подписях к фото.
     Затухание включается классом .is-clamped только когда текст реально
     не помещается (выставляется в JS), иначе короткий текст не блёкнет. */
  .clamp-text {
    max-height: 11.9em;   /* запасной вариант для старых браузеров */
    max-height: 7lh;
    overflow: hidden;
  }
  .clamp-text.is-clamped {
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  }
  .clamp-text.expanded {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .clamp-toggle.show { display: block; }

  .nav-inner { height: 56px; padding: 0 14px 0 18px; border-radius: 28px; }   /* 56/2 → полная «таблетка» */

  .nav-links {
    display: none;
    position: absolute;
    top: calc(56px + 12px + 12px);
    left: 12px; right: 12px;
    background: var(--surface);
    border-radius: var(--tile-r);
    box-shadow: var(--tile-shadow);
    flex-direction: column;
    padding: 12px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .tile-body { padding: 24px 16px; }
  footer { padding: 24px 16px; border-radius: 0 0 var(--tile-r) var(--tile-r); }

  .teacher-wrap { flex-direction: column; align-items: center; text-align: center; }
  .info-list li  { justify-content: center; }

  .form-row { grid-template-columns: 1fr; }

  #courses-grid,
  #courses-preview { grid-template-columns: 1fr; }

  /* Блок «фото + текст» преподавателя: складываем в колонку */
  .hp-image-wrap { flex-direction: column; gap: 20px; }
  .hp-main-img { width: 100%; order: -1; }
  .hp-image-left .hp-section-title { font-size: 1.5rem; }
  .hp-image-left .hp-block-text { font-size: 1rem; line-height: 1.7; }

  /* Крупные заголовки карточек — уменьшаем, чтобы не переполняли */
  .course-title-v,
  .project-block-title { font-size: 1.55rem; }

  /* Галереи (олимпиады / образование): ровная сетка 2 в ряд,
     вместо хрупкой «фикс-высота + авто-ширина». Соотношение сторон
     берётся из inline-стиля элемента, заданного в JS. */
  .hp-gallery-grid--thumbnails {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hp-gallery-grid--thumbnails .hp-gallery-item {
    height: auto;
    width: 100%;
  }
  /* Образование — альбомные дипломы, по одному на строку */
  .hp-section[data-block="education_diplomas"] .hp-gallery-grid--thumbnails {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-logo { width: 92%; max-width: 480px; }   /* визуально крупнее на телефоне */
  .hero-text p { font-size: .92rem; margin-bottom: 22px; }   /* текст под лого — меньше */
  /* Кнопки в один ряд, равной ширины */
  .hero-actions { flex-direction: row; gap: 8px; }
  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 8px;
    font-size: .88rem;
    justify-content: center;
  }
  .tile-title { font-size: 1.3rem; }
  .contact-method-cards { grid-template-columns: repeat(2, 1fr); }

  /* Вложенные карточки — тоже ужимаем по горизонтали, чтобы текст
     не зажимался двойными отступами (плитка + карточка) */
  .inner-card { padding: 18px 16px; }
  .course-card-v { padding: 20px 16px; }
  .lecture-card { padding: 16px; }
  /* У блока проекта отступы задают header/lectures — сам блок без паддинга,
     иначе получается двойной отступ */
  .inner-card.project-block { padding: 0; }
  /* Материалы — единый горизонтальный отступ 16px, как у остальных карточек.
     Селектор с .material-card — чтобы перебить базовые правила ниже по файлу. */
  .material-card .material-card-header { padding: 16px 16px 10px; }
  .material-card .material-card-body   { padding: 4px 16px 12px; }
  .material-card .material-files       { padding: 12px 16px 16px; }
}

/* ── Footer: 3-column layout ─────────────────────── */
.footer-brand {
  font-size: .95rem;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  margin-bottom: 4px;
  text-align: right;
}
.footer-inner {
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  gap: 0 100px;
  text-align: left;
  align-items: start;
}
.footer-copy {
  color: rgba(255,255,255,.35);
  font-size: .82rem;
  text-align: right;
}
.footer-dev {
  color: rgba(255,255,255,.35);
  font-size: .82rem;
  text-align: right;
  margin-top: 4px;
}
.footer-dev a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
}
.footer-dev a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-col-title {
  font-size: .7rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 19px;
  text-align: center;
}
.footer-nav {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 6px 60px;
  position: static;
  padding: 0;
  background: none;
  z-index: auto;
}
[data-copy] { cursor: copy; }
.footer-nav a {
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color .15s;
}
.footer-nav a:hover { color: #fff; }
.footer-contacts {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 6px 40px;
}
.footer-contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: color .15s;
}
.footer-contact-link:hover { color: #fff; }
.footer-contact-link img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

/* ── Nav: social icon links ──────────────────────── */
.nav-social-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  padding: 5px !important;
  border-radius: 50% !important;
}
.nav-social-link:hover { background: var(--primary-light) !important; color: inherit !important; }
.nav-social-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

/* ── FAB ─────────────────────────────────────────── */
.fab-wrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,99,235,.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.fab-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 28px rgba(37,99,235,.45);
  transform: translateY(-2px);
}
.fab-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.fab-btn.open svg { transform: rotate(45deg); }
.fab-popup {
  background: var(--surface);
  border-radius: var(--tile-r);
  box-shadow: 0 4px 28px rgba(37,99,235,.15);
  padding: 10px;
  min-width: 180px;
  transform: scale(.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s cubic-bezier(.4,0,.2,1), opacity .18s ease;
  transform-origin: bottom right;
}
.fab-popup.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.fab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  transition: background .12s;
}
.fab-item:hover { background: var(--periwinkle); }
.fab-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Materials ──────────────────────────────────────*/
#materials-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.material-card {
  background: var(--surface);
  border-radius: var(--tile-r);
  box-shadow: var(--tile-shadow);
  overflow: hidden;
}

.material-card-header {
  padding: 18px 20px 10px;
}

/* Image: full size, no cropping */
.material-card-img {
  width: 100%;
  height: auto;
  display: block;
}

.material-card-body {
  padding: 4px 20px 12px;
}

.material-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.material-condition-preview,
.material-condition-full,
.material-solution-text {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 6px;
}

/* Превью условия: вместо многоточия — плавное затухание в прозрачность */
.material-condition-faded {
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

/* Toggle buttons — same style as reviews */
.material-toggle-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  font-family: inherit;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  margin: 6px 0;
}
.material-toggle-btn:hover { background: var(--primary-light); }

/* Slide animation via grid trick */
.material-expandable {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s ease;
}
.material-expandable.open {
  grid-template-rows: 1fr;
}
.material-expandable-inner {
  overflow: hidden;
  min-height: 0; /* required: allows grid item to shrink to 0 */
}

/* Solution/answer content sits INSIDE the inner wrapper */
.material-block-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  margin-bottom: 4px;
}

.material-solution-text,
.material-answer {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ── File badges — rectangle, white, colored border ─*/
.material-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.material-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}
.material-file-badge:hover { opacity: .75; }

.material-file-badge--pdf   { border-color: #ef4444; color: #dc2626; }
.material-file-badge--word  { border-color: #3b82f6; color: #1d4ed8; }
.material-file-badge--img   { border-color: #38bdf8; color: #0369a1; }
.material-file-badge--video { border-color: #a855f7; color: #7c3aed; }
.material-file-badge--file  { border-color: #94a3b8; color: #475569; }

/* File type icons — document shape with folded corner */
.file-badge-icon {
  width: 28px;
  height: 34px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.material-file-badge--pdf  .file-badge-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M2 0 L18 0 L28 10 L28 34 Q28 36 26 36 L2 36 Q0 36 0 34 L0 2 Q0 0 2 0Z' fill='%23fee2e2'/%3E%3Cpolygon points='18,0 28,10 18,10' fill='%23fca5a5'/%3E%3Ctext x='14' y='25' text-anchor='middle' dominant-baseline='middle' font-family='Arial,sans-serif' font-size='7' font-weight='900' fill='%23dc2626'%3EPDF%3C/text%3E%3C/svg%3E");
}
.material-file-badge--word .file-badge-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M2 0 L18 0 L28 10 L28 34 Q28 36 26 36 L2 36 Q0 36 0 34 L0 2 Q0 0 2 0Z' fill='%23dbeafe'/%3E%3Cpolygon points='18,0 28,10 18,10' fill='%23bfdbfe'/%3E%3Ctext x='14' y='25' text-anchor='middle' dominant-baseline='middle' font-family='Arial,sans-serif' font-size='7' font-weight='900' fill='%231d4ed8'%3EDOC%3C/text%3E%3C/svg%3E");
}
.material-file-badge--img  .file-badge-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M2 0 L18 0 L28 10 L28 34 Q28 36 26 36 L2 36 Q0 36 0 34 L0 2 Q0 0 2 0Z' fill='%23e0f2fe'/%3E%3Cpolygon points='18,0 28,10 18,10' fill='%2393c5fd'/%3E%3Ctext x='14' y='25' text-anchor='middle' dominant-baseline='middle' font-family='Arial,sans-serif' font-size='7' font-weight='900' fill='%230369a1'%3EIMG%3C/text%3E%3C/svg%3E");
}
.material-file-badge--video .file-badge-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M2 0 L18 0 L28 10 L28 34 Q28 36 26 36 L2 36 Q0 36 0 34 L0 2 Q0 0 2 0Z' fill='%23f3e8ff'/%3E%3Cpolygon points='18,0 28,10 18,10' fill='%23e9d5ff'/%3E%3Ctext x='14' y='25' text-anchor='middle' dominant-baseline='middle' font-family='Arial,sans-serif' font-size='7' font-weight='900' fill='%237c3aed'%3EVID%3C/text%3E%3C/svg%3E");
}
.material-file-badge--file  .file-badge-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M2 0 L18 0 L28 10 L28 34 Q28 36 26 36 L2 36 Q0 36 0 34 L0 2 Q0 0 2 0Z' fill='%23f1f5f9'/%3E%3Cpolygon points='18,0 28,10 18,10' fill='%23e2e8f0'/%3E%3Ctext x='14' y='25' text-anchor='middle' dominant-baseline='middle' font-family='Arial,sans-serif' font-size='6' font-weight='900' fill='%23475569'%3EFILE%3C/text%3E%3C/svg%3E");
}

.file-badge-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive: footer + nav social + FAB ───────── */
@media (max-width: 768px) {
  .nav-social-item { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fab-wrap { bottom: 20px; right: 16px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }

  /* Всё в подвале — по левому краю (заголовки и нижняя подпись) */
  .footer-col-title { text-align: left; }
  .footer-inner > .footer-col { justify-self: start !important; text-align: left !important; }
  .footer-brand, .footer-copy, .footer-dev { text-align: left !important; }

  /* Разделы и Контакты — одинаковый первый столбец фиксированной ширины,
     поэтому вторые столбцы попарно делят общую левую границу.
     Почта остаётся в одну строку и просто сдвигается левее. */
  .footer-nav,
  .footer-contacts {
    grid-template-columns: 104px 1fr;
    grid-auto-flow: column;
    column-gap: 16px;
    row-gap: 12px;
    justify-items: start;
  }
  .footer-nav { grid-template-rows: repeat(4, auto); }
  .footer-contacts { grid-template-rows: repeat(2, auto); }
  .footer-contact-link { min-width: 0; font-size: .75rem; }
  .footer-contact-link span { white-space: nowrap; }
  .footer-contact-link img { width: 20px; height: 20px; }
}
/* Подстраховка для очень узких экранов (<360px): почта переносится,
   чтобы не появлялся горизонтальный скролл */
@media (max-width: 359px) {
  .footer-contact-link span { white-space: normal; overflow-wrap: anywhere; }
}
