/* --- GRID --- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 15px;
}

/* --- COURSE CARD --- */
.course-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  position: relative;
  transition: box-shadow .2s ease;
}

.course-card.mimuw {
  background: #f3f8fd;  /* light blue */
  border: 1px solid #cbddee;
}

.course-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* --- LOGO (absolute) --- */
.course-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
}

/* --- ICON & TITLE --- */
.course-icon {
  font-size: 2.3rem;
  margin-bottom: 10px;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.course-id {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
}

/* --- BADGES --- */
.badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.75rem;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-weight: 600;
  border: 1px solid transparent;
}

/* --- SUBTLE STATUS COLORS --- */
.badge-current {
  background: #d8f5d1;
  border-color: #7fcd82;
  color: #225c29;
}

.badge-past {
  background: #e8eef5;
  border-color: #9aa9c2;
  color: #3f4a5a;
}

/* --- CATEGORY COLORS --- */
.badge-teaching {
  background: #dbe7ff;
  border-color: #6b8cff;
  color: #1a3a9c;
}

.badge-coordination {
  background: #ecd9ff;
  border-color: #b06cff;
  color: #5a287a;
}

.badge-teaching_coordination {
  background: #daf2f0;
  border-color: #5bc2bd;
  color: #145b59;
}

/* --- AUTHORED --- */
.badge-original {
  background: #ffe9bf;
  border-color: #ffb938;
  color: #6b4600;
}

/* --- LEVEL BADGE --- */
.badge-level {
  background: #f2f3f5;
  border-color: #c2c4c7;
  color: #333;
}

/* --- LEGEND (matches badges exactly) --- */
#teaching-legend {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.legend-row { margin: 5px 0; }
.legend-label { font-weight: 600; margin-right: 6px; }
.legend-details { color: gray; font-size: 0.9em; font-weight: 300; margin-right: 6px; }


/* Corner logo */
.course-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 54px;
  height: auto;
  opacity: 0.9;
  transition: opacity .2s ease;
}

.course-card:hover .course-logo {
  opacity: 1;
}

/* Years badge */
.badge-years {
  background: #eef3f8;
  border: 1px solid #b7c3d9;
  color: #3a4a63;
}

/* Current badge remains subtle */
.badge-current {
  background: #d8f5d1;
  border-color: #7fcd82;
  color: #225c29;
}



/* Institution logo (top-left) */
.course-card .course-logo {
  position: absolute;
  top: 2px;
  left: 8px;
  width: 58px;
  height: auto;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.course-card:hover .course-logo {
  opacity: 1;
  transform: scale(1.05);
}

/* Language flag (top-right) */
.course-card .course-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.4em;
}

/* Title wrapper: center icon + title */
.course-title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  gap: 8px;
}

.course-icon {
  font-size: 2.5em;
}

.course-title {
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}




