/* ============================================================
   Страница автора (author.hbs)
   Токены общие с темой: текст #191919, акцент #fa6e4b,
   Golos Text для тела, Cormorant Garamond для крупного заголовка.

   Шапка тёмная и стыкуется с чёрной шапкой сайта в один блок —
   тот же приём, что у обложки лонгрида (.longrind-header) и у
   страницы поддержки. Портрет на тёмном читается лучше всего,
   а у автора без фото полоса остаётся осмысленной: роль, имя,
   счётчик материалов.
   ============================================================ */

.author-hero {
  /* вплотную к шапке: у .site-main padding-top 103px при шапке 78px,
     то есть 25px чистого зазора — их и снимаем */
  margin-top: -25px;
  background-color: #191919;
  color: #fff;
  position: relative;
  z-index: 97;
  padding: 56px 0 48px;
}

.author-hero__grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* Автор без фото: колонка портрета не резервируется */
.author-hero__grid:not(:has(.author-hero__photo)) {
  grid-template-columns: minmax(0, 1fr);
}

.author-hero__photo {
  position: relative;
  width: 180px;
  /* тонкое кольцо вокруг портрета вместо рамки — не съедает размер фото */
  outline: 1px solid rgba(255, 255, 255, 0.22);
  outline-offset: 9px;
  border-radius: 50%;
}

.author-hero__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}

.author-hero__body {
  min-width: 0;
  padding-top: 4px;
}

/* Надстрочник — роль автора из поля location (соглашение проекта),
   «Автор» остаётся фолбэком для профилей с пустой ролью */
.author-hero__kicker {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.author-hero__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  color: #fff;
}

.author-hero__bio {
  margin: 18px 0 0;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

/* Подвал шапки: слева ссылки, справа счётчик; разделён волосяной линией */
.author-hero__foot {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
}

.author-hero__count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
}

.author-hero__count-num {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

.author-hero__count-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Ссылки автора --------------------------------------------------
   Иконки — CSS-маски: файлы соцсетей в теме залиты белым, а маска берёт
   только альфу, поэтому цвет задаётся background-color и меняется
   по наведению. Тот же приём уже используется в donate.css. */

.author-soc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.author-soc__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.author-soc__item:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

/* У всех кнопок темы outline снят через !important в screen.css —
   перебиваем специфичностью, иначе фокус с клавиатуры не виден */
.author-soc__item:focus-visible,
.author-soc__site:focus-visible {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 3px;
}

/* Собственный сайт — не кружок, а плашка с адресом:
   он информативнее иконки и сразу показывает домен */
.author-soc__site {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  max-width: 320px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.author-soc__site:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.author-soc__site-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-soc__ico {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-color: currentColor;
}

.author-soc__ico--site {
  width: 17px;
  height: 17px;
  -webkit-mask: url("../images/author/site.svg") center / contain no-repeat;
  mask: url("../images/author/site.svg") center / contain no-repeat;
}
.author-soc__ico--x {
  -webkit-mask: url("../images/X.svg") center / contain no-repeat;
  mask: url("../images/X.svg") center / contain no-repeat;
}
.author-soc__ico--facebook {
  -webkit-mask: url("../images/soc-icon-5.svg") center / contain no-repeat;
  mask: url("../images/soc-icon-5.svg") center / contain no-repeat;
}
.author-soc__ico--instagram {
  -webkit-mask: url("../images/soc-icon-3.svg") center / contain no-repeat;
  mask: url("../images/soc-icon-3.svg") center / contain no-repeat;
}
.author-soc__ico--threads {
  -webkit-mask: url("../images/threads.svg") center / contain no-repeat;
  mask: url("../images/threads.svg") center / contain no-repeat;
}
.author-soc__ico--youtube {
  -webkit-mask: url("../images/soc-icon-4.svg") center / contain no-repeat;
  mask: url("../images/soc-icon-4.svg") center / contain no-repeat;
}
.author-soc__ico--tiktok {
  -webkit-mask: url("../images/soc-icon-7.svg") center / contain no-repeat;
  mask: url("../images/soc-icon-7.svg") center / contain no-repeat;
}
.author-soc__ico--bluesky {
  -webkit-mask: url("../images/author/bluesky.svg") center / contain no-repeat;
  mask: url("../images/author/bluesky.svg") center / contain no-repeat;
}
.author-soc__ico--mastodon {
  -webkit-mask: url("../images/author/mastodon.svg") center / contain no-repeat;
  mask: url("../images/author/mastodon.svg") center / contain no-repeat;
}
.author-soc__ico--linkedin {
  -webkit-mask: url("../images/author/linkedin.svg") center / contain no-repeat;
  mask: url("../images/author/linkedin.svg") center / contain no-repeat;
}

/* --- Лента материалов автора --------------------------------------- */

.author-feed {
  margin-top: 40px;
}

.author-feed__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.author-feed__head-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(25, 25, 25, 0.5);
  flex-shrink: 0;
}

/* Линия добирает строку до правого края — заголовок читается как рубрикатор */
.author-feed__head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background-color: rgba(25, 25, 25, 0.12);
}

.author-feed__empty {
  padding: 48px 0 64px;
  font-size: 18px;
  line-height: 1.4;
  color: rgba(25, 25, 25, 0.55);
}

@media (max-width: 991px) {
  .author-hero {
    /* шапка на мобильном 62px, а padding-top у .site-main считан от 78 — зазор 24 */
    margin-top: -24px;
    padding: 36px 0 32px;
  }

  .author-hero__grid {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 28px;
  }

  .author-hero__photo {
    width: 132px;
    outline-offset: 7px;
  }

  .author-hero__title {
    font-size: 40px;
  }

  .author-hero__bio {
    margin-top: 14px;
    font-size: 16px;
  }

  .author-hero__foot {
    margin-top: 24px;
    padding-top: 20px;
  }

  .author-feed {
    margin-top: 28px;
  }
}

@media (max-width: 575px) {
  .author-hero {
    padding: 28px 0 26px;
  }

  .author-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .author-hero__photo {
    width: 104px;
    outline-offset: 6px;
  }

  .author-hero__body {
    padding-top: 0;
  }

  .author-hero__title {
    font-size: 32px;
  }

  .author-hero__bio {
    font-size: 15px;
  }

  /* На телефоне счётчик уезжает под ссылки — иначе он жмёт их в две строки */
  .author-hero__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .author-hero__count {
    margin-left: 0;
  }

  .author-soc__item {
    width: 40px;
    height: 40px;
  }

  .author-soc__site {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    max-width: 100%;
  }
}
