/* ==========================================================
   Arena Times Date & Calendar widget
   The date and its line under it, and the month that opens from
   them. Inherits colour from wherever it sits - a dark header
   or a light one - and every value has a Style control.
   Logical properties throughout, so it mirrors for RTL.
   ========================================================== */

.arena-cal {
	position: relative;
	display: flex;
}

.arena-cal__toggle {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	row-gap: 4px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

div.arena-cal__toggle {
	cursor: default;
}

.arena-cal__line {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.arena-cal__date {
	font-weight: 500;
	transition: color .2s ease;
}

.arena-cal__icon {
	display: inline-flex;
	line-height: 0;
	font-size: .75em;
	transition: transform .2s ease;
}

.arena-cal__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.arena-cal.is-open .arena-cal__icon {
	transform: rotate(180deg);
}

.arena-cal__sub {
	font-size: .8em;
	opacity: .8;
}

/* ── The month ── */
.arena-cal__pop {
	position: absolute;
	inset-block-start: 100%;
	inset-inline-start: 0;
	z-index: 120;
	width: 280px;
	margin-block-start: 10px;
	padding: 14px;
	border-radius: 10px;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
	font-size: 14px;
	box-sizing: border-box;
}

.arena-cal__pop[hidden] {
	display: none;
}

.arena-cal-align-center .arena-cal__pop {
	inset-inline-start: 50%;
	transform: translateX(-50%);
}

[dir="rtl"] .arena-cal-align-center .arena-cal__pop {
	transform: translateX(50%);
}

.arena-cal-align-end .arena-cal__pop {
	inset-inline-start: auto;
	inset-inline-end: 0;
}

.arena-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-block-end: 10px;
}

.arena-cal__month {
	font-weight: 600;
}

.arena-cal__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	cursor: pointer;
}

.arena-cal__nav:is(:hover, :focus-visible):not(:disabled) {
	background: rgba(0, 0, 0, .06);
}

.arena-cal__nav:disabled {
	opacity: .3;
	cursor: default;
}

[dir="rtl"] .arena-cal__nav svg {
	transform: scaleX(-1);
}

.arena-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 2px;
	text-align: center;
	transition: opacity .2s ease;
}

.arena-cal__grid.is-loading {
	opacity: .5;
}

.arena-cal__wd {
	padding-block: 4px;
	font-size: .8em;
	font-weight: 600;
	opacity: .6;
}

.arena-cal__day {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	border-radius: 50%;
	color: inherit;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

/* A day with stories: a link, with a small dot under its number. */
a.arena-cal__day {
	font-weight: 600;
}

a.arena-cal__day::after {
	content: "";
	position: absolute;
	inset-block-end: 4px;
	inset-inline-start: 50%;
	width: 4px;
	height: 4px;
	margin-inline-start: -2px;
	border-radius: 50%;
	background: currentColor;
	opacity: .5;
}

a.arena-cal__day:is(:hover, :focus-visible) {
	background-color: rgba(0, 0, 0, .07);
}

span.arena-cal__day {
	opacity: .35;
}

.arena-cal__day.is-today {
	box-shadow: inset 0 0 0 1px currentColor;
}

.arena-cal__day.is-selected {
	background-color: #1a1a1a;
	color: #fff;
	opacity: 1;
}

.arena-cal__day.is-selected::after {
	opacity: .8;
}

.arena-cal__today {
	display: block;
	margin: 10px auto 0;
	padding: 4px 10px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: .9em;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.arena-cal__icon,
	.arena-cal__day,
	.arena-cal__grid {
		transition: none;
	}
}
