/**
 * Instructor profile — /instructor/{username}/
 *
 * A hero band carrying who they are and what the site can vouch for, then the
 * page's three sections: about, courses, what students say. The review summary
 * and star markup are course.css's — this file styles only what is its own.
 */

/* ── Hero ─────────────────────────────────────────────────────────────────── */

/* A band. It needs no escape of its own: the page wrapper already reaches the
   window edge, so this simply fills it. */
.courseglade-tp-hero {
  background: var(--courseglade-surface-lowest);
  border-bottom: 1px solid var(--courseglade-border);
}

/* Something for the page to open on. It carries no content, so it is short —
   enough to read as a band and to give the avatar an edge to break. */
.courseglade-tp-cover {
  height: 150px;
  background: linear-gradient(115deg, var(--courseglade-primary-deep), var(--courseglade-primary-light));
}

.courseglade-tp-hero__inner {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-block: 31px;
}

/* Pulled up over the cover, with a ring of the page behind it so the two bands
   read as one header rather than as a photo sitting on a seam. */
.courseglade-tp-avatar {
  flex: none;
  width: 252px;
  height: 252px;
  margin-top: -112px;
  border: 6px solid var(--courseglade-surface-lowest);
  border-radius: 15px;
  object-fit: cover;
  background: var(--courseglade-surface-low);
}

.courseglade-tp-id {
  flex: 1;
  min-width: 260px;
  max-width: 100%;
}

.courseglade-instructor-profile h1.courseglade-tp-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--courseglade-on-surface);
}

.courseglade-tp-headline {
  margin: 5px 0 0;
  font-size: 1rem;
  color: var(--courseglade-on-surface-muted);
}

/* The facts that qualify the name: where, in what languages, for how long. */
.courseglade-tp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--courseglade-on-surface-muted);
}

.courseglade-tp-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.courseglade-tp-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.courseglade-tp-links a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--courseglade-border);
  border-radius: 50%;
  color: var(--courseglade-on-surface-muted);
  transition: color var(--courseglade-transition), border-color var(--courseglade-transition);
}

.courseglade-tp-links a:hover,
.courseglade-tp-links a:focus-visible {
  border-color: var(--courseglade-primary);
  color: var(--courseglade-primary);
}

/* Right-aligned so the numbers read as a block rather than as more prose. */
.courseglade-tp-strip {
  flex: none;
  display: flex;
  gap: 26px;
  text-align: right;
}

.courseglade-tp-strip b {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--courseglade-on-surface);
  white-space: nowrap;
}

.courseglade-tp-strip span {
  font-size: 0.75rem;
  color: var(--courseglade-on-surface-muted);
  white-space: nowrap;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */

.courseglade-tp-body {
  padding: 32px 0 60px;
}

/* The gap below this band belongs to the wrapper, not to the section inside
   it. That section is a grid item, so its own bottom margin only adds to its
   column and is absorbed whenever the chips beside it run to more rows —
   which left "About" sitting flush against the courses heading. */
.courseglade-tp-top {
  margin-bottom: 32px;
}

.courseglade-tp-top > .courseglade-tp-sec {
  margin-bottom: 0;
}

/* Prose on the left at a readable measure, the scannable list on the right. */
.courseglade-tp-top--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 48px;
}

.courseglade-tp-side-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--courseglade-on-surface);
}

.courseglade-tp-sec {
  margin-bottom: 32px;
}

.courseglade-tp-sec:last-child {
  margin-bottom: 0;
}

.courseglade-instructor-profile .courseglade-tp-sec > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--courseglade-on-surface);
}

/* The count beside a heading, so "Courses by Rachel" does not have to be read
   to find out how many there are. */
.courseglade-tp-count {
  padding: 7px 10px;
  border: 1px solid var(--courseglade-border);
  border-radius: var(--courseglade-radius-pill);
  background: var(--courseglade-surface-lowest);
  font-size: 1rem;
  font-weight: 700;
  color: var(--courseglade-on-surface-muted);
  line-height: 1;
}

.courseglade-tp-bio p {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--courseglade-on-surface-secondary);
}

.courseglade-tp-bio p:last-child {
  margin-bottom: 0;
}

.courseglade-tp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A surface tint disappears on a themed page background, so the chip carries
   its own edge and sits on white. */
.courseglade-tp-chip {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--courseglade-border);
  border-radius: var(--courseglade-radius-pill);
  background: var(--courseglade-surface-lowest);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--courseglade-on-surface-secondary);
}

/* ── Reviews ──────────────────────────────────────────────────────────────── */

/* course.css caps the breakdown bar at 320px, which suits a course sidebar and
   leaves half this card empty. Here the bar is the width it is given. */
.courseglade-instructor-profile .courseglade-reviews-breakdown__bar {
  max-width: none;
}

.courseglade-instructor-profile .courseglade-reviews-summary {
  margin-bottom: 12px;
}

/* Each review is its own card. Rules between them read as one block of text
   with lines through it; the cards say where one person stops and the next
   starts. */
.courseglade-tp-reviews {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.courseglade-tp-rev {
  padding: 16px 20px;
  border: 1px solid var(--courseglade-border);
  border-radius: var(--courseglade-radius-md);
  background: var(--courseglade-surface-lowest);
}

.courseglade-tp-rev__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.courseglade-tp-rev__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--courseglade-surface-low);
}

.courseglade-tp-rev__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--courseglade-on-surface);
}

.courseglade-tp-rev__stars {
  display: inline-flex;
  gap: 1px;
  line-height: 0;
}

/* Which course, and when — the attribution, not the review. */
.courseglade-tp-rev__where {
  font-size: 0.75rem;
  color: var(--courseglade-on-surface-muted);
}

.courseglade-tp-rev__where a {
  color: var(--courseglade-on-surface-muted);
  text-decoration: none;
}

.courseglade-tp-rev__where a:hover,
.courseglade-tp-rev__where a:focus-visible {
  color: var(--courseglade-primary);
  text-decoration: underline;
}

.courseglade-instructor-profile .courseglade-tp-rev p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--courseglade-on-surface-secondary);
}

/* ── Narrow ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  /* Stacked, the list follows the prose rather than sitting beside it, so it
     needs the gap the grid was providing. */
  .courseglade-tp-top--split {
    display: block;
  }

  /* Stacked there is no column gap to separate the two, so the prose carries
     the space again and the list, now last, stops adding a second one. */
  .courseglade-tp-top > .courseglade-tp-sec {
    margin-bottom: 32px;
  }

  .courseglade-tp-side {
    margin-bottom: 0;
  }
}

@media (max-width: 860px) {
  .courseglade-tp-strip {
    width: 100%;
    flex-wrap: wrap;
    gap: 16px 24px;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .courseglade-tp-cover {
    height: 110px;
  }

  .courseglade-tp-avatar {
    width: 150px;
    height: 150px;
    margin-top: -70px;
    border-width: 5px;
  }

  .courseglade-instructor-profile h1.courseglade-tp-name {
    font-size: 1.5rem;
  }

  .courseglade-tp-rev__where {
    flex-basis: 100%;
  }
}

/* ── All reviews ──────────────────────────────────────────────────────────── */

.courseglade-tp-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  color: var(--courseglade-on-surface-muted);
}

.courseglade-tp-crumb a {
  font-weight: 600;
  color: var(--courseglade-primary);
  text-decoration: none;
}

.courseglade-tp-crumb a:hover,
.courseglade-tp-crumb a:focus-visible {
  text-decoration: underline;
}

.courseglade-instructor-profile h1.courseglade-tp-page-title {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--courseglade-on-surface);
}

.courseglade-tp-all {
  margin-top: 12px;
}

/* On a page that is only reviews there is room for two columns, and a single
   file of ten cards down a 1200px page is mostly margin. */
.courseglade-tp-reviews--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  gap: 16px;
}

@media (max-width: 768px) {
  .courseglade-tp-reviews--grid {
    grid-template-columns: 1fr;
  }
}

/* The dashboard's pager, which is scoped to #courseglade-dashboard and styled
   in a file this page does not load. Same markup, so it is the same pager to
   look at, without pulling dashboard.css onto a public profile. */
.courseglade-instructor-profile .courseglade-earnings-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 20px;
}

.courseglade-instructor-profile .courseglade-page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--courseglade-border);
  border-radius: var(--courseglade-radius-sm);
  background: var(--courseglade-surface-lowest);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--courseglade-on-surface-secondary);
  text-decoration: none;
  transition: all var(--courseglade-transition);
}

/* The page you are already on does not respond: there is nowhere to go. */
.courseglade-instructor-profile a.courseglade-page-btn:not(.is-active):hover,
.courseglade-instructor-profile a.courseglade-page-btn:not(.is-active):focus {
  border-color: var(--courseglade-primary);
  background: var(--courseglade-surface);
  color: var(--courseglade-primary);
  text-decoration: none;
}

.courseglade-instructor-profile .courseglade-page-btn.is-active {
  border-color: var(--courseglade-primary);
  background: var(--courseglade-primary);
  color: var(--courseglade-surface-lowest);
}

/* A dead end keeps the box, so the row stays even — it reads as unavailable
   rather than disappearing. */
.courseglade-instructor-profile span.courseglade-page-btn {
  background: var(--courseglade-surface);
  color: var(--courseglade-gray-300);
  cursor: default;
}

.courseglade-instructor-profile .courseglade-page-ellipsis {
  padding: 0 2px;
  color: var(--courseglade-gray-400);
  user-select: none;
}
