/* Módulo 1 — Conjuntos numéricos (Matemática · 9º ano) */
@import url("../../ciencias/biologia/modulo-1/modulo.css");
@import url("../../css/lesson-modules.css");

.lesson--math {
  --math-orange: #f37021;
  --math-orange-dark: #e85a18;
  --math-navy: #2e4a8a;
  --math-navy-deep: #1e3a6e;
  --math-cream: #fdf8ee;
  --math-peach: #fff5ed;
  --math-yellow-bar: #ffe082;
  --lesson-teal: var(--math-orange);
  --lesson-teal-soft: rgba(243, 112, 33, 0.12);
}

[data-theme="dark"] .lesson--math {
  --math-cream: rgba(243, 112, 33, 0.1);
  --math-peach: rgba(243, 112, 33, 0.08);
  --lesson-teal-soft: rgba(243, 112, 33, 0.18);
}

.lesson--math.lesson--book {
  --book-pink: var(--math-navy);
  --book-teal: var(--math-orange);
  --book-breadcrumb-teal: var(--math-orange);
}

.lesson--math.lesson--book .lesson-meta {
  color: var(--math-orange) !important;
}

.lesson--math .lesson-badge {
  background: var(--math-orange) !important;
  box-shadow: 0 2px 10px rgba(243, 112, 33, 0.35);
}

.lesson--math .lesson-cover-strip__mod {
  box-shadow: 0 2px 12px rgba(46, 74, 138, 0.35);
}

.lesson--math .lesson-cover-strip__sector {
  box-shadow: 0 2px 8px rgba(243, 112, 33, 0.25);
}

.lesson--math h1 {
  border-bottom-color: var(--math-orange);
}

.lesson--math .lesson-toc {
  border-left-color: var(--math-orange);
}

.lesson--math .lesson-toc a:hover {
  color: var(--math-orange);
}

/* Faixa vertical “Matemática | Módulo 1” (estilo manual) */
.lesson--math.doc-main {
  position: relative;
  padding-right: 2.85rem;
}

.math-subject-rail {
  position: absolute;
  right: 0;
  top: 0.5rem;
  width: 2.4rem;
  min-height: 11rem;
  max-height: calc(100% - 1rem);
  padding: 1rem 0.35rem;
  background: linear-gradient(
    180deg,
    var(--math-orange) 0%,
    var(--math-orange-dark) 100%
  );
  border-radius: 10px 0 0 10px;
  box-shadow: -2px 4px 16px rgba(243, 112, 33, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: #fff;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.35;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 720px) {
  .lesson--math.doc-main {
    padding-right: 0;
  }

  .math-subject-rail {
    position: static;
    width: auto;
    min-height: 0;
    max-height: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
    border-radius: var(--radius-md);
    padding: 0.55rem 1rem;
    margin: 0 0 1.15rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    pointer-events: auto;
  }
}

/* Bloco de revisão “Você já estudou” */
.math-review {
  margin: 1.75rem 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--math-peach);
  border: 1px solid color-mix(in srgb, var(--math-orange) 28%, var(--border));
  border-top: none;
  overflow: hidden;
}

.math-review__tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.55rem 1rem;
  background: var(--math-orange);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  max-width: max-content;
  border: none;
  line-height: inherit;
}

.lesson--math .math-review__tab::after {
  display: none;
}

.math-review__tab::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #fff;
  opacity: 0.95;
}

.math-review__bar {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--math-orange),
    color-mix(in srgb, var(--math-orange) 40%, transparent)
  );
  margin: 0;
}

.math-review__body {
  padding: 1.1rem 1.2rem 1.25rem;
}

.math-review__body > p:first-child {
  margin-top: 0;
}

.math-num {
  color: var(--math-orange);
  font-weight: 700;
}

.math-sub {
  font-weight: 700;
}

.math-lines {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.math-lines li {
  margin-bottom: 0.85rem;
  min-height: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
}

/* Caixas de fórmula / definição */
.math-formula-box {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  text-align: center;
  background: var(--math-cream);
  border: 1px solid color-mix(in srgb, var(--math-orange) 35%, var(--border));
  border-radius: var(--radius-md);
  font-size: 1.05rem;
}

.math-formula-box--inline-explain {
  text-align: left;
  font-size: 1rem;
}

.math-formula-box p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Tabela tema laranja */
.math-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.math-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.math-table th {
  padding: 0.65rem 0.75rem;
  background: var(--math-orange);
  color: #fff;
  font-weight: 700;
  text-align: left;
}

.math-table td {
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  vertical-align: top;
}

.math-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
}

/* Citação Pitágoras */
.math-quote-band {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--math-yellow-bar);
  border-right: 4px solid var(--math-yellow-bar);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.math-quote-band blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
}

.math-quote-band figcaption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: normal;
}

/* Rodapé de página estilo manual */
.math-page-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.math-page-footer__grade {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--math-orange);
  border-radius: 999px;
}

.math-page-footer__grade strong {
  color: var(--math-orange);
  font-weight: 800;
}

.math-aside-note {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--math-orange) 8%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.math-aside-note h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--math-navy);
}

[data-theme="dark"] .math-aside-note h3 {
  color: var(--math-orange);
}

.math-heading-accent {
  color: #4b5335;
  font-weight: 750;
}

[data-theme="dark"] .math-heading-accent {
  color: var(--text);
}

.lesson--math h2.math-h2--orange {
  color: var(--math-orange);
}

.lesson--math h2.math-h2--orange::after {
  background: linear-gradient(90deg, var(--math-orange), transparent);
}

/* SVG Venn simples */
.math-venn-wrap {
  margin: 1rem auto;
  max-width: 280px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.math-venn-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
