/* AJ Authors — author box + author profile header.
   Design tokens and the card treatment mirror aj-events / aj-related so the
   author card sits naturally alongside the rest of the America Josh site.

   No media queries on purpose: WP Rocket's "used CSS" pass can defer or strip
   them, which previously left aj-related's grid stuck multi-column on mobile.
   Everything below is intrinsically responsive (flex-wrap + clamp + min()). */

:root {
  --aj-ink: var(--wp--preset--color--ink, #14202e);
  --aj-blue: var(--wp--preset--color--brand-blue, #0592ce);
  --aj-red: var(--wp--preset--color--brand-red, #ff1d27);
  --aj-line: rgba(20, 32, 46, 0.12);
  --aj-radius: 14px;
}

/* ---------------------------------------------------------------------------
   Shared: avatar, link icons, strapline
   ------------------------------------------------------------------------ */

.aj-author-avatar {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.aj-author-avatar .aj-author-avatar__img,
.aj-author-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(20, 32, 46, 0.06);
}

.aj-author-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aj-author-links li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aj-author-links .aj-author-links__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--aj-line);
  border-radius: 50%;
  color: var(--aj-ink);
  background: #fff;
  text-decoration: none;
  box-shadow: none;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.aj-author-links .aj-author-links__link svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.aj-author-links .aj-author-links__link:hover,
.aj-author-links .aj-author-links__link:focus-visible {
  color: #fff;
  background: var(--aj-blue);
  border-color: var(--aj-blue);
  transform: translateY(-1px);
}

.aj-author-links__item--website .aj-author-links__link:hover,
.aj-author-links__item--website .aj-author-links__link:focus-visible {
  background: var(--aj-ink);
  border-color: var(--aj-ink);
}

.aj-author-sep {
  margin: 0 0.45rem;
  opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   Author box (single post)

   The outer element keeps Neve's .nv-author-biography class so the Customizer's
   --avatarsize / --borderradius / --authorcontentalign variables reach us, but
   the inner markup is ours, so none of Neve Pro's own author rules apply.
   ------------------------------------------------------------------------ */

.aj-author-box {
  margin: 2.5rem 0 1.5rem;
  padding: 1.4rem;
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
  background: #fff;
}

.aj-author-box__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.2rem;
}

.aj-author-box__inner.right {
  flex-direction: row-reverse;
}

.aj-author-box__inner.center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.aj-author-box__inner.center .aj-author-links,
.aj-author-box__inner.center .aj-author-box__footer {
  justify-content: center;
}

.aj-author-box__avatar {
  /* 24vw keeps the avatar from eating a small phone's width once the text has
     wrapped below it; on anything wider it stays at the Customizer's size. */
  width: min(var(--avatarsize, 96px), 24vw);
  height: min(var(--avatarsize, 96px), 24vw);
}

.aj-author-box__avatar img {
  border-radius: var(--borderradius, 50%);
}

/* Longhands, not the `flex` shorthand: Safari does not reliably parse a math
   function inside the shorthand, and a dropped declaration leaves the default
   `flex: 0 1 auto`, which sizes the column to its content and squeezes the
   prose into a sliver beside the avatar instead of wrapping under it.

   The 20rem basis is the point at which the text stacks: any time there is less
   than that beside the avatar, this column takes a full-width row of its own. */
.aj-author-box__body {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: min(100%, 20rem);
  min-width: 0;
  text-align: var(--authorcontentalign, left);
}

.aj-author-box__inner.center .aj-author-box__body {
  text-align: center;
}

.aj-author-box__eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--aj-blue);
}

.aj-author-box .aj-author-box__name {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--aj-ink);
}

.aj-author-box .aj-author-box__name a {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}

.aj-author-box .aj-author-box__name a:hover,
.aj-author-box .aj-author-box__name a:focus-visible {
  color: var(--aj-blue);
  text-decoration: underline;
}

.aj-author-box__strapline {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(20, 32, 46, 0.72);
}

.aj-author-box .aj-author-box__bio {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(20, 32, 46, 0.88);
}

.aj-author-box .aj-author-box__bio p {
  margin: 0 0 0.6rem;
}

.aj-author-box .aj-author-box__bio p:last-child {
  margin-bottom: 0;
}

.aj-author-box__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.9rem;
}

.aj-author-box .aj-author-box__more {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--aj-blue);
  text-decoration: none;
  white-space: nowrap;
}

.aj-author-box .aj-author-box__more:hover,
.aj-author-box .aj-author-box__more:focus-visible {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Author profile header (author archive)
   ------------------------------------------------------------------------ */

.aj-author-profile-wrap .nv-page-title {
  max-width: none;
}

.aj-author-profile {
  margin: 0 0 1.75rem;
  padding: 1.6rem;
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
  background: #fff;
  text-align: left;
}

.aj-author-profile__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.aj-author-profile__avatar {
  width: clamp(76px, 18vw, 118px);
  height: clamp(76px, 18vw, 118px);
}

/* Longhands for the same reason as .aj-author-box__body above. */
.aj-author-profile__ident {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: min(100%, 18rem);
  min-width: 0;
}

.aj-author-profile__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--aj-blue);
}

.aj-author-profile .aj-author-profile__name {
  margin: 0 0 0.3rem;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--aj-ink);
}

.aj-author-profile__strapline {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(20, 32, 46, 0.72);
}

.aj-author-profile__bio {
  margin: 1.15rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(20, 32, 46, 0.88);
  max-width: 70ch;
}

.aj-author-profile__bio p {
  margin: 0 0 0.75rem;
}

.aj-author-profile__bio p:last-child {
  margin-bottom: 0;
}

.aj-author-profile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--aj-line);
}

.aj-author-stat {
  min-width: 0;
}

.aj-author-profile__stats .aj-author-stat__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(20, 32, 46, 0.55);
}

.aj-author-profile__stats .aj-author-stat__value {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--aj-ink);
}

.aj-author-profile__topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}

.aj-author-profile__topics-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(20, 32, 46, 0.55);
}

.aj-author-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aj-author-topics li {
  margin: 0;
  list-style: none;
}

.aj-author-topics .aj-author-topic {
  display: inline-block;
  padding: 0.24rem 0.7rem;
  border: 1px solid var(--aj-line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--aj-ink);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.aj-author-topics .aj-author-topic:hover,
.aj-author-topics .aj-author-topic:focus-visible {
  color: #fff;
  background: var(--aj-blue);
  border-color: var(--aj-blue);
}

/* Neve prints an empty meta list under each archive card when no post meta is
   enabled; the leftover margin reads as a broken gap. */
.author .nv-meta-list:empty {
  display: none;
}
