/* Hearthgill: what the prospectus needs that a theme of tokens cannot say.
   The print's own furniture comes first; the four outside widgets come last,
   each under its own heading with its lines counted. */

@font-face {
	font-family: "Caprasimo";
	src: url("/yeti/examples/booking/fonts/caprasimo-latin-400.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "Karla";
	src: url("/yeti/examples/booking/fonts/karla-latin.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

/* ---- The sheet ---- */

/* Two inks overprint: where they cross on paper they multiply to a third
   color; on dark stock light inks add up instead. */
:root { --overprint: multiply; }
@media (prefers-color-scheme: dark) {
	:root { --overprint: screen; }
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

h2 { font-size: var(--yeti-text-2xl); line-height: 1.02; text-wrap: balance; }

.aside {
	margin: 0;
	font-size: var(--yeti-text-sm);
	color: var(--yeti-color-text-muted);
}

/* ---- The top strip ---- */

.strip { border-block-end: var(--yeti-border-width) solid var(--yeti-color-text); }
.strip-title {
	margin: 0;
	font-size: var(--yeti-text-sm);
	font-weight: var(--yeti-weight-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.strip .field { font-size: var(--yeti-text-sm); }

/* ---- The front cover ---- */

/* The name is sized from its own column, so it fills the cover at any width. */
.front [data-span="5"] { container-type: inline-size; }
.name {
	margin: 0;
	font-size: clamp(2.75rem, 18.5cqi, 6rem);
	line-height: 0.86;
}
.name > span {
	display: block;
	mix-blend-mode: var(--overprint);
}
.name > span:first-child { color: var(--yeti-color-primary); }
.name > span:last-child {
	margin-block-start: -0.36em;
	margin-inline-start: 0.5em;
}

.facts dt { font-weight: var(--yeti-weight-bold); }

/* A photograph as the duplicator prints it: the halftone file is black dots
   on white; one layer screens the black up to the key ink and one multiplies
   the white down to the paper, so a pixel between the two lands between ink
   and paper. After dark the same two layers print pale on navy. */
.halftone {
	position: relative;
	display: block;
	isolation: isolate;
}
.halftone > img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}
.halftone::before,
.halftone::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.halftone::before {
	background-color: light-dark(var(--yeti-color-text), var(--yeti-color-surface));
	mix-blend-mode: screen;
}
.halftone::after {
	background-color: light-dark(var(--yeti-color-surface), var(--yeti-color-text));
	mix-blend-mode: multiply;
}
/* The cover picture overprints the sheet itself, so the sheet supplies the
   paper in the light and the stock in the dark: that layer becomes a blank. */
.press .halftone::before { background-color: light-dark(var(--yeti-color-text), black); }
.press .halftone::after { background-color: light-dark(white, var(--yeti-color-text)); }

/* The second ink, as a dot tint laid out of register behind the picture.
   The picture overprints it. */
.press { position: relative; }
.press::before {
	content: "";
	position: absolute;
	inset-block-start: calc(-1 * var(--yeti-space-sm));
	inset-inline-start: calc(-1 * var(--yeti-space-sm));
	inline-size: 52%;
	block-size: 46%;
	background-image: radial-gradient(circle, var(--yeti-color-primary) 0 1.9px, transparent 2.3px);
	background-size: 6px 6px;
}
.press > swiper-container {
	position: relative;
	mix-blend-mode: var(--overprint);
}

.press figure { margin: 0; }
.press figcaption {
	padding-block-start: var(--yeti-space-xs);
	font-size: var(--yeti-text-sm);
	line-height: 1.35;
}

/* The price, a round sticker in the key ink, stuck on a little crooked. */
.sticker {
	position: absolute;
	z-index: 2;
	inset-block-start: calc(-1 * var(--yeti-space-md));
	inset-inline-end: calc(-1 * var(--yeti-space-sm));
	display: grid;
	place-content: center;
	inline-size: 9.5rem;
	aspect-ratio: 1;
	margin: 0;
	padding: var(--yeti-space-sm);
	border-radius: 50%;
	background-color: var(--yeti-color-text);
	color: var(--yeti-color-surface);
	font-size: var(--yeti-text-sm);
	font-weight: var(--yeti-weight-strong);
	line-height: 1.1;
	text-align: center;
	rotate: 8deg;
}
.sticker strong {
	display: block;
	font-family: var(--yeti-font-heading);
	font-size: 2.5rem;
	font-weight: 400;
	line-height: 1;
}

/* On a narrow sheet the sticker is smaller and stays inside the margin. */
@media (max-width: 40rem) {
	.sticker {
		inset-inline-end: 0;
		inline-size: 7.25rem;
		font-size: var(--yeti-text-xs);
	}
	.sticker strong { font-size: 1.9rem; }
}

/* The contact strip under the picture. */
#place-thumbs swiper-slide {
	padding-block-end: 4px;
	border-block-end: 4px solid transparent;
	cursor: pointer;
	opacity: 0.6;
}
#place-thumbs .swiper-slide-thumb-active {
	border-block-end-color: var(--yeti-color-primary);
	opacity: 1;
}

/* ---- The week ---- */

.week caption {
	padding-block-end: var(--yeti-space-xs);
	font-family: var(--yeti-font-heading);
	font-size: var(--yeti-text-lg);
	color: var(--yeti-color-text);
	text-align: start;
}
.week th { font-weight: var(--yeti-weight-bold); }
/* The second ink's one mark on this spread: the rule the timetable hangs from. */
.week table { border-block-start: 6px solid var(--yeti-color-primary); }
.week caption { padding-block-start: var(--yeti-space-sm); caption-side: top; }

/* ---- The plates ---- */

.plates figure { margin-inline: 0; }
.plates img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}
.plates a { display: block; cursor: zoom-in; }
.plates figcaption {
	padding-block-start: var(--yeti-space-xs);
	font-size: var(--yeti-text-sm);
	line-height: 1.35;
}

/* ---- The slip ---- */

/* The line you cut along, with the scissors on it. */
.slip {
	position: relative;
	border-block-start: var(--yeti-border-width) dashed var(--yeti-color-text);
	scroll-margin-block-start: var(--yeti-space-md);
}
.slip::before {
	content: "";
	position: absolute;
	inset-block-start: -0.85rem;
	inset-inline-start: max(var(--yeti-space-md), 4vw);
	inline-size: 1.6rem;
	block-size: 1.6rem;
	background-color: var(--yeti-color-text);
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='5' cy='6.5' r='3'/%3E%3Ccircle cx='5' cy='17.5' r='3'/%3E%3Cpath d='M7.6 8 22 17.5M7.6 16 22 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.key s { text-decoration-thickness: 2px; }

/* An error is not a color here. The box is ruled twice as heavy and the
   message is set bold. */
.slip .field:has(> [aria-invalid="true"], > :user-invalid) > :is(input, select) { box-shadow: inset 0 0 0 var(--yeti-border-width) var(--yeti-color-text); }
.slip [data-error] { font-weight: var(--yeti-weight-bold); }

/* A date box has stops inside it, and on its picker button the box is no
   longer :focus. The ring stays on the box for all of them. */
.slip input[type="date"]:focus-within {
	outline: 2px solid var(--yeti-color-focus);
	outline-offset: 2px;
}

/* The three benches: lettered, the chosen one printed solid, the others
   dashed. The radio stays in the page for the keyboard; the letter is its
   face. */
.benches {
	display: grid;
	gap: var(--yeti-space-xs);
	padding: 0;
	border: 0;
}
.benches > legend { padding-inline: 0; font-weight: var(--yeti-weight-strong); }
.benches > .field {
	display: block;
	position: relative;
	margin: 0;
}
.benches input {
	position: absolute;
	inset-block-start: var(--yeti-space-sm);
	inset-inline-start: var(--yeti-space-sm);
	opacity: 0;
}
.benches label {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--yeti-space-sm);
	align-items: start;
	padding: var(--yeti-space-sm);
	border: var(--yeti-border-width) dashed var(--yeti-color-border);
	font-weight: var(--yeti-weight-normal);
	cursor: pointer;
}
.benches label > b {
	display: grid;
	place-content: center;
	inline-size: 1.5em;
	aspect-ratio: 1;
	border: var(--yeti-border-width) solid currentColor;
	border-radius: 50%;
	font-family: var(--yeti-font-heading);
	font-size: var(--yeti-text-xl);
	font-weight: 400;
	line-height: 1;
}
.benches label [data-numeric] { display: block; font-weight: var(--yeti-weight-bold); }
.benches .field:has(:checked) label {
	border-style: solid;
	border-color: var(--yeti-color-text);
	background-color: var(--yeti-color-surface-raised);
}
.benches .field:has(:checked) b {
	background-color: var(--yeti-color-text);
	color: var(--yeti-color-surface-raised);
}
.benches .field:has(:focus-visible) label {
	outline: 2px solid var(--yeti-color-focus);
	outline-offset: 2px;
}

.tally {
	padding-block-start: var(--yeti-space-md);
	border-block-start: var(--yeti-border-width) solid var(--yeti-color-text);
}
.tally output {
	max-inline-size: 52ch;
	font-weight: var(--yeti-weight-strong);
}

/* ---- The colophon ---- */

.colophon {
	border-block-start: var(--yeti-border-width) solid var(--yeti-color-text);
	font-size: var(--yeti-text-sm);
}
.colophon h2 { font-size: var(--yeti-text-lg); }
.colophon p { line-height: 1.5; }

/* ---- Printer's marks: which parts are not Yeti ---- */

.marks { position: relative; }
:root[data-marks] .marks {
	outline: 2px dashed var(--yeti-color-text);
	outline-offset: 6px;
}
:root[data-marks] .marks::after {
	content: attr(data-lib);
	position: absolute;
	z-index: 5;
	inset-block-start: -6px;
	inset-inline-end: var(--yeti-space-sm);
	translate: 0 -50%;
	padding: 0.1em 0.6em;
	background-color: var(--yeti-color-text);
	color: var(--yeti-color-surface);
	font-size: var(--yeti-text-xs);
	font-weight: var(--yeti-weight-bold);
	white-space: nowrap;
}

/* On the cover the sticker has the right-hand corner, so the tag takes the left. */
:root[data-marks] .front .marks::after {
	inset-inline: var(--yeti-space-sm) auto;
}

/* ==== The four widgets, inked from Yeti's tokens ==== */

/* ---- Swiper Element: 1 line, and the page's own controls ----
   Its arrows and dots are not used: the three buttons under the picture are
   Yeti buttons that page.js hands to it. */
swiper-container { --swiper-theme-color: var(--yeti-color-primary); }

/* Until Swiper has started, and when it cannot load, the slides are a plain
   row that scrolls and snaps, and its controls stay away. */
swiper-container:not([data-ready]) {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}
swiper-container:not([data-ready]) > swiper-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
}
#place-thumbs:not([data-ready]),
:root:not([data-slider]) .slider-controls,
:root[data-still] #place-pause { display: none; }

/* ---- Cally: 7 rules, 19 declarations ----
   Its buttons live in shadow DOM, out of Yeti's reach, so they are styled
   through its parts. Never set color on a day button: it would override the
   chosen day's own. The two chosen days print solid in the key ink, like the
   chosen bench; the nights between them take the second ink as a tint. */
calendar-range, calendar-month {
	--color-accent: var(--yeti-color-text);
	--color-text-on-accent: var(--yeti-color-surface-raised);
}
calendar-range::part(button) {
	inline-size: var(--yeti-control-size);
	block-size: var(--yeti-control-size);
	border: var(--yeti-border-width) solid var(--yeti-color-text);
	border-radius: var(--yeti-radius-full);
	background-color: var(--yeti-color-surface-raised);
	color: inherit;
}
calendar-range::part(button):focus-visible,
calendar-month::part(button):focus-visible {
	outline: 2px solid var(--yeti-color-focus);
	outline-offset: 2px;
}
calendar-month::part(heading) { font-family: var(--yeti-font-heading); font-size: var(--yeti-text-lg); font-weight: 400; }
calendar-month::part(button) { font: inherit; border-radius: 0; }
calendar-month::part(range-inner) { background-color: var(--yeti-color-primary-subtle); color: var(--yeti-color-primary-text); }
calendar-month::part(disallowed) { text-decoration: line-through 2px; opacity: 0.6; }

/* The page's own arrangement of it: two months side by side, one when the
   slip is narrow, on the coated paper of a form box. */
calendar-range {
	display: block;
	inline-size: 100%;
	container-type: inline-size;
	padding: var(--yeti-space-md);
	border: var(--yeti-border-width) solid var(--yeti-color-text);
	background-color: var(--yeti-color-surface-raised);
}
calendar-range svg { inline-size: 1.1em; block-size: 1.1em; }
.months {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	gap: var(--yeti-space-lg);
}
@container (width < 36rem) {
	calendar-month[offset] { display: none; }
}
/* Without Cally the two date boxes above do the whole job. */
calendar-range:not(:defined),
:root:not(:has(calendar-range:defined)) .key { display: none; }

/* ---- Choices.js: 19 custom properties and 3 rules ---- */
:root {
	--choices-bg-color: var(--yeti-control-surface);
	--choices-bg-color-dropdown: var(--yeti-color-surface-raised);
	--choices-bg-color-disabled: var(--yeti-color-surface-sunken);
	--choices-keyline-color: var(--yeti-control-border);
	--choices-base-border: var(--yeti-border-width) solid;
	--choices-text-color: var(--yeti-color-text);
	--choices-primary-color: var(--yeti-color-primary);
	--choices-item-color: var(--yeti-on-primary);
	--choices-highlight-color: var(--yeti-color-focus);
	--choices-highlighted-color: var(--yeti-color-primary-soft);
	--choices-border-radius: var(--yeti-control-radius);
	--choices-border-radius-item: var(--yeti-control-radius);
	--choices-font-size-lg: var(--yeti-text-md);
	--choices-font-size-md: var(--yeti-text-md);
	--choices-font-size-sm: var(--yeti-text-sm);
	--choices-input-height: var(--yeti-control-size);
	--choices-inner-padding: 0 var(--yeti-space-sm);
	--choices-inner-one-padding: 0;
	--choices-list-single-padding: 0 var(--yeti-space-md) 0 0;
}
/* Its box is taller than Yeti's control and sits on a bottom margin. */
.choices { margin-block-end: 0; }
.choices__inner { display: flex; align-items: center; box-sizing: border-box; }
/* It draws no focus ring of its own on the closed box. */
.choices:focus-visible { outline: 2px solid var(--yeti-color-focus); outline-offset: 2px; }
/* The page's own touch: each color in the list carries a swatch that
   page.js colors from the option's hue. */
.choices__item[data-value]::before {
	content: "";
	display: inline-block;
	inline-size: 0.8em;
	block-size: 0.8em;
	margin-inline-end: 0.5em;
	border-radius: 50%;
	background-color: var(--swatch, transparent);
	box-shadow: inset 0 0 0 1.5px var(--yeti-color-text);
}

/* ---- PhotoSwipe: 9 lines ----
   It appends its lightbox to body, where Yeti's flow rhythm gives any later
   sibling a top margin. It positions itself, so the margin comes off. Its
   ground and its icons are custom properties: the plate is held up against
   the key ink in the light and the darkest stock after dark. */
.pswp, .pswp__top-bar { margin: 0; }
.pswp {
	--pswp-bg: light-dark(var(--yeti-color-text), var(--yeti-color-surface-sunken));
	--pswp-placeholder-bg: var(--pswp-bg);
	--pswp-icon-color: light-dark(var(--yeti-color-surface), var(--yeti-color-text));
	--pswp-icon-color-secondary: var(--pswp-bg);
}
.pswp__button:focus-visible { outline: 2px solid var(--pswp-icon-color); outline-offset: -4px; }

/* The page's own caption under the enlarged plate, ruled in the second ink. */
.pswp__caption {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	margin: 0;
	padding: var(--yeti-space-sm) var(--yeti-space-md);
	border-block-start: var(--yeti-border-width) solid var(--yeti-color-primary);
	background-color: var(--pswp-bg);
	color: var(--pswp-icon-color);
	font-size: var(--yeti-text-sm);
	text-align: center;
}
