/* wp-content/themes/migennois/assets/css/agenda.css
 * Events Manager screens rendered by the theme overrides (agenda list,
 * event page, place page). Loaded only on those pages.
 */

.otm-icon {
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	vertical-align: -0.2em;
}

/* Filters: period segmented control (scrolls on mobile) + category chips. */
.otm-agenda__filters {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin-block-end: var(--wp--preset--spacing--40);
}

.otm-segmented,
.otm-chips {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.otm-segmented {
	width: fit-content;
	max-width: 100%;
	padding: 0.25rem;
	border-radius: var(--wp--preset--border-radius--pill);
	background: var(--wp--preset--color--brun);
}

.otm-segmented__item,
.otm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 2.75rem;
	padding: 0 var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--pill);
	white-space: nowrap;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.otm-segmented__item {
	color: var(--wp--preset--color--ligne);
}

.otm-segmented__item[aria-current] {
	background: var(--wp--preset--color--or);
	color: var(--wp--preset--color--encre);
}

.otm-chip {
	border: var(--wp--custom--border--width) solid var(--wp--preset--color--ligne);
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
}

.otm-chip[aria-current] {
	border-color: var(--wp--preset--color--brun);
	background: var(--wp--preset--color--brun);
	color: var(--wp--preset--color--sable);
}

.otm-chip__count {
	opacity: 0.7;
	font-weight: 500;
}

.otm-agenda__count {
	margin: 0 0 var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--gris);
	font-size: var(--wp--preset--font-size--small);
}

/* Event cards: horizontal row on mobile, card grid from 48rem. */
.otm-event-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

.otm-event-card {
	position: relative;
	display: grid;
	grid-template-columns: 7rem minmax(0, 1fr);
	height: 100%;
	overflow: hidden;
	border: var(--wp--custom--border--width) solid var(--wp--preset--color--ligne);
	border-radius: var(--wp--preset--border-radius--m);
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
}

.otm-event-card:focus-within {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--or-fonce);
	outline-offset: var(--wp--custom--focus--offset);
}

.otm-event-card__media {
	position: relative;
	min-height: 7rem;
	background: var(--wp--preset--color--creme);
}

.otm-event-card--no-image {
	grid-template-columns: 5.5rem minmax(0, 1fr);
}

.otm-event-card--no-image .otm-event-card__media {
	min-height: 0;
}

.otm-event-card--no-image .otm-date-tile {
	position: static;
	margin: var(--wp--preset--spacing--30) auto 0;
	background: var(--wp--preset--color--blanc);
}

.otm-event-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.otm-date-tile {
	position: absolute;
	top: var(--wp--preset--spacing--20);
	left: var(--wp--preset--spacing--20);
	display: grid;
	justify-items: center;
	min-width: 3.25rem;
	padding: 0.375rem 0.5rem;
	border-radius: var(--wp--preset--border-radius--s);
	background: var(--wp--preset--color--sable);
	line-height: 1;
	text-transform: uppercase;
}

.otm-date-tile__dow,
.otm-date-tile__month {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--or-fonce);
}

.otm-date-tile__day {
	font-family: var(--wp--preset--font-family--barlow-condensed);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	color: var(--wp--preset--color--brun);
}

.otm-event-card__body {
	display: grid;
	align-content: start;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.otm-event-card__body > * {
	margin: 0;
}

.otm-event-card__category {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ardoise-fonce);
}

.otm-event-card__title {
	font-family: var(--wp--preset--font-family--barlow);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	line-height: 1.25;
	text-transform: none;
}

.otm-event-card__title a {
	color: inherit;
	text-decoration: none;
}

.otm-stretched-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.otm-stretched-link:focus-visible {
	outline: none;
}

.otm-event-card__meta {
	display: grid;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gris);
}

.otm-event-card__meta li {
	display: flex;
	gap: 0.375rem;
	align-items: flex-start;
}

.otm-event-card.is-canceled .otm-event-card__title {
	text-decoration: line-through;
}

.otm-badge {
	display: inline-block;
	width: fit-content;
	margin: 0;
	padding: 0.25rem 0.625rem;
	border-radius: var(--wp--preset--border-radius--pill);
	background: var(--wp--preset--color--sauge-clair);
	color: var(--wp--preset--color--ardoise-fonce);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.otm-badge--alert,
.otm-notice--alert {
	background: var(--wp--preset--color--bordeaux);
	color: var(--wp--preset--color--blanc);
}

.otm-notice {
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--s);
}

.otm-empty {
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
	border-radius: var(--wp--preset--border-radius--m);
	background: var(--wp--preset--color--creme);
	text-align: center;
}

.otm-pagination {
	margin-block-start: var(--wp--preset--spacing--50);
	text-align: center;
}

/* Single event / place. */
.otm-page-head__kicker {
	margin: var(--wp--preset--spacing--40) 0 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.otm-page-head__kicker a {
	color: var(--wp--preset--color--ardoise-fonce);
	text-decoration: none;
}

.otm-page-head__kicker a:hover {
	text-decoration: underline;
}

.otm-event-content {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}

.otm-location__top {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	align-items: start;
}

.otm-location__info {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
}

.otm-location__description {
	max-width: var(--wp--style--global--content-size);
}

.otm-location__info .otm-location__description {
	margin-block-start: 0;
}

.otm-location__description > :first-child {
	margin-block-start: 0;
}

.otm-location__map .otm-carte-bloc {
	margin: 0;
}

@media (min-width: 64rem) {
	.otm-location__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.otm-location--no-map .otm-location__top {
		grid-template-columns: minmax(0, 46rem);
	}
}

.otm-event__dates,
.otm-event__description,
.otm-event__booking {
	max-width: var(--wp--style--global--content-size);
}

.otm-event__dates {
	margin-block-start: var(--wp--preset--spacing--60);
}

.otm-event__dates h2 {
	font-size: var(--wp--preset--font-size--x-large);
}

.otm-event__dates-list {
	flex-wrap: wrap;
	overflow: visible;
}

.otm-event__dates-list .otm-chip:hover {
	border-color: var(--wp--preset--color--brun);
}

.otm-event__top {
	display: grid;
	gap: var(--wp--preset--spacing--50);
}

.otm-event__top--no-image .otm-event__description {
	margin-block-start: 0;
	order: 1;
}

.otm-event__top--no-image .otm-event__description > :first-child,
.otm-event__top--no-image .otm-event__description > h2 + * {
	margin-block-start: 0;
}

.otm-event__media {
	margin: 0;
}

.otm-event__media img {
	width: 100%;
	border-radius: var(--wp--preset--border-radius--l);
}

.otm-facts-card {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	align-content: start;
	padding: var(--wp--preset--spacing--50);
	border: var(--wp--custom--border--width) solid var(--wp--preset--color--ligne);
	border-radius: var(--wp--preset--border-radius--m);
	background: var(--wp--preset--color--blanc);
}

.otm-facts-card__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.otm-facts {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
}

.otm-facts__row dt {
	display: flex;
	gap: 0.375rem;
	align-items: center;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gris);
}

.otm-facts__row dd {
	margin: 0.25rem 0 0;
	font-weight: 600;
}

.otm-facts-card__actions {
	display: grid;
	gap: var(--wp--preset--spacing--20);
}

.otm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 3rem;
	padding: 0 var(--wp--preset--spacing--50);
	border-radius: var(--wp--preset--border-radius--pill);
	font-weight: 700;
	text-decoration: none;
}

.otm-btn--primary {
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--blanc);
}

.otm-btn--primary:hover {
	background: var(--wp--preset--color--ardoise-fonce);
	color: var(--wp--preset--color--blanc);
}

.otm-btn--outline {
	border: var(--wp--custom--border--strong) solid var(--wp--preset--color--brun);
	color: var(--wp--preset--color--brun);
}

.otm-btn--outline:hover {
	background: var(--wp--preset--color--brun);
	color: var(--wp--preset--color--sable);
}

.otm-event__description,
.otm-event__booking,
.otm-related,
.otm-location__description {
	margin-block-start: var(--wp--preset--spacing--60);
}

.otm-event__description h2,
.otm-event__booking h2,
.otm-related h2 {
	font-size: var(--wp--preset--font-size--x-large);
}

.otm-facts-card--inline {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
	.otm-event-grid {
		grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	}

	.otm-event-card {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}

	.otm-event-card__media {
		aspect-ratio: var(--wp--custom--card--image-ratio);
	}

	/* No photo: keep the compact row (date column + text) at every width. */
	.otm-event-card--no-image {
		grid-template-columns: 5.5rem minmax(0, 1fr);
		grid-template-rows: none;
	}

	.otm-event-card--no-image .otm-event-card__media {
		aspect-ratio: auto;
	}

	.otm-facts-card--inline {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}
}

@media (min-width: 64rem) {
	.otm-event__top {
		grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr);
		align-items: start;
	}

	.otm-event__top--no-image {
		grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr);
	}

	/* Key facts first on small screens, beside the text from 64rem. */
	.otm-event__top--no-image .otm-event__description {
		order: -1;
	}

	.otm-event__facts {
		position: sticky;
		top: var(--wp--preset--spacing--50);
	}
}

/* Photos inserted in the text from the classic editor (Events Manager). */
.otm-event__description img,
.otm-location__description img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-block: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--m);
}

.otm-event__description .aligncenter,
.otm-location__description .aligncenter {
	margin-inline: auto;
}

@media (min-width: 48rem) {
	.otm-event__description img.alignleft,
	.otm-location__description img.alignleft {
		float: left;
		max-width: 50%;
		margin-inline-end: var(--wp--preset--spacing--40);
	}

	.otm-event__description img.alignright,
	.otm-location__description img.alignright {
		float: right;
		max-width: 50%;
		margin-inline-start: var(--wp--preset--spacing--40);
	}

	.otm-event__description::after,
	.otm-location__description::after {
		content: "";
		display: table;
		clear: both;
	}
}

/* Galleries in descriptions: keep the block's own grid and cropping. */
.otm-event__description .wp-block-gallery img,
.otm-location__description .wp-block-gallery img {
	height: 100%;
	margin: 0;
}

.otm-event__description .wp-block-gallery,
.otm-event__description .wp-block-image {
	margin-block: var(--wp--preset--spacing--40);
}
