@import url("../components/kids-menu.css");
/* ===== Design tokens — fonte única de cor/sombra =====
   Mude um valor aqui e ele muda no site inteiro. As categorias apontam pros
   acentos de marca; a sombra navy é um trio RGB pra usar com alpha variável:
   box-shadow: 0 10px 26px rgba(var(--shadow-rgb), .07). */

/* Menu/header: fonte única em components/kids-menu.css (reusável; o componente
   kids-menu.js injeta esse mesmo arquivo nas páginas em subpasta). */

:root {
    /* Acentos de marca */
    --c-blue:   #2aa9e0;
    --c-green:  #22b07d;
    --c-amber:  #f59e0b;
    --c-pink:   #ec4899;
    --c-purple: #a855f7;
    --c-indigo: #6366f1;
    --c-red:    #ef4444;

    /* Categorias das histórias → apontam pros acentos */
    --c-emocoes:  var(--c-amber);
    --c-rotina:   var(--c-blue);
    --c-aventura: var(--c-green);

    /* Texto */
    --c-ink:       #0f2740;  /* títulos / navy forte */
    --c-text:      #3b5a7a;  /* corpo */
    --c-text-soft: #56708a;
    --c-text-2:    #5b6b7c;  /* texto neutro secundário */
    --c-muted:     #6b86a3;  /* metadados (categoria · duração) */

    /* Superfícies / linhas */
    --c-surface:   #fff;
    --c-surface-2: #f6fafd;  /* fundo suave de blocos */
    --c-line:      #e6eef5;  /* bordas claras */

    /* Sombra navy — usar com alpha: rgba(var(--shadow-rgb), .12) */
    --shadow-rgb: 15, 39, 64;
}

/* ===== Reset básico ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* overflow-x: clip (não hidden) — clipa o vazamento horizontal do hero SEM criar
   scroll container, senão o position:sticky da barra de personagem não engata. */
html, body { width: 100%; overflow-x: clip; }
body {
    font-family: 'Baloo 2', system-ui, sans-serif;
    color: #1a3a5c;
    background: #fff;
}

/* ===== Menu/header ===== estilo movido pra components/kids-menu.css (fonte única,
   importado no topo deste arquivo). Mexer no menu = mexer só lá. */

/* ===== PAGE TOC — Table of Contents lateral ===== */
.page-toc-toggle {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 61;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 10px 30px rgba(var(--shadow-rgb),0.16);
    color: var(--c-ink);
    cursor: pointer;
    display: grid;
    place-items: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.toc-icon-menu,
.toc-icon-close {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toc-icon-menu i {
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: left center;
    animation: tocLineIn 0.35s ease both;
}
.toc-icon-menu i:nth-child(1) { --y: -6px; transform: translateY(var(--y)); animation-delay: 0s; }
.toc-icon-menu i:nth-child(2) { --y: 0; transform: translateY(var(--y)); animation-delay: 0.1s; }
.toc-icon-menu i:nth-child(3) { --y: 6px; transform: translateY(var(--y)); animation-delay: 0.2s; }
.toc-icon-close i {
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}
.toc-icon-close i:nth-child(1) { transform: rotate(45deg); }
.toc-icon-close i:nth-child(2) { transform: rotate(-45deg); }
.page-toc-toggle.active .toc-icon-menu,
.page-toc-toggle:not(.active) .toc-icon-close {
    opacity: 0;
    transform: rotate(-45deg) scale(0.8);
}
.page-toc-toggle.active .toc-icon-close,
.page-toc-toggle:not(.active) .toc-icon-menu {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.page-toc {
    position: fixed;
    top: 128px;
    right: 24px;
    z-index: 60;
    width: 220px;
    padding: 16px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(var(--shadow-rgb),0.10);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(var(--shadow-rgb),0.16);
    font-family: 'Baloo 2', system-ui, sans-serif;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.page-toc.collapsed {
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 40px));
}
.page-toc-title {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--shadow-rgb),0.10);
    color: var(--c-ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.page-toc ul {
    list-style: none;
    display: grid;
    gap: 2px;
}
.page-toc li {
    animation: tocLiIn 0.35s ease both;
}
.page-toc a {
    display: block;
    padding: 8px 6px;
    border-radius: 8px;
    color: rgba(var(--shadow-rgb),0.72);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.page-toc a:hover {
    color: var(--c-ink);
    background: rgba(42,169,224,0.10);
    transform: translateX(-2px);
}

/* ===== Navegação VOLTAR/AVANÇAR — flutuante à esquerda, grande pra criança =====
   Par do components/kids-nav.js (drop-in: o componente se injeta sozinho no body).
   Fica no canto onde antes morava o toggle do TOC (que foi pra direita). Voltar
   e Avançar são o histórico real do navegador (history.back/forward), aparecem
   em toda página, inclusive a home. */
.kids-nav {
    position: fixed;
    top: 92px;
    left: 24px;
    z-index: 61;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: kidsBackIn 0.4s cubic-bezier(.34,1.56,.64,1) both;
}
.kids-back, .kids-fwd {
    display: inline-flex;
    align-items: center;
    height: 52px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.kids-back {
    gap: 10px;
    padding: 0 22px 0 8px;
    background: linear-gradient(135deg, var(--c-amber), var(--c-pink));
    box-shadow: 0 12px 28px rgba(236,72,153,0.38);
}
.kids-fwd {
    justify-content: center;
    width: 52px;
    padding: 0;
    background: linear-gradient(135deg, var(--c-blue), var(--c-indigo));
    box-shadow: 0 12px 28px rgba(42,169,224,0.38);
}
.kids-back:hover, .kids-fwd:hover { transform: translateY(-2px) scale(1.05); }
.kids-back:active, .kids-fwd:active { transform: translateY(0) scale(0.96); }
.kids-back-arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
}
.kids-back-arrow svg, .kids-fwd svg { width: 22px; height: 22px; display: block; }

@keyframes kidsBackIn {
    from { opacity: 0; transform: translateX(-20px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 640px) {
    /* Só o círculo da seta: fixo, o pill inteiro cobria o breadcrumb no topo
       e perseguia o conteúdo na rolagem (título de card, player, "Montar →"). */
    .kids-nav { gap: 8px; left: 16px; }
    .kids-back-label { display: none; }
    .kids-back, .kids-fwd { width: 46px; height: 46px; }
    .kids-back { justify-content: center; padding: 0; }
    .kids-back-arrow { width: 34px; height: 34px; }
}

@keyframes tocLineIn {
    from { transform: translateY(var(--y, 0)) scaleX(0); opacity: 0; }
    to { transform: translateY(var(--y, 0)) scaleX(1); opacity: 1; }
}
@keyframes tocLiIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1440px) {
    .page-toc {
        transform: translateX(calc(100% + 40px));
        opacity: 0;
        pointer-events: none;
    }
    .page-toc:not(.collapsed) {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 640px) {
    /* No celular o TOC vira FAB no canto de baixo: colado no header ele parecia
       um segundo hambúrguer e cobria conteúdo (filtro da home, transcrição). */
    .page-toc-toggle { top: auto; bottom: 20px; right: 16px; }
    .page-toc {
        top: auto;
        bottom: 78px;
        right: 16px;
        width: min(220px, calc(100vw - 48px));
        max-height: calc(100vh - 160px);
        overflow-y: auto;
    }
    .page-toc.collapsed { transform: translateY(calc(100% + 40px)); }
}

/* Hamburger + dropdown mobile do menu: em components/kids-menu.css */

/* ===== Fontes infantis ===== */
/* Site todo em Baloo 2 (arredondada e divertida). Títulos com peso 700 pra
   chamar mais atenção; corpo herda Baloo 2 do body. Bloco no fim do arquivo
   pra sobrescrever os font-family por seletor. */
.page-toc-title,
.hero-title,
.section-kicker,
.section-title,
.char-name,
.parallax-kicker,
.parallax-title,
.emocao-nome,
.page-hero-kicker,
.page-hero-title {
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-weight: 700;
}

/* ===== Títulos coloridos por seção (mais alegre/infantil) ===== */
#sobre      .section-title { color: var(--c-green); }
#personagens .section-title { color: var(--c-blue); }
#emocoes    .section-title { color: var(--c-amber); }
#rotina     .section-title { color: var(--c-pink); }
#audios     .section-title { color: var(--c-purple); }
#familia    .section-title { color: var(--c-green); }

/* ===== Rodapé único (injetado por components/kids-footer.js) ===== */
.site-footer {
    background: var(--c-ink);
    color: #cdd9e6;
    padding: 48px 24px 28px;
    margin-top: 80px;
}
.site-footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}
.footer-brand {
    max-width: 360px;
}
.footer-logo {
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-weight: 800;
    font-size: 32px;
    letter-spacing: .04em;
    color: #fff;
    text-decoration: none;
}
.footer-tagline {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: #9fb2c6;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}
.footer-nav a {
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #cdd9e6;
    text-decoration: none;
    transition: color .2s ease;
}
.footer-nav a:hover {
    color: #4dd4a0;
}
.footer-bottom {
    max-width: 1040px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.12);
    text-align: center;
    font-size: 13px;
    color: #7c93a9;
}
@media (max-width: 640px) {
    .site-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* ===== kids-toggle — checkbox estilizado (trilho deslizante), base única do site.
   Mesmo desenho do .campo-toggle do admin, com os tokens daqui. Uso:
   <label class="kids-toggle"><input type="checkbox"><span class="trilho"></span> Texto</label> */
.kids-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--c-text);
    cursor: pointer;
    user-select: none;
}
.kids-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.kids-toggle .trilho {
    display: inline-block;   /* span é inline: sem isso o width/height não pega */
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: var(--c-line);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.kids-toggle .trilho::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: left 0.15s ease;
}
.kids-toggle input:checked + .trilho { background: var(--c-green); }
.kids-toggle input:checked + .trilho::after { left: 23px; }
.kids-toggle input:focus-visible + .trilho { outline: 2px solid var(--c-blue); outline-offset: 2px; }

