/* "Currently studying" courses grouped by school (site/settingsParent.js's
   course editor, on Settings, Student setup and Portfolio's My courses).
   Shown once a student has courses from more than one school, e.g. AP
   courses next to Alberta K-12 courses: one small card per school, the
   school's name on top, its courses as chips underneath. The school picked
   in the box (where new courses go) is outlined in the accent colour. */

.settings-academic-course-chips.is-grouped,
.ss-course-card .settings-academic-course-chips.is-grouped {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  align-items: start;
  gap: 10px;
}

.settings-academic-course-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  background: rgba(var(--text-rgb), 0.03);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.settings-academic-course-group.is-current {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.07);
}

.settings-academic-course-group__name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.settings-academic-course-group__name::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.settings-academic-course-group.is-current .settings-academic-course-group__name {
  color: var(--accent);
}

.settings-academic-course-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

/* Long course names (French especially) wrap inside the chip. */
.settings-academic-course-group .settings-academic-course-chip {
  max-width: 100%;
  min-width: 0;
}

.settings-academic-course-chip__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .settings-academic-course-group { transition: none; }
}
