/* =============================================================
   shared.css — Estilos para textos de conteúdo de Física
   Tema claro, reutiliza variáveis de css/style.css
   ============================================================= */

/* ---- HERO DO CONTEÚDO ---- */
.content-hero {
  background: linear-gradient(135deg, #1e2a78 0%, #2f5bea 50%, #6a2fe8 100%);
  color: #fff;
  padding: 3rem 2rem 2.5rem;
}

.content-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.breadcrumb a:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumb span {
  opacity: 0.6;
}

.content-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
  line-height: 1.15;
}

.content-subtitle {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 600px;
  margin-bottom: 1.2rem;
}

.formula-highlight {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-size: 1.2rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  color: #facc15;
  font-weight: 700;
}

/* ---- LAYOUT: SIDEBAR + CONTEÚDO ---- */
.content-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  align-items: start;
}

/* ---- SIDEBAR TOC ---- */
.content-toc {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 4px 18px var(--shadow);
  overflow: hidden;
}

.toc-header {
  background: linear-gradient(90deg, #2f5bea, #6a2fe8);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.85rem 1.2rem;
}

.toc-list {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  counter-reset: none;
}

.toc-list li {
  border-left: 3px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  counter-increment: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc-list li::before {
  display: none;
}

.toc-list li.active,
.toc-list li:hover {
  border-left-color: #6a2fe8;
  background: rgba(106,47,232,0.05);
}

.toc-list a {
  display: block;
  padding: 0.5rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s;
}

.toc-list li.active a,
.toc-list a:hover {
  color: #6a2fe8;
  font-weight: 600;
}

.toc-nav {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.toc-nav a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
}

.toc-nav a:hover {
  border-color: #6a2fe8;
  color: #6a2fe8;
  background: rgba(106,47,232,0.05);
}

/* ---- CONTEÚDO PRINCIPAL ---- */
.content-main {
  min-width: 0;
}

.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--titulo);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.content-section h2 .sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f5bea, #6a2fe8);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.content-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--subtitulo);
  margin: 1.8rem 0 0.8rem;
}

.content-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--texto);
  margin-bottom: 0.9rem;
  text-align: justify;
  hyphens: auto;
}

/* ---- CAIXA DE FÓRMULA ---- */
.formula-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-left: 5px solid #2f5bea;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.formula-box .formula-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--subtitulo);
}

.formula-box .formula-expr {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--titulo);
  letter-spacing: 1px;
}

.formula-box .formula-legend {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.formula-box .formula-legend span {
  display: block;
}

.formula-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.formula-row .formula-box {
  flex: 1;
  min-width: 200px;
}

/* ---- VISUAIS DE POSIÇÃO ---- */
.position-visual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin: 1.4rem 0 1.6rem;
}

.position-visual {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 10px 24px var(--shadow);
}

.position-visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.position-visual figcaption {
  padding: 0.75rem 0.95rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--titulo);
  background: var(--surface);
}

@media (min-width: 860px) {
  .position-visual-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- CAIXA DE DESTAQUE / DICA ---- */
.highlight-box {
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-border);
  border-left: 5px solid #facc15;
  border-radius: 10px;
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.highlight-box .hb-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.highlight-box p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--warn-text);
  line-height: 1.6;
}

.highlight-box.curiosity-box {
  display: block;
}

.curiosity-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.curiosity-title {
  flex: 1;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--info-text);
  line-height: 1.4;
}

.curiosity-toggle {
  border: 1px solid var(--info-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--info-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

.curiosity-toggle:hover,
.curiosity-toggle:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.curiosity-content {
  margin-top: 0.85rem;
  padding-left: 2.2rem;
}

.curiosity-content p,
.curiosity-content li {
  color: var(--info-text);
}

.curiosity-content p + p,
.curiosity-content p + ul,
.curiosity-content ul + p,
.curiosity-content ul + ul {
  margin-top: 0.8rem;
}

.highlight-box.info {
  background: var(--info-bg);
  border-color: var(--info-border);
  border-left-color: var(--subtitulo);
}

.highlight-box.info p {
  color: var(--info-text);
}

.highlight-box.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  border-left-color: #ef4444;
}

.highlight-box.danger p {
  color: var(--danger-text);
}

/* ---- CAIXA DE EXEMPLO ---- */
.example-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0;
}

.example-box .ex-header {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6a2fe8;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.example-box .ex-body {
  font-size: 0.97rem;
  color: var(--texto);
  line-height: 1.7;
}

.example-box .ex-body p {
  margin-bottom: 0.6rem;
  font-size: 0.97rem;
}

.example-box .ex-body .equation-line {
  color: var(--titulo);
  font-weight: 700;
  text-align: center;
}

.example-box .ex-result {
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--titulo);
  font-size: 1rem;
  background: var(--surface-2);
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
}

/* ---- GRID DE SUB-EXEMPLOS (dentro de .example-box) ---- */
.example-box .ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 0.2rem;
}

.example-box .ex-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.example-box .ex-item .ex-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #6a2fe8;
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.example-box .ex-item p {
  margin-bottom: 0.28rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.example-box .ex-item p:last-child {
  margin-bottom: 0;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
  font-weight: 700;
  color: var(--titulo);
}

/* ---- IMAGEM DE CONTEÚDO ---- */
.content-img {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 10px;
  margin: 1.5rem auto;
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

/* ---- PLACEHOLDER DE IMAGEM ---- */
.img-placeholder {
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.img-placeholder .ph-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.img-placeholder .ph-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.img-placeholder .ph-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.5;
  margin: 0;
}

.img-placeholder.wide {
  padding: 3rem 2rem;
}

/* ---- CARD DE CONCEITO (resumo) ---- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.concept-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.concept-card:hover {
  box-shadow: 0 6px 20px rgba(47,91,234,0.1);
  transform: translateY(-2px);
}

.concept-card .cc-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
  display: block;
}

.concept-card .cc-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--titulo);
  margin-bottom: 0.4rem;
}

.concept-card .cc-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---- CALCULADORA INTERATIVA ---- */
.calc-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 14px var(--shadow);
}

.calc-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--titulo);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.calc-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-field input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg);
}

.calc-field input:focus {
  outline: none;
  border-color: var(--subtitulo);
  box-shadow: 0 0 0 3px rgba(47,91,234,0.12);
  background: var(--surface);
}

.calc-field input.calc-result-field {
  background: var(--info-bg);
  border-color: var(--info-border);
  font-weight: 700;
  color: var(--info-text);
}

.calc-btn {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(90deg, #2f5bea, #6a2fe8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}

.calc-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.calc-result {
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.97rem;
  display: none;
}

.calc-result.ok {
  display: block;
  background: var(--ok-bg);
  border: 1.5px solid var(--ok-border);
  color: var(--ok-text);
}

.calc-result.erro {
  display: block;
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-border);
  color: var(--danger-text);
}

/* ---- GRÁFICO INTERATIVO ---- */
.graph-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 14px var(--shadow);
}

.graph-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--titulo);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.graph-canvases {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}

.graph-canvases canvas {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.graph-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.slider-row label {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-width: 180px;
  font-weight: 600;
}

.slider-row input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: #6a2fe8;
}

/* ---- TABELA INTERNA ---- */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px var(--shadow);
}

.content-table thead {
  background: linear-gradient(90deg, #2f5bea, #6a2fe8);
}

.content-table thead th {
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
}

.content-table tbody td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--texto);
}

.content-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.content-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---- RODAPÉ DE NAVEGAÇÃO ---- */
.content-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.content-footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.content-footer-nav a:hover {
  border-color: #6a2fe8;
  color: #6a2fe8;
  background: rgba(106,47,232,0.04);
}

.content-footer-nav .nav-next {
  margin-left: auto;
}

/* ---- SUMÁRIO (seção de resumo final) ---- */
.summary-box {
  background: linear-gradient(135deg, rgba(47,91,234,0.06), rgba(106,47,232,0.06));
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  margin: 2rem 0;
}

.summary-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--titulo);
  margin: 0 0 1rem;
}

.summary-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-box ul li {
  counter-increment: none;
  padding-left: 1.4rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--texto);
  line-height: 1.5;
  margin-bottom: 0;
}

.summary-box ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #6a2fe8;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---- SEÇÃO DE APLICAÇÃO COTIDIANA ---- */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.daily-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.daily-card .dc-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.daily-card .dc-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--titulo);
  margin-bottom: 0.3rem;
}

.daily-card .dc-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* ---- RESPONSIVO ---- */
@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.2rem 3rem;
  }

  .content-toc {
    position: static;
    margin-bottom: 1rem;
  }

  .toc-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.3rem;
  }

  .toc-list li {
    border-left: none;
    border-radius: 6px;
    background: var(--surface-2);
  }

  .toc-list li.active,
  .toc-list li:hover {
    border-left-color: transparent;
    background: rgba(106,47,232,0.08);
  }

  .toc-list a {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .toc-nav {
    flex-direction: row;
    justify-content: space-between;
  }

  .toc-nav a {
    flex: 1;
  }

  .formula-row {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .content-hero {
    padding: 2rem 1.2rem 1.8rem;
  }

  .content-title {
    font-size: 1.6rem;
  }

  .calc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .graph-canvases canvas {
    width: 100%;
    height: auto;
  }

  .content-footer-nav {
    flex-direction: column;
  }

  .content-footer-nav .nav-next {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ---- NOTAS DE RODAPÉ ---- */
.footnote-ref {
  color: var(--cor-destaque, #2f5bea);
  text-decoration: none;
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}
.footnote-ref:hover { text-decoration: underline; }

.content-footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.content-footnotes ol {
  padding-left: 1.2em;
  margin: 0;
}
.content-footnotes li {
  margin-bottom: 0.4rem;
}

.footnote-back {
  color: var(--cor-destaque, #2f5bea);
  text-decoration: none;
  margin-left: 0.3em;
  font-size: 0.9em;
}
.footnote-back:hover { text-decoration: underline; }

/* ---- NOTAÇÃO VETORIAL ---- */
.vec {
  display: inline-block;
  position: relative;
  padding-top: 0.5em;
  line-height: 1;
}
.vec::before {
  content: '\2192'; /* → */
  position: absolute;
  top: 0.05em;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.55em;
  line-height: 1;
  font-style: normal;
  font-weight: normal;
}

/* ---- SCRIPT DE SCROLL ATIVO NA TOC ---- */
/* Controlado via JS, mas a classe .active é aplicada por JS */

/* ── Simulações embutidas (iframe) ── */
.sim-embed {
  margin: 2.5rem 0 1.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.sim-embed-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.75rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 520px) {
  .sim-embed iframe { height: 650px; }
}

