/* =============================================================================
   The month calendar, and the booking page it sits on.

   `.pmonth` is the public month, on a teacher's page. It shows open times and
   nothing else.

   `.smonth` is the Studio one, for a teacher looking at their own month. It
   shows everything that is on.

   Both write explicit fallbacks in every var(), because the two live in
   different documents: the front of the site never loads studio.css and the
   Studio never loads the theme's. A token that resolves on one side and to
   nothing on the other is how a calendar ends up with no borders on exactly
   one of them.
   ============================================================================= */

/* ======================================================== the booking page == */

.booking-head{ margin-bottom: 2rem; }
.booking-head .rule-accent{ margin: .9rem 0 1.1rem; }

.booking-app{ margin-top: .5rem; }

/* Each step scrolls itself into view when the one before it is done, and the
   site header is sticky at 73px. Without this the browser puts the step's top
   edge at viewport zero, which is underneath the header, so the heading and
   the first line of the panel are hidden and the step appears to begin at its
   second element. The margin clears the header and leaves a little air. */
.booking-step{ margin-top: 1.75rem; scroll-margin-top: 96px; }

/* These sit under a 64px name, and at 19px they read as captions rather than
   as the headings of the two things the page is for. */
.booking-step__h{
	font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
	line-height: 1.2;
	margin: 0 0 .85rem;
}

/* The panels use the site's own `who` card, so the border, the radius and the
   accent rule along the top are the ones every other panel on the site has.
   They only need their own inner spacing. */
.booking-form,
.booking-done{ padding: 1.75rem 1.75rem 1.9rem; }

/* The panel is a .who card, and peak.css sets `.who p { color: var(--peak-body) }`
   at one class plus one element. A lone class cannot beat that, so the chip
   painted dark grey on the accent red and measured 1.93. The selector carries
   the parent so it outranks the panel rule rather than tying with it. */
.booking-form p.booking-form__chosen{
	display: inline-block;
	background: var(--peak-accent, #53326B);
	color: #fff;
	font-weight: 700;
	border-radius: .4rem;
	padding: .55rem .9rem;
	margin: 0 0 1.35rem;
	font-size: var(--peak-t5, .95rem);
}

.booking-form__known{ margin: .85rem 0 0; }

/* Side by side on anything but a phone, and both full width on one, so the
   action people came for is never a thin target beside a wide one. */
.booking-form__actions{
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin-top: 1.6rem;
}
.booking-form__actions .btn{ flex: 1 1 auto; min-width: 12rem; }

@media (max-width: 480px){
	.booking-form__actions .btn{ flex: 1 1 100%; }
}

.booking-form__error{
	margin: 1.1rem 0 0;
	padding: .8rem 1rem;
	border-radius: .4rem;
	background: #FBE9EA;
	border: 1px solid #F0CDCF;
	color: #8C1015;
	font-weight: 600;
}

.booking-done__tick{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: #1E7A4D;
	color: #fff;
	font-size: 1.85rem;
	font-weight: 700;
	line-height: 1;
	margin: 0 0 1.15rem;
}
.booking-done__h{ margin: 0 0 .75rem; }

/* The time they have just been given is the single fact this screen exists to
   deliver, and it was rendered at the same 14px as the note underneath it.
   The parent selector is there for the same reason as on the chip: `.who p`
   wins a straight fight with a lone class. */
.booking-done p.booking-done__msg{
	font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem);
	font-weight: 600;
	color: var(--peak-ink, #1B1418);
	margin: 0 0 .6rem;
}
.booking-done__note{ margin: 0; }

/* The teacher's own classes, beneath their calendar. */
.booking-classes{ margin-top: 3rem; }
.booking-classes table{ margin-bottom: 0; }
.booking-classes th{
	font-size: .74rem;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--peak-muted, #6C6478);
	font-weight: 700;
	padding: 1.15rem 1.5rem;
}
.booking-classes td{ vertical-align: middle; padding: 1.35rem 1.5rem; }
.booking-classes .cl-name{ font-weight: 700; }
/* "Wednesday 6:00 pm" and "Ages 12 - 15" are single facts, and wrapping them
   over two lines made a table of one-line rows look like a table of ragged
   two-line ones. The class name is the only cell that should ever wrap. */
@media (min-width: 992px){
	.booking-classes td:nth-child(2),
	.booking-classes td:nth-child(3){ white-space: nowrap; }
}

/* Below this the five columns cannot hold their content: the class names wrap
   to three lines, "Ages 12 - 15" wraps to three more, and the Register button
   is pushed off the right of the screen inside the responsive wrapper, which
   means the one action on the row can only be reached by scrolling sideways
   in a table nobody realises scrolls. So each row becomes a card, with the
   column headings carried down as labels on the cells.

   At tablet width, not phone width. A 768px table looked survivable until a
   teacher with twenty-five classes loaded: "Intermediate Tap Technique & Teen
   Large Group Choreo" in a 120px column is five lines, and the whole table
   turns into a wall of ragged four-line rows. */
@media (max-width: 991.98px){
	.booking-classes .table-responsive{ overflow: visible; }
	.booking-classes thead{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.booking-classes table,
	.booking-classes tbody,
	.booking-classes tr,
	.booking-classes td{ display: block; width: auto; }

	.booking-classes tr{
		border: 1px solid var(--peak-line, #E6E1E4);
		border-radius: .6rem;
		padding: 1.15rem 1.2rem;
		margin-bottom: .9rem;
		background: #fff;
	}
	.booking-classes tr:last-child{ margin-bottom: 0; }

	.booking-classes td{
		border: 0;
		padding: 0 0 .5rem;
		text-align: left !important;
	}

	/* The label and the value on one line, so a card is four short rows
	   rather than eight alternating ones. */
	.booking-classes td[data-label]{
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 1rem;
	}
	.booking-classes td[data-label]::before{
		content: attr(data-label);
		flex: none;
		font-size: .74rem;
		letter-spacing: .09em;
		text-transform: uppercase;
		font-weight: 700;
		color: var(--peak-muted, #6C6478);
	}

	/* The class name is the card's heading, so it keeps the whole width. */
	.booking-classes td.cl-name{
		display: block;
		font-size: 1.1rem;
		padding-bottom: .75rem;
	}
	.booking-classes td.cl-name::before{ content: none; }

	.booking-classes td.cl-do{ padding: .9rem 0 0; }
	.booking-classes td.cl-do .btn{ width: 100%; }
}

/* ========================================================= the public month == */

.pmonth{
	--pm-line: var(--peak-line, #E4DCEC);
	--pm-ink: var(--peak-ink, #1B1418);
	--pm-soft: var(--peak-muted, #6C6478);
	--pm-accent: var(--peak-accent, #53326B);
	--pm-accent-dark: var(--peak-accent-dark, #3B2350);
	--pm-tint: var(--peak-accent-tint, #F6F1FA);
	--pm-panel: #fff;
	--pm-past: #FAF9FA;
	border: 1px solid var(--pm-line);
	border-radius: .9rem;
	background: var(--pm-panel);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(23,18,26,.05), 0 12px 32px -18px rgba(23,18,26,.28);
}

/* The bar carries the accent, so the calendar reads as a piece of this site
   rather than as a widget that landed on it. */
.pmonth__bar{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.5rem 1.85rem;
	background: var(--pm-accent);
	color: #fff;
}
.pmonth__label{
	font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem);
	font-weight: 800;
	letter-spacing: -.01em;
	text-align: center;
	flex: 1 1 auto;
}
.pmonth__nav{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(255,255,255,.45);
	border-radius: .5rem;
	background: rgba(255,255,255,.12);
	text-decoration: none;
	color: #fff;
	font-size: 1.25rem;
	flex: none;
}
.pmonth__nav:hover{ background: #fff; color: var(--pm-accent); border-color: #fff; }
.pmonth__nav:focus-visible{ outline: 3px solid #fff; outline-offset: 2px; }

/* max-width: none because the theme sets p{max-width:66ch} as a reading
   measure, which is right for prose and wrong for a tinted strip: the band
   stopped 574px into a 924px calendar and read as a stray highlight rather
   than as a row of the thing. */
.pmonth__count{
	max-width: none;
	color: var(--pm-ink);
	font-size: .95rem;
	font-weight: 600;
	margin: 0;
	padding: 1.15rem 1.85rem;
	background: var(--pm-tint);
	border-bottom: 1px solid var(--pm-line);
}

/* The hairlines are the grid's own background showing through a 1px gap, so
   every cell is bounded on all four sides without doubling up borders. */
.pmonth__grid{
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1px;
	background: var(--pm-line);
	padding: 1px;
}

.pmonth__wd{
	font-size: .8rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	font-weight: 800;
	color: var(--pm-ink);
	text-align: center;
	padding: 1.1rem .3rem;
	background: var(--peak-bg-soft, #F6F4F8);
}

/* Much taller than it was. A day holding four half-hour slots needs the room
   to show all four rather than four cramped lines, and a month only as tall as
   its text reads as a table rather than as a calendar. */
/* A grid row is as tall as its tallest cell, so the floor is set on the days
   that hold something and the rest are left to be as short as they need to be.
   A week with nothing free then takes one short band instead of the full 168,
   and September stops spending three hundred pixels on weeks that have already
   been and gone. */
.pmonth__day{
	background: var(--pm-panel);
	min-height: 92px;
	padding: 1rem .9rem;
	display: flex;
	flex-direction: column;
	gap: .4rem;
}
.pmonth__day.has-open{ min-height: 196px; }

/* The days that belong to the months either side, and the ones already gone.
   Both are context rather than content: knocking them back is what lets the
   handful of bookable days carry the page. */
.pmonth__day.is-outside{ background: var(--pm-past); }
.pmonth__day.is-outside .pmonth__n{ opacity: .5; }

/* A day with something free is tinted and carries the accent down its edge, so
   the eye finds the bookable days without reading a word. */
.pmonth__day.has-open{
	background: var(--pm-tint);
	box-shadow: inset 4px 0 0 var(--pm-accent);
}

.pmonth__day.is-today{ box-shadow: inset 0 0 0 2px var(--pm-accent); }
.pmonth__day.has-open.is-today{ box-shadow: inset 0 0 0 2px var(--pm-accent), inset 4px 0 0 var(--pm-accent); }

.pmonth__wdname{ display: none; }

.pmonth__n{
	font-size: .95rem;
	color: var(--pm-soft);
	font-variant-numeric: tabular-nums;
	padding-left: .15rem;
}

/* The number on a bookable day is a filled counter, not just bolder text. It
   is the one mark that tells you at a glance which five days of the month you
   can actually do something with. */
.pmonth__day.has-open .pmonth__n{
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.85rem;
	height: 1.85rem;
	padding: 0 .35rem;
	border-radius: 999px;
	background: var(--pm-accent);
	color: #fff;
	font-weight: 800;
}

.pmonth__slots{ display: flex; flex-direction: column; gap: .4rem; }

.pmonth__slot{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border: 1px solid var(--pm-accent);
	background: #fff;
	color: var(--pm-accent);
	border-radius: .45rem;
	padding: .55rem .4rem;
	font: inherit;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.15;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	min-height: 50px;
	transition: background-color .12s ease, color .12s ease;
}
.pmonth__slot:hover{ background: var(--pm-accent); color: #fff; }
.pmonth__slot:focus-visible{ outline: 3px solid var(--pm-accent); outline-offset: 2px; }
.pmonth__slot.is-picked{ background: var(--pm-accent-dark); border-color: var(--pm-accent-dark); color: #fff; }

/* Seven columns of 44px tap targets do not fit on a phone, so below that the
   month becomes a list of the days that actually have something free. The
   empty days carry nothing a parent needs, so they go rather than being
   squeezed into an unreadable column. */
@media (max-width: 640px){
	.pmonth__grid{ display: block; background: transparent; padding: .9rem; gap: 0; }
	.pmonth__wd{ display: none; }
	.pmonth__day{ display: none; }
	.pmonth__day.has-open{
		display: block;
		min-height: 0;
		margin-bottom: .85rem;
		padding: 1rem 1.05rem 1.05rem;
		border: 1px solid var(--pm-line);
		border-left: 4px solid var(--pm-accent);
		border-radius: .6rem;
		background: #fff;
	}
	.pmonth__day.has-open:last-child{ margin-bottom: 0; }

	/* On the phone the date is a heading for the card, so it goes back to
	   being words. The counter pill works in a grid cell, where it is the
	   only thing in the corner, and looks like a stray badge on a full
	   width card with the weekday beside it. */
	.pmonth__day.has-open .pmonth__n{
		display: flex;
		align-items: baseline;
		gap: .5rem;
		min-width: 0;
		height: auto;
		padding: 0;
		border-radius: 0;
		background: none;
		color: var(--pm-ink);
		font-size: 1.2rem;
		margin-bottom: .75rem;
	}
	.pmonth__wdname{
		display: block;
		font-size: .78rem;
		font-weight: 700;
		color: var(--pm-accent);
		text-transform: uppercase;
		letter-spacing: .08em;
	}
	.pmonth__slots{ flex-direction: row; flex-wrap: wrap; gap: .55rem; }
	.pmonth__slot{ width: auto; flex: 1 1 8rem; min-width: 7rem; padding: .8rem 1rem; font-size: 1rem; min-height: 50px; }
}

/* ========================================================= the Studio month == */

.smonth{ margin-top: 4px; }

.smonth__grid{
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.smonth__wd{
	font-size: 10.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-4, #9A93A3);
	font-weight: 700;
	text-align: center;
	padding-bottom: 4px;
}

.smonth__day{
	border: 1px solid var(--line, #E4DCEC);
	border-radius: 6px;
	background: var(--panel, #fff);
	min-height: 96px;
	padding: 5px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	overflow: hidden;
}
.smonth__day.is-outside{ opacity: .45; background: transparent; }
.smonth__day.is-today{ border-color: var(--plum, #53326B); box-shadow: inset 0 0 0 1px var(--plum, #53326B); }

.smonth__n{
	font-size: 11px;
	font-weight: 700;
	color: var(--ink-3, #736B7C);
	font-variant-numeric: tabular-nums;
}

.smonth__ev{
	display: block;
	font-size: 10.5px;
	line-height: 1.25;
	padding: 3px 5px;
	border-radius: 4px;
	background: var(--plum-wash, #F2ECF7);
	color: var(--ink, #1B1418);
	border-left: 3px solid var(--plum-fill, #633F7E);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.smonth__ev b{ font-family: var(--num, ui-monospace, monospace); font-weight: 700; margin-right: 4px; }

/* A one to one and a class read differently at a glance, the same way they do
   on the week board. */
.smonth__ev.is-one,
.smonth__ev.is-booking{
	background: var(--good-wash, #E4F2EA);
	border-left-color: var(--good, #1E7A4D);
}

.smonth__free{ font-size: 10.5px; color: var(--ink-4, #9A93A3); }

@media (max-width: 900px){
	.smonth__grid{ display: block; }
	.smonth__wd{ display: none; }
	.smonth__day{ min-height: 0; margin-bottom: 6px; }
	.smonth__day.is-outside{ display: none; }
	.smonth__ev{ white-space: normal; }
}

/* The month takes the whole row inside the Studio.

   It lives in .editorwrap, the two pane frame the week board shares with the
   class editor. That split is right for the board, where you pick a class on
   the left and edit it on the right. It is wrong for a month: seven columns
   inside 62 per cent of the width gave each day about 90px, and every class in
   the studio rendered as "Peak ..." with the part that identifies it cut off. */
.editorwrap:has(#calMonth:not([hidden])){
	grid-template-columns: 1fr;
}

.editorwrap:has(#calMonth:not([hidden])) .smonth__ev{
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* The teacher's photograph beside their name. Square, so a portrait and a
   landscape crop the same way rather than the header height changing with
   whichever picture happens to be on the record. */
.booking-head__photo{
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px var(--peak-line, #E4DCEC);
	display: block;
}

@media (max-width: 575.98px){
	.booking-head__photo{ width: 64px; height: 64px; }
}
