﻿.mega-menu-container {
    width: 90%;
    background: white;
    height: 45vh;
    position: absolute;
    left: 5%;
    right: 0;
    top: 100%;
    display: none;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, .27);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    overflow: hidden;
}

.mega-menu-container.show {
    display: flex;
}

    .mega-menu-container .mega-menu-column {
        width: 33%;
        padding: 10px;
        border-right: 1px solid #eeeeee;
        position: relative;
    }

    /* Columns 2 and 3 scroll inside .mega-menu-column-inner; column 1's list sits directly in the column. */
    .mega-menu-container .mega-menu-column:nth-child(1) {
        overflow-y: auto;
    }

    .mega-menu-container .mega-menu-column:nth-child(3) {
        flex-grow: 1;
        border-right: none;
    }

        .mega-menu-container .mega-menu-column .mega-menu-column-inner {
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            display: none;
            overflow-y: auto;
        }

            .mega-menu-container .mega-menu-column .mega-menu-column-inner.show {
                display: block;
            }

        .mega-menu-container .mega-menu-column .mega-menu-articles {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            overflow-y: auto;
            padding: 10px;
            background: #eeeeee;
        }

            /* The articles panel is rendered after the third-tier lists, so it gives way whenever one of them is open. */
            .mega-menu-container .mega-menu-column .third-column.show ~ .mega-menu-articles {
                display: none;
            }

            .mega-menu-container .mega-menu-articles .mega-menu-article-list {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 18px;
                list-style-type: none;
                margin: 0;
                padding: 0 10px 10px;
            }

            .mega-menu-container .mega-menu-articles .mega-menu-article-card {
                display: block;
                height: 100%;
                background: white;
                border-radius: 6px;
                overflow: hidden;
                color: black;
                text-decoration: none;
            }

            .mega-menu-container .mega-menu-articles .mega-menu-article-image {
                display: block;
                width: 100%;
                height: 125px;
                object-fit: cover;
            }

            /* Margin rather than padding: overflow only clips at the padding edge, so padding would show the top of a third line. */
            .mega-menu-container .mega-menu-articles .mega-menu-article-title {
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                line-clamp: 2;
                overflow: hidden;
                margin: 12px 10px;
                text-align: left;
                font-family: Albert Sans, sans-serif;
                font-weight: 500;
            }

        /* Set here rather than inherited: the column headings are li elements but the news panel heading is a div. */
        .mega-menu-container .mega-menu-column .mega-menu-label {
            font-size: 17px;
            line-height: 24px;
            font-weight: bold;
            color: black;
            padding: 10px;
        }

            .mega-menu-container .mega-menu-column .mega-menu-label:hover {
                background: unset !important;
                cursor: unset;
            }

        .mega-menu-container .mega-menu-column .mega-menu-list {
            list-style-type: none;
            padding-left: 0;
            margin-top: 0;
        }

            .mega-menu-container .mega-menu-column .mega-menu-list li, .mega-menu-container .mega-menu-column .mega-menu-list li button {
                display: flex;
                align-items: center;
                justify-content: space-between;
                background: unset;
                width: 100%;
                text-align: left;
            }

                .mega-menu-container .mega-menu-column .mega-menu-list li button {
                    padding: 0; margin: 0;
                }

                /* The toggles are spans inside buttons, so without this they inherit li's 17px while the plain links get a's 1rem. */
                .mega-menu-container .mega-menu-column .mega-menu-list li .dropdown-link {
                    padding: 10px;
                    font-size: 1rem;
                    width: 100%;
                    cursor: pointer;
                }        
        
        .mega-menu-container .mega-menu-column .mega-menu-list li .icon {
            position: relative;
            transform: rotate(-90deg);
            margin-right: 10px;
        }

            .mega-menu-container .mega-menu-column .mega-menu-list li:hover {
                background: #eeeeee;
            }            
            
            .mega-menu-container .mega-menu-column .mega-menu-list li.active {
                background: #eeeeee;
            }

    .mega-menu-container .dropdown-link:hover {
        background: unset;
    }

    .mega-menu-container .dropdown-link.w--current {
        background: unset;
        background-color: unset;
    }

    /* Chrome and Edge on Windows 11 hide default scroll bars until hovered; styled ones always show when the content overflows. */
    .mega-menu-container ::-webkit-scrollbar {
        width: 6px;
    }

    .mega-menu-container ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .mega-menu-container ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

        .mega-menu-container ::-webkit-scrollbar-thumb:hover {
            background: #555;
        }