/* ---------------------------------------------------------------------- */
/* Custom theme polish for the Web Dev Book (CSC336 + CSC337)             */
/* ---------------------------------------------------------------------- */

:root {
  --wdb-radius: 0.6rem;
}

/* ---- Landing page hero + course cards ---------------------------------- */

.wdb-hero {
  text-align: center;
  padding: 1.5rem 0 2rem;
}

.wdb-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.wdb-hero p {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 42rem;
  margin: 0 auto;
}

.wdb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.wdb-card {
  position: relative;
  display: block;
  padding: 1.25rem 1.4rem;
  border-radius: var(--wdb-radius);
  border: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wdb-card-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.wdb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--md-accent-fg-color);
}

.wdb-card h3 {
  margin: 0 0 0.35rem;
  color: var(--md-default-fg-color);
}

.wdb-card p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.wdb-card .wdb-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

/* ---- Unit / lecture overview tables ------------------------------------ */

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

/* ---- Key takeaways / callout polish ------------------------------------ */

.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--wdb-radius);
}

/* ---- Mermaid diagrams: keep them comfortably sized and centered -------- */

.md-typeset .mermaid {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0;
}

/* ---- Content images: frame screenshots so they stand out from body text */

.md-typeset img {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 1.5rem auto;
  padding: 8px;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: var(--wdb-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  background: var(--md-default-bg-color);
}

/* Logos/icons that happen to sit inside typeset content (rare) shouldn't get
   the screenshot treatment -- opt out with this class if ever needed. */
.md-typeset img.wdb-bare {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

/* ---- Lecture chapter nav badge ------------------------------------------ */

.wdb-lecture-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.wdb-lecture-meta span {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
}
