/*
 * Author archive (author.php): a profile band with the author's photo, name,
 * bio and LinkedIn link, then their blog posts as the /blog/ listing's cards
 * in two columns, paged. Loaded only on author archives (oit_enqueue_author_css()
 * in functions.php), after style.css, with oit-resource-listing (the cards'
 * base styles and the pagination).
 *
 * The page runs the full width of the window (the bands and the card grid
 * are held to the 1280px content column by padding), the same as a single
 * blog post's hero.
 */

/* Full-bleed wrapper; Astra's own padding and width on #primary go */
body.author #primary.oit-author { /* #primary: out-ranks Astra's .ast-separate-container #primary margin and padding */
  --oit-author-inset: max(var(--page-gutter), calc(50vw - 640px));
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  flex: 0 0 auto; /* Astra lays #primary out in a flex row, which shrank this to the container */
  margin: 0 0 0 calc(50% - 50vw);
  padding: 0;
}

/* ---- Profile band ---- */

.oit-author-hero {
  padding: var(--space-4xl) var(--oit-author-inset);
  background: var(--surface-secondary);
}

.oit-author-hero__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3xl);
}

.oit-author-hero__avatar {
  flex: none;
  width: 192px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
}

.oit-author-hero__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oit-author-hero__text {
  min-width: 0;
}

.oit-author-hero__eyebrow {
  margin-bottom: var(--space-xs);
  color: var(--text-action);
  font-family: var(--font-family-base);
  font-size: var(--eyebrow-normal-size);
  line-height: var(--eyebrow-normal-line-height);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

body.author h1.oit-author-hero__name {
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  font-size: var(--h1-size);
  line-height: var(--h1-line-height);
  font-weight: var(--font-weight-bold);
}

.oit-author-hero__bio {
  max-width: 800px;
  margin: 0 0 var(--space-lg);
  color: var(--text-primary);
  font-size: var(--text-lg-size);
  line-height: var(--text-lg-line-height);
}

.oit-author-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
  font-size: var(--text-normal-size);
  line-height: var(--text-normal-line-height);
}

.oit-author-hero a.oit-author-hero__linkedin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: color 0.2s ease;
}

.oit-author-hero a.oit-author-hero__linkedin:hover {
  color: var(--text-action);
}

/* LinkedIn logo in the link's color, from icons/linkedin.svg */
.oit-author-hero__linkedin-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: url("/wp-content/themes/astra-child/icons/linkedin.svg") no-repeat center / contain;
  mask: url("/wp-content/themes/astra-child/icons/linkedin.svg") no-repeat center / contain;
}

/* ---- Articles ---- */

.oit-author-posts {
  padding: var(--space-3xl) var(--oit-author-inset) var(--space-4xl);
}

.oit-author-posts__title {
  margin: 0 0 var(--space-lg);
  color: var(--text-primary);
  font-size: var(--h3-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--h3-line-height);
}

.oit-author-posts__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: stretch;
}

.oit-author-posts__empty {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .oit-author-hero {
    padding-block: var(--space-3xl);
  }

  .oit-author-hero__inner {
    gap: var(--space-xl);
  }

  .oit-author-hero__avatar {
    width: 144px;
  }
}

@media (max-width: 767px) {
  .oit-author-hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .oit-author-hero__avatar {
    width: 120px;
  }

  body.author h1.oit-author-hero__name {
    font-size: var(--h3-size);
    line-height: var(--h3-line-height);
  }

  .oit-author-posts__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .oit-author-posts {
    padding-block: var(--space-2xl);
  }
}
