/*
 * Sipoon Wolf theme styles for the schedule page (page-templates/schedule.php).
 *
 * inc/assets.php loads this file only on these pages, after main.css. The tokens are in main.css.
 */

/* Schedule page ----------------------------------------------------- */

.schedule-content {
	padding-top: var(--wolf-section);
}

.schedule-calendar {
	padding: clamp(40px, 5vw, 80px) 0 var(--wolf-section);
}

.schedule-calendar__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 2.4vw, 32px);
}

/* The month bar: the month, the legend, the filter and the calendar feed link. */
.schedule-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding-bottom: 16px;
	border-bottom: 4px solid var(--wolf-ink);
}

.schedule-bar__month {
	display: flex;
	align-items: center;
	gap: 12px;
}

.schedule-bar__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 2px solid var(--wolf-ink);
	border-radius: 50%;
	background: var(--wolf-paper);
	color: var(--wolf-ink);
	transition: background-color 0.15s, color 0.15s;
}

a.schedule-bar__nav:hover {
	background: var(--wolf-ink);
	color: var(--wolf-paper);
}

.schedule-bar__nav[aria-disabled="true"] {
	opacity: 0.3;
}

.schedule-bar__title {
	min-width: 7.4em;
	font-weight: 900;
	font-size: clamp(26px, 3vw, 44px);
	line-height: 1;
	text-align: center;
	text-transform: uppercase;
}

.schedule-bar__title:focus {
	outline: none;
}

.schedule-bar__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

.schedule-legend {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
}

.schedule-legend::before {
	content: "";
	width: 18px;
	height: 18px;
	border-radius: 4px;
	background: var(--wolf-gold);
}

.schedule-legend--away::before {
	background: var(--wolf-paper);
	box-shadow: inset 0 0 0 2px var(--wolf-ink);
}

/* The "Only home games" switch. */
.schedule-switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: var(--wolf-ink);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.schedule-switch__track {
	position: relative;
	flex: none;
	width: 44px;
	height: 26px;
	border-radius: 13px;
	background: var(--wolf-line-strong);
	transition: background-color 0.15s;
}

.schedule-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--wolf-paper);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	transition: left 0.15s var(--wolf-ease);
}

.schedule-switch[aria-checked="true"] .schedule-switch__track {
	background: var(--wolf-ink);
}

.schedule-switch[aria-checked="true"] .schedule-switch__track::after {
	left: 21px;
}

.schedule-switch:hover .schedule-switch__track {
	box-shadow: 0 0 0 2px var(--wolf-ink);
}

.schedule-subscribe {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--wolf-ink);
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.14em;
	text-decoration: none;
	text-transform: uppercase;
}

.schedule-subscribe:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.schedule-chips .chip[aria-current="true"] {
	border-color: var(--wolf-ink);
	background: var(--wolf-ink);
	color: var(--wolf-paper);
}

/* The month table. */
.schedule-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.schedule-table th {
	padding: 12px 14px;
	background: var(--wolf-ink);
	color: var(--wolf-paper);
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.16em;
	text-align: left;
	text-transform: uppercase;
}

.schedule-table__day {
	position: relative;
	height: 150px;
	padding: 10px;
	border: 1px solid var(--wolf-line);
	background: var(--wolf-paper);
	vertical-align: top;
}

.schedule-table__day.is-outside {
	background: var(--wolf-paper-3);
}

.schedule-table__day.has-games:hover,
.schedule-table__day.is-selected {
	background: var(--wolf-gold-tint);
}

.schedule-table__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	margin: -4px 0 2px -4px;
	padding: 0 10px;
	border-radius: 22px;
	color: var(--wolf-ink);
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: 17px;
	text-decoration: none;
}

/* The whole day is the link. */
a.schedule-table__number::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* The focus ring goes around the whole day. */
a.schedule-table__number:focus-visible {
	outline: none;
}

a.schedule-table__number:focus-visible::after {
	outline: 3px solid var(--wolf-ink);
	outline-offset: -3px;
}

.is-outside .schedule-table__number {
	color: var(--wolf-line-strong);
}

.is-past .schedule-table__number {
	color: var(--wolf-muted);
}

.is-selected .schedule-table__number {
	box-shadow: inset 0 0 0 2px var(--wolf-ink);
}

.is-today .schedule-table__number {
	background: var(--wolf-ink);
	color: var(--wolf-paper);
}

.schedule-entry {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin-top: 6px;
	padding: 6px 8px;
	border-radius: var(--wolf-radius);
	background: var(--wolf-gold);
	font-size: 12.5px;
	line-height: 1.25;
}

.schedule-entry--away {
	background: var(--wolf-paper);
	box-shadow: inset 0 0 0 2px var(--wolf-ink);
}

.schedule-entry > span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.schedule-entry__team {
	font-family: var(--wolf-font-display);
	font-weight: 800;
}

.schedule-table__more {
	display: block;
	margin-top: 6px;
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 12.5px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* The list of the games of the month. Only on a small screen. */
.schedule-agenda {
	display: none;
	flex-direction: column;
	gap: 20px;
}

.schedule-agenda__day {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.schedule-agenda__title {
	padding-bottom: 8px;
	border-bottom: 2px solid var(--wolf-ink);
	font-weight: 900;
	font-size: 18px;
	text-transform: uppercase;
}

.schedule-agenda__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.schedule-row {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 12px 14px;
	border-radius: var(--wolf-radius);
	background: var(--wolf-gold);
	color: var(--wolf-ink);
	text-decoration: none;
}

.schedule-row--away {
	background: var(--wolf-paper);
	box-shadow: inset 0 0 0 2px var(--wolf-ink);
}

.schedule-row__time {
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: 18px;
}

.schedule-row__teams {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.schedule-row__team {
	font-weight: 700;
	font-size: 16px;
}

.schedule-row__opponent {
	color: var(--wolf-ink-2);
	font-size: 15px;
}

.schedule-row__kind {
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.schedule-empty {
	color: var(--wolf-ink-2);
	font-size: 17px;
}

/* The games of the selected day on a grey band. */
.schedule-day {
	padding: clamp(48px, 6vw, 96px) 0;
	background: var(--wolf-paper-2);
}

.schedule-day__inner,
.schedule-day__body {
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 2.4vw, 32px);
}

.schedule-day__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 32px;
}

.schedule-day__title {
	font-weight: 900;
	font-size: clamp(28px, 3vw, 44px);
	line-height: 1;
	text-transform: uppercase;
}

.schedule-day__count {
	color: var(--wolf-ink-2);
	font-size: 16px;
}

.schedule-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
	gap: clamp(16px, 2vw, 24px);
}

.schedule-card {
	display: flex;
	flex-direction: column;
	border: 2px solid var(--wolf-ink);
	background: var(--wolf-paper);
}

.schedule-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 2px solid var(--wolf-ink);
	background: var(--wolf-gold);
	font-family: var(--wolf-font-display);
}

.schedule-card--away .schedule-card__head {
	background: var(--wolf-paper-2);
}

.schedule-card__time {
	font-weight: 900;
	font-size: clamp(26px, 2.2vw, 32px);
	line-height: 1;
}

.schedule-card__kind {
	font-weight: 800;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.schedule-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 14px;
	padding: 22px;
}

.schedule-card__title {
	font-weight: 900;
	font-size: 22px;
	line-height: 1.15;
	text-transform: uppercase;
}

.schedule-card__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 8px 20px;
	margin: 0;
	font-size: 16px;
}

.schedule-card__facts dt {
	color: var(--wolf-muted);
}

.schedule-card__facts dd {
	margin: 0;
}

.schedule-card__link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	margin-top: auto;
	border-radius: var(--wolf-radius);
	background: var(--wolf-paper-2);
	color: var(--wolf-ink);
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.15s;
}

.schedule-card__link:hover {
	background: var(--wolf-gold-hover);
}

.schedule-source {
	color: var(--wolf-muted);
	font-size: 15px;
}

.schedule-source a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wolf-ink);
	font-weight: 600;
	text-decoration: none;
}

.schedule-source a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

/* On a small screen, the list of the month replaces the table and the cards. */
@media (max-width: 860px) {

	.schedule-table,
	.schedule-day__body {
		display: none;
	}

	.schedule-agenda {
		display: flex;
	}

	.schedule-day {
		padding: 8px 0;
	}

	.schedule-chips {
		flex-wrap: nowrap;
		margin-inline: calc(-1 * var(--wolf-gutter));
		padding: 2px var(--wolf-gutter);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.schedule-chips::-webkit-scrollbar {
		display: none;
	}

	.schedule-chips > * {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}
