/* Стилі публічного профілю. */
/* Public profile: mobile first. One framed card: optional cover, avatar, name, headline, status, links.
   Avatar above the text on phones, beside it from 48em. */

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.profile-card__cover {
  aspect-ratio: 3 / 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.profile-card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.profile-card__body {
  display: grid;
  gap: var(--s-4);
  justify-items: start;
  padding: var(--s-5);
}

/* With a cover the avatar overlaps its lower edge (half of its 8rem). */
.has-cover .profile-card__avatar { margin-top: calc(-4rem - var(--s-5)); }
.has-cover .profile-card__avatar .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.profile-card__avatar .avatar { display: grid; }

.profile-card__text { min-width: 0; display: grid; gap: var(--s-3); justify-items: start; }
.profile-card__titles { display: grid; gap: var(--s-1); min-width: 0; }
.profile-head__name { font-size: var(--fs-4); overflow-wrap: anywhere; }
.profile-head__handle { margin: 0; font-family: var(--font-mono); font-size: var(--fs--1); }
.profile-head__headline { max-width: 52ch; margin: 0; font-size: var(--fs-1); line-height: 1.4; overflow-wrap: anywhere; }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs--1);
}

.profile-meta li { display: flex; align-items: center; gap: var(--s-1); min-width: 0; overflow-wrap: anywhere; }
.profile-meta .icon { width: var(--icon-s); height: var(--icon-s); color: var(--muted); }


.profile-head__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs--1);
}

.profile-head__links { align-items: center; }
.profile-head__links li { display: flex; align-items: center; min-height: var(--control-h); }
.profile-head__links a,
.profile-head__links li { overflow-wrap: anywhere; }
.profile-head .with-icon { display: inline-flex; align-items: center; gap: var(--s-1); }

@media (pointer: coarse) {
  .profile-head .with-icon { min-height: var(--control-h); }
}

.profile-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }

/* Three counts in one framed row, split by hairlines. */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--s-6) 0 var(--s-7);
  background: var(--surface);
  border: 1px solid var(--line);
}

.profile-stats > div { padding: var(--s-4) var(--s-4) var(--s-5); min-width: 0; }
.profile-stats > div + div { border-left: 1px solid var(--line); }

.profile-stats dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.profile-stats dd {
  margin: var(--s-2) 0 0;
  font-family: var(--font-display);
  font-size: var(--fs-3);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track-display);
  font-variant-numeric: tabular-nums;
}

/* Sections under the tabs: a clear gap between projects, drafts and the badge. */
.profile-projects + .profile-projects,
.profile-projects + .embed { margin-top: var(--s-7); }

.profile-projects__title { font-size: var(--fs-2); margin-bottom: var(--s-4); }
.profile-projects__note { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }

.profile-row__main { min-width: 0; }
.profile .plate-row > :nth-child(3):not(.plate-row__marks) { grid-column: 2; justify-self: start; }
@media (min-width: 48em) { .profile .plate-row > :nth-child(3):not(.plate-row__marks) { grid-column: auto; justify-self: end; } }


.profile-pinned { margin-bottom: var(--s-6); }
.profile-tabs { margin-bottom: var(--s-5); }

.profile-log { list-style: none; margin: 0; padding: 0; }
.profile-log__item { display: grid; gap: var(--s-2); padding: var(--s-4); min-width: 0; }
.profile-log__item + .profile-log__item { border-top: 1px solid var(--line); }
.profile-log__item .log-entry__meta { margin: 0; }
.profile-log__item .log-entry__text { overflow-wrap: anywhere; }

.profile-about__text { max-width: 68ch; }
.profile-about__label { margin: var(--s-6) 0 var(--s-3); }

@media (min-width: 48em) {
  .profile-card__body { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-6); align-items: start; padding: var(--s-6); }
  .has-cover .profile-card__avatar { margin-top: calc(-4rem - var(--s-6)); }
  .profile-head__name { font-size: var(--fs-5); }
  .profile-stats > div { padding-inline: var(--s-5); }
  .profile-stats dd { font-size: var(--fs-4); }
}
