/* Mise en page éditoriale des cours SNT et NSI. */
.prose.card {
  width: min(960px, 100%);
  max-width: 960px;
  margin-inline: auto;
  padding: clamp(1.35rem, 3vw, 3rem);
}

.prose p,
.prose li {
  line-height: 1.78;
}

.prose > p {
  margin: 1rem 0 1.2rem;
  font-size: 1.03rem;
}

.prose h2 {
  margin: 2.7rem 0 1rem;
  padding-bottom: 0.55rem;
  color: var(--primary);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.18;
  border-bottom: 2px solid #dce7f0;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  color: #174d66;
  font-size: 1.3rem;
}

.prose h4 {
  margin: 1.45rem 0 0.55rem;
  color: #2d536c;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.25rem;
  border-left: 5px solid var(--secondary);
  border-radius: 0 10px 10px 0;
  background: #edf8f6;
  color: #183f48;
}

.prose blockquote p {
  margin: 0.35rem 0;
}

.prose figure {
  margin: 2rem auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fbfd;
  box-shadow: 0 10px 28px rgba(20, 39, 62, 0.06);
}

.prose figure img {
  display: block;
  width: 100%;
  max-width: 820px;
  max-height: 460px;
  margin: 0 auto;
  object-fit: contain;
}

.prose figcaption {
  max-width: 72ch;
  margin: 0.8rem auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.prose table {
  width: 100%;
  margin: 1.6rem 0;
  font-size: 0.96rem;
}

.prose th {
  background: #e8f0f6;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1.2rem 1.35rem;
  line-height: 1.55;
}

.prose p code,
.prose li code,
.prose td code {
  padding: 0.12rem 0.35rem;
  border: 1px solid #d8e1e8;
  border-radius: 5px;
  background: #f2f6f8;
  color: #163b65;
}

.course-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: clamp(1rem, 3vw, 2rem);
  width: min(960px, 100%);
  margin: 1.25rem auto 2rem;
  padding: clamp(1.2rem, 2.5vw, 2rem);
  align-items: center;
}

.course-progress-copy h2 {
  margin: 0.15rem 0 0.45rem;
}

.course-progress-status {
  margin: 0;
  color: var(--muted);
}

.course-progress-meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}

.course-progress-meter progress,
.chapter-progress progress {
  width: 100%;
  height: 0.72rem;
}

.course-progress-action {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbfd;
}

.course-progress-action > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.course-progress-action > strong {
  line-height: 1.35;
}

.course-continue-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.course-continue-link:hover,
.course-continue-link:focus-visible {
  filter: brightness(0.94);
}

.chapter-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 1rem;
  align-items: start;
}

.chapter-heading-row h3 {
  margin-top: 0.2rem;
}

.chapter-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.7rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.chapter-progress strong {
  color: var(--text);
}

.chapter-progress progress {
  grid-column: 1 / -1;
}

.dashboard-course-grid {
  align-items: stretch;
}

.dashboard-course-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.dashboard-course-card h2,
.dashboard-course-card p {
  margin-block: 0;
}

.dashboard-course-heading,
.dashboard-course-actions,
.dashboard-course-progress > div {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.dashboard-course-heading > strong {
  color: var(--primary);
  font-size: 0.95rem;
}

.dashboard-course-progress {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.25rem;
}

.dashboard-course-progress span {
  color: var(--muted);
  font-size: 0.88rem;
}

.dashboard-course-progress progress {
  width: 100%;
  height: 0.68rem;
}

.dashboard-course-next {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dashboard-course-next span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-course-next strong {
  line-height: 1.35;
}

.dashboard-course-actions {
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.dashboard-course-actions .course-continue-link {
  margin-top: 0;
}

.dashboard-course-actions > a:last-child {
  font-size: 0.9rem;
  font-weight: 700;
}

.teacher-progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.teacher-progress-stat {
  display: grid;
  gap: 0.45rem;
  min-height: 150px;
  align-content: start;
}

.teacher-progress-stat > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teacher-progress-stat > strong {
  color: var(--primary);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.05;
}

.teacher-progress-stat > small {
  color: var(--muted);
  line-height: 1.45;
}

.teacher-progress-stat progress {
  width: 100%;
  height: 0.7rem;
  margin-top: 0.35rem;
}

.teacher-progress-table-wrap {
  margin-top: 0.5rem;
}

.teacher-progress-cell {
  min-width: 190px;
}

.teacher-progress-cell progress {
  width: min(150px, 100%);
  height: 0.65rem;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.teacher-progress-state {
  display: inline-flex;
  width: fit-content;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.teacher-progress-state-complete {
  background: #e7f5ec;
  color: #17613a;
}

.teacher-progress-state-active {
  background: #fff4d9;
  color: #795600;
}

.teacher-progress-state-idle {
  background: #eef2f5;
  color: #4b5e6c;
}

.reader-breadcrumbs,
.reader-heading,
.manual-reader {
  width: min(1240px, 100%);
  margin-inline: auto;
}

.reader-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.reader-breadcrumbs a {
  font-weight: 600;
}

.reader-heading {
  align-items: end;
}

.reader-position {
  display: grid;
  min-width: min(240px, 100%);
  gap: 0.35rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.reader-position progress {
  width: min(240px, 100%);
  height: 0.6rem;
}

.manual-reader {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.manual-reader-main {
  min-width: 0;
}

.manual-reader-main > .prose.card,
.reader-section,
.reader-complete-form,
.lesson-pagination {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.manual-toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  overflow: auto;
}

.manual-toc-heading {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.manual-toc-heading p {
  margin: 0;
}

.manual-toc-heading a {
  font-size: 0.88rem;
  font-weight: 700;
}

.manual-toc details {
  border-top: 1px solid var(--border);
}

.manual-toc details:last-child {
  border-bottom: 1px solid var(--border);
}

.manual-toc summary {
  padding: 0.8rem 0.25rem;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.manual-toc ol {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.manual-toc li + li {
  margin-top: 0.2rem;
}

.manual-toc li a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.manual-toc li.is-current a {
  background: #e8f0f6;
  color: var(--primary);
  font-weight: 750;
}

.reader-section {
  margin-top: 1.5rem;
}

.reader-complete-form {
  margin-top: 1.6rem;
}

.lesson-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.lesson-pagination-link {
  display: grid;
  gap: 0.3rem;
  min-height: 88px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}

.lesson-pagination-link:hover,
.lesson-pagination-link:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(20, 39, 62, 0.08);
}

.lesson-pagination-link span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.lesson-pagination-link strong {
  line-height: 1.35;
}

.lesson-pagination-next {
  text-align: right;
}

@media (max-width: 1100px) {
  .teacher-progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .manual-reader {
    grid-template-columns: 1fr;
  }

  .reader-position {
    justify-items: start;
  }

  .manual-toc {
    position: static;
    max-height: none;
  }

  .course-progress-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .prose.card {
    padding: 1.15rem;
  }

  .prose figure {
    margin-inline: -0.25rem;
    padding: 0.65rem;
  }

  .chapter-heading-row,
  .lesson-pagination,
  .teacher-progress-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-course-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .lesson-pagination-spacer {
    display: none;
  }

  .lesson-pagination-next {
    text-align: left;
  }
}

@media print {
  .course-progress-card,
  .chapter-progress,
  .teacher-progress-summary,
  .reader-breadcrumbs,
  .reader-position,
  .manual-toc,
  .reader-complete-form,
  .lesson-pagination {
    display: none !important;
  }

  .manual-reader {
    display: block;
    width: 100%;
  }

  .reader-heading {
    width: 100%;
  }

  .prose.card {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .prose figure {
    break-inside: avoid;
    box-shadow: none;
  }

  .prose h2,
  .prose h3,
  .prose h4 {
    break-after: avoid;
  }
}
