/* ===================================================================
   SHARED HEADER — RATGEBER MEGA MENU CONTENT (global/partials/header.ejs)
   Linked by the header partial next to header.css and header-nav.css (the panel frame, open state
   and transitions); the --hd-* tokens come from the critical inline CSS of head-with-css-tracking.ejs.
   This file styles only what is inside #ratgeber-mega-menu.
   =================================================================== */

/* Mega menu container — wide enough for four columns plus the CTA */
.mega-menu {
    width: 1050px;
}

/* =============================================================
   MEGA MENU CONTENT — the ID prefix gives these rules the specificity to win
   over the globals in styles.css, the same approach as #logo-container in the header.
   ============================================================= */

/* Base reset for every element inside the mega menu */
#ratgeber-mega-menu a {
    display: inline;
    height: auto;
    padding: 0;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    border-radius: 0;
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    transition: color 0.2s ease;
    line-height: inherit;
}

#ratgeber-mega-menu a:hover {
    background-color: transparent;
}

#ratgeber-mega-menu a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--hd-focus-ring);
    border-radius: 4px;
}

#ratgeber-mega-menu a::before,
#ratgeber-mega-menu a::after {
    display: none;
    content: none;
}

#ratgeber-mega-menu h4 {
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    text-align: left;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.4;
}

#ratgeber-mega-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#ratgeber-mega-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Inner container */
#ratgeber-mega-menu .mega-menu-container {
    display: flex;
    padding: 24px;
    gap: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* Category area — a grid, so the rows line up across the columns */
#ratgeber-mega-menu .mega-menu-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* One column — subgrid with three rows (header, category 1, category 2) */
#ratgeber-mega-menu .mega-menu-column {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    gap: 0;
    min-width: 0;
}

/* Column header with icon */
#ratgeber-mega-menu .mega-menu-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--hd-mint);
    align-self: start;
}

#ratgeber-mega-menu .mega-menu-column-header-icon {
    width: 28px;
    height: 28px;
    background: var(--hd-mint);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#ratgeber-mega-menu .mega-menu-column-header-icon svg {
    width: 16px;
    height: 16px;
    color: var(--hd-accent);
    display: block;
}

#ratgeber-mega-menu .mega-menu-column-header-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hd-accent);
    line-height: 1.3;
}

/* Category block */
#ratgeber-mega-menu .mega-menu-category {
    display: flex;
    flex-direction: column;
    padding-top: 28px;
}

#ratgeber-mega-menu .mega-menu-column > .mega-menu-category:first-of-type {
    padding-top: 28px;
}

/* Category title */
#ratgeber-mega-menu .mega-menu-category-title {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

#ratgeber-mega-menu .mega-menu-category-title a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

#ratgeber-mega-menu .mega-menu-category-title a:hover {
    color: var(--hd-accent);
}

/* Article link list */
#ratgeber-mega-menu .mega-menu-links {
    list-style: none;
    margin: 0;
    padding: 0 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-grow: 1;
}

#ratgeber-mega-menu .mega-menu-links li a {
    font-size: 13.5px;
    color: #555;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    font-weight: 400;
    transition: color 0.2s ease;
}

#ratgeber-mega-menu .mega-menu-links li a:hover {
    color: var(--hd-accent);
}

/* "All articles" link — always at the bottom edge of the column */
#ratgeber-mega-menu .mega-menu-show-all {
    font-size: 13px;
    color: var(--hd-accent);
    text-decoration: none;
    margin-top: auto;
    padding-top: 8px;
    font-weight: 500;
    display: inline-block;
    transition: opacity 0.2s ease;
}

#ratgeber-mega-menu .mega-menu-show-all:hover {
    opacity: 0.8;
    text-decoration: underline;
}


/* ===================================================================
   MEGA MENU RESPONSIVE
   =================================================================== */

@media (max-width: 1100px) {
    .mega-menu {
        width: 950px;
    }

    #ratgeber-mega-menu .mega-menu-categories {
        gap: 16px;
    }

    #ratgeber-mega-menu .mega-menu-column {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .has-mega-menu .mega-menu {
        display: none !important;
    }

    .has-mega-menu .dropdown-arrow {
        display: none;
    }

    .has-mega-menu {
        position: static;
    }
}
