form.search-form.custom-posts-filter-form {
    background: #dddddd;
    padding: 20px;
}

form.search-form.custom-posts-filter-form {
    display: flex;
    margin: 0px 0px 1rem;
}

.filter-dropdowns {
    display: inline-flex;
    flex-wrap: wrap;
    flex: 1;
    gap: 0.5rem;
    max-width: 100%;
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: space-between;
}

.filter-options > div {
    flex-grow: 1;
}

.filter-options > div > * {
    width: 100%;
}

.search-form.custom-posts-filter-form button.search-submit {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 10px;
    margin: 0px 1rem;
}

.filter-dropdown select, .search-form.custom-posts-filter-form input.search-field {
    padding: 10px;
    border: 0px;
    height: -webkit-fill-available;
}

div#ce_holder {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

a.ce_group {
    flex: 1 1 calc(33.33% - 1rem); /* Adjust to 3 items per row, subtracting gap */
    max-width: calc(34% - 1rem); /* Prevent overflow */
    box-sizing: border-box; /* Ensure padding is included in the width */
}

.ce_image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ce_overlay {
    height: 100%;
}

.ce_overlay p {
    color: white;
    background-color: rgba(0, 0, 0, 0.267);
    padding: 1rem;
    position: relative;
    bottom: 0px;
}

span.ce_text p {
    margin: 0px;
}


ul.events-month-list {
    list-style: none;
    margin: 0;
}

.events-month h3 {
    color: black;
}

.events-calendar-outer { margin-bottom: 2rem; }
.events-month { margin-bottom: 3rem; }
.events-month h3 { margin-bottom: .5rem; margin-top: 1rem; }
.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-table th { background: #eee; padding: 6px; font-weight: bold; }
.calendar-table td {
    height: 120px;
    vertical-align: top;
    padding: 4px;
    border: 1px solid #ddd;
    font-size: 12px;
}
.calendar-daynum { font-weight: bold; margin-bottom: 4px; }
.calendar-event { margin-bottom: 4px; font-size: 11px; line-height: 1.2; }
.calendar-event a { font-weight: bold; text-decoration: none; display: block; }

/* ===== Modal Overlay ===== */
.events-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 70px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.5);
}

/* ===== Modal Box ===== */
.events-modal-content {
    background: #fff;
    margin: auto;
    padding: 20px;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
}

/* ===== Modal Close Button ===== */
.events-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
}

/* ===== Modal Items ===== */
.events-modal-content ul {
    list-style: none;
    padding: 0;
}

.events-modal-content li {
    margin-bottom: 10px;
}

.events-modal-content a {
    font-weight: bold;
    text-decoration: none;
    display: block;
    margin-bottom: 3px;
}

.calendar-more a {
    font-size: 12px;
    cursor: pointer;
    display: inline-block;
    margin-top: 4px;
    color: #0073aa;
}

/* ===========================
   MOBILE CALENDAR FIX: STACKED LAYOUT
   =========================== */
@media (max-width: 768px) {

    .calendar-table,
    .calendar-table thead,
    .calendar-table tbody,
    .calendar-table tr,
    .calendar-table th,
    .calendar-table td {
        display: block;
        width: 100%;
    }

    .calendar-table tr {
        margin-bottom: 1.2rem;
        border: 1px solid #ccc;
        padding: 6px;
        border-radius: 6px;
    }

    .calendar-table th {
        display: none;  /* Hide weekday headings */
    }

    .calendar-table td {
        border: none;
        height: fit-content !important;
        padding: 8px 6px;
    }

    .calendar-daynum {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 4px;
    }

    .calendar-event {
        margin-left: 10px;
        padding-left: 6px;
        border-left: 2px solid #0073aa;
    }
	
	form.search-form.custom-posts-filter-form, .filter-options, div#ce_holder {
        flex-direction: column;
    }
    .search-form.custom-posts-filter-form button.search-submit {
        margin: 1rem 0px 0px;
    }
    a.ce_group {
        flex: 1 1 calc(100% - 1rem);
        max-width: calc(100% - 0rem);
    }
	.events-calendar-outer {
		max-width: 80%;
		margin: auto;
	}
	td.empty-date {
    	display: none;
	}
	.calendar-event a {
		font-size: 1.3rem;
	}
	span.event-time, span.event-location {
   	 	font-size: 1.1rem;
	}
}
