/* "Articles" menu: dropdown on desktop (hover + click), expandable list on mobile */
.articles-menu {
    position: relative;
    display: inline-block;
}

.articles-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-links .articles-toggle { color: var(--text-color, #333); }
.footer-links .articles-toggle { color: white; font-weight: inherit; }

.articles-toggle:hover,
.articles-toggle:focus-visible,
.articles-menu.open .articles-toggle {
    color: var(--primary-color, #FF9800);
}

.articles-caret {
    display: inline-block;
    font-size: 0.75em;
    transition: transform 0.3s ease;
}

.articles-menu.open .articles-caret { transform: rotate(180deg); }

.articles-dropdown {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    padding: 8px 0;
    border-radius: 8px;
    text-align: left;
    z-index: 1100;
}

/* invisible bridge so the menu stays open while the pointer moves to it */
.articles-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-links .articles-dropdown {
    top: calc(100% + 10px);
    left: auto;
    right: 0;
    transform: none;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.nav-links .articles-dropdown::before { top: -12px; }

.footer-links .articles-dropdown {
    bottom: calc(100% + 10px);
    background: #444;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}
.footer-links .articles-dropdown::before { bottom: -12px; }

.articles-dropdown a {
    display: block;
    padding: 8px 18px;
    white-space: nowrap;
}

.nav-links .articles-dropdown a:hover { background: rgba(255, 152, 0, 0.08); }
.footer-links .articles-dropdown a:hover { background: rgba(255, 255, 255, 0.06); }

.articles-menu.open .articles-dropdown { display: block; }

@media (hover: hover) and (min-width: 769px) {
    .articles-menu:hover .articles-dropdown { display: block; }
    .articles-menu:hover .articles-toggle { color: var(--primary-color, #FF9800); }
}

/* Mobile: expandable list inside the menu instead of a floating dropdown */
@media (max-width: 768px) {
    .articles-menu.open { flex-basis: 100%; }
    .articles-dropdown,
    .nav-links .articles-dropdown,
    .footer-links .articles-dropdown {
        position: static;
        transform: none;
        min-width: 0;
        margin-top: 8px;
        padding: 4px 0 4px 12px;
        box-shadow: none;
        background: transparent;
        border-left: 2px solid var(--primary-color, #FF9800);
        border-radius: 0;
    }
    .articles-dropdown::before { display: none; }
    .articles-dropdown a { padding: 6px 8px; white-space: normal; }
    .footer-links .articles-dropdown {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }
}
