/* Custom styles to fix WordPress menu display */
#sidebar nav#menu ul li ul {
    display: none; /* Hidden by default */
    padding-left: 0.75em;
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

#sidebar nav#menu ul li.active > ul {
    display: block; /* Show when parent is active */
}

/* Automatic display of submenu when parent is current page */
#sidebar nav#menu ul li.current-menu-item > ul,
#sidebar nav#menu ul li.current-menu-parent > ul,
#sidebar nav#menu ul li.current-menu-ancestor > ul {
    display: block !important;
}

/* Set cursor to pointer for opener class links */
#sidebar nav#menu ul li a.opener {
    cursor: pointer;
}

/* Banner layout fixes */
#banner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

#banner .content {
    flex: 3;
    padding-right: 2em;
}

#banner .image.object {
    flex: 2;
    max-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#banner .image.object img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    max-height: 400px;
}

/* Responsive adjustments */
@media screen and (max-width: 736px) {
    #banner {
        flex-direction: column;
    }
    
    #banner .image.object {
        max-width: 100%;
        margin-top: 2em;
    }
}

/* Banner image styling */
#banner .image.object {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#banner .image.object img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.banner-featured-image {
    object-position: center;
}

/* Banner image fixes */
#banner {
    display: flex;
    flex-direction: row;
}

#banner .content {
    flex: 3;
}

#banner .image.object {
    flex: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    height: auto;
}

.banner-image {
    object-fit: cover;
    width: 100%;
    height: auto;
    max-height: 400px;
}

/* Ensure the banner keeps its original layout on mobile */
@media screen and (max-width: 736px) {
    #banner {
        flex-direction: column;
    }
    
    #banner .image.object {
        margin-top: 1.5em;
    }
}

/* Slideshow plugin adjustments */
#banner .image.object .slideshow_container,
#banner .image.object .slideshow_view,
#banner .image.object .slideshow_slides {
    width: 100% !important;
    max-height: 400px !important;
}

#banner .image.object .slideshow_slide img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

/* General plugin container styles */
#banner .image.object > div {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

/* Responsive styles */
@media screen and (max-width: 736px) {
    #banner {
        flex-direction: column;
    }
    
    #banner .image.object {
        margin-top: 1.5em;
        width: 100%;
    }
}
