/* Events calendar (cwp/events-calendar): "Live Events Calendar" on the Rawk the Year pages.
   Season tabs across the top, then that season's events in two columns (one under 768px). */
.block-events-calendar {
	color: var(--wp--preset--color--primary);
}


/* The radios that drive the tabs: kept in the page for keyboards and screen readers, not seen */
.block-events-calendar__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.block-events-calendar__tabs {
	display: grid;
	grid-template-columns: repeat(var(--seasons, 4), 1fr);
	margin: 0 0 8px;
	background: var(--wp--preset--color--background);
}

.block-events-calendar__tabs label {
	padding: 18px 8px;
	font-family: var(--wp--preset--font-family--secondary);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.2em;
	text-align: center;
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-dark);
	cursor: pointer;
}

.block-events-calendar__tabs label + label {
	border-left: 1px solid var(--wp--custom--color--divider);
}

.block-events-calendar__tabs label:hover {
	color: var(--wp--preset--color--primary);
}

@media only screen and (max-width: 600px) {
	.block-events-calendar__tabs label {
		padding: 14px 2px;
		font-size: 0.75rem;
		letter-spacing: 0.12em;
	}
}

/* The checked season's tab is brass with a dark green label, and its panel shows.
   Radio n pairs with tab n and panel n. */
.block-events-calendar__radio:focus-visible ~ .block-events-calendar__tabs {
	outline: 2px solid var(--wp--preset--color--brass-dark);
	outline-offset: 2px;
}

.block-events-calendar__radio[data-season="1"]:checked ~ .block-events-calendar__tabs label:nth-child(1),
.block-events-calendar__radio[data-season="2"]:checked ~ .block-events-calendar__tabs label:nth-child(2),
.block-events-calendar__radio[data-season="3"]:checked ~ .block-events-calendar__tabs label:nth-child(3),
.block-events-calendar__radio[data-season="4"]:checked ~ .block-events-calendar__tabs label:nth-child(4) {
	background: var(--wp--preset--color--quaternary);
	color: var(--wp--preset--color--primary);
}

.block-events-calendar__panel {
	display: none;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(var(--rows, 3), auto);
	grid-auto-flow: column;
	column-gap: 56px;
}

.block-events-calendar__radio[data-season="1"]:checked ~ .block-events-calendar__panel[data-season="1"],
.block-events-calendar__radio[data-season="2"]:checked ~ .block-events-calendar__panel[data-season="2"],
.block-events-calendar__radio[data-season="3"]:checked ~ .block-events-calendar__panel[data-season="3"],
.block-events-calendar__radio[data-season="4"]:checked ~ .block-events-calendar__panel[data-season="4"] {
	display: grid;
}

/* The editor's preview drops the radios' checked state, so until one is checked the season
   marked open in the markup shows */
.block-events-calendar:not(:has(.block-events-calendar__radio:checked)) .block-events-calendar__panel.is-open {
	display: grid;
}

.block-events-calendar:not(:has(.block-events-calendar__radio:checked)) .block-events-calendar__tabs label.is-open {
	background: var(--wp--preset--color--quaternary);
	color: var(--wp--preset--color--primary);
}

@media only screen and (max-width: 767px) {
	.block-events-calendar__panel {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-auto-flow: row;
	}
}

/* One event: the date beside its words, a hairline under it */
.block-events-calendar__event {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 18px;
	padding: 28px 0;
	border-bottom: 1px solid var(--wp--custom--color--divider);
}

@media only screen and (max-width: 600px) {
	.block-events-calendar__event {
		grid-template-columns: 76px minmax(0, 1fr);
		gap: 14px;
		padding: 16px 0;
	}
}

/* No line under the last event of each column (marked in render.php). Stacked in one column
   on phones, only the very last loses it. */
.block-events-calendar__event.is-column-end {
	border-bottom: 0;
}

@media only screen and (max-width: 767px) {
	.block-events-calendar__event.is-column-end:not(:last-child) {
		border-bottom: 1px solid var(--wp--custom--color--divider);
	}
}

.block-events-calendar__date {
	display: flex;
	flex-direction: column;
	align-self: center;
	text-align: center;
	color: var(--wp--preset--color--brass-dark);
}

.block-events-calendar__month {
	width: 50%;
	margin: 0 auto;
	padding: 0 0 4px;
	border-bottom: 1px solid var(--wp--preset--color--brass-dark);
	font-size: 0.9375rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.block-events-calendar__day {
	padding-top: 2px;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1;
}

.block-events-calendar__year {
	margin-top: 2px;
	font-size: 0.625rem;
	letter-spacing: 0.16em;
}

.block-events-calendar__info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
}

.block-events-calendar__tag {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--custom--caps--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps--tracking-label);
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-dark);
}

/* The label, time and host share one line; on a phone it is set smaller so it usually fits */
@media only screen and (max-width: 600px) {
	.block-events-calendar__tag {
		font-size: var(--wp--custom--caps--tiny);
		letter-spacing: var(--wp--custom--caps--tracking-tiny);
	}
}

.block-events-calendar__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--black);
}

/* Three lines at most */
.block-events-calendar__blurb {
	display: -webkit-box;
	overflow: hidden;
	font-size: 1rem;
	line-height: 1.45;
	color: var(--wp--preset--color--black);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}
