:root {
  --teach-bg: #edf4fb;
  --teach-ink: #162336;
  --teach-muted: #4a5c6b;
  --teach-accent: #245b9c;
  --teach-card: #ffffff;
  --teach-border: #d7e4f2;
  --teach-pill: #e3eefb;
}

body.theme-dark {
  --teach-bg: #0f172a;
  --teach-ink: #e5e7eb;
  --teach-muted: #94a3b8;
  --teach-accent: #93c5fd;
  --teach-card: #111827;
  --teach-border: rgba(148, 163, 184, 0.22);
  --teach-pill: rgba(147, 197, 253, 0.12);
}

.teach-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  color: var(--teach-ink);
}

.quarto-title-block {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0.5rem;
}

.quarto-title-block .title,
.quarto-title-block .subtitle,
.quarto-title-block .description {
  text-align: left;
}

.quarto-title-block .title {
  margin-bottom: 0.35rem;
}


.teach-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, var(--teach-bg), #ffffff);
  border: 1px solid var(--teach-border);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(31, 35, 40, 0.08);
  margin-bottom: 2rem;
}

body.theme-dark .teach-hero {
  background: linear-gradient(135deg, #0f172a, #111827);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.teach-hero h1 {
  font-size: 2.2rem;
  margin: 0 0 0.4rem 0;
}

.teach-hero p {
  margin: 0;
  color: var(--teach-muted);
}

.teach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.teach-card {
  display: flex;
  flex-direction: column;
  background: var(--teach-card);
  border: 1px solid var(--teach-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 22px rgba(22, 35, 54, 0.06);
}

body.theme-dark .teach-card {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.teach-card-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.teach-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--teach-pill);
  color: var(--teach-accent);
  font-size: 1.3rem;
}

.teach-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.teach-link {
  color: #162336;
  text-decoration: none;
}

.teach-link:hover {
  color: #0065bd;
}

body.theme-dark .teach-link {
  color: #e5e7eb;
}

body.theme-dark .teach-link:hover {
  color: #93c5fd;
}

.teach-subtitle {
  color: var(--teach-muted);
  font-size: 0.95rem;
}

.teach-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: auto;
}

.teach-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--teach-pill);
  color: var(--teach-accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.teach-pill:hover {
  color: #1f4e79;
}

body.theme-dark .teach-pill:hover {
  color: #bfdbfe;
}

.teach-section h2 {
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
}

.teach-thesis-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--teach-ink);
}

.teach-thesis-list li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .teach-hero {
    padding: 1.2rem 1.25rem;
  }

  .teach-hero h1 {
    font-size: 1.8rem;
  }
}

.teach-thesis-list {
  list-style: none;
  padding: 0;
  width: 100%;
}

.teach-thesis-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Vertically center items */
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  width: 100%;
}

.teach-thesis-list li:hover {
  background-color: #f9f9f9;
}

.thesis-title {
  font-weight: 500;
  color: #333;
  padding-right: 20px;
  /* Space between text and badge */
}

/* Base style for badges */
.thesis-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
  /* Prevents badge from breaking into two lines */
  letter-spacing: 0.5px;
}

/* Specific colors for different types */
.tag-internship {
  background-color: #e3f2fd;
  color: #1565c0;
}

.tag-master {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.tag-bachelor {
  background-color: #fff3e0;
  color: #ef6c00;
}

body.theme-dark .teach-thesis-list {
  color: #ffffff;
}

body.theme-dark .teach-thesis-list li {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

body.theme-dark .teach-thesis-list li:hover {
  background-color: rgba(148, 163, 184, 0.12);
}

body.theme-dark .thesis-title {
  color: #ffffff;
}

body.theme-dark .thesis-tag {
  color: #ffffff;
}

body.theme-dark .tag-internship {
  background-color: rgba(56, 189, 248, 0.35);
}

body.theme-dark .tag-master {
  background-color: rgba(74, 222, 128, 0.35);
}

body.theme-dark .tag-bachelor {
  background-color: rgba(251, 146, 60, 0.35);
}