/* =========================================================
   ESTILOS GERAIS — A EMANCIPAÇÃO DA DISSONÂNCIA
========================================================= */

/* --- QUEBRAR LIMITES DO TEMA (WORDPRESS / PAGE BUILDER) --- */
.entry-content > #emanc-app {
  max-width: none !important;
  width: 100%;
}

/* =========================================================
   ROOT — PALETA UNIFICADA
========================================================= */
#emanc-app {
  --brand: #12b3b6;
  --brand-soft: #e6f6f7;
  --accent: #f5c84c;

  --bg: #f6f8fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #5b6570;
  --line: #e2e8f0;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 16px;

  --hdr-h: 64px;
  --hdr-bg: rgba(255, 255, 255, 0.55);
  --hdr-bg-solid: rgba(255, 255, 255, 0.96);
  --toc-w: 260px;

  font-family: "IBM Plex Sans",
               -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Arial, sans-serif;

  color: var(--ink);
  background: var(--bg);
  font-size: 22px;
}

#emanc-app,
#emanc-app * {
  box-sizing: border-box;
}

/* =========================================================
   HEADER
========================================================= */
#emanc-app .header {
  position: sticky;
  top: 0;
  z-index: 5;

  height: var(--hdr-h);
  border-bottom: 1px solid var(--line);

  backdrop-filter: saturate(1.4) blur(10px);
  background: linear-gradient(to bottom, var(--hdr-bg), transparent);
  transition: background 0.2s ease;
}

#emanc-app .header.scrolled {
  background: var(--hdr-bg-solid);
}

/* =========================================================
   LAYOUT + CONTEÚDO PRINCIPAL
========================================================= */
#emanc-app .layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;

  max-width: 1300px !important;
  margin: 20px auto 0;
  padding: 0 20px;

  min-height: calc(100vh - var(--hdr-h));
  min-height: calc(100dvh - var(--hdr-h));

  transition: max-width .25s ease, padding .25s ease;
}

@media (min-width: 1400px) {
  #emanc-app .layout {
    max-width: 1440px;
    padding: 0 24px;
  }
}

/* paragrafos*/

#emanc-app p,
#emanc-app li {
  text-align: justify;
  text-justify: inter-word;

  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* =========================================================
   CONTEÚDO INTERNO
========================================================= */
#emanc-app .content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  scroll-behavior: smooth;
}

/* =========================================================
   PAINÉIS
========================================================= */
#emanc-app .pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

/* ============================================================
   TOC — BOTÃO
============================================================ */
#emanc-app #toc-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 99998;

  width: 40px;
  height: 40px;

  background: var(--panel);
  color: var(--ink);
  font-size: 24px;

  border: 2px solid var(--brand);
  border-radius: 12px;
  cursor: pointer;

  box-shadow: var(--shadow);
  transition: all .25s ease;

  display: flex;
  align-items: center;
  justify-content: center;
}

#emanc-app #toc-btn:hover {
  background: var(--brand);
  color: #fff;
}

/* ============================================================
   TOC — PAINEL LATERAL
============================================================ */
#emanc-app .toc {
  position: fixed;
  top: 50px;
  left: 70px;
  width: 300px;
  height: 90vh;
  border-radius: 12px;

  background: var(--panel);
  border-right: 3px solid var(--brand);
  box-shadow: 0 0 40px rgba(0,0,0,.08);

  padding: 28px 22px;
  overflow-y: auto;
  z-index: 99997;

  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

/* estado aberto */
#emanc-app .toc.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   TOC — LISTA / LINKS
============================================================ */
#emanc-app .toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#emanc-app .toc li {
  margin-bottom: 14px;
}

#emanc-app .toc a {
  text-decoration: none;
  font-size: 1rem;
  color: var(--ink);
  padding: 4px 0;
  display: block;

  border-left: 3px solid transparent;
  transition: all .2s ease;
}

#emanc-app .toc a:hover {
  color: var(--brand);
  border-left-color: var(--brand);
}

#emanc-app .toc a.active,
#emanc-app .toc a[aria-current="true"] {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}

/* =========================================================
   CARTÕES / HERO
========================================================= */
#emanc-app .hero,
#emanc-app .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* HERO — título principal */
#emanc-app .hero h2 {
  margin: 0 0 .25rem;
  font-size: 1.25rem;
}

/* =========================================================
   TITLE (JS) — SECÇÕES DINÂMICAS
========================================================= */
#emanc-app .card h2,
#emanc-app .hero h2 {
  margin: 32px 0 16px;
  padding: 6px 0 6px 14px;

  font-size: 1.3em;
  font-weight: 700;
  line-height: 1.25;

  color: var(--ink);

  border-left: 5px solid var(--brand);
  border-radius: 4px;

  background: linear-gradient(
    to right,
    rgba(18,179,182,0.08),
    transparent 70%
  );
}

#emanc-app .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* =========================================================
   MEDIA — YOUTUBE STANDARD AO CENTRO
========================================================= */
#emanc-app .media {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#emanc-app .yt-wrap {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  position: relative;
}

#emanc-app .yt-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* =========================================================
   TOC — MOBILE
========================================================= */
@media (max-width: 760px){

  #emanc-app #toc-btn{
    left: 12px;
  }

  #emanc-app .toc{
    position: fixed;
    top: 0;
    left: 55px;

    width: calc(100% - 55px);
    height: 100vh;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    background: var(--panel);
    border-right: 3px solid var(--brand);
    box-shadow: 0 0 40px rgba(0,0,0,.18);

    z-index: 99999;
  }

  #emanc-app{
    font-size: 16px;
  }
}
