#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    z-index: 9998;
    overflow-y: auto;
}

#search-overlay a {
    color: #168371;
}
#search-overlay h2 {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
#search-overlay h3 {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* LAYOUT */
#search-container {
    position: relative;
    max-width: 900px;
    margin: 3rem auto;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
#search-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    font-weight: bold;
    background-color: #fff;
    border: 1px solid #b6b7d5;
    border-radius: 100vw;
    color: #666;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;

}
#search-close:after{
  display: inline-block;
  content: "\00d7"; /* This will render the 'X' */
}
#search-results {
    display: grid;
    grid-template-columns: minmax(10rem, min-content) auto;
    grid-template-rows: auto auto;
    max-width: 100%;
    column-gap: 1rem;
}
#search-refinements {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    padding-block: 1rem;
}
#search-hits {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
#search-pagination {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    margin-inline: auto;
    padding-top: 0.5rem;
}
#search-poweredby {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    text-align: right;
    margin-left: auto;
    font-size: 0.8em;
    color: #666;
    margin-top: 10px;
}

#toggle-refinements {
    background: transparent;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    #search-results {
        display: block;
    }
    .ais-Hits-item,
    .ais-InfiniteHits-item {
        padding: 1rem !important;
    }
    .search-refinement-wrapper {
        margin-block: 1rem;
    }
}


/* POST ITEM STYLES */
.post-item {
    width: 100%;
}
.post-item h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.post-item-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 1024px) {
    .post-item-columns {
        grid-template-columns: 1fr;
    }
}
.post-snippet {
    margin-bottom: 0.5rem;
}
.post-item-labels {
    margin-top: 0.5rem;
}
.post-item-labels span {
    background-color: #f5f5fa;
    border: 1px solid #b6b7d5;
    border-radius: 9rem;
    padding: 2px 6px;
    font-size: 0.8em;
    color: #23263b;
    margin-right: 5px;
}
.post-hours ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0.2rem 0;
}
.post-warning {
    font-weight: bold;
    margin-block: 0.5rem;
}
.post-info {
    margin-block: 0.5rem;
    font-style: italic;
}
.post-date {
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5rem;
}

.no-search-results {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-style: italic;
    color: #666;
    padding: 3rem 1rem;
}

#search-results:has(.no-search-results),
#search-results:has(.no-search-results) #search-refinements {
    display: block;
}
.search-refinement-wrapper:has(.ais-RefinementList--noRefinement) {
    display: none;
}

/* INSTANT SEARCH WIDGET OVERRIDES */
#search-container *:focus {
    outline-color: #f2cc21 !important;
}
.ais-SearchBox-input:focus {
    border-color: #168371 !important;
    outline: 2px solid #f2cc21!important;
    outline-offset: 2px;
}
.ais-RefinementList-checkbox:focus {
    outline: 2px solid #f2cc21 !important;
    outline-offset: 2px;
}
.ais-Hits-item em,
.ais-InfiniteHits-item em {
    background-color: #f2cc21;
}
.ais-PoweredBy {
    display: inline-flex !important;
}
.ais-RefinementList-label {
    padding: 0;
}
.ais-SearchBox-input {
    margin: 0;
}
#search-overlay .ais-InfiniteHits-loadMore {
    background:#168371;
    padding:5px;
    border:1px solid #168371;
    color:#fff;	
    font-style:normal !important;
}
#search-overlay .ais-InfiniteHits-loadMore:focus {
    outline: 2px solid #f2cc21;
}
#search-overlay .ais-InfiniteHits-loadMore:hover {
    background:#fff;
    padding:4px;
    border:2px solid #168371;
    color:#168371;	
}

/* SEARCH BUTTON */
#search-button {
    position:absolute;
    width: 1160px;
    padding: 0.25rem 1rem;
    border-radius:10px;
    border: 0;
    bottom: 1em;
    margin: 0 auto;
    left: 0;
    right: 0;
    background-color:#fff;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
#search-button img {
    width:19px;
    height:19px;
    pointer-events: none;
}
#search-button span {
    color:#666;
    height: 2rem;
    line-height: 2rem;
    pointer-events: none;
}
@media screen and (max-width: 1180px) {
    #search-button {
        width: 96%;
    }
}

/* HELPER CLASSES */
.hidden {
    display: none;
}
.modal-open {
    pointer-events: none;
    overflow: hidden;
}
.modal-open #search-overlay {
    pointer-events: auto;
}