/* =========================================================================
   "Courses I offer" - single source of truth for the feature's styles.
   Loaded on three pages:
     - the Account page (/members-area/account): opt-in "Set it up" + management
       (Refresh, per-course show/hide),
     - the owner's own profile (MyProfile): DISPLAY-ONLY of the chosen courses,
     - a public member profile (Profile): DISPLAY-ONLY of the chosen courses.
   Reuses the .subject-card chrome from desktop.css; only the switch, the slim
   invite, the Coherence chip, the setup block and the refresh row are new.
   Accent is the house orange (--8bm-orange) so it reads as its own section.
   ========================================================================= */

.courses-offered-container,
.courses-offered-public-wrapper,
.courses-offered-public-heading { --courses-accent: var(--8bm-orange, #F76922); }

.courses-offered-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.courses-offered-icon {
  width: 22px;
  height: 22px;
  color: var(--courses-accent);
  flex-shrink: 0;
}

/* ---- Coherence mark / wordmark ------------------------------------------- */
.courses-offered-logo {
  display: inline-block;
  height: 18px;
  width: auto;
  flex-shrink: 0;
  vertical-align: middle;
}
.courses-offered-ext { font-weight: 700; line-height: 1; }

/* ---- Provenance chip ------------------------------------------------------ */
.courses-offered-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 16px;
  border: 1px solid var(--courses-accent);
  color: var(--courses-accent);
  background: rgba(247, 105, 34, 0.08);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
/* Brand chip: the Coherence mark + wordmark, quieter than the orange chip. */
.courses-offered-chip--brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: auto;
  padding: 3px 9px;
  border: 1px solid #ece7e3;
  background: #fbf8f6;
  color: #8a827c;
}
.courses-offered-chip--brand .courses-offered-logo { height: 15px; }
/* The public card's chip also carries the external-link arrow. */
.courses-offered-chip--link .courses-offered-logo { height: 14px; }

/* =========================================================================
   Account page: opt-in "Set it up" block (shown before the tutor has set up).
   ========================================================================= */
.courses-offered-setup { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.courses-offered-setup__lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #564943;
}
.courses-offered-setup__lead strong { color: #3f352f; }

/* "Learn more" expandable - makes the off-site / separate-site point plainly. */
.courses-offered-learnmore {
  border: 1px solid #ece7e3;
  border-radius: 12px;
  background: #fbf8f6;
  padding: 0 14px;
}
.courses-offered-learnmore > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--courses-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.courses-offered-learnmore > summary::-webkit-details-marker { display: none; }
.courses-offered-learnmore > summary::before {
  content: "+";
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}
.courses-offered-learnmore[open] > summary::before { content: "\2212"; } /* minus */
.courses-offered-learnmore__body { padding: 0 0 14px; }
.courses-offered-learnmore__body p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #6b625c;
}
.courses-offered-learnmore__body p:last-child { margin-bottom: 0; }
.courses-offered-learnmore__body strong { color: #3f352f; }

.courses-offered-setup__actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.courses-offered-setup__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.courses-offered-setup__btn .courses-offered-logo {
  height: 17px;
  /* the mark is multicolour; on the orange button, render it in white */
  filter: brightness(0) invert(1);
}
.courses-offered-setup__note { margin: 0; font-size: 12px; color: #9a918b; }

/* =========================================================================
   Account page: management (shown once the tutor is offering courses).
   ========================================================================= */
.courses-offered-body { display: flex; flex-direction: column; gap: 14px; }

/* Per-course switch (a native checkbox styled as a toggle). */
.courses-offered-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #564943;
  user-select: none;
}
.courses-offered-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.courses-offered-switch__track {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d8d2ce;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}
.courses-offered-switch--sm .courses-offered-switch__track { width: 34px; height: 19px; }
.courses-offered-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.courses-offered-switch--sm .courses-offered-switch__thumb { width: 15px; height: 15px; }
.courses-offered-switch input:checked + .courses-offered-switch__track { background: var(--courses-accent); }
.courses-offered-switch input:checked + .courses-offered-switch__track .courses-offered-switch__thumb { transform: translateX(18px); }
.courses-offered-switch--sm input:checked + .courses-offered-switch__track .courses-offered-switch__thumb { transform: translateX(15px); }
.courses-offered-switch input:focus-visible + .courses-offered-switch__track {
  outline: 2px solid var(--courses-accent);
  outline-offset: 2px;
}
.courses-offered-switch__state {
  font-size: 12px;
  font-weight: 600;
  color: #7D7A7A;
  min-width: 46px;
}
/* Only the switch toggles; the "Shown/Hidden" word sits beside it, not inside the label. */
.courses-offered-visibility { display: inline-flex; align-items: center; gap: 8px; }

/* Slim, low-key invite (not a banner) while no courses are pulled yet. */
.courses-offered-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed #e2ddd9;
  border-radius: 12px;
  background: #fbf7f4;
}
.courses-offered-invite__text { margin: 0; font-size: 13px; color: #6b625c; line-height: 1.4; }
.courses-offered-invite__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--courses-accent);
  text-decoration: none;
  white-space: nowrap;
}
.courses-offered-invite__link:hover { text-decoration: underline; }

/* Course name (muted) + its manage icon-button sit together on the left. */
.courses-offered-container .subject-card--course .subject-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.courses-offered-card__name-wrap { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.courses-offered-container .subject-card--course .courses-offered-card__name {
  color: #8a827c !important;   /* muted - overrides the strong accordion-title colour */
  font-weight: 600;
}
.courses-offered-card__content { padding-top: 10px; }
.courses-offered-card__manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #a79e98;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.courses-offered-card__manage-btn:hover {
  color: var(--8bm-orange, #F76922);
  background: rgba(247, 105, 34, 0.09);
}

/* Refresh / manage / last-updated row. */
.courses-offered-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.courses-offered-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--courses-accent);
  border-radius: 10px;
  background: var(--courses-accent);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.courses-offered-refresh:hover { opacity: 0.85; }
.courses-offered-refresh:disabled { opacity: 0.55; cursor: default; }
.courses-offered-logo--on-refresh { height: 16px; margin: 0; filter: brightness(0) invert(1); }
.courses-offered-manage-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--courses-accent);
  text-decoration: none;
}
.courses-offered-manage-link:hover { text-decoration: underline; }
.courses-offered-refreshed { font-size: 12px; color: #9a918b; margin-left: auto; }

/* The invite / manage links are <button>s (they POST then redirect); strip native button chrome. */
button.courses-offered-invite__link,
button.courses-offered-manage-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

/* "Stop offering courses" - discreet, destructive-ish; sits apart from the row. */
.courses-offered-stop {
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #a2726a;
  cursor: pointer;
  text-decoration: underline;
}
.courses-offered-stop:hover { color: #8c4f45; }

/* =========================================================================
   Profile display (owner's own profile AND public member profile).
   The whole card links out to the Coherence course page.
   ========================================================================= */
.courses-offered-public-heading .courses-offered-icon {
  width: 22px;
  height: 22px;
  color: var(--8bm-orange, #F76922);
  flex-shrink: 0;
}
.courses-offered-public-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.courses-offered-public-card:hover .subjects__accordion-title { color: var(--8bm-orange, #F76922); }
.courses-offered-public-wrapper .subject-card--course .subject-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* =========================================================================
   Explore page: People / Courses view toggle + the Courses card grid.
   ========================================================================= */
.explore-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border: 1px solid #ece7e3;
  border-radius: 999px;
  background: #f7f4f1;
}
.explore-mode-toggle__btn {
  border: none;
  background: none;
  padding: 7px 18px;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #7d7470;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.explore-mode-toggle__btn.is-active {
  background: var(--8bm-orange, #F76922);
  color: #fff;
}

/* Courses view is hidden until its mode is active; People regions hide when it is. */
#coursesModeContainer { display: none; }
#cardsContainer.explore-courses-active .matches-results-toolbar,
#cardsContainer.explore-courses-active #matchingProfilesContainer,
#cardsContainer.explore-courses-active .results-container,
#cardsContainer.explore-courses-active .matches-empty-state { display: none !important; }
#cardsContainer.explore-courses-active #coursesModeContainer { display: block; }

.explore-courses-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.explore-courses-search {
  flex: 1 1 260px;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid #ded7d2;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #3f352f;
}
.explore-courses-search:focus {
  outline: 2px solid var(--8bm-orange, #F76922);
  outline-offset: 1px;
  border-color: var(--8bm-orange, #F76922);
}
.explore-courses-count { margin: 0; font-size: 13px; color: #9a918b; white-space: nowrap; }

.explore-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.explore-course-card {
  border: 1px solid #ece7e3;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.explore-course-card__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.explore-course-card__main .courses-offered-chip--brand { align-self: flex-start; }
.explore-course-card__title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #3f352f;
  line-height: 1.35;
}
.explore-course-card__main:hover .explore-course-card__title { color: var(--8bm-orange, #F76922); }
.explore-course-card__blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6b625c;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.explore-course-card__tutor { margin: 0; font-size: 12px; color: #8a827c; }
.explore-course-card__tutor a { color: var(--8bm-orange, #F76922); text-decoration: none; font-weight: 600; }
.explore-course-card__tutor a:hover { text-decoration: underline; }

.explore-courses-state { padding: 24px 4px; color: #9a918b; font-size: 14px; }
