.p-story-profile {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 38px 0 34px;
  border-bottom: 1px solid var(--story-line);
}

.p-story-profile__avatar {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid var(--story-line);
  border-radius: 50%;
  background: var(--story-soft);
  color: var(--story-accent);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.p-story-profile__body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.p-story-profile__head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
}

.p-story-profile__name {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: .12em;
}

.p-story-profile__count {
  color: var(--story-muted);
  font-size: 13px;
}

.p-story-profile__description {
  max-width: 640px;
  margin: 0;
  color: var(--story-muted);
  font-size: 13px;
  line-height: 1.8;
}

.p-story-profile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-story-profile__tags a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  color: var(--story-muted);
  font-size: 12px;
  line-height: 1;
}

.p-story-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--story-line);
}

.p-story-tabs__item {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--story-ink);
  color: var(--story-ink);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.p-story-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--story-gap);
  padding: var(--story-gap) 0 0;
}

.c-story-card {
  min-width: 0;
}

.c-story-card__link {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--story-soft);
}

.c-story-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-story-card__empty {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--story-soft);
}

.c-story-card__title {
  position: absolute;
  inset: auto 0 0;
  display: block;
  padding: 38px 10px 10px;
  color: var(--story-paper);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  background: linear-gradient(to top, rgba(18,15,11,.66), rgba(18,15,11,0));
  transition: opacity .18s ease;
}

.c-story-card__link:hover .c-story-card__title,
.c-story-card__link:focus-visible .c-story-card__title {
  opacity: 1;
}

.p-story-gallery__empty {
  grid-column: 1 / -1;
  margin: 48px 0;
  color: var(--story-muted);
  text-align: center;
}

.p-story-pagination {
  margin: 36px 0 0;
  text-align: center;
}

.p-story-pagination .nav-links {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.p-story-pagination .page-numbers {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--story-line);
  color: var(--story-muted);
  font-size: 13px;
}

.p-story-pagination .current {
  color: var(--story-ink);
  border-color: var(--story-ink);
}

@media (max-width: 720px) {
  .p-story-profile {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    padding: 24px 12px 22px;
  }

  .p-story-profile__avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  .p-story-profile__name {
    font-size: 20px;
  }

  .p-story-profile__description {
    grid-column: 1 / -1;
    font-size: 12px;
  }

  .p-story-profile__tags {
    grid-column: 1 / -1;
  }

  .p-story-tabs__item {
    min-height: 42px;
  }

  .p-story-gallery {
    gap: 3px;
    padding-top: 3px;
  }

  .c-story-card__title {
    display: none;
  }
}

.p-story-profile__avatar {
  overflow: hidden;
}

.p-story-profile__avatarImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
