/**
 * Ponte de tema nativo → home composta (modo Código / blocos).
 * A lua do site (body[data-theme-style]) manda; o canvas do autor (.ll-home + --ll-*)
 * e os {{component:*}} acompanham sem segundo interruptor.
 */

/* Aperto do chrome nativo só na home composta (wrapper pt-4 + navbar mb-6). */
body:has([data-home-composition]) > .container.pt-4 {
    padding-top: 0.65rem !important;
}

body:has([data-home-composition]) #navbar.navbar-main {
    margin-bottom: 0.85rem !important;
}

body:has([data-home-composition]) main.altum-animate {
    padding-top: 0;
}

[data-home-composition] {
    color-scheme: light;
}

[data-theme-style="dark"] [data-home-composition] {
    color-scheme: dark;
}

/* Tokens do canvas (convenção .ll-* / --ll-*). Sobrepõe o CSS claro do autor em dark. */
[data-theme-style="dark"] [data-home-composition] .ll-home,
[data-theme-style="dark"] [data-home-composition] [data-home-theme] {
    --ll-ink: #f5f7fa;
    --ll-blue: #4ea1ff;
    --ll-blue-deep: #1a6fd4;
    --ll-green: #3dcea0;
    --ll-lime: #b8ed4a;
    --ll-sand: #1a2433;
    --ll-paper: #0b1220;
    --ll-line: rgba(245, 247, 250, 0.16);
}

[data-theme-style="dark"] [data-home-composition] .ll-home {
    color: var(--ll-ink);
    background:
        radial-gradient(circle at 8% 8%, rgba(184, 237, 74, 0.12), transparent 24rem),
        linear-gradient(180deg, var(--ll-paper), #0f1828 44%, #0b1220);
}

/* Cores fixas típicas do template Codex (não usam var()). */
[data-theme-style="dark"] [data-home-composition] .ll-lead,
[data-theme-style="dark"] [data-home-composition] .ll-proof,
[data-theme-style="dark"] [data-home-composition] .ll-section-heading > p:last-child,
[data-theme-style="dark"] [data-home-composition] .ll-hero-art figcaption,
[data-theme-style="dark"] [data-home-composition] .ll-link-grid span {
    color: rgba(245, 247, 250, 0.72);
}

[data-theme-style="dark"] [data-home-composition] .ll-button-secondary,
[data-theme-style="dark"] [data-home-composition] .ll-hero-art {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--ll-line, rgba(245, 247, 250, 0.16));
    color: var(--ll-ink, #f5f7fa);
}

[data-theme-style="dark"] [data-home-composition] .ll-path-card-entry {
    background: var(--ll-sand, #1a2433);
    border-color: var(--ll-line, rgba(245, 247, 250, 0.16));
}

[data-theme-style="dark"] [data-home-composition] .ll-link-grid {
    border-color: var(--ll-line, rgba(245, 247, 250, 0.16));
}

[data-theme-style="dark"] [data-home-composition] .ll-link-grid a {
    border-color: var(--ll-line, rgba(245, 247, 250, 0.16));
    color: var(--ll-ink, #f5f7fa);
}

/* Componentes vivos: herdam --ll-* (já escuros) em vez de forçar ilha clara. */
[data-home-composition] .home-composer-system,
[data-home-composition] .home-composer-embed {
    --hc-ink: var(--ll-ink, #071b2b);
    --hc-paper: var(--ll-paper, #fffdf8);
    --hc-sand: var(--ll-sand, #f3eee4);
    --hc-line: var(--ll-line, rgba(7, 27, 43, 0.14));
    --hc-muted: rgba(7, 27, 43, 0.68);
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed {
    --hc-muted: rgba(245, 247, 250, 0.72);
    color: var(--hc-ink);
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system h2,
[data-theme-style="dark"] [data-home-composition] .home-composer-system h3,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .card-title,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed h2,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed h3,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed .card-title {
    color: var(--hc-ink);
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system .card,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .pricing-plan,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed .card {
    background-color: var(--hc-sand) !important;
    color: var(--hc-ink) !important;
    border-color: var(--hc-line) !important;
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system .bg-primary-100 {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system .text-muted,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .text-gray-800,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .blockquote-footer,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed .text-muted,
[data-theme-style="dark"] [data-home-composition] .home-composer-embed .text-gray-800 {
    color: var(--hc-muted) !important;
}

[data-theme-style="dark"] [data-home-composition] .home-composer-system .pricing-header,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .pricing-body,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .index-faq .card,
[data-theme-style="dark"] [data-home-composition] .home-composer-system .index-faq .btn {
    color: var(--hc-ink);
    border-color: var(--hc-line);
}
