/**
 * Author archive template — premium MSA blog-author page.
 *
 * Loaded only on is_author() (see msa_author_assets() in functions.php).
 * Every rule is scoped under `.author-page` so it can never leak into the
 * homepage, other archives, single posts, the program/trainer CPT templates,
 * the /blog/ index, header or footer.
 *
 * Palette mirrors the rest of the theme:
 *   navy   #050a24 / #101a4a       blue  #4cc9ff
 *   lime   #b7f238                 red   #ff334b
 *   text   #17215c
 */

.author-page {
  color: #17215c;
}

.author-page .author-container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
 * HERO
 * ------------------------------------------------------------------------ */
.author-page .author-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 4vw, 64px) 0 clamp(46px, 3.8vw, 58px);
  color: #fff;
  background:
    radial-gradient(circle at 15% 22%, rgba(76, 201, 255, .14), transparent 32%),
    radial-gradient(circle at 78% 18%, rgba(183, 242, 56, .10), transparent 30%),
    linear-gradient(135deg, #050a24 0%, #101a4a 52%, #050a24 100%);
}

.author-page .author-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(255, 255, 255, .04) 49.8%, rgba(255, 255, 255, .04) 50.2%, transparent 50.4%);
  pointer-events: none;
}

.author-page .author-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) minmax(300px, .7fr);
  gap: clamp(28px, 3.5vw, 52px);
  align-items: center;
}

/* Avatar */
.author-page .author-hero-avatar {
  width: 205px;
  height: 205px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(183, 242, 56, .55);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .32), 0 0 0 9px rgba(255, 255, 255, .06);
  background: linear-gradient(135deg, #101a4a, #050a24);
}

.author-page .author-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Copy */
.author-page .author-hero-copy {
  min-width: 0;
}

.author-page .author-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(76, 201, 255, .12);
  border: 1px solid rgba(76, 201, 255, .34);
  color: #cdeeff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.author-page .author-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7f238;
  box-shadow: 0 0 0 4px rgba(183, 242, 56, .18);
}

.author-page .author-title {
  margin: 12px 0 0;
  color: #fff;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.author-page .author-role {
  margin: 16px 0 0;
  color: #cdeeff;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 800;
}

.author-page .author-bio {
  margin: 16px 0 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.65;
}

/* Socials */
.author-page .author-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.author-page .author-social-link {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .16);
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.author-page .author-social-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.author-page .author-social-link:hover,
.author-page .author-social-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(76, 201, 255, .16);
  border-color: rgba(76, 201, 255, .45);
  color: #cdeeff;
  outline: none;
}

/* Hero visual */
.author-page .author-hero-visual {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.author-page .author-court {
  position: relative;
  width: min(100%, 320px);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(160deg, rgba(76, 201, 255, .16), rgba(10, 18, 54, .55));
  border: 1px solid rgba(120, 170, 255, .26);
  box-shadow: 0 30px 80px rgba(4, 10, 40, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(6px);
}

.author-page .author-court svg {
  display: block;
  width: 100%;
  height: auto;
}

.author-page .author-court__ball {
  animation: author-ball-bob 4.2s ease-in-out infinite;
  transform-origin: center;
}

@keyframes author-ball-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
  .author-page .author-court__ball { animation: none; }
}

.author-page .author-hero-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: #fff;
  color: #0d1b3a;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.author-page .author-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------------------
 * CONTENT
 * ------------------------------------------------------------------------ */
.author-page .author-content {
  padding: clamp(64px, 6vw, 96px) 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(76, 201, 255, .07), transparent 28%),
    linear-gradient(180deg, #f6f8ff 0%, #ffffff 48%, #f4f7ff 100%);
}

.author-page .author-articles-head {
  margin-bottom: 26px;
}

.author-page .author-articles-title {
  margin: 0;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #17215c;
}

.author-page .author-articles-sub {
  margin: 10px 0 0;
  color: #45507f;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.6;
}

/* Filters */
.author-page .author-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(28px, 3.5vw, 42px);
}

.author-page .author-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(23, 33, 92, .12);
  color: #17215c;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.author-page .author-pill:hover {
  transform: translateY(-1px);
  border-color: #4cc9ff;
  color: #1f6fd6;
}

.author-page .author-pill--active {
  background: #17215c;
  border-color: #17215c;
  color: #fff;
}

/* Layout */
.author-page .author-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.author-page .author-main {
  min-width: 0;
}

.author-page .author-sidebar {
  display: grid;
  gap: 22px;
}

/* Sidebar cards — styled to match the /blog/ archive cards (scoped, no leakage) */
.author-page .author-sidebar-card {
  padding: 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .94));
  border: 1px solid rgba(23, 33, 92, .09);
  box-shadow: 0 24px 70px rgba(24, 35, 93, .10);
}

.author-page .author-sidebar-card__title {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #1f6fd6;
}

.author-page .author-topics,
.author-page .author-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-page .author-topics li,
.author-page .author-recent li {
  border-top: 1px solid rgba(23, 33, 92, .08);
}

.author-page .author-topics li:first-child,
.author-page .author-recent li:first-child {
  border-top: 0;
}

.author-page .author-topics a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: #17215c;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.author-page .author-topics a:hover {
  color: #1f6fd6;
}

.author-page .author-topics__count {
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(76, 201, 255, .14);
  color: #1f6fd6;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.author-page .author-recent__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  text-decoration: none;
}

.author-page .author-recent__title {
  color: #17215c;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.author-page .author-recent__link:hover .author-recent__title {
  color: #1f6fd6;
}

.author-page .author-recent__date {
  color: rgba(23, 33, 92, .55);
  font-size: 12.5px;
  font-weight: 600;
}

@media (min-width: 981px) {
  .author-page .author-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
  }

  .author-page .author-sidebar {
    position: sticky;
    top: 110px;
  }
}

/* Shared card placeholder (no thumbnail) */
.author-page .author-card-placeholder {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------------------------------------------------------------------------
 * FEATURED CARD
 * ------------------------------------------------------------------------ */
.author-page .author-featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  margin-bottom: 26px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(23, 33, 92, .08);
  box-shadow: 0 24px 70px rgba(24, 35, 93, .12);
}

.author-page .author-featured-card__image {
  position: relative;
  display: block;
  min-height: 280px;
  background: linear-gradient(135deg, #101a4a, #050a24);
  overflow: hidden;
}

.author-page .author-featured-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-page .author-featured-card__body {
  padding: clamp(26px, 3vw, 38px);
  display: flex;
  flex-direction: column;
}

.author-page .author-featured-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(23, 33, 92, .55);
}

.author-page .author-featured-card__cat {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(76, 201, 255, .14);
  color: #1f6fd6;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.author-page .author-featured-card__title {
  margin: 14px 0 0;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #17215c;
}

.author-page .author-featured-card__title a {
  color: inherit;
  text-decoration: none;
}

.author-page .author-featured-card__title a:hover {
  color: #1f6fd6;
}

.author-page .author-featured-card__excerpt {
  margin: 12px 0 0;
  color: #45507f;
  font-size: 16px;
  line-height: 1.6;
}

.author-page .author-featured-card__link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: #1f6fd6;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.author-page .author-featured-card__link:hover {
  gap: 11px;
  color: #0f5ec0;
}

/* ---------------------------------------------------------------------------
 * ARTICLE GRID
 * ------------------------------------------------------------------------ */
.author-page .author-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.author-page .author-article-card {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(23, 33, 92, .08);
  box-shadow: 0 18px 50px rgba(24, 35, 93, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.author-page .author-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 64px rgba(24, 35, 93, .14);
}

.author-page .author-article-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #101a4a, #050a24);
}

.author-page .author-article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-page .author-article-card__cat {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 999px;
  background: #b7f238;
  color: #0d1b3a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.author-page .author-article-card__body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.author-page .author-article-card__meta {
  color: rgba(23, 33, 92, .55);
  font-size: 13px;
  font-weight: 700;
}

.author-page .author-article-card__title {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #17215c;
}

.author-page .author-article-card__title a {
  color: inherit;
  text-decoration: none;
}

.author-page .author-article-card__title a:hover {
  color: #1f6fd6;
}

.author-page .author-article-card__excerpt {
  margin: 10px 0 0;
  color: #45507f;
  font-size: 15px;
  line-height: 1.55;
}

.author-page .author-article-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: #1f6fd6;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.author-page .author-article-card__link:hover {
  gap: 9px;
  color: #0f5ec0;
}

/* ---------------------------------------------------------------------------
 * SIDEBAR CARDS
 * ------------------------------------------------------------------------ */
.author-page .author-card {
  padding: 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .94));
  border: 1px solid rgba(23, 33, 92, .09);
  box-shadow: 0 24px 70px rgba(24, 35, 93, .10);
}

.author-page .author-card__title {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #1f6fd6;
}

.author-page .author-card-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.author-page .author-card-person img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid rgba(76, 201, 255, .4);
}

.author-page .author-card-person__name {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #17215c;
}

.author-page .author-card-person__role {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(23, 33, 92, .62);
}

.author-page .author-card-line {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #45507f;
}

.author-page .author-card-line strong {
  color: #17215c;
}

.author-page .author-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: #1f6fd6;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.author-page .author-card__link:hover {
  color: #0f5ec0;
}

/* Topics */
.author-page .author-topics {
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-page .author-topics li {
  border-top: 1px solid rgba(23, 33, 92, .08);
}

.author-page .author-topics li:first-child {
  border-top: 0;
}

.author-page .author-topics a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: #17215c;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.author-page .author-topics a:hover {
  color: #1f6fd6;
}

.author-page .author-topics__count {
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(76, 201, 255, .14);
  color: #1f6fd6;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Recent posts */
.author-page .author-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-page .author-recent li {
  border-top: 1px solid rgba(23, 33, 92, .08);
}

.author-page .author-recent li:first-child {
  border-top: 0;
}

.author-page .author-recent a {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  text-decoration: none;
}

.author-page .author-recent__thumb {
  flex: none;
  width: 64px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #101a4a, #050a24);
}

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

.author-page .author-recent__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.author-page .author-recent__title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: #17215c;
}

.author-page .author-recent a:hover .author-recent__title {
  color: #1f6fd6;
}

.author-page .author-recent__date {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(23, 33, 92, .5);
}

/* ---------------------------------------------------------------------------
 * PAGINATION
 * ------------------------------------------------------------------------ */
.author-page .author-pagination {
  margin-top: clamp(40px, 5vw, 60px);
}

.author-page .author-pagination .nav-links,
.author-page .author-pagination .page-numbers {
  display: inline-flex;
}

.author-page .author-pagination .nav-links {
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.author-page .author-pagination .page-numbers {
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(23, 33, 92, .12);
  color: #17215c;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.author-page .author-pagination a.page-numbers:hover {
  transform: translateY(-2px);
  border-color: #4cc9ff;
  color: #1f6fd6;
}

.author-page .author-pagination .page-numbers.current {
  background: #17215c;
  border-color: #17215c;
  color: #fff;
}

.author-page .author-pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

/* ---------------------------------------------------------------------------
 * EMPTY STATE
 * ------------------------------------------------------------------------ */
.author-page .author-empty-state {
  padding: clamp(48px, 6vw, 80px);
  border-radius: 22px;
  text-align: center;
  background: #fff;
  border: 1px dashed rgba(23, 33, 92, .18);
}

.author-page .author-empty-state h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 900;
  color: #17215c;
}

.author-page .author-empty-state p {
  margin: 12px auto 0;
  max-width: 46ch;
  color: #45507f;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * RESPONSIVE
 * ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .author-page .author-hero-grid {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .author-page .author-hero-visual {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
  }

  .author-page .author-court {
    flex: 0 1 320px;
  }
}

@media (max-width: 980px) {
  .author-page .author-hero {
    padding: 48px 0 52px;
  }

  .author-page .author-hero-grid,
  .author-page .author-layout {
    grid-template-columns: 1fr;
  }

  .author-page .author-hero-avatar {
    margin: 0 auto;
  }

  .author-page .author-hero-visual {
    flex-direction: column;
    align-items: center;
  }

  .author-page .author-court {
    flex: none;
    width: min(100%, 360px);
  }

  .author-page .author-hero-cta {
    align-self: center;
  }

  .author-page .author-sidebar {
    display: none;
  }

  .author-page .author-featured-card {
    grid-template-columns: 1fr;
  }

  .author-page .author-featured-card__image {
    min-height: 220px;
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 640px) {
  .author-page .author-container {
    width: min(100% - 28px, 1280px);
  }

  .author-page .author-title {
    font-size: clamp(26px, 8vw, 36px);
    text-align: center;
  }

  .author-page .author-hero-copy {
    text-align: center;
  }

  .author-page .author-hero {
    padding: 96px 0 42px;
  }

  .author-page .author-hero-grid {
    gap: 22px;
  }

  .author-page .author-hero-avatar {
    width: 170px;
    height: 170px;
    margin-top: 8px;
  }

  /* Hide the decorative court/CTA visual on mobile (keeps hero compact). */
  .author-page .author-hero-visual {
    display: none;
  }

  .author-page .author-eyebrow,
  .author-page .author-hero-cta {
    align-self: center;
  }

  .author-page .author-socials {
    justify-content: center;
    margin-top: 20px;
  }

  .author-page .author-articles-grid {
    grid-template-columns: 1fr;
  }
}
