/*
 * Celler Garnison-Museum – grouped hamburger navigation
 * Loaded globally after Big Picture's style.css and mmenu.css.
 */

/* Keep the section labels calm and museum-like inside the Mmenu panel. */
.mm-menu .cgm-menu-heading,
#top-nav .cgm-menu-heading {
    pointer-events: none;
}

.mm-menu .cgm-menu-heading::after,
#top-nav .cgm-menu-heading::after {
    display: none !important;
}

.mm-menu .cgm-menu-heading > .mm-listitem__text,
.mm-menu .cgm-menu-heading > .cgm-menu-heading-label,
#top-nav .cgm-menu-heading > .cgm-menu-heading-label {
    display: block;
    padding-top: 22px;
    padding-bottom: 7px;
    color: #9b7f43 !important;
    font-family: "Hind", sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.mm-menu .cgm-menu-heading:first-child > .mm-listitem__text,
.mm-menu .cgm-menu-heading:first-child > .cgm-menu-heading-label,
#top-nav .cgm-menu-heading:first-child > .cgm-menu-heading-label {
    padding-top: 10px;
}

.mm-menu .cgm-menu-heading--spaced,
#top-nav .cgm-menu-heading--spaced {
    margin-top: 9px;
    border-top: 1px solid rgba(11, 44, 69, .12);
}

/* Menu links: stronger than the default plugin styling, without becoming bulky. */
.mm-menu .cgm-menu-list > .mm-listitem:not(.cgm-menu-heading) > .mm-listitem__text,
#top-nav .cgm-menu-list > li:not(.cgm-menu-heading) > a {
    color: #0b2c45;
    font-family: "Hind", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
}

.mm-menu .cgm-menu-list > .mm-listitem:not(.cgm-menu-heading) > .mm-listitem__text:hover,
.mm-menu .cgm-menu-list > .mm-listitem:not(.cgm-menu-heading) > .mm-listitem__text:focus,
#top-nav .cgm-menu-list > li:not(.cgm-menu-heading) > a:hover,
#top-nav .cgm-menu-list > li:not(.cgm-menu-heading) > a:focus {
    color: #8d7136;
}

/* Mmenu uses its own list item separators; keep them subtle. */
.mm-menu .cgm-menu-list > .mm-listitem:not(.cgm-menu-heading)::after {
    border-color: rgba(11, 44, 69, .08);
}

/* Avoid a separator immediately below a section heading. */
.mm-menu .cgm-menu-heading + .mm-listitem::after {
    border-color: rgba(11, 44, 69, .08);
}

/* ==========================================================
   CGM v2 – prominent desktop navigation and menu trigger
   ========================================================== */

.header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Give the three primary museum areas a calm, visible frame. */
.desktop-inline-nav ul {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 10px 17px;
    list-style: none;
    border: 1px solid rgba(11, 44, 69, .18);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(11, 44, 69, .065);
}

.desktop-inline-nav li {
    margin: 0;
    padding: 0;
}

.desktop-inline-nav li + li {
    position: relative;
    margin-left: 17px;
    padding-left: 17px;
}

.desktop-inline-nav li + li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 18px;
    transform: translateY(-50%);
    background: rgba(11, 44, 69, .22);
}

.desktop-inline-nav a {
    color: #0b2c45 !important;
    font-family: "Hind", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
}

.desktop-inline-nav a:hover,
.desktop-inline-nav a:focus {
    color: #8d7136 !important;
}

/* Make the hamburger an intentional control, not a tiny glyph. */
.menu-toggle {
    position: relative;
    display: inline-block;
    flex: 0 0 46px;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1.5px solid #0b2c45 !important;
    border-radius: 50%;
    background: #fff !important;
    background-image: none !important;
    box-shadow: 0 6px 18px rgba(11, 44, 69, .08);
    text-indent: -9999px;
    overflow: hidden;
    box-sizing: border-box;
}

.menu-toggle::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 14px;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #0b2c45;
    box-shadow: 0 7px 0 #0b2c45, 0 14px 0 #0b2c45;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    border-color: #b49a62 !important;
    outline: none;
    box-shadow: 0 8px 20px rgba(11, 44, 69, .12);
}

.menu-toggle:hover::before,
.menu-toggle:focus::before {
    background: #9b7f43;
    box-shadow: 0 7px 0 #9b7f43, 0 14px 0 #9b7f43;
}

@media screen and (max-width: 1200px) {
    .desktop-inline-nav ul {
        padding: 9px 14px;
    }

    .desktop-inline-nav a {
        font-size: 15px;
    }

    .desktop-inline-nav li + li {
        margin-left: 13px;
        padding-left: 13px;
    }
}


/* ==========================================================
   CGM – Collection detail pages: mobile width / overflow fix
   Big Picture's original mobile layout makes #collection-items
   wider than its container (calc(100% + 21px)). Keep all
   corrections strictly scoped to .collections.show.
   ========================================================== */

@media screen and (max-width: 800px) {
    body.collections.show,
    body.collections.show #wrap,
    body.collections.show #content {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.collections.show #content {
        box-sizing: border-box;
    }

    body.collections.show .flex {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    body.collections.show .collection-meta {
        order: 1;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-left: 0 !important;
        box-sizing: border-box;
    }

    body.collections.show .collection-meta .mobile-toggle {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    body.collections.show #collection-items {
        order: 2;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 20px 0 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    body.collections.show #collection-items > * {
        max-width: 100%;
        box-sizing: border-box;
    }

    body.collections.show #collection-items h2 {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: left;
    }

    body.collections.show #collection-items .browse-header {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 12px 0 !important;
        flex-wrap: wrap;
        gap: 10px;
        box-sizing: border-box;
    }

    body.collections.show #collection-items .records {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    body.collections.show #collection-items .records .item,
    body.collections.show #collection-items .item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    body.collections.show #collection-items img {
        max-width: 100% !important;
        height: auto;
    }

    body.collections.show #collection-items table {
        max-width: 100%;
    }
}


/* ==========================================================
   CGM – Collection detail pages: remove redundant metadata rail
   ========================================================== */

body.collections.show .collection-meta {
    display: none !important;
}

body.collections.show .flex {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.collections.show #collection-items {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    box-sizing: border-box;
}

body.collections.show #collection-items h2 {
    width: 100% !important;
}
