/* components/archive-header.css — layout for partials/archive-header.hbs.
   Shared rules first; [data-variant] carries the differences. */

.archive-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-block: var(--space-10);
  padding-block-end: var(--space-6);
  border-block-end: var(--border-width) solid var(--color-border-soft);
}

.archive-header__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Back link to the tag's section, above the title. Styled as a post's
   kicker (.post__tag in post.css) — keep the two in step. */
.archive-header__section {
  align-self: flex-start;
  font-family: var(--font-ui);
  font-size: var(--post-tag-size, var(--text-base));
  font-weight: var(--weight-normal);
  text-decoration: none;
}

.archive-header__title {
  font-size: var(--text-4xl);
}

.archive-header__description {
  max-width: var(--measure);
  color: var(--color-fg-tone);
  font-size: var(--text-lg);
}

/* Location · website. Reads as part of the author's bio, not small print. */
.archive-header__meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-fg-tone);
}

/* :has(), since the whitespace inside means :empty never matches. */
.archive-header__meta:not(:has(> *)) {
  display: none;
}

/* Empty alt text keeps the dot out of the accessible name. */
.archive-header__location:not(:last-child)::after {
  content: "·" / "";
  margin-inline-start: var(--space-2);
}

.archive-header__website {
  overflow-wrap: anywhere;
}

.archive-header__image {
  width: 100%;
  height: auto;
}

/* Author: portrait beside the text at every width. The rule closes the
   header; no margin below it, as the feed's first card has its own padding. */
.archive-header[data-variant="author"] {
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-6);
  margin-block-end: 0;
  padding-block-end: var(--space-10);
}

.archive-header[data-variant="author"] .archive-header__body {
  flex: 1;
}

.archive-header[data-variant="author"] .archive-header__title {
  font-size: var(--archive-author-title-size);
}

.archive-header[data-variant="author"] .archive-header__media {
  flex-shrink: 0;
}

.archive-header[data-variant="author"] .archive-header__image {
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border-radius: var(--radius-avatar, 50%);
}

@media (width >= 48rem) {
  .archive-header[data-variant="author"] .archive-header__image {
    width: 10rem;
    height: 10rem;
  }
}

/* Author from --bp-lg: the portrait stays on the content edge (not on the
   feed's columns, which would inset it), with a fixed gap to the text. */
@media (width >= 64rem) {
  .archive-header[data-variant="author"] {
    gap: var(--space-8);
  }
}

/* Tag: banner below the text, side by side from --bp-lg. */
@media (width >= 64rem) {
  .archive-header[data-variant="tag"] {
    flex-direction: row;
    align-items: center;
    gap: var(--space-10);
  }

  .archive-header[data-variant="tag"] .archive-header__body {
    flex: 1;
  }

  .archive-header[data-variant="tag"] .archive-header__media {
    flex: 1;
  }
}
