/* Author Profile & Sticky Sidebar. Inherits the theme's fonts and link colour. */

/* ---------- Sticky sidebar ---------- */
.ap-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: var(--ap-sticky-top, 24px);
  z-index: 5;
}
.ap-sticky-self {
  align-self: flex-start; /* stop flex/grid stretching the sidebar to full height */
  height: auto;
}

/* ---------- Shared pieces ---------- */
.ap-box, .ap-profile, .ap-card, .ap-byline {
  --ap-line: rgba(127, 127, 127, 0.28);
  --ap-muted: 0.72;
}
.ap-box p, .ap-profile p, .ap-card p { margin: 0; }

.ap-name { font-weight: 700; font-size: 1.15em; line-height: 1.25; }
.ap-name a { text-decoration: none; color: inherit; }
.ap-name a:hover { text-decoration: underline; }
.ap-role { font-weight: 500; margin-top: 0.15em !important; }
.ap-cred { font-size: 0.9em; opacity: var(--ap-muted); margin-top: 0.15em !important; }
.ap-bio { margin-top: 0.75em !important; line-height: 1.6; }
.ap-bio p + p { margin-top: 0.75em; }

.ap-topics, .ap-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.ap-topics { margin-top: 0.9em; }
.ap-topics li {
  margin: 0;
  font-size: 0.8em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
}
.ap-links li { margin: 0; }
.ap-links a {
  display: inline-block;
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.3em 0.75em;
  border: 1px solid var(--ap-line);
  border-radius: 4px;
  text-decoration: none;
}
.ap-links a:hover, .ap-links a:focus-visible { border-color: currentColor; }

.ap-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  margin-top: 1.1em;
  padding-top: 1em;
  border-top: 1px solid var(--ap-line);
}
.ap-more { font-weight: 600; font-size: 0.9em; }
.ap-count { font-size: 0.9em; opacity: var(--ap-muted); }

/* ---------- Author box (end of post) ---------- */
.ap-box {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.25em;
  margin: 2.5em 0 1.5em;
  padding: 1.5em;
  border: 1px solid var(--ap-line);
  border-left: 4px solid currentColor;
  border-radius: 4px;
}
.ap-photo img, .ap-card img, .ap-profile-photo, .ap-byline img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  max-width: none;
}
.ap-photo img { width: 96px; height: 96px; }
.ap-label { font-size: 0.85em; opacity: var(--ap-muted); margin-bottom: 0.1em !important; }

/* ---------- Author page header ---------- */
.ap-profile {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2em;
  align-items: start;
  margin: 0 0 2.5em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--ap-line);
}
.ap-profile-photo { width: 140px; height: 140px; }
.ap-name-lg { font-size: 1.75em; }
.ap-profile .ap-bio { max-width: 42em; }

/* ---------- Sidebar card ---------- */
.ap-card { text-align: left; }
.ap-card img { width: 72px; height: 72px; margin-bottom: 0.75em; }
.ap-card .ap-name { font-size: 1.05em; }
.ap-card .ap-bio { font-size: 0.92em; }
.ap-card .ap-links { margin-top: 0.9em; }

/* ---------- Byline ---------- */
.ap-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em 0.9em;
  font-size: 0.92em;
  margin: 0 0 1.75em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--ap-line);
}
.ap-byline img { width: 36px; height: 36px; }
.ap-byline a { font-weight: 600; }
.ap-dates { opacity: var(--ap-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .ap-box { grid-template-columns: 64px 1fr; gap: 1em; padding: 1.1em; }
  .ap-photo img { width: 64px; height: 64px; }
  .ap-profile { grid-template-columns: 1fr; gap: 1.1em; }
  .ap-profile-photo { width: 104px; height: 104px; }
  .ap-name-lg { font-size: 1.45em; }
  .ap-foot { flex-direction: column; align-items: flex-start; }
}
