#ewtn-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    height: 40px;
    width: 100%;
    background-color: transparent;
    position: relative;
    box-sizing: border-box;
}

#ewtn-menu::before {
    content: '';
    flex-grow: 1;
    background-color: #6e6e6e;
    height: 100%;
}

#ewtn-menu li {
    position: relative;
    margin-left: 2px;
    background-color: #6e6e6e;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
    padding: 0;
}

#ewtn-menu li a {
    color: white;
    text-decoration: none;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    height: 100%;
    text-transform: uppercase;
}

#ewtn-menu li:hover,
#ewtn-menu li.current-menu-item {
    background-color: #808080;
}

.current-menu-ancestor > a {
    background-color: #808080 !important;
}

#ewtn-menu li ul {
    display: none; /* Hide sub menus by default */
    position: absolute;
    top: 100%; /* Position below the parent */
    left: 0;
    list-style: none;
    background-color: #808080;
    padding: 0;
    margin: 0;
    z-index: 9999;
    width: max-content; /* Adjust width for better appearance */
}

#ewtn-menu li:hover > ul {
    display: block; /* Show sub menu on hover */
}

#ewtn-menu li ul li {
    width: 100%;
    margin: 0;
}

#ewtn-menu li ul li a {
    white-space: nowrap;
    padding: 10px 15px;
    text-align: left; /* Align text to the left */
}

#ewtn-menu li ul li:hover {
    background-color: #808080; /* Highlight on hover */
}

/* Styles for sub-sub menu items */
#ewtn-menu li ul li ul {
    display: block; /* Hide sub-sub menus by default */
    position: absolute; /* Position them properly */
    top: 100%; /* Align directly below the parent sub-menu */
    right: 0; /* Align with the parent item */
    padding-left: 20px; /* Indent for sub-sub menu items */
    margin: 0; /* Remove any margins */
    width: 100%;
    background-color: #6e6e6e;;
}


#ewtn-menu li ul li ul li a {
    white-space: nowrap; /* Prevent wrapping */
    padding: 10px 15px; /* Ensure padding is consistent */
    text-align: left; /* Align text to the left */
}

/* Search box container styles */
#search-box-container {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 40%;
    background-color: #f5f5f5;
    padding: 5px;
    box-sizing: border-box;
    z-index: 1000;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-height: none;
}

#search-box-container .search-input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 5px;
}

#search-input {
    flex: 1;
    padding: 5px;
    margin-right: 10px;
}

#search-button {
    background-color: #6e6e6e;
    color: white;
    font-weight: bold;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

#search-button:hover {
    background-color: #808080;
}

/* Search results styles */
#search-results {
    width: 100%;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    max-height: none;
    overflow: hidden;
}

#search-results div {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

#search-results div img {
    width: 50px;
    margin-right: 10px;
}

#search-results div .result-content {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take up remaining space */
    align-items: flex-start; /* Ensure content aligns to the left */
}

/* Post title */
#search-results div .result-content a {
    color: #333;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit title to 2 lines */
    -webkit-box-orient: vertical;
    line-height: 1.5;
    max-height: 3em; /* Limit title to 2 lines */
    margin: 0; /* Remove any default margins */
}

/* Post date below the title, aligned to the left */
#search-results div .result-content .post-date {
    color: #666;
    font-size: 0.85em;
    font-weight: normal; /* Less bold */
    margin-top: 2px;
    text-align: left; /* Ensure the date is left-aligned */
    align-self: flex-start; /* Make sure the date aligns to the left */
}

#search-results div:hover {
    background-color: #eee;
}

#search-results .view-all-link {
    text-align: center;
    padding: 10px;
    background-color: #f0f0f0;
    cursor: pointer;
    border-top: 1px solid #ddd;
}

#search-results .view-all-link a {
    text-decoration: none;
    color: #0073aa;
}

#search-results .view-all-link a:hover {
    text-decoration: underline;
}
