/* =====================================================================
   Autism Bucks events: calendar + event cards (Gareth's design)
   ===================================================================== */
.ab-events {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
}

/* ---------- Calendar ---------- */
.ab-cal {
	flex: 1 1 340px;
	max-width: 100%;
	background: #fff;
	border: 1px solid var(--ab-sage-border, #D3DBCB);
	border-radius: 22px;
	padding: clamp(16px, 4vw, 24px);
}
.ab-cal[hidden] { display: none; }

.ab-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.ab-cal__nav {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	border: 2px solid var(--ab-teal, #274B47);
	background: #fff;
	color: var(--ab-teal, #274B47);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ab-cal__nav:hover { background: var(--ab-sage, #E7EDE0); }

.ab-events .ab-cal__month {
	margin: 0;
	font-family: var(--ab-font-heading, Poppins, sans-serif);
	font-weight: 600;
	font-size: 20px;
	color: var(--ab-teal, #274B47);
}

.ab-cal__weekdays,
.ab-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}
.ab-cal__weekdays { margin-bottom: 6px; }
.ab-cal__weekdays span {
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--ab-muted, #4A5856);
	padding: 6px 0;
}

/* Each day: a circle, centred in its grid square */
.ab-cal__day {
	justify-self: center;
	align-self: center;
	width: min(100%, 46px);
	aspect-ratio: 1;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	font: inherit;
	font-size: 16px;
	color: var(--ab-ink, #1F2A28);
}
.ab-cal__day.is-today { box-shadow: inset 0 0 0 2px var(--ab-teal, #274B47); }

.ab-cal__day--event {
	background: var(--ab-orange, #FF7300);
	color: #1A1A1A;
	font-weight: 700;
	cursor: pointer;
}
.ab-cal__day--event[aria-pressed="true"] {
	background: var(--ab-teal, #274B47);
	color: #fff;
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ab-orange, #FF7300);
}

.ab-cal__key {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #E2E6DC;
	font-size: 15px;
	color: var(--ab-muted, #4A5856);
}
.ab-cal__key span { display: flex; align-items: center; gap: 8px; }
.ab-cal__key-dot { display: block; width: 16px; height: 16px; border-radius: 50%; }
.ab-cal__key-dot--event    { background: var(--ab-orange, #FF7300); }
.ab-cal__key-dot--selected { background: var(--ab-teal, #274B47); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ab-orange, #FF7300); }
.ab-cal__key-dot--today    { box-shadow: inset 0 0 0 2px var(--ab-teal, #274B47); }

.ab-cal__empty {
	margin: 16px 0 0;
	font-size: 16px;
	color: var(--ab-muted, #4A5856);
}

/* ---------- Event list: its own scrolling box ---------- */
.ab-events__list {
	flex: 2 1 440px;
	min-width: 0;
	position: relative;   /* so cards' positions are measured inside the box */
	list-style: none;
	margin: 0;
	padding: 4px 10px 4px 4px;   /* room for the hover lift and focus ring */
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.ab-events.is-ready .ab-events__list {
	overflow-y: auto;
	overscroll-behavior: contain;   /* scrolling the list doesn't scroll the page */
	scrollbar-gutter: stable;
}
.ab-events.is-ready.is-stacked .ab-events__list { max-height: 70vh; }

.ab-event {
	display: flex;
	gap: clamp(14px, 3vw, 20px);
	align-items: flex-start;
	margin: 0;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 20px;
	padding: clamp(16px, 3vw, 22px);
	box-shadow: 0 1px 2px rgba(39, 75, 71, .05);
	cursor: pointer;
	transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.ab-event:hover {
	box-shadow: 0 8px 20px rgba(39, 75, 71, .10);
	border-color: #F3B98A;
}
.ab-event.is-selected {
	background: #FFF4EA;
	border-color: var(--ab-orange-dark, #C25700);
}

/* Date badge */
.ab-event__badge {
	flex: none;
	width: clamp(60px, 14vw, 72px);
	border: 0;
	padding: 10px 0;
	border-radius: 14px;
	background: var(--ab-sage, #E7EDE0);
	color: var(--ab-teal, #274B47);
	text-align: center;
	cursor: pointer;
	font-family: var(--ab-font-heading, Poppins, sans-serif);
	line-height: 1.1;
}
.ab-event.is-selected .ab-event__badge { background: var(--ab-orange-dark, #C25700); color: #fff; }
.ab-event__mon { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ab-event__day { display: block; font-size: 28px; font-weight: 700; margin: 2px 0; }
.ab-event__wd  { display: block; font-size: 13px; font-weight: 500; }

.ab-event__body { min-width: 0; }
.ab-events .ab-event__title {
	margin: 0 0 4px;
	font-family: var(--ab-font-heading, Poppins, sans-serif);
	font-weight: 600;
	font-size: 19px;
	line-height: 1.3;
	color: var(--ab-ink, #1F2A28);
}
.ab-event__where {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ab-teal, #274B47);
}
.ab-event__desc {
	margin: 0;
	font-size: 17px;
	line-height: 1.55;
	max-width: 60ch;
}
.ab-event__link { margin: 10px 0 0; }
.ab-event__link a { font-weight: 700; }

.ab-events :focus-visible {
	outline: 3px solid var(--ab-orange, #FF7300);
	outline-offset: 3px;
}

.ab-events__none { color: var(--ab-muted, #4A5856); }

@media (prefers-reduced-motion: reduce) {
	.ab-event { transition: none; }
}
