/* css/home-sabermeuip-overrides.css
 * Overrides especificos do sabermeuip sobre homepage-enhanced.css do CDP.
 * Ajustes: cor accent, panel multi-card, mini-mapa quadrado, header padding.
 */

/* ====== Fix sticky context: site.css usa overflow-x:hidden no html/body
   que quebra position:sticky (vira scroll container). Reseta para clip,
   que evita scroll horizontal SEM criar containing block. ====== */
html, body {
    overflow-x: clip !important;
}

/* ====== Header: FIXO abaixo do microheader, padding generoso ====== */
.main-header {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    position: fixed !important;
    top: 30px !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.85rem 0;
}
.main-header > .container,
.main-header .container,
body.home-landing .main-header > .container,
body.home-landing .main-header .container {
    padding-left: clamp(24px, 4vw, 56px) !important;
    padding-right: clamp(24px, 4vw, 56px) !important;
    max-width: 1700px !important;
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
}
.main-header .header-content {
    gap: 1.5rem;
}
/* Empurra todo o conteudo abaixo do microheader (30px) + header fixo (~64px). */
body {
    padding-top: 94px !important;
}
body.home-landing {
    /* Homepage tem hero full-bleed, mas tambem precisa do offset */
    padding-top: 94px !important;
}
@media (max-width: 920px) {
    body, body.home-landing { padding-top: 30px !important; }
}
body.dark-mode .main-header {
    background: rgba(15, 23, 42, 0.92) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* ====== Logo modernizado ====== */
.main-header .site-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0071e3;
    background: none;
    -webkit-text-fill-color: initial;
    -webkit-background-clip: initial;
    background-clip: initial;
    transition: transform 0.2s ease, color 0.2s ease;
}
.main-header .site-logo:hover {
    transform: translateY(-1px);
    color: #003c87;
}
body.dark-mode .main-header .site-logo {
    color: #7dd3fc;
}

/* ====== Nav moderna ====== */
.main-header .main-navigation {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.main-header .nav-link {
    color: #334155;
    background: none !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.92rem;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.main-header .nav-link:hover,
.main-header .nav-link.active,
.main-header .dropdown-toggle.active {
    color: #0071e3;
    background: rgba(0, 113, 227, 0.08) !important;
    border-color: transparent !important;
}
.main-header .nav-link.active {
    font-weight: 600;
    background: rgba(0, 113, 227, 0.1) !important;
}
.main-header .nav-link .nav-icon {
    margin-right: 6px;
    font-size: 0.9em;
    color: inherit;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.dark-mode .main-header .nav-link {
    color: #d7dde7;
    background: none !important;
    border-color: transparent !important;
}
body.dark-mode .main-header .nav-link:hover,
body.dark-mode .main-header .nav-link.active {
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.12) !important;
}

/* ====== Dropdown modernizado ====== */
.main-header .dropdown-content {
    top: calc(100% + 6px);
    border-radius: 10px;
    padding: 10px;
    min-width: 280px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.08);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.main-header .dropdown-separator {
    border-top: 1px solid #e2e8f0;
    margin: 8px 0;
}
body.dark-mode .main-header .dropdown-separator {
    border-top-color: rgba(255, 255, 255, 0.08);
}
.main-header .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.18s ease, color 0.18s ease;
}
.main-header .dropdown-item .nav-icon {
    margin-right: 0;
    color: #0071e3;
    font-size: 0.95em;
    width: 18px;
    text-align: center;
}
.main-header .dropdown-item:hover {
    background: rgba(0, 113, 227, 0.08);
    color: #0071e3;
}
.main-header .dropdown-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 8px 12px 4px;
    font-weight: 700;
}
body.dark-mode .main-header .dropdown-content {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode .main-header .dropdown-item {
    color: #e2e8f0;
}
body.dark-mode .main-header .dropdown-item .nav-icon {
    color: #7dd3fc;
}

/* ====== Mobile ====== */
@media (max-width: 920px) {
    .main-header .main-navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .main-header .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
    .main-header .nav-dropdown {
        width: 100%;
    }
    .main-header .dropdown-content {
        position: static;
        box-shadow: none;
        border: 0;
        min-width: 0;
        padding: 4px 0 4px 12px;
    }
}

/* =====================================================================
   QUICK HUB - pagina /calculos-rapidos: hub de tools + artigos + progs.
   ===================================================================== */
.quick-hub { padding: 24px 0 48px; }
.quick-hub__section { margin-bottom: 48px; }
.quick-hub__title {
    font-size: 1.5rem;
    border-bottom: 2px solid #0071e3;
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}
.quick-hub__title i { color: #0071e3; }
.quick-hub__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 920px) { .quick-hub__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .quick-hub__grid { grid-template-columns: 1fr; } }
.quick-hub__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.quick-hub__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
    border-color: rgba(0, 113, 227, 0.30);
}
.quick-hub__card-title { font-weight: 600; font-size: 0.98rem; color: #0071e3; }
.quick-hub__card-desc { font-size: 0.85rem; color: #475569; line-height: 1.4; }
.quick-hub__family { margin-bottom: 24px; }
.quick-hub__family-title {
    font-size: 1.05rem;
    color: #334155;
    margin: 0 0 10px;
    font-weight: 600;
}
.quick-hub__leaf-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.quick-hub__leaf-list li a {
    display: inline-block;
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.82rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.quick-hub__leaf-list li a:hover { background: #0071e3; color: #fff; border-color: #0071e3; }
body.dark-mode .quick-hub__title { color: #e2e8f0; }
body.dark-mode .quick-hub__card { background: #1e293b; border-color: rgba(255, 255, 255, 0.08); color: #e2e8f0; }
body.dark-mode .quick-hub__card-title { color: #7dd3fc; }
body.dark-mode .quick-hub__card-desc { color: #94a3b8; }
body.dark-mode .quick-hub__family-title { color: #cbd5e1; }
body.dark-mode .quick-hub__leaf-list li a { background: #334155; color: #e2e8f0; border-color: rgba(255, 255, 255, 0.06); }
body.dark-mode .quick-hub__leaf-list li a:hover { background: #0071e3; color: #fff; }

/* =====================================================================
   TOOL HERO — full-bleed escuro, com breadcrumb embutido.
   Usado por paginas de ferramenta que definem $useToolHero = true antes
   de incluir o header e depois fazem require de includes/tool-hero.php.
   ===================================================================== */
.tool-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(800px 400px at 80% 100%, rgba(125, 211, 252, 0.18) 0%, transparent 60%),
        radial-gradient(600px 300px at 10% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 60%),
        linear-gradient(135deg, rgba(0, 60, 135, 0.95) 0%, rgba(0, 30, 80, 0.98) 100%),
        #003c87;
    padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 48px);
    width: 100%;
    box-sizing: border-box;
}
.tool-hero__inner {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}
.tool-hero__breadcrumbs {
    margin-bottom: clamp(16px, 2vw, 24px);
}
.tool-hero__breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    align-items: center;
}
.tool-hero__breadcrumbs li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tool-hero__breadcrumbs li + li::before {
    content: "/";
    color: rgba(255, 255, 255, 0.4);
    margin-right: 4px;
}
.tool-hero__breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s;
}
.tool-hero__breadcrumbs a:hover {
    color: #fff;
    text-decoration: underline;
}
.tool-hero__breadcrumbs span[aria-current="page"] {
    color: #fff;
    font-weight: 600;
}
.tool-hero__head {
    display: flex;
    gap: clamp(16px, 2vw, 24px);
    align-items: center;
}
.tool-hero__icon {
    width: clamp(56px, 6vw, 80px);
    height: clamp(56px, 6vw, 80px);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(125, 211, 252, 0.08));
    border: 1px solid rgba(125, 211, 252, 0.3);
    flex-shrink: 0;
}
.tool-hero__icon i {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    color: var(--tool-hero-accent, #7dd3fc);
}
.tool-hero__title {
    margin: 0 0 8px 0;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}
.tool-hero__lede {
    margin: 0;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
}
@media (max-width: 640px) {
    .tool-hero__head { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Quando tool-hero esta presente, esconder o H1 duplicado dentro do card */
body.has-tool-hero .main-ip-card > #ip-card-title,
body.has-tool-hero .main-ip-card > .card-title:first-child {
    display: none;
}

/* ====== Hero - ajuste cor accent ====== */
.home-hero-pro__title em {
    font-style: normal;
    color: #7dd3fc;
}

/* ====== Hero grid: aumentar a coluna do panel ====== */
.home-hero-pro__grid {
    grid-template-columns: 1fr 1.25fr !important;
}

@media (max-width: 1100px) {
    .home-hero-pro__grid {
        grid-template-columns: 1fr !important;
    }
}

/* ====== Panel - layout 2-col interno (stats + mini-map) ====== */
.home-hero-pro__panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 760px) {
    .home-hero-pro__panel-body {
        grid-template-columns: 1fr;
    }
}

/* ====== Stats grid expandido ====== */
.home-hero-pro__panel-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-content: start;
}

.home-hero-pro__stat {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(0, 60, 135, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: #0b2545;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-hero-pro__stat[href]:hover {
    transform: translateY(-2px);
    border-color: #0071e3;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.18);
}

.home-hero-pro__stat-head {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-hero-pro__stat-head i {
    color: #0071e3;
    font-size: 0.85rem;
}

.home-hero-pro__stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0b2545;
    line-height: 1.2;
}

.home-hero-pro__stat-value--mono {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-all;
}

.home-hero-pro__stat-meta {
    font-size: 0.72rem;
    color: #64748b;
}

.home-hero-pro__stat--wide {
    grid-column: 1 / -1;
}

/* ====== Mini-map Leaflet ====== */
.home-hero-pro__map {
    position: relative;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 60, 135, 0.18);
    background: linear-gradient(135deg, #e8f1ff 0%, #d6e7f9 100%);
    color: #0b2545;
    box-shadow: 0 4px 14px rgba(0, 60, 135, 0.12);
}

.home-hero-pro__map-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.home-hero-pro__map-canvas .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.7);
}

.home-hero-pro__map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #475569;
    background:
        radial-gradient(circle at 30% 30%, rgba(0, 113, 227, 0.12) 0%, transparent 50%),
        repeating-linear-gradient(45deg, rgba(0, 60, 135, 0.04) 0px, rgba(0, 60, 135, 0.04) 8px, transparent 8px, transparent 16px),
        linear-gradient(135deg, #f0f7ff 0%, #d6e9ff 100%);
}

.home-hero-pro__map-placeholder i {
    font-size: 2.4rem;
    color: #0071e3;
    margin-bottom: 6px;
}

.home-hero-pro__map-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
}

.home-hero-pro__map-overlay-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-hero-pro__map-overlay-value {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-hero-pro__map-overlay-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 980px) {
    .home-hero-pro__map { min-height: 200px; }
}

/* ====== Banner abaixo do header (full-bleed visual, max-width interno) ====== */
.banner-ad-after-header {
    width: 100%;
    background: #f5f5f7;
    padding: 12px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.banner-ad-after-header__inner {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}
body.dark-mode .banner-ad-after-header {
    background: #0f172a;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ====== Layout shift: main + sidebar 2-col (mesmo padrao do contadordeprazo) ======
   CDP usa: grid minmax(0,1fr) 340px, gap 30px, sidebar sticky top 20px (dentro do shell). */
.cdp-tool-shift {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 30px;
    align-items: start;
}
.cdp-tool-body {
    min-width: 0;
}
/* Dentro do shift, o .container interno nao deve ter padding-right (gap do grid ja separa). */
.cdp-tool-shift .cdp-tool-body .container,
.cdp-tool-shift .cdp-tool-body > main > .container,
.cdp-tool-shift > .cdp-tool-body .container {
    padding-right: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
/* Sidebar STICKY igual CDP - o wrapper inteiro fica sticky a partir do header fixo.
   margin-top alinha visualmente com o topo do conteudo da ferramenta
   (main tem padding-top:32px no site.css). */
.cdp-tool-sidebar {
    position: sticky;
    top: 110px; /* microheader 30 + header fixo ~64 + folga 16 */
    align-self: start;
    width: 340px;
    flex-shrink: 0;
    margin-top: 32px;
}
.cdp-tool-sidebar .ad-slot {
    min-height: 250px;
    max-width: 300px;
    margin: 0 auto;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile/tablet: stack vertical, sidebar abaixo do conteudo (igual CDP @<=850px). */
@media (max-width: 1024px) {
    .cdp-tool-shift {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .cdp-tool-sidebar {
        position: static;
        width: 100%;
        max-width: 320px;
        margin: 16px auto;
    }
}

/* Home nao tem sidebar nem shift (hero ocupa tudo). */
body.home-landing .cdp-tool-shift { display: block; max-width: none; padding: 0; }
body.home-landing .cdp-tool-sidebar { display: none; }
