/* ===== Shared teaching styles (cards) ===== */
.teaching {
  margin: 1rem 0 2.5rem;
}

.teaching-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: .75rem;
}

.teaching-title {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: .2px;
}

.teaching-ay {
  font-size: .95rem;
  opacity: .75;
}

/* Grid: always 1 per row */
.teaching-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.teaching-grid.one-per-row { grid-template-columns: 1fr; }

.course-card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .15s ease, transform .06s ease;
}
.course-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.course-card__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  align-items: start;
  margin-bottom: .5rem;
}

.course-card__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

.course-card__role {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: .6rem;
  background: #111;
  color: #fff;
  white-space: nowrap;
}
.chip--light {
  background: #eef2f7;
  color: #0f172a;
  font-weight: 600;
}

/* Meta list */
.course-card__meta {
  list-style: none;
  padding: 0;
  margin: .25rem 0 .5rem 0;
  display: grid;
  gap: .25rem;
}
.course-card__meta li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .5rem;
  align-items: baseline;
}
.meta-label {
  font-size: .82rem;
  opacity: .7;
}
.meta-value {
  font-size: .95rem;
  font-weight: 600;
}

/* Actions */
.course-card__actions {
  margin-top: .4rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .35rem .6rem;
}
.btn-link {
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  font-weight: 600;
}
.media-sep {
  opacity: .6;
  margin: 0 .2rem;
}

/* Muted helper */
.muted { color: #6b7280; }

/* ===== Collapsible academic years (past teaching) ===== */
.year-acc {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .9rem;
  background:
    radial-gradient(1200px 1200px at 0% -10%, #f9fbff 0%, transparent 60%) ,
    #fff;
  padding: .5rem .9rem .85rem;
  margin: 1rem 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.year-acc[open] {
  border-color: #cfe8ff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.year-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .55rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
  background: linear-gradient(180deg, #f7fbff 0%, #f2f6fb 100%);
  border: 1px solid #e2e8f0;
  border-radius: .7rem;
  transition: background .2s ease, border-color .2s ease;
}
.year-summary:hover {
  background: linear-gradient(180deg, #eef6ff 0%, #e9f0f8 100%);
  border-color: #cbd5e1;
}

/* Left cluster (chevron + title) */
.year-left {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Custom chevron */
.year-acc > summary::marker { content: ""; }
.year-chevron {
  width: 0.9rem;
  height: 0.9rem;
  display: inline-block;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: rotate(-45deg);
  margin-right: .1rem;
  transition: transform .2s ease;
}
.year-acc[open] .year-chevron {
  transform: rotate(45deg);
}

/* Count badge */
.year-badge {
  font-size: .78rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

/* Space content inside details */
.year-acc .teaching-grid {
  margin-top: .8rem;
}

/* Responsive */
@media (max-width: 680px) {
  .course-card__meta li { grid-template-columns: 1fr; }
}
