/* Components shared by the portal and the dashboard/CRM: identity marks and
   photo frames, star ratings, filter chips, the lesson-mode badge, icon
   buttons. Loaded on both surfaces (before portal.css on the portal, instead
   of it on the dashboard), so the CRM no longer carries the whole public
   stylesheet. A rule belongs here once a dashboard or CRM template renders
   its classes. */

.lesson-mode-badge {
  background: var(--color-brand-soft);
  color: var(--accent-primary);
}

/* A lead's state (`Lead.STATUS_CLASSES`), on the CRM and the requester's
   own list. New waits on someone, so it is the one filled badge; Contacted
   is the brand tint, Enrolled the green one, Lost the page grey. The icon
   says the same without colour (Von Restorff, `docs/conventions.md`). */
.badge.lead-status {
  align-items: center;
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  gap: var(--space-1);
}

.badge.lead-status--new {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.lead-status--new .fa-circle {
  font-size: 0.5em;
}

.badge.lead-status--contacted {
  background: var(--color-brand-soft);
  color: var(--color-brand);
}

.badge.lead-status--enrolled {
  background: var(--identity-green-start);
  color: var(--identity-green-ink);
}

.badge.lead-status--lost {
  background: var(--bg);
  color: var(--text-muted);
}

.btn-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  /* 44px: the smallest target Apple and Material allow for a finger. */
  height: 2.75rem;
  justify-content: center;
  padding: 0;
  width: 2.75rem;
}

.center-profile-logo {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--accent-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 3rem;
  font-weight: 700;
  height: var(--profile-logo-size, 7.5rem);
  justify-content: center;
  overflow: hidden;
  width: var(--profile-logo-size, 7.5rem);
}

.center-profile-logo img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

img.center-profile-logo {
  object-fit: contain;
}

/* Stars are drawn in reverse so `:checked ~` reaches every lower one; the row
   reads one to five again because the flex direction is reversed too. */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.25rem;
  justify-content: flex-end;
}

.star-rating__star {
  color: var(--border);
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
}

/* The control is a real radio, hidden visually and never removed, so the stars
   are driven by the input's own state rather than by script. */
.star-rating__control {
  block-size: 1px;
  inline-size: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  clip-path: inset(50%);
}

/* A star and every star below it. Reversed DOM order is what makes "below"
   reachable: the lower scores are the later siblings. */
.star-rating__star:has(.star-rating__control:checked),
.star-rating__star:has(.star-rating__control:checked) ~ .star-rating__star {
  color: var(--calendar-amber);
}

/* Hover comes last so a preview wins over the current selection. */
.star-rating__star:hover,
.star-rating__star:hover ~ .star-rating__star {
  color: var(--calendar-amber);
}

/* The ring goes on the star, because the control it belongs to is invisible. */
.star-rating__star:has(.star-rating__control:focus-visible) {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

@media (max-width: 767.98px) {
  .center-profile-logo {
    font-size: 2rem;
  }}

.teacher-detail-photo {
  align-items: center;
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: 50%;
  color: var(--accent-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 2.5rem;
  justify-content: center;
  overflow: hidden;
  width: 7rem;
}

.teacher-detail-photo img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.brand-mark-img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.brand-mark-fallback {
  align-items: center;
  display: flex;
  font-size: 1.75rem;
  font-weight: 700;
  height: 100%;
  justify-content: center;
  line-height: 1;
  width: 100%;
}

/* Before the identity rules: a teacher's initial carries both classes, and
   the tone has to win at equal specificity. */
.center-teacher-fallback {
  align-items: center;
  border: 1px solid transparent;
  color: var(--accent-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 700;
  justify-content: center;
}

.identity-fallback {
  --identity-start: var(--identity-blue-start);
  --identity-end: var(--identity-blue-end);
  --identity-ink: var(--identity-blue-ink);
  --identity-border: var(--identity-blue-border);
  align-items: center;
  background: linear-gradient(145deg, var(--identity-start), var(--identity-end));
  border-color: var(--identity-border);
  color: var(--identity-ink);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
}

.identity-fallback--red {
  --identity-start: var(--identity-red-start);
  --identity-end: var(--identity-red-end);
  --identity-ink: var(--identity-red-ink);
  --identity-border: var(--identity-red-border);
}

.identity-fallback--green {
  --identity-start: var(--identity-green-start);
  --identity-end: var(--identity-green-end);
  --identity-ink: var(--identity-green-ink);
  --identity-border: var(--identity-green-border);
}

.identity-fallback--yellow {
  --identity-start: var(--identity-yellow-start);
  --identity-end: var(--identity-yellow-end);
  --identity-ink: var(--identity-yellow-ink);
  --identity-border: var(--identity-yellow-border);
}

@media (max-width: 991.98px) {
  body.public-nav-open {
    overflow: hidden;
  }}

.filter-chip,
.filter-clear-all {
  font-family: inherit;
}

button.filter-chip,
button.filter-clear-all {
  cursor: pointer;
}

button.filter-clear-all {
  background: transparent;
  border: 0;
  padding: 0;
}

/* Icons that shorten text (`docs/conventions.md`, "Buttons and icons"): an
   icon stands for a label ("Age:", "Language:") or leads a short note, and
   always sits beside words. Muted, fixed width, so fact lines align the same
   way on cards, profiles and sheets. */
.fact-icon {
  color: var(--color-text-muted);
  display: inline-block;
  margin-inline-end: 0.35em;
  text-align: center;
  width: 1.1em;
}

/* Facts on one line, each with its icon, separated by space rather than "·". */
.fact {
  white-space: nowrap;
}

.fact + .fact {
  margin-inline-start: 0.75rem;
}

/* A short note led by its icon, replacing a sentence of instruction. */
.icon-note {
  align-items: baseline;
  color: var(--color-text-muted);
  display: flex;
  gap: 0;
}
