/* AOD Events: filter form and event detail layout. No colors. */

.aod-event-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem 1.5rem;
	margin-block-end: 1.5rem;
}

/* Each field is a column: label on top, control below. Wraps to one column on small screens. */
.aod-event-filters__field {
	flex: 1 1 12rem;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Field headings */
.aod-event-filters legend,
.aod-event-filters label:not(.aod-event-filters__option) {
	display: block;
	margin-block-end: 0.25rem;
	padding: 0;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
}

/* 1rem is 16px by default. Use 1.125rem for 18px. */
.aod-event-filters select,
.aod-event-filters input[type="search"] {
	inline-size: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
}

.aod-event-filters option {
	padding: 0.25rem 0.5rem;
}

.aod-event-filters__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
}

.aod-event-filters__option {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.aod-event-filters__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
}

/* Event details: label and value side by side. */
.aod-detail {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.5rem;
}

.aod-detail p {
	margin: 0;
}

/* Hide the whole pair, label included, when the value is empty (for example, location on a webinar). */
.aod-detail:has(.aod-detail__value:empty) {
	display: none;
}

/* Text for screen readers only, such as the event title inside the Register link. */
.aod-visually-hidden {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Result count: smaller and italic. */
.aod-event-count {
	font-size: 0.9rem;
	font-style: italic;
}

/* Status label colors. Change the three pairs here. Each pair keeps 4.5:1 contrast or better. */
.aod-status {
	--aod-status-bg: #dbeafb;
	--aod-status-text: #1a365d;
	display: inline-block;
	padding: 0.125em 0.625em;
	border: 1px solid transparent;
	border-radius: 999px;
	background-color: var(--aod-status-bg);
	color: var(--aod-status-text);
	font-weight: 600;
}

.event-status-upcoming .aod-status {
	--aod-status-bg: #1b6e3a;
	--aod-status-text: #fff;
}

.event-status-current .aod-status {
	--aod-status-bg: #b0126f;
	--aod-status-text: #fff;
}

.event-status-archived .aod-status {
	--aod-status-bg: #dbeafb;
	--aod-status-text: #1a365d;
}

/* Icons before the Type and Location labels. Decorative: they are CSS only, so screen readers skip them. */
.aod-detail--location .aod-detail__label::before,
.aod-detail--type .aod-detail__label::before {
	content: "";
	display: inline-block;
	inline-size: 1em;
	block-size: 1em;
	margin-inline-end: 0.35em;
	vertical-align: -0.125em;
	background-color: currentColor;
	-webkit-mask: var(--aod-icon) center / contain no-repeat;
	mask: var(--aod-icon) center / contain no-repeat;
}

.aod-detail--location .aod-detail__label {
	--aod-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
}

.event-type-in-person .aod-detail--type .aod-detail__label {
	--aod-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2c-3.3 0-8 1.7-8 5v1h16v-1c0-3.3-4.7-5-8-5z'/%3E%3C/svg%3E");
}

.event-type-webinar .aod-detail--type .aod-detail__label {
	--aod-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M3 4h18a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-7v2h3v2H7v-2h3v-2H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm1 2v9h16V6H4z'/%3E%3C/svg%3E");
}

/* Register button: new-window arrow that nudges right on hover and keyboard focus. Decorative, so screen readers skip it. */
.aod-register .wp-block-button__link::after {
	content: "";
	display: inline-block;
	inline-size: 1em;
	block-size: 1em;
	margin-inline-start: 0.35em;
	vertical-align: -0.125em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v10h-2v-6.6l-8.3 8.3-1.4-1.4L13.6 9H7z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v10h-2v-6.6l-8.3 8.3-1.4-1.4L13.6 9H7z'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.2s ease;
}

.aod-register .wp-block-button__link:hover::after,
.aod-register .wp-block-button__link:focus-visible::after {
	transform: translateX(0.25em);
}

@media (prefers-reduced-motion: reduce) {
	.aod-register .wp-block-button__link::after {
		transition: none;
	}
}
