/**
 * Homework / assignments layout (level pages)
 * Loaded after assets/css/style.css — scoped under .homework-section
 */

/* Level pages: less empty space under video hero */
.page-hero--level.page-hero--video {
  padding-bottom: var(--space-lg);
  min-height: 22rem;
}

@media (min-width: 768px) {
  .page-hero--level.page-hero--video {
    min-height: 24rem;
  }
}

/* Tight gap under hero — overrides default .section padding-top (was --space-4xl) */
.homework-section {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-3xl);
}

/* Loading & errors */
.homework-loading {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-secondary);
  font-size: 1rem;
}

.homework-error {
  max-width: 36rem;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-lg);
  background: rgba(193, 127, 89, 0.12);
  border: 1px solid var(--accent-terracotta-soft);
  border-radius: 8px;
  color: var(--text-primary);
}

[data-theme="dark"] .homework-error {
  background: rgba(212, 160, 136, 0.12);
}

/* Featured notice block(s) — Text column only, top of main content */
.hw-featured {
  max-width: 44rem;
  margin: 0 auto var(--space-4xl);
}

.hw-featured[hidden] {
  display: none !important;
}

.hw-featured__inner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-soft);
}

.hw-featured__item + .hw-featured__item {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-light);
}

/* Serif accent for announcement feel */
.hw-featured__text {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text-primary);
  text-align: center;
  white-space: pre-line;
}

.hw-featured__body {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.05rem + 0.65vw, 1.4rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-primary);
  text-align: center;
  white-space: pre-line;
  margin-bottom: 0;
  font-variant-numeric: lining-nums tabular-nums;
}

/* First segment when Extra + Text are merged (e.g. “remaining classes:” + dates) */
.hw-featured__headline {
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 1.28rem + 1.15vw, 2.05rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-md);
}

/* Assignment list */
.hw-list {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.hw-item {
  margin-bottom: var(--space-4xl);
}

.hw-item:last-child {
  margin-bottom: var(--space-2xl);
}

.hw-item__title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  .hw-item__title {
    font-size: 1.5rem;
  }
}

/* Indented relative to title (academic handout style) */
.hw-item__assignments {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  padding-left: 0;
  max-width: 100%;
}

@media (min-width: 640px) {
  .hw-item__assignments {
    margin-left: 2rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent-gold-soft);
  }
}

.hw-item__extra {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  padding-left: 0;
  font-style: italic;
}

@media (min-width: 640px) {
  .hw-item__extra {
    margin-left: 2rem;
    padding-left: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Chapter downloads (course-library.js) — below homework on level pages
   -------------------------------------------------------------------------- */

.chapter-materials .course-level {
  margin-bottom: 0;
}

/* “Chapter 1” — small grey serif label */
.chapter-materials .course-chapter__title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-sm);
  text-align: left;
}

.chapter-materials .library-chapter:first-child .course-chapter__title {
  margin-top: 0;
}

/* Section title (e.g. Écoutons / Audio) — large serif + gold rule */
.chapter-materials .course-group__title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--accent-gold);
  text-align: left;
}

/* Row cards: title left, Listen / Open PDF right */
.chapter-materials .library-item {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--space-md);
  background: var(--bg-card);
}

.chapter-materials .library-item:last-child {
  margin-bottom: 0;
}

.chapter-materials .library-item__title {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.chapter-materials .library-item .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .chapter-materials .library-item {
    flex-wrap: wrap;
  }

  .chapter-materials .library-item .btn {
    width: 100%;
    text-align: center;
  }
}
