/* =====================================================
   HEADER COMPARTILHADO — Recomendo Sites
   Usado por: index.html e todas as páginas do /blog.
   Qualquer ajuste no header deve ser feito SOMENTE aqui.
   Depende das variáveis --primary, --primary-dark, --dark
   e --border definidas em estilo.css / blog.css.
===================================================== */

:root {
    --header-h: 76px;
}

/* ---------- Barra fixa ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.93);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6; /* fixa o valor: o body do blog usa 1.7 e deixava o botão mais alto */
}

.site-header .nav {
    width: min(1160px, 92%);
    height: var(--header-h);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ---------- Logo (também usada no rodapé do index) ---------- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

/* "Recomendo Sites" é UM item do flex: o espaço entre as palavras
   é um espaço normal, sem o gap de 10px */
.logo-text b {
    color: var(--primary);
    font-weight: inherit;
}

.site-header .logo {
    color: var(--dark);
}

/* ---------- Links ---------- */
.site-header .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header .nav-links a {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.site-header .nav-links a:hover,
.site-header .nav-links a[aria-current="page"] {
    color: var(--primary);
}

/* ---------- Botão "Solicitar orçamento" ---------- */
.site-header .nav-links a.nav-cta {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    line-height: 1.6;
}

.site-header .nav-links a.nav-cta:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* ---------- Botão hambúrguer (☰ → ✕) ---------- */
.site-header .menu-btn {
    display: none;
    position: relative;
    width: 46px;
    height: 46px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--dark);
    cursor: pointer;
}

.site-header .menu-btn:hover {
    background: #f1f5f9;
}

.site-header .menu-btn span {
    position: absolute;
    left: 12px;
    width: 22px;
    height: 2.5px;
    border-radius: 3px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.site-header .menu-btn span:nth-child(1) { top: 15px; }
.site-header .menu-btn span:nth-child(2) { top: 22px; }
.site-header .menu-btn span:nth-child(3) { top: 29px; }

.site-header .menu-btn[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.site-header .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header .menu-btn[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

.site-header .menu-btn:focus-visible,
.site-header .nav-links a:focus-visible,
.site-header .logo:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 8px;
}

/* ---------- Mobile / tablet ---------- */
@media (max-width: 950px) {
    /* o <nav> fica vazio no mobile (o menu é absolute); sem o gap e com
       margin-left:auto o botão fica colado na direita */
    .site-header .nav {
        gap: 0;
    }

    .site-header .menu-btn {
        display: block;
        margin-left: auto;
    }

    .site-header .nav-links {
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 4% 20px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 24px 40px rgba(15, 23, 42, 0.12);
        max-height: calc(100vh - var(--header-h));
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
    }

    .site-header .nav-links.active {
        display: flex;
        animation: headerMenuIn 0.22s ease;
    }

    .site-header .nav-links li {
        border-bottom: 1px solid #f1f5f9;
    }

    .site-header .nav-links li:last-child {
        border: 0;
        padding-top: 14px;
    }

    .site-header .nav-links a {
        display: block;
        padding: 15px 4px;
        font-size: 16px;
    }

    .site-header .nav-links a.nav-cta {
        display: block;
        padding: 14px 18px;
        text-align: center;
    }
}

@keyframes headerMenuIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    :root {
        --header-h: 68px;
    }

    .site-header .logo {
        font-size: 18px;
    }

    .site-header .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}
