/*
Theme Name:   Astra Child
Template:     astra
Description:  Child theme for Downtown Somerville
*/

/* Hide sub-arrows in header nav (Elementor template #29) */
.elementor-29 .elementor-nav-menu .sub-arrow {
    display: none !important;
}

/* Header search */
header .jet-ajax-search__field[type="search"] {
    border-radius: 10px;
    color: #222D68;
}

header .jet-ajax-search__field[type="search"]:focus {
    outline: 2px solid #222D68;
    outline-offset: -2px;
}

header div.elementor-widget-wrap>div.elementor-nav-menu--toggle {
    margin-block-end: 0;
}

header form.jet-ajax-search__form button.jet-ajax-search__submit {
    background-color: transparent;
}

header form.jet-ajax-search__form button.jet-ajax-search__submit:hover,
header form.jet-ajax-search__form button.jet-ajax-search__submit:focus,
header form.jet-ajax-search__form button.jet-ajax-search__submit:active {
    background-color: transparent;
}

header form.jet-ajax-search__form button>span.jet-ajax-search-icon {
    color: #222D68;
    font-size: 24px;
}

header nav li.menu-item ul.sub-menu {
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25) !important;
}

header .elementor-nav-menu__align-justify .elementor-nav-menu--layout-horizontal .elementor-nav-menu>li>a {
    justify-content: flex-start;
}


/* Hide mobile search item on desktop */
.menu-item-search-mobile {
    display: none !important;
}

/* on mobile, show the arrows in the header nav */
@media (max-width: 768px) {
    .elementor-29 .elementor-nav-menu .sub-arrow {
        display: block !important;
    }

    /* Border on bottom of each top-level mobile menu item except the last */
    .elementor-nav-menu--dropdown>ul>li:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Parent menu links: text left, arrow right */
    .elementor-nav-menu--dropdown .elementor-item.has-submenu {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

}

/* Show search in hamburger dropdown whenever the hamburger is active */
@media (max-width: 768px) {
    .elementor-nav-menu--dropdown .menu-item-search-mobile {
        display: block !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        padding: 12px 20px;
    }

    .ds-mobile-search {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .ds-mobile-search input[type="search"] {
        flex: 1;
        padding: 10px 14px;
        border: 1px solid #ccc;
        border-radius: 10px;
        font-size: 15px;
        color: #222D68;
        background: #fff;
        outline: none;
    }

    .ds-mobile-search input[type="search"]:focus {
        border-color: #222D68;
        outline: 2px solid #222D68;
        outline-offset: -2px;
    }

    .ds-mobile-search button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border: none;
        border-radius: 10px;
        background: #222D68;
        color: #fff;
        cursor: pointer;
        flex-shrink: 0;
    }

    .ds-mobile-search button svg {
        stroke: #fff !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px;
        display: block;
        overflow: visible;
    }

    .ds-mobile-search button:hover,
    .ds-mobile-search button:focus {
        background: #1a2354;
    }
}

/* ===== Page Title Banner ===== */
.ds-page-banner {
    background: #222D68;
    overflow: hidden;
    position: relative;
}


.ds-page-banner__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 50px 20px;
    position: relative;
    display: flex;
    align-items: center;
}

.ds-page-banner__title {
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.2;
    margin: 0;
    position: relative;
    z-index: 1;
}

.ds-page-banner__image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 134px;
    width: auto;
    opacity: 1;
    pointer-events: none;
}

/* Constrain page content width */
.site-content .ast-container {
    max-width: 1040px;
}

/* Hide JetSearch AJAX dropdown results — let the form submit normally */
.jet-ajax-search__results-area {
    display: none !important;
}

/* ===== Search Results — full-width content ===== */
.search #primary {
    width: 100%;
    float: none;
}

.search #secondary {
    display: none;
}

.search .ast-article-post {
    width: 100%;
}

div.tribe-events-widget .tribe-events-widget-events-list a.tribe-events-widget-events-list__view-more-link {
    width: 100%;
    display: flex;
    justify-content: center;
    max-width: 260px;
    text-transform: uppercase;
    font-size: 16px;
    background-color: #F36C23;
    padding: 12px 16px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .ds-page-banner__inner {
        padding: 28px 16px;
    }

    .ds-page-banner__title {
        font-size: 24px;
    }

    .ds-page-banner__image {
        height: 85px;
        right: 0;
    }
}

@media (max-width: 480px) {
    .ds-page-banner__inner {
        padding: 20px 14px;
    }

    .ds-page-banner__title {
        font-size: 20px;
    }

    .ds-page-banner__image {
        height: 65px;
        right: 0;
    }
}

/* ===== Homepage Hero ===== */
.homepage-hero-section {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 320px;
    height: clamp(320px, 40vw, 772px);
    max-height: 678.65px;
    overflow: hidden;
}

.homepage-hero-section>.elementor-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.homepage-hero-section .elementor-column,
.homepage-hero-section .elementor-widget-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
}

.homepage-hero-section>.elementor-background-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

@media (max-width: 1024px) {
    .homepage-hero-section {
        min-height: 280px;
        height: clamp(280px, 55vw, 680px);
    }
}

@media (max-width: 767px) {
    .homepage-hero-section {
        min-height: 280px;
        height: clamp(280px, 100vw, 560px);
    }

    .homepage-hero-section>.elementor-container {
        padding-top: 32px;
    }
}

/* ===== Homepage Category Grid ===== */
.square-col {
    aspect-ratio: 480 / 318;
}

@media (max-width: 767px) {
    .square-col {
        width: 50% !important;
    }
}