.cel-archive-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

/*
 * The [page_banner] row above the filters (see archive-event.php). Same
 * minmax(0, 1fr) reasoning as .cel-event-filters below: a bare 1fr track
 * won't shrink below its content's intrinsic width, so an unusually wide
 * banner image could otherwise force the whole grid wider than the
 * viewport.
 */
.cel-archive-banners {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	max-width: 1200px;
	margin: 30px auto 0;
	padding: 0 20px;
}

/* The bottom row (below the listing/pagination) needs space underneath it
 * too, not just above — the top row already gets that from whatever
 * precedes it (the page header) needing none of its own. */
.cel-archive-banners--bottom {
	margin-bottom: 30px;
}

.cel-archive-banner-col:empty {
	display: none;
}

.cel-event-listing {
	text-align: left;
}

/*
 * 4-column grid: two rows of fields (see FILTER_ORDER in the PHP) plus the
 * Search button's own full-width row beneath them. Each field gets an
 * explicit inline grid-column/grid-row (see FILTER_GRID_POSITIONS) rather
 * than relying on auto-placement, since a taxonomy with no terms yet is left
 * out of the DOM entirely — auto-placement would slide every later field over
 * to fill the gap instead of leaving its cell blank.
 */
.cel-event-filters {
	display: grid;
	/*
	 * minmax(0, 1fr), not a bare 1fr: a grid track sized with plain `1fr`
	 * still won't shrink a column below its content's intrinsic min-width
	 * (same default-min-width:auto gotcha as a flex/grid item — see the
	 * .cel-tax-list-item note elsewhere in this codebase). A long combobox
	 * value like "All Event Types" was forcing that column — and therefore
	 * the whole grid — wider than the viewport on mobile, which is what
	 * actually broke responsiveness here (the max-width media queries below
	 * were firing correctly; the tracks just refused to shrink to fit them).
	 */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 28px;
	max-width: 100%;
	/* Card treatment so the filter bar reads as its own block, distinct from the plain table below it. */
	padding: 20px;
	background: #f7f8fa;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	box-sizing: border-box;
}

.cel-filter-field {
	min-width: 0;
}

.cel-filter-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #666;
	margin-bottom: 6px;
}

.cel-filter-field select.cel-filter,
.cel-filter-field input.cel-filter {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	font-family: inherit;
}

/*
 * The Search button's row. Deliberately has no inline grid-column/grid-row of
 * its own (unlike .cel-filter-field, see FILTER_GRID_POSITIONS in the PHP): as
 * the only auto-placed item in the grid it lands in the first free cell, which
 * is the row after the explicitly-placed fields at every breakpoint — so it
 * needs none of the `grid-column: auto !important` unpinning the fields
 * themselves need in the media queries below.
 */
.cel-filter-actions {
	grid-column: 1 / -1;
	display: flex;
	justify-content: flex-end;
}

/*
 * Scoped under .cel-filter-actions rather than styled as a bare
 * .cel-filter-submit class: the active theme sets its own padding/background/
 * border on `button` and `input[type="submit"]` via attribute/element
 * selectors, which outrank a single class regardless of load order (the same
 * specificity trap documented for the form controls in CLAUDE.md).
 */
.cel-filter-actions button.cel-filter-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	padding: 10px 24px;
	margin: 0;
	border: 1px solid #2b6cb0;
	border-radius: 4px;
	background: #2b6cb0;
	color: #fff;
	font-size: 14px;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	cursor: pointer;
}

.cel-filter-actions button.cel-filter-submit:hover,
.cel-filter-actions button.cel-filter-submit:focus {
	background: #23568c;
	border-color: #23568c;
	color: #fff;
}

@media (max-width: 560px) {
	.cel-filter-actions button.cel-filter-submit {
		width: 100%;
	}
}

/* Searchable taxonomy dropdown (City/Discipline/Event Type/Event Mode). */
.cel-combobox {
	position: relative;
}

.cel-combobox-toggle {
	width: 100%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	font-family: inherit;
	color: #333;
	cursor: pointer;
}

.cel-combobox-toggle:hover {
	border-color: #999;
}

/* Locked to the current taxonomy archive's own term (see render_taxonomy_combobox() in the PHP) — shown, not removed, but not reopenable. */
.cel-combobox-toggle:disabled {
	background: #f2f2f2;
	color: #777;
	cursor: not-allowed;
}

.cel-combobox-toggle:disabled:hover {
	border-color: #ccc;
}

.cel-combobox-toggle:disabled .cel-combobox-arrow {
	border-color: #bbb;
}

.cel-combobox-value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cel-combobox-arrow {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-right: 2px solid #777;
	border-bottom: 2px solid #777;
	transform: rotate(45deg);
	margin-top: -4px;
}

.cel-combobox-toggle[aria-expanded="true"] .cel-combobox-arrow {
	margin-top: 2px;
	transform: rotate(-135deg);
}

.cel-combobox-panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 20;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	padding: 8px;
}

.cel-combobox-search {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	margin-bottom: 6px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
}

.cel-combobox-options {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}

.cel-combobox-option {
	padding: 8px 10px;
	font-size: 14px;
	border-radius: 3px;
	cursor: pointer;
}

.cel-combobox-option:hover,
.cel-combobox-option.is-selected {
	background: #2b6cb0;
	color: #fff;
}

.cel-combobox-no-results {
	margin: 6px 2px 2px;
	font-size: 13px;
	color: #888;
}

@media (max-width: 900px) {
	.cel-archive-banners {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cel-event-filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/*
	 * Same override as the 560px breakpoint below, and for the same reason:
	 * FILTER_GRID_POSITIONS' inline grid-column values go up to 3/4 for the
	 * desktop 4-column layout. Left alone, a field pinned to explicit column
	 * 3 or 4 forces the grid engine to create implicit extra column tracks
	 * to hold it — sized by grid-auto-columns (default: content-based) — so
	 * the grid silently stayed ~4 columns wide here even though the template
	 * above says 2, which was the actual reason the "responsive" breakpoints
	 * appeared to do nothing.
	 */
	.cel-filter-field {
		grid-column: auto !important;
		grid-row: auto !important;
	}
}

@media (max-width: 560px) {
	.cel-archive-banners {
		grid-template-columns: minmax(0, 1fr);
	}

	.cel-event-filters {
		grid-template-columns: minmax(0, 1fr);
	}

	/*
	 * FILTER_GRID_POSITIONS (see the PHP) assigns every field an explicit
	 * inline grid-column/grid-row for the 4-col/2-row desktop layout, so a
	 * field's own inline style would otherwise still pin it to e.g. column 3
	 * even once the grid itself is down to a single column. Force every
	 * field back to the grid's own auto-flow at this width.
	 */
	.cel-filter-field {
		grid-column: auto !important;
		grid-row: auto !important;
	}
}

.cel-event-table-wrap {
	overflow-x: auto;
}

.cel-event-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.cel-event-table col.cel-col-start-date,
.cel-event-table col.cel-col-end-date {
	width: 12%;
}

.cel-event-table col.cel-col-title {
	width: 38%;
}

.cel-event-table col.cel-col-city {
	width: 18%;
}

.cel-event-table col.cel-col-mode {
	width: 20%;
}

.cel-event-table th,
.cel-event-table td {
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid #e5e5e5;
	vertical-align: top;
	overflow-wrap: break-word;
}

.cel-event-table td.cel-col-start-date,
.cel-event-table td.cel-col-end-date {
	white-space: nowrap;
}

.cel-event-table th {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #777;
}

.cel-event-table tbody.cel-loading {
	opacity: 0.5;
	pointer-events: none;
}

.cel-event-row--bold td {
	background: #fff8e6;
	font-weight: 700;
	color: #0089f7;
}

.cel-event-row--bold td:first-child {
	border-left: 3px solid #e0a800;
}

.cel-live-dot {
	display: inline-block;
	vertical-align: middle;
	width: 9px;
	height: 9px;
	margin-right: 6px;
	border-radius: 50%;
	background: #1a9c4a;
	animation: cel-live-blink 1.4s ease-in-out infinite;
}

@keyframes cel-live-blink {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.25;
	}
}

.cel-event-title-link {
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.cel-event-title-link:hover {
	text-decoration: underline;
}

.cel-mode-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cel-mode-list li {
	font-size: 13px;
	line-height: 1.5;
}

.cel-no-events {
	color: #777;
	text-align: center;
}

.cel-pagination {
	margin-top: 24px;
	display: flex;
	justify-content: center;
}

.cel-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 6px;
}

/*
 * Scoped to the <a>/<span> buttons only — the outer <ul> that
 * paginate_links() wraps them in also carries the "page-numbers" class, and
 * a bare ".page-numbers" selector would put its own border box around the
 * whole button group as well as each button.
 */
.cel-pagination a.page-numbers,
.cel-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 14px;
}

.cel-pagination a.page-numbers:hover {
	background: #f5f5f5;
}

.cel-pagination span.page-numbers.current {
	background: #333;
	color: #fff;
	border-color: #333;
}

.cel-pagination span.page-numbers.dots {
	border: none;
}

/*
 * Below 700px the 5-column fixed-width table (12/12/38/18/20%) has no room
 * to work with — date columns collapse to a few px and their text wraps
 * character-by-character (overflow-wrap: break-word with almost no width to
 * wrap into), which is what actually made the archive/taxonomy pages look
 * broken on a phone rather than just "not stacked". Below this width the
 * table becomes a stack of cards instead: each row an ungridded block, each
 * cell its own flex row with the column label (from data-label, set in
 * render_event_row()) on the left and the value on the right, since there's
 * no <thead> visible anymore to supply it.
 */
@media (max-width: 700px) {
	.cel-event-table-wrap {
		overflow-x: visible;
	}

	.cel-event-table {
		table-layout: auto;
	}

	.cel-event-table thead {
		display: none;
	}

	.cel-event-table,
	.cel-event-table tbody,
	.cel-event-table tr {
		display: block;
		width: 100%;
	}

	.cel-event-table tbody tr.cel-event-row {
		margin-bottom: 14px;
		border: 1px solid #e5e5e5;
		border-radius: 6px;
		overflow: hidden;
	}

	.cel-event-table tbody tr.cel-event-row--bold {
		border-left: 3px solid #e0a800;
	}

	.cel-event-table td {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 12px;
		width: auto;
		padding: 8px 14px;
		border-bottom: 1px solid #f0f0f0;
	}

	.cel-event-table tr.cel-event-row--bold td:first-child {
		border-left: none;
	}

	.cel-event-table td:last-child {
		border-bottom: none;
	}

	.cel-event-table td::before {
		content: attr(data-label);
		flex-shrink: 0;
		width: 40%;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: #888;
	}

	.cel-event-table td.cel-no-events {
		display: block;
		text-align: center;
	}

	.cel-event-table td.cel-no-events::before {
		content: none;
	}
}
