/* Zonas de publicidade — AdSense (reserva espaço, evita CLS) */

/* Oculto enquanto adsLive === false em config.js */
html.ads-off .ad-unit,
html.ads-off .page-aside,
html.ads-off #ad-gate,
html.ads-off .ad-gate-frame-wrap,
html.ads-off .ad-gate-tab-link {
    display: none !important;
}

html.ads-off .page-aside-left,
html.ads-off .page-aside-right {
    display: none !important;
}

/* Upload sempre acima de iframes de anúncio */
#step1 {
    position: relative;
    z-index: 20;
    isolation: isolate;
}

#uploadBtn {
    position: relative;
    z-index: 30;
}

.ad-unit {
    margin: 2rem 0;
    padding: 0.5rem 0;
    text-align: center;
    clear: both;
}

.ad-unit--tight { margin: 1.25rem 0; }

.ad-unit--spaced {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

.ad-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.35rem;
    user-select: none;
}

.ad-unit ins.adsbygoogle {
    display: block;
    margin: 0 auto;
}

/* Leaderboard / horizontal */
.ad-leaderboard {
    min-height: 90px;
}

.ad-leaderboard ins.adsbygoogle {
    min-height: 90px;
}

/* In-content */
.ad-incontent {
    min-height: 280px;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
}

.ad-incontent ins.adsbygoogle {
    min-height: 250px;
}

.ad-incontent--compact {
    min-height: 120px;
    padding: 0.5rem;
}

.ad-incontent--compact ins.adsbygoogle {
    min-height: 100px;
}

/* Anchor — antes do rodapé */
.ad-anchor {
    min-height: 90px;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/*
 * Trilhos laterais — conteúdo fixo no centro, ads só no espaço livre da tela.
 * Abaixo de 1480px: sem laterais (conteúdo usa largura total, sem espremer).
 * 1480px+: laterais esquerda e direita.
 * 1900px+: bloco extra por lado.
 */
.page-rails {
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(1rem, 2vw, 1.5rem);
    display: grid;
    grid-template-columns: 1fr min(1080px, 100%) 1fr;
    column-gap: clamp(0.75rem, 1.5vw, 1.25rem);
    align-items: start;
    margin-bottom: 0.5rem;
}

.page-main {
    grid-column: 2;
    width: 100%;
    min-width: 0;
}

.page-aside {
    display: none;
    position: sticky;
    top: 1rem;
    width: 100%;
    max-width: 300px;
}

.page-aside-left {
    grid-column: 1;
    justify-self: end;
}

.page-aside-right {
    grid-column: 3;
    justify-self: start;
}

.page-aside .ad-unit {
    margin: 0 0 1rem;
}

.ad-rail {
    min-height: 250px;
}

.ad-rail ins.adsbygoogle {
    min-height: 250px;
    width: 100%;
    max-width: 300px;
}

.ad-rail--tall {
    min-height: 600px;
}

.ad-rail--tall ins.adsbygoogle {
    min-height: 600px;
}

.ad-rail-extra {
    display: none;
}

/* Laterais quando há espaço nas margens (tablet landscape / desktop) */
@media (min-width: 1200px) {
    .page-aside-left,
    .page-aside-right {
        display: block;
    }
}

@media (min-width: 1900px) {
    .ad-rail-extra {
        display: block;
    }

    .ad-rail {
        min-height: 280px;
    }
}

/* Distância mínima de botões de ação (política AdSense) */
.actions-bar + .ad-unit,
.btn-primary + .ad-unit,
#step3 + .ad-unit {
    margin-top: 2.75rem;
}

.upload-area + .ad-unit,
#dropZone + .ad-unit {
    margin-top: 2rem;
}

/* Painel de publicidade (upload / gerar páginas) */
.ad-gate {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ad-gate.hidden { display: none !important; }

.ad-gate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

.ad-gate-frame-wrap {
    width: 100%;
    height: min(320px, 50vh);
    margin: 0 auto 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

#ad-gate-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ad-gate-tab-link {
    display: inline-block;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
}

.ad-gate-tab-link:hover { text-decoration: underline; }

.ad-gate-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 1.35rem 1.5rem 1.5rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.ad-gate-panel h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0.25rem 0 0.35rem;
    color: #0f172a;
}

.ad-gate-msg {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.ad-gate-slot {
    min-height: 280px;
    margin: 0 auto 1.15rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
}

.ad-gate-slot ins.adsbygoogle {
    min-height: 250px;
    display: block;
}

.ad-gate-slot.hidden { display: none !important; }

.ad-gate-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: opacity 0.2s;
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

label.ad-gate-btn { margin: 0; }

.ad-gate-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.ad-gate-btn:not(:disabled):hover {
    opacity: 0.92;
}

/* Cookie banner (páginas de guia sem banner no HTML) */
#cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 680px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    color: #f1f5f9;
    padding: 1.15rem 1.35rem;
    z-index: 2000;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#cookie-banner.hidden { display: none !important; }

#cookie-banner .cookie-text {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

#cookie-banner .cookie-text a { color: #a5b4fc; }

#cookie-banner .cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#cookie-banner .cookie-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

#cookie-banner .cookie-btn-accept {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

#cookie-banner .cookie-btn-analytics {
    background: #334155;
    color: #e2e8f0;
}

#cookie-banner .cookie-btn-reject {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
}

@media (max-width: 640px) {
    #cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
    }
}

/* Guias — trilhos laterais em telas largas */
.guia-rails {
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(1rem, 2vw, 1.5rem);
    display: grid;
    grid-template-columns: 1fr min(800px, 100%) 1fr;
    column-gap: clamp(0.75rem, 1.5vw, 1.25rem);
    align-items: start;
}

.guia-rails .guia-main {
    grid-column: 2;
    min-width: 0;
}

.guia-rails .page-aside-left { grid-column: 1; }
.guia-rails .page-aside-right { grid-column: 3; }

@media (min-width: 1380px) {
    .guia-rails .page-aside-left,
    .guia-rails .page-aside-right {
        display: block;
    }
}
