/* Course-module component
   -----------------------
   The cards borrow the image-led editorial rhythm of Breno's personal homepage,
   but add course-specific sequence, phase, topics, and assignment context.
   Chronological DOM order is pedagogical: CSS must never reorder the cards. */

.wh-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
  margin: 1.7rem 0 0;
}

.wh-module-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--wh-line);
  border-radius: 0.75rem;
  background: var(--wh-paper);
  box-shadow: 0 1px 2px rgba(22, 32, 36, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.wh-module-card:hover,
.wh-module-card:focus-within {
  border-color: color-mix(in srgb, var(--wh-green-strong) 70%, var(--wh-line));
  box-shadow: 0 12px 28px rgba(22, 32, 36, 0.11);
  transform: translateY(-2px);
}

.wh-module-card:focus-within {
  outline: 3px solid color-mix(in srgb, var(--wh-orange) 80%, white);
  outline-offset: 3px;
}

.wh-module-card__media {
  position: relative;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--wh-navy);
}

.wh-module-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.wh-module-card:hover .wh-module-card__media img,
.wh-module-card:focus-within .wh-module-card__media img {
  transform: scale(1.02);
}

.wh-module-card__count,
.wh-module-card__phase {
  position: absolute;
  top: 0.9rem;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  background: rgba(22, 30, 34, 0.86);
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  backdrop-filter: blur(8px);
}

.wh-module-card__count {
  left: 0.9rem;
  min-width: 3.2rem;
  padding: 0.42rem 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.wh-module-card__count small {
  margin-left: 0.1rem;
  color: #cdd7d4;
  font-size: 0.63rem;
  font-weight: 600;
}

.wh-module-card__phase {
  right: 0.9rem;
  padding: 0.43rem 0.65rem;
  color: #ffe0a9;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wh-module-card__body {
  display: flex;
  min-height: 22rem;
  flex-direction: column;
  padding: clamp(1.1rem, 2vw, 1.45rem);
}

.wh-module-card__meta {
  margin: 0;
  color: var(--wh-green-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wh-module-card__title {
  margin: 0.55rem 0 0;
  color: var(--wh-navy);
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.52rem);
  font-weight: 600;
  line-height: 1.2;
}

.wh-module-card__promise {
  margin: 0.7rem 0 0;
  color: var(--wh-muted);
  line-height: 1.58;
}

.wh-module-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.wh-module-card__topics span {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--wh-line);
  border-radius: 999px;
  color: var(--wh-muted);
  background: var(--wh-soft);
  font-size: 0.69rem;
  font-weight: 600;
}

/* Assessment state is carried by explicit text as well as an orange accent;
   color is never the only carrier of meaning. */
.wh-module-card__assessment {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.65rem;
  margin: auto 0 0;
  padding: 1rem 0 0.85rem;
  border-bottom: 1px solid var(--wh-line);
  color: var(--wh-ink);
  font-size: 0.78rem;
  line-height: 1.4;
}

.wh-module-card__assessment span {
  color: var(--wh-orange-strong);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wh-module-card__link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  color: var(--wh-green-strong);
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.wh-module-card__link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.wh-module-card__link:focus-visible {
  outline: none;
}

/* Module detail pages use a stable public-content pattern. Canvas remains the
   operational system for live dates, submissions, grades, and communication. */
.wh-module-page #title-block-header {
  display: none;
}

.wh-module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  min-height: 27rem;
  overflow: hidden;
  border: 1px solid #364347;
  border-radius: 0.75rem;
  color: var(--wh-paper);
  background: var(--wh-navy);
}

.wh-module-hero__copy {
  align-self: center;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.wh-module-hero__media {
  position: relative;
  min-height: 21rem;
  background: #101a20;
}

.wh-module-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wh-module-hero__eyebrow {
  margin: 0;
  color: #ffd28e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wh-module-hero h1 {
  max-width: 11ch;
  margin: 0.8rem 0 0;
  color: var(--wh-paper);
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.wh-module-hero__promise {
  max-width: 42ch;
  margin: 1.4rem 0 0;
  color: #d8e1df;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.wh-module-breadcrumb {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
}

.wh-module-breadcrumb a {
  color: var(--wh-green-strong);
}

.wh-module-decision {
  margin: 2rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 0.35rem solid var(--wh-orange);
  color: var(--wh-navy);
  background: var(--wh-soft);
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 600;
  line-height: 1.45;
}

.wh-module-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0 2.5rem;
}

.wh-module-snapshot > div {
  padding: 1rem;
  border-top: 3px solid var(--wh-green);
  background: var(--wh-soft);
}

.wh-module-snapshot strong,
.wh-module-snapshot span {
  display: block;
}

.wh-module-snapshot strong {
  color: var(--wh-green-strong);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.wh-module-snapshot span {
  margin-top: 0.25rem;
  color: var(--wh-ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.wh-module-page .wh-material-list a {
  display: block;
  margin: 0.55rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--wh-line);
  color: var(--wh-green-strong);
  background: var(--wh-paper);
  font-weight: 700;
  text-decoration: none;
}

.wh-module-page .wh-material-list a::after {
  float: right;
  content: "→";
}

.wh-module-page .wh-material-list a:hover,
.wh-module-page .wh-material-list a:focus-visible {
  border-color: var(--wh-green-strong);
  color: var(--wh-paper);
  background: var(--wh-green-strong);
}

.wh-module-page .wh-slide-grid {
  margin-top: 1rem;
  border-top: 1px solid var(--wh-line);
  border-radius: 0.75rem;
}

.wh-module-assignment {
  margin-top: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--wh-line);
  border-left: 0.35rem solid var(--wh-orange);
  border-radius: 0.45rem;
  background: var(--wh-soft);
}

.wh-module-assignment h3 {
  margin-top: 0;
}

.wh-module-assignment .wh-button-secondary {
  border-color: var(--wh-green-strong);
  color: var(--wh-green-strong);
  background: var(--wh-paper);
}

.wh-module-assignment .wh-button-secondary:hover,
.wh-module-assignment .wh-button-secondary:focus-visible {
  color: var(--wh-paper);
  background: var(--wh-green-strong);
}

.wh-module-assignment > :last-child,
.wh-module-assignment > :last-child > :last-child {
  margin-bottom: 0;
}

.wh-module-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--wh-line);
}

.wh-module-nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  color: var(--wh-green-strong);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 760px) {
  .wh-module-grid,
  .wh-module-hero,
  .wh-module-snapshot {
    grid-template-columns: 1fr;
  }

  .wh-module-card__body {
    min-height: 0;
  }

  .wh-module-card__assessment {
    margin-top: 1.2rem;
  }

  .wh-module-hero__media {
    min-height: 15rem;
    order: -1;
  }

  .wh-module-hero__copy {
    padding: 1.6rem 1.3rem 2rem;
  }
}

/* Motion is decorative and removed for users who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .wh-module-card,
  .wh-module-card__media img {
    transition: none;
  }

  .wh-module-card:hover,
  .wh-module-card:focus-within,
  .wh-module-card:hover .wh-module-card__media img,
  .wh-module-card:focus-within .wh-module-card__media img {
    transform: none;
  }
}

@media print {
  .wh-module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wh-module-card,
  .wh-module-hero {
    break-inside: avoid;
    box-shadow: none;
  }
}
