/* ===========================================================================
   style.css — «География работы» (шаблон geography компонента
   bitrix:news.list), Битрикс подключает его сам: вкладки, карточки
   с цифрами, карта. Карточки — копия правил ленты цифр
   (news.list/achievements), там же описано наведение.
   Отступы по макету 1920: от заголовка до вкладок 40px, от вкладок
   до цифр 60px, от цифр до карты 40px.
   =========================================================================== */

@layer blocks {

  /* Баннер под картой — разметка в /about/geography/index.php, отступ
     от карты — обычный отступ секций. Заголовок h1 выводит header.php */
  .geo-page__promo { margin-top: var(--section-gap); }

  .geo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 24px;
  }

  /* Вкладки — общий .pill-tabs (ui.css), отступ до цифр — у .geo__stats */

  /* === Карточки с цифрами ================================================= */

  /* Специфичнее .stat-cards ниже, которая сбрасывает margin */
  .geo .geo__stats {
    align-self: stretch;
    margin-top: 32px;
  }

  .stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .stat-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 120px;
    padding: 20px;
    border-radius: var(--radius-quote);
    background: var(--color-blue-50);
  }

  .stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--gradient-light);
    opacity: 0;
    transition: opacity var(--transition);
  }

  .stat-card:hover::before { opacity: 1; }

  .stat-card__value {
    color: var(--color-text);
    /* Цифры одной ширины — при досчёте текст не дёргается */
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-banner);
    line-height: 1;
  }

  .stat-card__label {
    color: var(--color-text-muted);
    font-size: var(--fs-text);
    line-height: 1;
  }

  /* === Карта ============================================================== */
  /* Пропорции заглушки макета (1600 × 656), на телефоне не ниже 420px.
     Пока API не загрузился — тёмный фон заглушки с надписью */

  .geo__map {
    position: relative;
    display: grid;
    place-items: center;
    align-self: stretch;
    min-height: 420px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: var(--radius-block);
    background: var(--color-gray-800);
    aspect-ratio: 1600 / 656;
  }

  .geo__map--ready { background: var(--color-blue-50); }

  .geo__map-status {
    color: var(--color-gray-300);
    font-size: var(--fs-text);
  }

  /* Контейнер карты, который создаёт script.js */
  .geo__map-canvas {
    position: absolute;
    inset: 0;
  }

  @media (width >= 768px) {
    .geo { margin-top: 40px; }
    .geo .geo__stats { margin-top: 60px; }
    .geo__map { margin-top: 40px; }
  }
}
