/* ============================================================
   TOPO, MENU MOBILE E RODAPÉ — identidade anime
   (components/navbar/navbar.php e footer.php)

   O fundo segue a "Cor do topo" das Definições (--color-navi). Se ela for
   branca, header.php troca as variáveis --nh-* para texto escuro.
   ============================================================ */

#site-header {
    --nh-text: #F3EFFA;
    --nh-muted: rgba(243, 239, 250, 0.68);
    --nh-line: rgba(243, 239, 250, 0.1);
    --nh-field: rgba(243, 239, 250, 0.06);
    --nh-accent: var(--color-primary, #FF3E7F);
    --nh-accent-rgb: var(--color-primary-rgb, 255, 62, 127);
    --nh-cyan: #3DE2FF;
    --nh-display: 'Dela Gothic One', 'Inter18pt', 'Arial Black', sans-serif;
    --nh-body: 'Zen Kaku Gothic New', 'Inter18pt', system-ui, sans-serif;
}

#site-header.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.nh {
    position: relative;
    height: 76px;
    font-family: var(--nh-body);
    border-bottom: 1px solid var(--nh-line);
    overflow: hidden;
}

/* Faixa de acento na base: rosa → ciano → some */
.nh::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--nh-accent) 0%, var(--nh-accent) 18%, var(--nh-cyan) 42%, transparent 75%);
}

/* Linhas de velocidade discretas à direita */
.nh-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(243, 239, 250, 0.035) 22px 24px);
    -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
}

.nh-in {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    width: 100%;
    max-width: 1280px;
    height: 100%;
    margin-inline: auto;
    padding-inline: 20px;
}

.nh-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Logo ---------- */

.nh-logo {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--nh-text);
    text-decoration: none;
}

.nh-logo img {
    display: block;
    max-width: 150px;
    height: auto;
    transition: max-width 0.15s ease;
}

#site-header.scrolled .nh-logo img {
    max-width: 125px;
}

/* Marca: losango rosa com um "eco" ciano deslocado */
.nh-mark {
    position: relative;
    width: 16px;
    height: 16px;
    flex: none;
}

.nh-mark::before,
.nh-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: rotate(45deg);
}

.nh-mark::before {
    background: var(--nh-cyan);
    translate: 4px 3px;
}

.nh-mark::after {
    background: var(--nh-accent);
}

.nh-name {
    font-family: var(--nh-display);
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------- Menu ---------- */

.nh-nav {
    flex: 1;
    min-width: 0;
}

.nh-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nh-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--nh-muted);
    text-decoration: none;
    isolation: isolate;
    transition: color 0.2s ease;
}

/* Traço inclinado que cresce da esquerda no hover */
.nh-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 3px;
    background: var(--nh-accent);
    transform: skewX(-24deg) scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nh-link:hover {
    color: var(--nh-text);
}

.nh-link:hover::after {
    transform: skewX(-24deg) scaleX(1);
}

/* Página atual: placa inclinada */
.nh-link.is-current {
    color: var(--nh-text);
}

.nh-link.is-current::before {
    content: "";
    position: absolute;
    inset: 4px 2px;
    z-index: -1;
    background: rgba(var(--nh-accent-rgb), 0.18);
    box-shadow: inset 0 0 0 1px rgba(var(--nh-accent-rgb), 0.45);
    transform: skewX(-14deg);
}

.nh-link.is-current::after {
    transform: skewX(-24deg) scaleX(1);
}

.nh-link:focus-visible,
.nh-search button:focus-visible,
.nh-burger:focus-visible {
    outline: 2px solid var(--nh-cyan);
    outline-offset: 2px;
}

/* ---------- Busca ---------- */

.nh-search {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nh-search input {
    width: 230px;
    height: 40px;
    margin: 0;
    padding: 0 44px 0 16px;
    font-family: var(--nh-body);
    font-size: 14px;
    color: var(--nh-text);
    background: var(--nh-field);
    border: 1px solid var(--nh-line);
    border-radius: 0;
    box-shadow: none;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
    transition: width 0.25s ease, border-color 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.nh-search input::placeholder {
    color: var(--nh-muted);
}

.nh-search input:focus {
    width: 290px;
    outline: none;
    background: rgba(var(--nh-accent-rgb), 0.08);
    border-color: var(--nh-accent);
}

.nh-search button {
    position: absolute;
    right: 4px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 32px;
    padding: 0;
    color: var(--nh-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nh-search button:hover,
.nh-search input:focus + button {
    color: var(--nh-accent);
}

.nh-search svg {
    width: 18px;
    height: 18px;
}

/* ---------- Hambúrguer (mobile) ---------- */

.nh-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    background: var(--nh-field);
    border: 1px solid var(--nh-line);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nh-burger span {
    display: block;
    height: 2px;
    background: var(--nh-text);
}

.nh-burger span:nth-child(2) {
    width: 70%;
    background: var(--nh-accent);
}

/* Template de artigo com "ocultar menu": só a logo, centralizada */
.nh--simple .nh-in {
    justify-content: center;
}

/* ---------- Menu mobile (painel lateral) ---------- */

.mobile-nav-panel {
    --nh-text: #F3EFFA;
    --nh-muted: rgba(243, 239, 250, 0.68);
    --nh-line: rgba(243, 239, 250, 0.1);
    --nh-field: rgba(243, 239, 250, 0.06);
    --nh-accent: var(--color-primary, #FF3E7F);
    --nh-accent-rgb: var(--color-primary-rgb, 255, 62, 127);
    --nh-cyan: #3DE2FF;
    background: #0D0A14;
    color: var(--nh-text);
    font-family: var(--nh-body);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
}

.mobile-nav-overlay {
    background-color: rgba(13, 10, 20, 0.7);
    backdrop-filter: blur(3px);
}

.mobile-nav-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--nh-line);
}

.mobile-nav-close svg {
    color: var(--nh-text);
}

.nh-search--panel {
    margin: 18px 20px 4px;
}

.nh-search--panel input,
.nh-search--panel input:focus {
    width: 100%;
}

.mobile-nav-panel nav.first {
    border-bottom: 1px solid var(--nh-line);
}

.mobile-nav-panel nav ul.menu li a {
    position: relative;
    padding: 10px 20px 10px 24px;
    color: var(--nh-text);
    font-size: 16px;
}

.mobile-nav-panel nav ul.menu li a::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    background: var(--nh-accent);
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.mobile-nav-panel nav ul.menu li a:hover {
    color: var(--nh-accent);
}

.mobile-nav-panel nav ul.menu li a:hover::before {
    transform: rotate(45deg) scale(1);
}

.mobile-nav-panel nav.second ul.menu li a {
    font-size: 14px;
    color: var(--nh-muted);
}

/* ---------- Rodapé ---------- */

footer {
    position: relative;
    background-color: var(--color-navi, #0D0A14);
    border-top: 1px solid rgba(243, 239, 250, 0.08);
    padding: 28px 0;
}

footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 2px;
    background: linear-gradient(270deg, var(--color-primary, #FF3E7F) 0%, #3DE2FF 30%, transparent 65%);
}

.footer-copy {
    font-family: 'Zen Kaku Gothic New', 'Inter18pt', system-ui, sans-serif;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(243, 239, 250, 0.68);
}

.footer-nav ul li a {
    font-family: 'Zen Kaku Gothic New', 'Inter18pt', system-ui, sans-serif;
    color: rgba(243, 239, 250, 0.85);
    transition: color 0.2s ease;
}

.footer-nav ul li a:hover {
    color: var(--color-primary, #FF3E7F);
    text-decoration: none;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
    .nh-search input,
    .nh-search input:focus {
        width: 190px;
    }
    .nh-link {
        padding: 0 10px;
    }
    .nh-link::after {
        left: 10px;
        right: 10px;
    }
}

@media (max-width: 1023px) {
    .nh {
        padding-inline: 0;
    }
    .nh-in {
        justify-content: center;
        padding-inline: 16px;
    }
    .nh-burger {
        display: flex;
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
    }
    .nh-nav,
    .nh-in > .nh-search {
        display: none;
    }
    .nh-name {
        font-size: 19px;
    }
    .nh-logo img {
        max-width: 130px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nh *,
    .nh *::before,
    .nh *::after,
    .mobile-nav-panel * {
        transition: none !important;
    }
}
