/* gnp-core: menu icons and header menu inline styling */

/* Support both header-menu (plugin) and primary-menu (theme) selectors */
.header-menu,
.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-menu li {
    display: inline-flex;
}

.header-menu a,
.primary-menu a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    /* Use theme variables so colors switch with light/dark.
       Provide fallbacks to the gnp-core variable names if the theme uses those. */
    color: var(--geeknplay-theme-muted, var(--gnp-color-muted, currentColor));
    font-weight: 700;
    padding: 0.25rem 0.25rem;
    transition: color var(--geeknplay-theme-transition, var(--gnp-transition, 180ms ease));
}

.header-menu a:hover,
.header-menu .current-menu-item > a,
.header-menu .current-menu-ancestor > a,
.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a {
    color: var(--geeknplay-theme-text, var(--gnp-color-text, currentColor));
}

.gnp-menu-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    line-height: 0;
    /* Ensure icons follow the text color */
    color: inherit;
}

.gnp-menu-icon .gnp-icon {
    width: 100%;
    height: 100%;
    display: block;
    /* Draw icons using stroke so large background rects don't become filled blocks */
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Ensure strokes don't scale oddly when the icon is resized */
.gnp-menu-icon .gnp-icon * {
    vector-effect: non-scaling-stroke;
}

/* Ensure the SVG preserves visible overflow and uses strokes by default.
   Individual elements inside the sprite which should be filled have explicit
   `fill="currentColor"` in the symbol markup. Avoid forcing fill globally. */
.gnp-menu-icon .gnp-icon {
    overflow: visible;
}

.gnp-menu-title {
    display: inline-block;
}

/* Make sure sub-menus don't force the header to be column layout */
.header-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Responsive: collapse spacing on small screens */
@media (max-width: 860px) {
    .header-menu {
        gap: 0.6rem;
        flex-direction: column;
        align-items: flex-start;
    }

    /* Hide menu icons on mobile, show only text */
    .primary-menu .gnp-menu-icon {
        display: none;
    }

    /* Adjust menu title spacing without icon */
    .primary-menu .gnp-menu-title {
        display: inline-block;
        margin: 0;
    }
}
