/* Barra do topo compartilhada por todas as páginas.
   ATENÇÃO: artigos/topbar.css é uma cópia deste arquivo (só muda o caminho das fontes: ../assets/).
   Altere os dois juntos — o teste "todas as páginas usam o mesmo topbar.css" confere isso. */

/* Fira Sans (SIL OFL 1.1, ver assets/fonts/OFL.txt) — hospedada no site, subconjunto latin */
@font-face {
    font-family: "Fira Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/fira-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../assets/fonts/fira-sans-500.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../assets/fonts/fira-sans-600.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../assets/fonts/fira-sans-700.woff2") format("woff2");
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    background: #ffffff;
    color: #0d0742;
    border-radius: 10px;
    font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

.topbar {
    --tb-gold: #d1b77d;
    --tb-on-dark: #ffffff;
    --tb-on-dark-muted: #c9cbe0;
    --tb-gutter: clamp(16px, 4vw, 32px);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 7, 66, 0.96);
    color: var(--tb-on-dark);
    border-bottom: 1px solid rgba(209, 183, 125, 0.25);
    font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    transition: box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

.topbar *,
.topbar *::before,
.topbar *::after {
    box-sizing: border-box;
}

.topbar.active {
    box-shadow: 0 6px 20px rgba(9, 5, 48, 0.35);
}

.topbar a:focus-visible {
    outline: 3px solid var(--tb-gold);
    outline-offset: 3px;
}

.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px var(--tb-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topbar .brand {
    display: flex;
    flex-direction: column;
    color: var(--tb-on-dark);
    text-decoration: none;
    line-height: 1.15;
    flex-shrink: 0;
}

.topbar .brand strong {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.topbar .brand span {
    margin-top: 3px;
    color: var(--tb-gold);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar .nav {
    display: flex;
    gap: 4px;
}

.topbar .nav a {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--tb-on-dark-muted);
    transition: color 150ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

.topbar .nav a:hover {
    color: var(--tb-on-dark);
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
    .topbar .nav a {
        padding: 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 760px) {
    .topbar {
        font-size: 16px;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 10px;
        padding-bottom: 6px;
    }

    .topbar .brand {
        align-items: center;
        text-align: center;
    }

    .topbar .nav {
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 calc(var(--tb-gutter) * -1);
        padding: 0 calc(var(--tb-gutter) - 8px);
    }

    .topbar .nav::-webkit-scrollbar {
        display: none;
    }

    .topbar .nav a {
        white-space: nowrap;
    }

    /* Centralizado quando cabe; quando não cabe, rola a partir do primeiro item */
    .topbar .nav a:first-child {
        margin-left: auto;
    }

    .topbar .nav a:last-child {
        margin-right: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topbar,
    .topbar .nav a {
        transition: none;
    }
}
