/**
 * Submenus in the mobile drawer.
 *
 * Goes with assets/js/gt-mobile-menu.js: the script adds a button where the
 * theme drew a chevron inside the link, and these rules place it, hide the old
 * chevron and show the submenu when it is open.
 */

/* The theme's own chevron, which was part of the link. */
.gt-drawer li.menu-item-has-children > a::after {
    display: none !important;
}

.gt-drawer li.menu-item-has-children {
    position: relative;
}

/* Keep the words clear of the button. */
.gt-drawer li.menu-item-has-children > a {
    padding-right: 54px;
}

.gt-subtoggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 54px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.gt-subtoggle span {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.18s ease;
    opacity: 0.85;
}

.gt-subtoggle:hover span,
.gt-subtoggle:focus-visible span {
    opacity: 1;
}

.gt-subtoggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

.gt-drawer li.gt-open > .gt-subtoggle span {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* The submenu itself: closed until the button says otherwise. */
.gt-drawer li.menu-item-has-children > ul.sub-menu {
    display: none;
}

.gt-drawer li.gt-open > ul.sub-menu {
    display: block;
}

.gt-drawer li.gt-open > ul.sub-menu > li > a {
    padding-left: 30px;
    font-size: 0.95em;
    opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
    .gt-subtoggle span {
        transition: none;
    }
}
