/*
 * CMIV Events — the event page.
 *
 * PHONE FIRST (Mike, 2026-09-30: "this must be extremely mobile friendly").
 * One column by default, in this order: the essentials (title, when, where),
 * the booking widget, then the details. From 860px wide it becomes two
 * columns — details on the left, booking and photo on the right, the right
 * column staying in view while the left scrolls.
 *
 * Inherits the site's fonts and colors. Two variables to tune it from a theme:
 *   --cmiv-ev-accent   links and small marks
 *   --cmiv-ev-line     hairlines and card borders
 */

.cmiv-ev {
	--cmiv-ev-accent: currentColor;
	--cmiv-ev-line: rgba(0, 0, 0, 0.12);
	--cmiv-ev-soft: rgba(0, 0, 0, 0.6);
	--cmiv-ev-tint: rgba(0, 0, 0, 0.03);
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "head" "side" "body";
	gap: 24px;
	max-width: 1160px;
	margin: 0 auto;
	box-sizing: border-box;
	overflow-wrap: anywhere;
}

.cmiv-ev *,
.cmiv-ev *::before,
.cmiv-ev *::after { box-sizing: border-box; }

.cmiv-ev__head { grid-area: head; }
.cmiv-ev__side { grid-area: side; display: grid; gap: 18px; align-content: start; min-width: 0; }
.cmiv-ev__body { grid-area: body; display: grid; gap: 28px; min-width: 0; }

@media (min-width: 860px) {
	.cmiv-ev {
		grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
		grid-template-areas: "head side" "body side";
		column-gap: 44px;
		row-gap: 28px;
	}
	.cmiv-ev__side { position: sticky; top: 24px; }
}

.cmiv-ev__title { margin: 0 0 10px; line-height: 1.15; }

.cmiv-ev__row { margin: 6px 0; line-height: 1.5; }
.cmiv-ev__row--when { font-weight: 600; }
.cmiv-ev__sep { margin: 0 6px; opacity: 0.5; }
.cmiv-ev__directions { color: var(--cmiv-ev-accent); white-space: nowrap; font-weight: 600; }

.cmiv-ev__h { margin: 0 0 12px; font-size: 1.15em; line-height: 1.25; }

.cmiv-ev__description > :first-child { margin-top: 0; }
.cmiv-ev__description > :last-child { margin-bottom: 0; }

/* The widget sizes itself; it only needs room. */
.cmiv-ev__widget { min-width: 0; }
.cmiv-ev__widget tami-widget { display: block; width: 100%; }

.cmiv-ev__box {
	padding: 18px 20px;
	border: 1px solid var(--cmiv-ev-line);
	border-radius: 12px;
	background: var(--cmiv-ev-tint);
}
.cmiv-ev__box p { margin: 0; line-height: 1.5; }

.cmiv-ev__image img { display: block; width: 100%; height: auto; border-radius: 12px; }

.cmiv-ev__map { position: relative; width: 100%; padding-top: 56%; border-radius: 12px; overflow: hidden; border: 1px solid var(--cmiv-ev-line); }
.cmiv-ev__map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.cmiv-ev__social { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cmiv-ev__social a {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--cmiv-ev-line);
	border-radius: 999px;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
	font-size: 0.92em;
}

/* Treatments and add-ons: a photo, the words, the price at the end. */
.cmiv-ev__offer-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cmiv-ev__offer {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--cmiv-ev-line);
	border-radius: 12px;
}
.cmiv-ev__offer-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; grid-column: 1; }
.cmiv-ev__offer-text { display: grid; gap: 2px; min-width: 0; grid-column: 2; }
.cmiv-ev__offer:not(:has(.cmiv-ev__offer-img)) .cmiv-ev__offer-text { grid-column: 1 / 3; }
.cmiv-ev__offer-name { font-weight: 700; }
.cmiv-ev__offer-desc, .cmiv-ev__offer-meta { font-size: 0.9em; color: var(--cmiv-ev-soft); }
.cmiv-ev__offer-price { grid-column: 3; font-weight: 700; white-space: nowrap; }

/* People. */
.cmiv-ev__people { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cmiv-ev__person { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
a.cmiv-ev__person:hover .cmiv-ev__person-name { text-decoration: underline; }
.cmiv-ev__avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; }
.cmiv-ev__avatar--initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--cmiv-ev-tint); border: 1px solid var(--cmiv-ev-line); }
.cmiv-ev__person-text { display: grid; min-width: 0; }
.cmiv-ev__person-name { font-weight: 700; }
.cmiv-ev__person-title { font-size: 0.9em; color: var(--cmiv-ev-soft); }
.cmiv-ev--member { display: block; }

/* [cmiv_events] — a list of upcoming events. */
.cmiv-ev-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.cmiv-ev-list__item a { display: grid; gap: 10px; height: 100%; padding: 0 0 14px; color: inherit; text-decoration: none; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 14px; overflow: hidden; }
.cmiv-ev-list__img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.cmiv-ev-list__text { display: grid; gap: 4px; padding: 0 16px; }
.cmiv-ev-list__item a:not(:has(.cmiv-ev-list__img)) .cmiv-ev-list__text { padding-top: 16px; }
.cmiv-ev-list__title { font-weight: 700; font-size: 1.1em; }
.cmiv-ev-list__when, .cmiv-ev-list__where { font-size: 0.92em; color: rgba(0, 0, 0, 0.6); }

.cmiv-ev-note { padding: 10px 12px; border: 1px dashed #c00; color: #900; font: 14px/1.4 system-ui, sans-serif; }

/* Small phones: a little tighter, the price under the words. */
@media (max-width: 420px) {
	.cmiv-ev { gap: 18px; }
	.cmiv-ev__offer { grid-template-columns: auto minmax(0, 1fr); }
	.cmiv-ev__offer-price { grid-column: 2; }
	.cmiv-ev__offer:not(:has(.cmiv-ev__offer-img)) .cmiv-ev__offer-price { grid-column: 1 / 3; }
}
