/*
 * Events RSS list (/district/events/) — scoped to body.dda-events-rss-page
 */

/*
 * Content width only — same pattern as News / Meetings wires + dda-custom-archive-hero.css:
 * scope layout to `main … > .container` (intro, filters, list). Never #et-main-area / #main-content:
 * those wrap the hero banner + whole column and must stay untouched for Theme Builder.
 */
body.dda-events-rss-page main#primary.dda-events-rss > .container,
body.dda-events-rss-page.dda-events-rss-page--with-sidebar main#primary.dda-events-rss > .dda-events-rss__layout > .dda-events-rss__main.container {
	width: 100%;
	max-width: 1080px;
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(1rem, 4vw, 1.5rem);
	padding-right: clamp(1rem, 4vw, 1.5rem);
	box-sizing: border-box;
}

/* Sidebar layout: width/padding on __layout (see dda-wire-section-sidebar.css). */
body.dda-events-rss-page.dda-events-rss-page--with-sidebar main#primary.dda-events-rss > .dda-events-rss__layout > .dda-events-rss__main.container {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
}

body.dda-events-rss-page .dda-events-rss {
	padding: clamp(72px, 10vh, 120px) 0 clamp(48px, 8vh, 80px);
	box-sizing: border-box;
}

body.dda-events-rss-page .dda-events-rss__head {
	margin-bottom: 1.75rem;
}

body.dda-events-rss-page .dda-events-rss__head .entry-title {
	margin-bottom: 0.35rem;
}

body.dda-events-rss-page .dda-events-rss__intro-block {
	max-width: 100%;
}

body.dda-events-rss-page .dda-events-rss__intro-block--in-header {
	margin: 0.75rem 0 0;
}

body.dda-events-rss-page .dda-events-rss__intro-block--below-hero {
	margin: 0 0 1.5rem;
}

body.dda-events-rss-page .dda-events-rss__intro-title {
	margin: 0 0 0.35rem;
	font-size: clamp(1.15rem, 2.2vw, 1.35rem);
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
}

body.dda-events-rss-page .dda-events-rss__intro-title a,
body.dda-events-rss-page .dda-events-rss__intro-external-link {
	color: inherit;
}

body.dda-events-rss-page .dda-events-rss__intro-external-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	text-decoration: none;
	line-height: 1.35;
}

body.dda-events-rss-page .dda-events-rss__intro-external-link__label {
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

body.dda-events-rss-page .dda-events-rss__intro-external-link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 3px;
	border-radius: 2px;
}

body.dda-events-rss-page .dda-events-rss__intro-external-link .fa-solid {
	display: inline-block;
	font-size: 12px;
	line-height: 1;
	width: 12px;
	flex-shrink: 0;
	align-self: center;
	vertical-align: middle;
	opacity: 0.92;
	color: currentColor;
}

body.dda-events-rss-page .dda-events-rss__external-icon {
	display: inline-block;
	font-size: 0.82em;
	line-height: 0;
	vertical-align: 0.08em;
	opacity: 0.9;
}

body.dda-events-rss-page .dda-events-rss__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 100%;
}

/* Kill theme left stripe / border on rows (Etch/Divi list/entry tweaks). */
body.dda-events-rss-page ul.dda-events-rss__list > li.dda-events-rss__item,
body.dda-events-rss-page ul.dda-events-rss__list > li.dda-events-rss__item .dda-events-rss__item-inner,
body.dda-events-rss-page ul.dda-events-rss__list > li.dda-events-rss__item .dda-events-rss__item-main,
body.dda-events-rss-page ul.dda-events-rss__list > li.dda-events-rss__item .dda-events-rss__item-detail {
	border-left: 0 !important;
	border-inline-start-width: 0 !important;
	box-shadow: none !important;
}

body.dda-events-rss-page ul.dda-events-rss__list > li.dda-events-rss__item .dda-events-rss__title-link {
	border-left: 0 !important;
	border-inline-start-width: 0 !important;
}

body.dda-events-rss-page .dda-events-rss__item {
	padding: 1rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	border-left: 0 !important;
	border-inline-start: 0 !important;
}

body.dda-events-rss-page .dda-events-rss__item:first-child {
	padding-top: 0;
}

/* Visually hidden — appended to title link name for screen readers (new tab). */
body.dda-events-rss-page .dda-events-rss__sr-only {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

/* List row: 2 columns — thumb (left), all text (right). DOM order matches layout. */
body.dda-events-rss-page .dda-events-rss__item-inner {
	display: grid;
	grid-template-columns: clamp(88px, 22vw, 132px) minmax(0, 1fr);
	column-gap: 1rem;
	align-items: start;
	border: 0 !important;
	border-left: 0 !important;
	border-inline-start: 0 !important;
	padding-left: 0 !important;
	margin-left: 0 !important;
}

body.dda-events-rss-page .dda-events-rss__thumb-link {
	display: inline-block;
	align-self: start;
	justify-self: start;
	width: fit-content;
	max-width: 100%;
	min-width: 0;
	line-height: 0;
	vertical-align: top;
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
	background: none;
	outline: none;
	text-decoration: none;
	color: inherit;
}

body.dda-events-rss-page .dda-events-rss__item-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	align-items: stretch;
	margin: 0;
	padding: 0;
	border: none;
	border-left: none;
	box-shadow: none;
	background: transparent;
}

body.dda-events-rss-page .dda-events-rss__title-link {
	display: inline-flex;
	max-width: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: 4px;
}

body.dda-events-rss-page .dda-events-rss__item-detail {
	min-width: 0;
}

body.dda-events-rss-page .dda-events-rss__thumb-wrap {
	position: relative;
	width: 100%;
	max-width: clamp(88px, 22vw, 132px);
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: 6px;
	background: #eef2f7;
	border: none;
	box-sizing: border-box;
}

/* Hover dim only — no inset “frame” lines */
body.dda-events-rss-page .dda-events-rss__thumb-wrap::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 6px;
	background: rgba(15, 23, 42, 0.35);
	opacity: 0;
	pointer-events: none;
}

/* Overlay only while pointer is over the thumbnail box — not when hovering `.title-link`. */
body.dda-events-rss-page .dda-events-rss__thumb-link > .dda-events-rss__thumb-wrap:hover::after,
body.dda-events-rss-page .dda-events-rss__thumb-link:focus-visible > .dda-events-rss__thumb-wrap::after {
	opacity: 1;
}

body.dda-events-rss-page .dda-events-rss__thumb-wrap--fallback {
	background: #f1f5f9;
}

body.dda-events-rss-page .dda-events-rss__thumb-wrap--fallback .dda-events-rss__thumb {
	object-fit: contain;
	object-position: center;
	padding: 0.65rem;
	opacity: 0.32;
	filter: grayscale(100%);
}

body.dda-events-rss-page .dda-events-rss__thumb {
	position: relative;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
}

body.dda-events-rss-page .dda-events-rss__title-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.1em;
	row-gap: 0.25em;
	line-height: 1.3;
	min-width: 0;
}

body.dda-events-rss-page .dda-events-rss__title-new-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 0;
	transform: translateY(-0.08em);
	min-width: 12px;
	min-height: 12px;
	margin-left: 0.4em;
}

body.dda-events-rss-page .dda-events-rss__title-new-tab .fa-solid {
	font-size: 12px;
	line-height: 1;
	margin: 0;
}

body.dda-events-rss-page .dda-events-rss__title-text {
	font-weight: 600;
	font-size: 1.05rem;
	color: #1a1a1a;
	text-underline-offset: 0.12em;
}

body.dda-events-rss-page .dda-events-rss__title-link:hover .dda-events-rss__title-text,
body.dda-events-rss-page .dda-events-rss__title-link:focus .dda-events-rss__title-text {
	text-decoration: underline;
}

body.dda-events-rss-page .dda-events-rss__title-link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 3px;
	border-radius: 4px;
}

body.dda-events-rss-page .dda-events-rss__title-link:focus-visible .dda-events-rss__title-text {
	text-decoration: underline;
}

body.dda-events-rss-page span.dda-events-rss__title {
	display: block;
	font-weight: 600;
	font-size: 1.05rem;
	line-height: 1.35;
	color: #1a1a1a;
}

body.dda-events-rss-page .dda-events-rss__meta {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.875rem;
	color: #666;
}

body.dda-events-rss-page .dda-events-rss__summary {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: #555;
}

body.dda-events-rss-page .dda-events-rss__notice,
body.dda-events-rss-page .dda-events-rss__empty {
	padding: 1rem 1.25rem;
	background: #f8f8f8;
	border-radius: 6px;
	max-width: 100%;
}

body.dda-events-rss-page .dda-events-rss__notice-detail {
	margin-top: 0.5rem;
	font-size: 0.8rem;
	word-break: break-word;
}

/* News-wire filter strip reused on /district/events/ — neutralize extra .dda-news-wire section padding */
body.dda-events-rss-page .dda-events-rss__filter-strip.dda-news-wire {
	padding: 0 0 1.35rem !important;
	margin-top: 0.5rem;
	margin-bottom: 1.75rem !important;
	border-bottom: 2px solid #cbd5e1;
	background: transparent;
	box-sizing: border-box;
}

body.dda-events-rss-page .dda-events-rss__filter-strip-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: clamp(0.75rem, 2.5vw, 1.25rem);
	width: 100%;
}

body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__filters-shell {
	width: 100%;
	align-items: flex-end;
	align-content: flex-start;
}

body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__filters-form {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	row-gap: clamp(0.65rem, 2vw, 0.85rem);
	column-gap: 0.75rem;
}

/*
 * Filter Apply + Clear: load after shared wire CSS; beats Divi et_pb_bg_layout_light on /district/events/.
 */
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:hover,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:focus-visible {
	box-sizing: border-box !important;
	min-height: 2.5rem !important;
	padding: 0.35rem 1.5em !important;
	font-size: 17px !important;
	line-height: 1.25 !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	letter-spacing: normal !important;
	border-width: 1px !important;
	border-style: solid !important;
	border-radius: 0 !important;
	transform: none !important;
	filter: none !important;
	box-shadow: none !important;
}

body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button {
	color: #ffffff !important;
	border-color: #ffffff !important;
	background-color: #892020 !important;
	background-image: none !important;
}

body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:hover,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:focus-visible {
	color: #ffffff !important;
	border-color: #ffffff !important;
	background-color: #c6312f !important;
	background-image: none !important;
	padding: 0.35rem 1.5em !important;
	min-height: 2.5rem !important;
}

body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button::before,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button::after {
	content: none !important;
	display: none !important;
}

body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:hover .et_pb_button_text,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:focus-visible .et_pb_button_text {
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	text-decoration-thickness: 1px !important;
}

body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:not(:has(.et_pb_button_text)):not(:has(.et_pb_button_content_wrapper)):hover,
body.dda-events-rss-page .dda-news-wire__filter-actions .dda-wire-filter-primary.et_pb_button:not(:has(.et_pb_button_text)):not(:has(.et_pb_button_content_wrapper)):focus-visible {
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	text-decoration-thickness: 1px !important;
}

/* Location / Sort / Year / Month / Apply — single compact toolbar row */
body.dda-events-rss-page .dda-events-rss__filters-toolbar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: flex-start;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
}

body.dda-events-rss-page .dda-events-rss__filter-field {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

body.dda-events-rss-page .dda-events-rss__filter-field .dda-news-wire__filter-label {
	margin-bottom: 0.35rem;
}

body.dda-events-rss-page .dda-events-rss__filter-select {
	display: block;
	height: 40px;
	min-height: 40px;
	border-radius: 4px;
	border: 1px solid #ddd;
	padding: 0 10px;
	background: #fff;
	font: inherit;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

body.dda-events-rss-page #dda-events-scope.dda-events-rss__filter-select {
	min-width: 8.25rem;
	max-width: 10rem;
}

body.dda-events-rss-page #dda-events-year.dda-events-rss__filter-select,
body.dda-events-rss-page #dda-events-month.dda-events-rss__filter-select {
	min-width: 8.5rem;
	max-width: 11rem;
}

body.dda-events-rss-page .dda-events-rss__filter-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	flex: 0 1 auto;
	margin-left: auto;
}

body.dda-events-rss-page .dda-events-rss__results-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 1.25rem;
}

body.dda-events-rss-page .dda-events-rss__results-toolbar .dda-news-wire__results-status {
	flex: 1 1 12rem;
	margin: 0;
	min-width: 0;
}

body.dda-events-rss-page .dda-events-rss__per-page-field {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

body.dda-events-rss-page .dda-events-rss__per-page-select {
	height: 40px;
	border-radius: 4px;
	border: 1px solid #ddd;
	padding: 0 10px;
	background: #fff;
	font: inherit;
	min-width: 4.5rem;
	max-width: 8rem;
	box-sizing: border-box;
}

body.dda-events-rss-page .dda-news-wire__results-status {
	max-width: 100%;
}

/*
 * Filters + toolbar: tablet/narrow layouts (events archive only).
 * Above ~900px the shared news-wire row keeps sort | month | date row on one flow.
 */
@media (max-width: 56.25rem) {
	body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__filters-form {
		flex-direction: column;
		align-items: stretch;
		align-content: stretch;
	}

	body.dda-events-rss-page .dda-events-rss__filters-toolbar-row {
		align-items: stretch;
	}

	body.dda-events-rss-page .dda-events-rss__filter-field {
		flex: 1 1 calc(50% - 5px);
		min-width: min(100%, 9rem);
	}

	body.dda-events-rss-page .dda-events-rss__filter-select {
		min-height: 44px;
		min-width: 0;
		max-width: none;
	}

	body.dda-events-rss-page #dda-events-scope.dda-events-rss__filter-select,
	body.dda-events-rss-page #dda-events-year.dda-events-rss__filter-select,
	body.dda-events-rss-page #dda-events-month.dda-events-rss__filter-select {
		min-width: 0;
		max-width: none;
	}

	body.dda-events-rss-page .dda-events-rss__filter-actions {
		flex: 1 1 100%;
		margin-left: 0;
		width: 100%;
		justify-content: stretch;
	}

	body.dda-events-rss-page .dda-events-rss__filter-actions .dda-wire-filter-primary,
	body.dda-events-rss-page .dda-events-rss__filter-actions .dda-wire-filter-secondary.et_pb_button {
		flex: 1 1 calc(50% - 0.25rem);
		min-width: 8rem;
		min-height: 44px;
		justify-content: center;
		text-align: center;
	}

	body.dda-events-rss-page .dda-events-rss__filter-field[role='group'] .dda-news-wire__sort {
		width: 100%;
		justify-content: flex-start;
		box-sizing: border-box;
	}

	body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__sort-icon {
		min-width: 44px;
		min-height: 44px;
	}

	/*
	 * Results toolbar on tablet/narrow viewports.
	 * Keep status text on the left and the Per page selector on the right within a single
	 * row so the toolbar stays consistent with the news/meetings wires and the desktop
	 * layout. The natural `flex-wrap: wrap` (declared above) still stacks the children
	 * when the viewport is too narrow to fit them inline.
	 */
	body.dda-events-rss-page .dda-events-rss__results-toolbar {
		flex-direction: row;
		align-items: flex-end;
		gap: 12px;
	}

	body.dda-events-rss-page .dda-events-rss__per-page-field {
		flex: 0 0 auto;
		width: auto;
		align-items: flex-start;
	}

	body.dda-events-rss-page .dda-events-rss__per-page-select {
		width: auto;
		max-width: 8rem;
		min-height: 44px;
	}

	body.dda-events-rss-page .dda-events-rss__results-toolbar .dda-news-wire__results-status {
		font-size: clamp(1rem, 4vw, 1.125rem);
	}
}

@media (max-width: 28rem) {
	body.dda-events-rss-page .dda-events-rss__item-inner {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 0.75rem;
	}

	body.dda-events-rss-page .dda-events-rss__thumb-wrap {
		max-width: 12rem;
	}

	body.dda-events-rss-page .dda-events-rss__intro-title {
		font-size: 1.05rem;
	}

	body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__filter-actions .dda-wire-filter-primary,
	body.dda-events-rss-page .dda-events-rss__filter-strip .dda-news-wire__filter-actions .dda-wire-filter-secondary.et_pb_button {
		flex: 1 1 100%;
	}
}
