/* ==========================================================================
   Special Topics in Artificial Intelligence - course website styles
   One accent color, generous whitespace, restrained academic look.
   ========================================================================== */

:root {
  --accent: #0f766e;          /* deep teal - links, week numbers, highlights */
  --accent-soft: #e6f2f1;     /* light tint of the accent for backgrounds    */
  --ink: #1f2937;             /* main text                                   */
  --ink-muted: #6b7280;       /* secondary text                              */
  --line: #e5e7eb;            /* hairline borders                            */
  --card-bg: #ffffff;
  --page-bg: #fcfcfd;
}

/* ---- Base typography -------------------------------------------------- */

body {
  background-color: var(--page-bg);
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 { margin-bottom: 0.75rem; }

h2 {
  margin-top: 2.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #0b5a54;
  text-decoration: underline;
}

/* ---- Navbar ------------------------------------------------------------ */

.navbar {
  border-bottom: 1px solid var(--line);
  background-color: #ffffff !important;
}

.navbar .navbar-brand {
  font-weight: 700;
  color: var(--ink);
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
  color: var(--accent) !important;
}

/* ---- Sidebar ----------------------------------------------------------- */

.sidebar nav[role="doc-toc"] a:hover,
#quarto-sidebar .sidebar-item .sidebar-item-text a:hover {
  color: var(--accent);
}

#quarto-sidebar .sidebar-item .active {
  color: var(--accent);
  font-weight: 600;
}

.sidebar-menu-container .sidebar-section .sidebar-section-header,
#quarto-sidebar .sidebar-item-section > .sidebar-item-container > a {
  font-weight: 600;
}

/* ---- Hero block (homepage) --------------------------------------------- */

.course-hero {
  padding: 2.5rem 2rem;
  margin: 0.5rem 0 2rem 0;
  background: var(--accent-soft);
  border: 1px solid #d3e7e5;
  border-radius: 12px;
}

.course-hero h1 {
  margin-top: 0;
  font-size: 2rem;
}

.course-hero .hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.course-hero p.lead {
  font-size: 1.08rem;
  color: var(--ink);
  max-width: 46rem;
  margin-bottom: 0;
}

/* ---- Cards ------------------------------------------------------------- */

.topic-card,
.quicklink-card {
  height: 100%;
  padding: 1.25rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.topic-card h3,
.quicklink-card h3 {
  margin-top: 0;
  font-size: 1.02rem;
  font-weight: 650;
}

.topic-card p,
.quicklink-card p {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
}

.quicklink-card {
  border-left: 3px solid var(--accent);
}

.quicklink-card a {
  font-weight: 600;
}

/* ---- Badges ------------------------------------------------------------ */

.badge-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-lecture   { background: #eef2ff; color: #3730a3; }
.badge-practical { background: #ecfdf5; color: #065f46; }
.badge-project   { background: #fff7ed; color: #9a3412; }
.badge-exam      { background: #fef2f2; color: #991b1b; }
.badge-soon      { background: #f3f4f6; color: #6b7280; }

/* ---- Week number chip (timeline / schedule) ----------------------------- */

.week-chip {
  display: inline-block;
  min-width: 2.5rem;
  text-align: center;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---- Tables ------------------------------------------------------------ */

.table {
  font-size: 0.95rem;
}

.table thead th {
  border-bottom: 2px solid var(--line);
  font-weight: 650;
  white-space: nowrap;
}

.table tbody tr:hover {
  background-color: #f8fafa;
}

/* keep wide tables usable on small screens */
.table-responsive-wrap {
  overflow-x: auto;
}

/* ---- Grading breakdown bar ---------------------------------------------- */

.grade-bar {
  display: flex;
  width: 100%;
  height: 2.4rem;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0 0.5rem 0;
  border: 1px solid var(--line);
}

.grade-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.grade-seg-1 { background: #0f766e; }
.grade-seg-2 { background: #2b8a82; }
.grade-seg-3 { background: #479e96; }
.grade-seg-4 { background: #64b2ab; }
.grade-seg-5 { background: #86c6c0; color: #073b37; }

.grade-legend {
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* ---- Announcement / status block ---------------------------------------- */

.status-box {
  margin: 2rem 0 3rem 0;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.status-box .status-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.status-box p:last-child {
  margin-bottom: 0;
}

/* ---- Page navigation (prev / next week) ---------------------------------- */

.page-navigation .nav-page a {
  color: var(--accent);
}

/* ---- Small screens -------------------------------------------------------- */

@media (max-width: 767.98px) {
  .course-hero {
    padding: 1.5rem 1.25rem;
  }
  .course-hero h1 {
    font-size: 1.5rem;
  }
  .grade-seg {
    font-size: 0.68rem;
  }
}

/* ---- Lecture week navigation (bottom of each week page) ------------------- */

.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.week-nav a {
  font-weight: 600;
}

.week-nav .week-nav-prev { text-align: left; }
.week-nav .week-nav-all  { text-align: center; flex: 1; }
.week-nav .week-nav-next { text-align: right; }

@media (max-width: 575.98px) {
  .week-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .week-nav .week-nav-prev,
  .week-nav .week-nav-next {
    text-align: center;
  }
}

/* ---- Mobile: wide tables scroll instead of crushing columns -------------- */

@media (max-width: 767.98px) {
  .table-responsive-wrap > table {
    min-width: 720px;
  }
}
