/* Визитки ДСМР по макету Figma «Умма», страница «Сайт-визитка»; компоненты – страница UI-kit.
   Цвета и текст повторяют стили Vizitka/* из Figma. Страницы статичные, без скриптов */

:root {
  --green: #186345;         /* Vizitka/Green */
  --green-tint: #E5F6EE;    /* Vizitka/Green Tint */
  --green-tint-hover: #C3F0DC; /* Vizitka/Green Tint Hover – на тон выше */
  --blue: #1C82B5;          /* Vizitka/Blue */
  --blue-tint: #E5F3FC;     /* Vizitka/Blue Tint */
  --blue-tint-hover: #C5E9FF;  /* Vizitka/Blue Tint Hover */
  --gold: #E0B764;          /* Vizitka/Gold */
  --gold-dark: #AF8022;     /* Vizitka/Gold Dark */
  --gold-tint: #FAF3E5;     /* Vizitka/Gold Tint */
  --gold-tint-hover: #F7E4C0;  /* Vizitka/Gold Tint Hover */
  --gold-pale: #E9CB90;     /* Vizitka/Gold Pale */
  --button: linear-gradient(90deg, #006030, #01773A);       /* Vizitka/Button Gradient */
  --button-hover: linear-gradient(90deg, #01773A, #208648); /* Vizitka/Button Gradient Hover – на тон светлее */
  --row-hover: #EEF1F1;     /* Vizitka/Row Hover */
  --green-gray: #547D75;    /* Vizitka/Green Gray */
  --gray: #61706D;          /* Vizitka/Gray */
  --card: #FAFBFB;          /* Vizitka/Card */
  --border-card: #E4F1EF;   /* Border/Card */
  --text-primary: #0E2D27;  /* Text/Primary */
  --text-tertiary: #849491; /* Text/Tetriary */
  --white: #FFFFFF;
  --bg-basic: #F1F8F7;      /* Background/Basic – поля по бокам на компьютере */
  --status: #14542D;        /* верхний край картинки шапки – цвет полосы статус-бара */
  --page-max: 480px;
  /* нижнее поле панели: 24 по макету, на iPhone с полоской «домой» – сколько она занимает */
  --bar-bottom: max(24px, env(safe-area-inset-bottom));
}

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

html {
  -webkit-text-size-adjust: 100%;
}

/* Safari 26 красит полосу статус-бара цветом фона body, Chrome – по theme-color.
   На телефоне страница закрывает body целиком, цвет виден только в полосе */
body {
  margin: 0;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--status);
}

a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 12px;
}

.page {
  position: relative;
  max-width: var(--page-max);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--white);
}

/* Шапка: картинка ДСМР 4:3 на всю ширину колонки, текст по центру по вертикали.
   Длинный текст растягивает шапку, картинка тогда обрезается слева – логотип справа остается */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: min(75vw, calc(var(--page-max) * .75));
  padding: calc(72px + env(safe-area-inset-top)) 16px 8px;
  overflow: hidden;
  background: var(--status);
  color: var(--white);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right top;
}

.hero__name,
.hero__position {
  position: relative;
  margin: 0;
  overflow-wrap: break-word;
}

.hero__name {
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
}

/* Фамилия, имя с отчеством и обращение – каждое с новой строки */
.hero__line {
  display: block;
}

/* Ширина 251 из 343 на 375 px: справа внизу орнамент */
.hero__position {
  max-width: 73%;
  font-size: 12px;
  line-height: 16px;
  color: var(--gold);
  text-wrap: pretty;
}

/* Строка должности, как прислала ДСМР: с новой строки; не влезла в колонку – делится на две ровные */
.hero__position-line {
  display: block;
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

/* Дополнительные логотипы – в ряд слева от логотипа ДСМР на картинке. На 375 px сверху 16, правый край
   в 106 от края шапки, высота 62, через 20; шире и уже масштабируются вместе с картинкой */
.hero__logos {
  position: absolute;
  top: min(4.27vw, 20.5px);
  right: 28.27%;
  display: flex;
  align-items: flex-start;
  gap: min(5.33vw, 25.6px);
}

.hero__logos img {
  display: block;
  width: auto;
  height: min(16.53vw, 79.4px);
}

/* Снизу место под закрепленную панель (80, на Android с подсказкой – 106) и промежуток 20 до нее */
.main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 16px calc(76px + var(--bar-bottom) + var(--hint, 0px));
}

.main--plain {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Быстрые действия: на 375 три кнопки заполняют ряд ровно, шире – растягиваются.
   Уже 375 поля кнопок меньше, уже 360 – без иконок, иначе ряд не помещается */
.actions {
  display: flex;
  gap: 8px;
}

.action {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease;
}

.action img {
  display: block;
  flex: none;
}

.action--call {
  background: var(--green-tint);
  color: var(--green);
}

.action--telegram {
  background: var(--blue-tint);
  color: var(--blue);
}

.action--site {
  background: var(--gold-tint);
  color: var(--gold-dark);
}

@media (max-width: 374px) {
  .action {
    padding: 0 10px;
  }
}

@media (max-width: 359px) {
  .action img {
    display: none;
  }
}

/* Карточка контактов: заголовок прописными, строки через разделитель 1 px с полями по 4 */
.card {
  padding: 16px 0;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: var(--card);
}

.card__title {
  margin: 0;
  padding: 0 20px 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  text-transform: uppercase;
  color: var(--green-gray);
}

.card__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card__list li + li {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border-card);
}

/* Строка – ссылка целиком: аватар, подпись со значением, стрелка */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 16px 8px 20px;
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease;
}

.avatar {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.avatar--letter {
  display: grid;
  place-items: center;
  background: var(--green);
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
  color: var(--white);
}

.avatar--max {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: url('../assets/max-bg-sm.png') center / cover no-repeat;
}

.avatar--max img {
  display: block;
  width: 22.5px;
  height: 22.41px;
}

.row__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.row__label {
  font-size: 14px;
  line-height: 18px;
  color: var(--gray);
}

.row__value {
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.row__chevron {
  display: block;
  flex: none;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
  font-size: 11px;
  line-height: 18px;
  color: var(--text-tertiary);
}

.footer__caption {
  margin: 0;
}

.footer__credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}

.footer__credit img {
  display: block;
  width: 131px;
  height: 16px;
}

/* Нижняя панель закреплена: контент прокручивается под ней. На компьютере – в колонке */
.bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px 16px var(--bar-bottom);
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .05);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  background: var(--button);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--gold-pale);
  text-decoration: none;
  transition: transform .1s ease;
}

.button img {
  display: block;
  flex: none;
}

.button:active {
  transform: scale(.98);
}

/* На Android файл контакта скачивается, окно «Сохранить» появляется, когда его открывают, – подсказка
   только там. Телефон без мыши, но не iPhone и не iPad (у них есть -webkit-touch-callout) */
.bar__hint {
  display: none;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: var(--text-tertiary);
}

@media (hover: none) and (pointer: coarse) {
  @supports not (-webkit-touch-callout: none) {
    :root {
      --hint: 26px;
    }

    .bar__hint {
      display: block;
    }
  }
}

/* На компьютере по бокам от колонки – светлый фон приложения */
@media (min-width: 481px) {
  body {
    background: var(--bg-basic);
  }
}

/* Ховер: фон кнопок на тон выше, главная кнопка на тон светлее, строка карточки – Row Hover */
@media (hover: hover) and (pointer: fine) {
  .action--call:hover {
    background: var(--green-tint-hover);
  }

  .action--telegram:hover {
    background: var(--blue-tint-hover);
  }

  .action--site:hover {
    background: var(--gold-tint-hover);
  }

  .row:hover {
    background: var(--row-hover);
  }

  .button:hover {
    background: var(--button-hover);
  }

  .footer__credit:hover {
    color: var(--text-primary);
  }
}
