/*
 * Event Calendar month view — layout only (Phase 4C, Decision 026).
 * Deliberately isolated from frontend-event-card.css: a month grid is
 * a genuinely different presentation shape (a <table>, not a card
 * list), not a variant of the Event Card. Registered with
 * frontend-event-card.css as a dependency (Frontend\CalendarRenderer::
 * register_assets()) purely so this file can rely on its :root design
 * tokens (fonts, accent color, status badge colors) via var() with a
 * hard fallback in every case — no atomic Event Card class is reused
 * or redefined here.
 *
 * Single breakpoint, deliberately: a normal 7-column <table> above
 * 700px, converted to a stacked one-day-per-row block list below it
 * (the standard CSS-only "responsive table" technique: every table
 * element gets display:block) — same markup, no separate render path,
 * no JavaScript. No !important anywhere.
 */

.jdx-events-calendar {
	width: 100%;
	box-sizing: border-box;
	font-family: var(--jdx-events-font-secondary, inherit);
}

.jdx-events-calendar__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.jdx-events-calendar__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 1em;
}

.jdx-events-calendar__prev,
.jdx-events-calendar__next {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	min-height: 44px;
	padding: 0.4em 0.75em;
	color: inherit;
	text-decoration: none;
	border: 1px solid var(--jdx-events-card-border-color, #4a4a4a);
}

.jdx-events-calendar__prev:hover,
.jdx-events-calendar__next:hover {
	text-decoration: underline;
}

.jdx-events-calendar__heading {
	font-family: var(--jdx-events-font-primary, inherit);
	text-transform: uppercase;
	margin: 0;
	text-align: center;
	flex: 1 1 auto;
}

.jdx-events-calendar__table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.jdx-events-calendar__table th {
	padding: 0.5em;
	text-align: center;
	font-size: 0.8em;
	text-transform: uppercase;
}

.jdx-events-calendar__table th abbr {
	text-decoration: none;
}

.jdx-events-calendar__day {
	vertical-align: top;
	border: 1px solid var(--jdx-events-card-border-color, #4a4a4a);
	padding: 0.4em;
	min-height: 5em;
}

.jdx-events-calendar__day--outside {
	opacity: 0.5;
}

.jdx-events-calendar__day--today {
	outline: 2px solid var(--jdx-events-color-accent, currentColor);
	outline-offset: -2px;
}

.jdx-events-calendar__day-label {
	display: none;
}

.jdx-events-calendar__date {
	display: block;
	font-family: var(--jdx-events-font-primary, inherit);
	font-weight: 600;
}

.jdx-events-calendar__events {
	list-style: none;
	margin: 0.35em 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.jdx-events-calendar__event {
	display: block;
	font-size: 0.8em;
	line-height: 1.25;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	border-left: 3px solid var(--jdx-events-color-accent, currentColor);
	padding-left: 0.35em;
}

.jdx-events-calendar__event:hover {
	text-decoration: underline;
}

.jdx-events-calendar__event--cancelled {
	border-left-color: var(--jdx-events-badge-cancelled-bg, #b30000);
	text-decoration: line-through;
	opacity: 0.75;
}

.jdx-events-calendar__event--postponed {
	border-left-color: var(--jdx-events-badge-postponed-bg, #9a6400);
}

.jdx-events-calendar__event--sold-out {
	opacity: 0.6;
}

@media ( max-width: 700px ) {
	.jdx-events-calendar__table,
	.jdx-events-calendar__table thead,
	.jdx-events-calendar__table tbody,
	.jdx-events-calendar__table tr,
	.jdx-events-calendar__table th,
	.jdx-events-calendar__table td {
		display: block;
		width: 100%;
	}

	.jdx-events-calendar__table thead {
		display: none;
	}

	.jdx-events-calendar__table tr {
		margin-bottom: 0.75em;
	}

	.jdx-events-calendar__day {
		border-bottom: none;
	}

	.jdx-events-calendar__day:last-child {
		border-bottom: 1px solid var(--jdx-events-card-border-color, #4a4a4a);
	}

	.jdx-events-calendar__day-label {
		display: inline;
		font-size: 0.8em;
		text-transform: uppercase;
		margin-right: 0.5em;
	}

	.jdx-events-calendar__date {
		display: inline;
	}
}
