/* ==========================================================================
   Manus Page Builder — Layouts dos templates
   --------------------------------------------------------------------------
   Contêiner : conteúdo centralizado, SEM caixa. Usa o fundo e as cores da
               página (metabox). Nada de fundo branco próprio.
   Caixa     : o fundo da página fica do lado de fora; o conteúdo fica numa
               caixa centralizada (cor via --manus-pb-box-bg).
   Variáveis definidas pelo plugin a partir do metabox (quando preenchidas):
     --manus-pb-text, --manus-pb-heading, --manus-pb-link
   Variáveis que você pode sobrescrever no CSS personalizado:
     --manus-pb-container-width, --manus-pb-box-width, --manus-pb-box-bg,
     --manus-pb-box-text, --manus-pb-box-radius, --manus-pb-box-shadow
   ========================================================================== */

body.manus-pb-page {
    --manus-pb-container-width: 1200px;
    --manus-pb-box-width: 980px;
    --manus-pb-box-bg: #ffffff;
    --manus-pb-box-radius: 16px;
    --manus-pb-box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    --manus-pb-gutter: clamp(16px, 4vw, 32px);
}

/* --------------------------------------------------------------------------
   Base comum
   -------------------------------------------------------------------------- */
body.manus-pb-page .manus-pb-layout {
    background: transparent;
    padding: clamp(32px, 6vw, 64px) 0;
    color: var(--manus-pb-text, inherit);
    min-height: 40vh;
}

/* Temas costumam pintar esses wrappers de branco: no plugin eles ficam
   transparentes para o fundo da página aparecer. */
body.manus-pb-page .manus-pb-layout .site-main,
body.manus-pb-page .manus-pb-layout .manus-pb-layout__article {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}

body.manus-pb-page .manus-pb-layout__inner {
    width: 100%;
    max-width: var(--manus-pb-container-width);
    margin: 0 auto;
    padding: 0 var(--manus-pb-gutter);
    box-sizing: border-box;
}

body.manus-pb-page .manus-pb-layout__header {
    margin: 0 0 clamp(20px, 3vw, 32px);
    padding: 0;
}

body.manus-pb-page .manus-pb-layout__title {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    line-height: 1.15;
    font-weight: 700;
    color: var(--manus-pb-heading, inherit);
}

body.manus-pb-page .manus-pb-layout__excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.85;
}

body.manus-pb-page .manus-pb-layout .manus-pb-content {
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--manus-pb-text, inherit);
    font-size: 1rem;
    line-height: 1.7;
}

body.manus-pb-page .manus-pb-layout .manus-pb-content > *:first-child { margin-top: 0; }
body.manus-pb-page .manus-pb-layout .manus-pb-content > *:last-child  { margin-bottom: 0; }

body.manus-pb-page .manus-pb-layout .manus-pb-content :is(h1, h2, h3, h4, h5, h6) {
    color: var(--manus-pb-heading, inherit);
}

body.manus-pb-page .manus-pb-layout .manus-pb-content a {
    color: var(--manus-pb-link, inherit);
}

/* Blocos alinhados "largura total" / "largo" dentro do contêiner */
body.manus-pb-page .manus-pb-layout .manus-pb-content .alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
body.manus-pb-page .manus-pb-layout .manus-pb-content .alignwide {
    width: auto;
    max-width: none;
    margin-left: calc(-1 * var(--manus-pb-gutter));
    margin-right: calc(-1 * var(--manus-pb-gutter));
}

body.manus-pb-page .manus-pb-layout__footer {
    margin-top: 32px;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Subpáginas e navegação: seguem as cores da página (sem branco fixo) */
body.manus-pb-page .manus-pb-layout .manus-pb-child-pages-section {
    margin-top: 48px;
}
body.manus-pb-page .manus-pb-layout .manus-pb-child-pages-section .section-title {
    color: var(--manus-pb-heading, inherit);
}
body.manus-pb-page .manus-pb-layout .child-page-card {
    background: transparent;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
}
body.manus-pb-page .manus-pb-layout .child-page-card .card-title a,
body.manus-pb-page .manus-pb-layout .child-page-card .card-read-more {
    color: var(--manus-pb-link, inherit);
}
body.manus-pb-page .manus-pb-layout .manus-pb-page-navigation {
    border-color: color-mix(in srgb, currentColor 20%, transparent);
}

/* --------------------------------------------------------------------------
   Contêiner
   -------------------------------------------------------------------------- */
/* Nenhuma regra extra: o contêiner é só largura máxima + respiro lateral. */

/* --------------------------------------------------------------------------
   Caixa
   -------------------------------------------------------------------------- */
body.manus-pb-page .manus-pb-layout--boxed .manus-pb-layout__inner {
    max-width: calc(var(--manus-pb-box-width) + 2 * var(--manus-pb-gutter));
}

body.manus-pb-page .manus-pb-layout--boxed .manus-pb-layout__article.manus-pb-layout__box {
    background: var(--manus-pb-box-bg);
    color: var(--manus-pb-box-text, var(--manus-pb-text, #1e293b));
    border-radius: var(--manus-pb-box-radius);
    box-shadow: var(--manus-pb-box-shadow);
    padding: clamp(24px, 5vw, 56px);
    overflow: hidden;
}

body.manus-pb-page .manus-pb-layout--boxed .manus-pb-layout__title {
    color: var(--manus-pb-heading, #0f172a);
}

body.manus-pb-page .manus-pb-layout--boxed .manus-pb-content {
    color: var(--manus-pb-box-text, var(--manus-pb-text, #1e293b));
}

/* Sem fundo definido no metabox, um cinza claro deixa a caixa visível */
body.manus-pb-page.manus-pb-template-boxed:not(.manus-pb-bg-color):not(.manus-pb-bg-image):not(.manus-pb-bg-gradient) {
    background-color: #eef2f6;
}

/* alignfull dentro da caixa: ocupa a caixa inteira, não a tela */
body.manus-pb-page .manus-pb-layout--boxed .manus-pb-content .alignfull {
    width: auto;
    max-width: none;
    margin-left: calc(-1 * clamp(24px, 5vw, 56px));
    margin-right: calc(-1 * clamp(24px, 5vw, 56px));
}

/* --------------------------------------------------------------------------
   Largura total
   -------------------------------------------------------------------------- */
body.manus-pb-page .manus-pb-template-full-width .manus-pb-content {
    color: var(--manus-pb-text, inherit);
}
body.manus-pb-page .manus-pb-template-full-width .manus-pb-content :is(h1, h2, h3, h4, h5, h6) {
    color: var(--manus-pb-heading, inherit);
}
body.manus-pb-page .manus-pb-template-full-width .manus-pb-content a {
    color: var(--manus-pb-link, inherit);
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    body.manus-pb-page .manus-pb-layout--boxed .manus-pb-layout__inner {
        padding: 0 12px;
    }
    body.manus-pb-page .manus-pb-layout--boxed .manus-pb-layout__article.manus-pb-layout__box {
        border-radius: calc(var(--manus-pb-box-radius) * 0.75);
    }
}
