/* Classroom landing page. Uses the same restrained paper-and-ink palette as the
   newer home and catalogue pages. Category previews start open: this classroom
   has only seven categories, while the existing ten-course cap keeps its 189
   courses from becoming one unbroken wall of links. */
.classroom-page {
  color: #29251f;
  margin: 0 auto;
  max-width: 1080px;
  padding: 6px 14px 34px;
  text-align: left;
}

.classroom-crumbs {
  align-items: center;
  color: #8a7a6a;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82em;
  gap: 7px;
  margin-bottom: 10px;
}

.classroom-crumbs a {
  color: #6b6257;
  text-decoration: none;
}

.classroom-crumbs a:hover {
  color: #4e0d0d;
  text-decoration: underline;
}

.classroom-hero {
  align-items: center;
  background:
    radial-gradient(circle at 92% 18%, rgba(185, 156, 96, 0.18), transparent 30%),
    linear-gradient(105deg, #f7f1dd 0%, #fbf9ef 64%, #f2eddd 100%);
  border: 1px solid #e0d5b4;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(62, 47, 25, 0.06);
  display: flex;
  gap: 30px;
  justify-content: space-between;
  overflow: hidden;
  padding: 15px 20px 14px;
  position: relative;
}

.classroom-hero::before {
  background-color: #b99c60;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.classroom-hero h1 {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.classroom-hero__lead {
  color: #6b6257;
  font-size: 0.84em;
  line-height: 1.45;
  margin: 4px 0 0;
}

.classroom-stats {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, minmax(66px, 1fr));
  margin: 0;
}

.classroom-stats div {
  border-left: 1px solid #d9c7a0;
  min-width: 62px;
  padding: 0 13px;
}

.classroom-stats dt {
  color: #8a7a6a;
  font-size: 0.7em;
  letter-spacing: 0.08em;
}

.classroom-stats dd {
  color: #4e0d0d;
  font-size: 1.12em;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin: 0;
}

.classroom-library {
  padding-top: 24px;
}

.classroom-library__head {
  align-items: flex-end;
  border-bottom: 1px solid #dddcc8;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px 9px;
}

.classroom-library__head h2 {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.18em;
  font-weight: 600;
  margin: 0;
}

.classroom-library__head p {
  color: #8a7a6a;
  font-size: 0.82em;
  line-height: 1.5;
  margin: 3px 0 0;
}

.classroom-toolbar {
  display: flex;
  flex: none;
  gap: 7px;
}

.classroom-toolbar button {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.65);
  border: 1px solid #cccbb8;
  border-radius: 999px;
  color: #1a5276;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.78em;
  justify-content: center;
  min-height: 44px;
  padding: 5px 13px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.classroom-toolbar button:hover:not(:disabled) {
  background-color: #fff;
  border-color: #8a8a72;
  color: #4e0d0d;
}

.classroom-toolbar button:focus-visible,
.classroom-category summary:focus-visible,
.classroom-category a:focus-visible {
  outline: 3px solid rgba(26, 82, 118, 0.35);
  outline-offset: 2px;
}

.classroom-toolbar button:disabled {
  cursor: default;
  opacity: 0.42;
}

.classroom-category {
  background-color: rgba(255, 255, 255, 0.72);
  border: 1px solid #d9d9c6;
  border-left: 3px solid #e4e2cf;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.classroom-category[open] {
  border-left-color: #4a7c59;
  box-shadow: 0 4px 12px rgba(62, 47, 25, 0.05);
}

.classroom-category summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: 12px;
  list-style: none;
  min-height: 48px;
  padding: 12px 16px;
  transition: background-color 0.15s ease;
  user-select: none;
}

.classroom-category summary::-webkit-details-marker {
  display: none;
}

.classroom-category summary::before {
  color: #aaa994;
  content: "\203A";
  flex: none;
  font-size: 1.25em;
  line-height: 1;
  transform: translateY(2px);
  transition: transform 0.15s ease;
}

.classroom-category[open] > summary::before {
  transform: translateY(2px) rotate(90deg);
}

.classroom-category summary:hover {
  background-color: #fbfbf4;
}

.classroom-category__title {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.08em;
  font-weight: 600;
}

.classroom-category__count {
  color: #8a7a6a;
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
}

.classroom-category__body {
  border-top: 1px solid #efeedf;
  padding: 14px 16px 15px;
}

/* Shared chips also serve /classrooms; this page gives them a quieter,
   left-aligned reading order inside each category panel. */
.classroom-page .course-chips {
  gap: 7px;
  justify-content: flex-start;
  margin: 0;
}

.classroom-page .course-chip {
  align-items: center;
  background-color: #fbfaf3;
  border-color: #dedbc7;
  box-sizing: border-box;
  display: inline-flex;
  min-height: 44px;
  line-height: 1.45;
  padding: 7px 12px;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.classroom-page .course-chip:hover {
  background-color: #fff;
  border-color: #9b9277;
  color: #4e0d0d;
  text-decoration: none;
}

.classroom-page .course-chip-more {
  background-color: transparent;
  border-color: #b9ad8a;
}

.classroom-category__all {
  color: #4a7c59;
  display: inline-flex;
  font-size: 0.82em;
  gap: 5px;
  margin-top: 12px;
  text-decoration: none;
}

.classroom-category__all:hover {
  color: #365e42;
  text-decoration: underline;
}

.classroom-empty {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px dashed #cfcdb9;
  border-radius: 10px;
  color: #8a7a6a;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 34px 16px;
  text-align: center;
}

.classroom-empty i {
  color: #b99c60;
  font-size: 1.5em;
}

.classroom-empty p {
  margin: 0;
}

@media screen and (max-width: 720px) {
  .classroom-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 15px 16px 13px;
  }

  .classroom-stats {
    width: 100%;
  }

  .classroom-stats div:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .classroom-library__head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .classroom-toolbar {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 420px) {
  .classroom-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .classroom-stats div {
    min-width: 0;
    padding-left: 12px;
    padding-right: 8px;
  }

  .classroom-category summary {
    padding-left: 13px;
    padding-right: 13px;
  }

  .classroom-category__body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .classroom-page .course-chips li {
    width: 100%;
  }

  .classroom-page .course-chip {
    display: flex;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .classroom-page *,
  .classroom-page *::before,
  .classroom-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
