/* The top of a book page */

/*
 * The page is on the page's five tracks (Will, 2026-09-11): the cover across
 * the first two, with the cover itself 5rem in from either edge, and the
 * panel — title, subtitle, byline, the buy panel, the specification — across
 * the third and fourth, with About the Book, the author and the reviews under
 * it on the same two tracks. So the buy panel's right edge is the prose's
 * right edge, and both are a column edge of the related-books row beneath.
 *
 * It was measured off the dev site on 2026-09-04 as a 528px cover column, a
 * 32px gutter and the rest for everything else, the prose at 640px; the
 * tracks put the cover column at 536 and the prose at 537, a few pixels from
 * the reference and on the grid everything else on the site sits on.
 *
 * The article is the grid; the intro component's own wrapper steps out of
 * the way with `display: contents` so its cover and panel are the article's
 * grid items, and the details component that follows it takes the same two
 * tracks.
 */
.saqi-book {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	column-gap: 1.5rem;
	align-items: start;
}

.saqi-book__intro {
	display: contents;
}

.saqi-book__cover {
	grid-column: 1 / span 2;
	padding-inline: 5rem;
}

.saqi-book__panel,
.saqi-book > .saqi-book-details {
	grid-column: 3 / span 2;
}

@media (max-width: 63.9375rem) {
	.saqi-book {
		grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
	}

	.saqi-book__cover {
		grid-column: 1;
		padding-inline: 0;
	}

	.saqi-book__panel,
	.saqi-book > .saqi-book-details {
		grid-column: 2;
	}
}

@media (max-width: 47.9375rem) {
	.saqi-book {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 2rem;
	}

	.saqi-book__cover,
	.saqi-book__panel,
	.saqi-book > .saqi-book-details {
		grid-column: 1;
	}

	/* The cover stops filling the column on a phone turned on its side,
	   where it would be most of the first screen. */
	.saqi-book__cover {
		max-width: 16rem;
	}
}

/* Held upright, it fills the column, gutter to gutter (Will, 2026-09-17). */
@media (max-width: 47.9375rem) and (orientation: portrait) {
	.saqi-book__cover {
		max-width: none;
	}
}

.saqi-book__image {
	display: block;
	width: 100%;
	height: auto;
	/* The dev site's: 1px 1px 15px at 14.5% black, a cover lying on the page. */
	box-shadow: var(--wp--custom--shadow--card);
}

.saqi-book__image--empty {
	box-shadow: none;
}

.saqi-book__image--empty {
	aspect-ratio: 1 / 1.53;
	background: var(--wp--preset--color--rule);
}

.saqi-book__title {
	margin: 0;
}

/* A step up from `lg`, in the mid grey rather than the light: the subtitle
   is part of the name, not a note on it (Will, 2026-09-11). */
.saqi-book__subtitle {
	margin: 0.5rem 0 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xl);
	color: var(--wp--preset--color--mid);
}

.saqi-book__credits {
	margin-top: 1rem;
}

/* The byline: 19.2px Inter at 600 in #444, the dev site's figures. */
.saqi-book__credits .book-header__author {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	color: var(--wp--preset--color--muted);
}

/* The names are links in the site's link grey, darker on the rollover, like
   every link on the book page (Will, 2026-09-15; until then the byline was
   #444 and dimmed to the mid grey). The accent is for the way into the
   basket. */
.saqi-book__credits a {
	color: var(--saqi-link);
	text-decoration: none;
	transition: color var(--saqi-rollover);
}

.saqi-book__credits a:hover,
.saqi-book__credits a:focus-visible {
	color: var(--saqi-link-hover);
}

.saqi-book__credits .book-header__role {
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--muted);
}

.saqi-book__buy {
	margin-top: 2rem;
}

/*
 * The buy panel: WooCommerce's own form — its markup, its field names, its
 * script — in the theme's clothes. Nothing here changes what the form
 * submits; it is the field the checkout uses, the button the footer uses,
 * and the figures measured off the dev site on 2026-09-04: a 45px select
 * on 12px 16px padding, 3px radii, a 42px button on the accent.
 *
 * Until 2026-09-04 this leaned on nothing at all: Breakdance's stylesheet
 * only reached inside its own wrapper, which this template never had.
 */
.saqi-book__buy {
	/* The panel's two tracks, not a cap of its own: its right edge is the
	   prose's right edge below it. */
	font-family: var(--wp--preset--font-family--sans);
}

/* The price: the range on a book with editions, one figure otherwise. */
.saqi-book__buy > .price {
	display: block;
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xl);
}

.saqi-book__buy .price del {
	color: var(--wp--preset--color--light);
}

.saqi-book__buy .price ins {
	text-decoration: none;
}

/* Once an edition is chosen its own price prints below; the range steps
   aside rather than saying two things. */
.saqi-book__buy:has(.woocommerce-variation-price .price) > .price {
	display: none;
}

.saqi-book__buy .woocommerce-variation-price .price {
	display: block;
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xl);
}

/* Woo's variations table is a table for one label and one select. */
.saqi-book__buy table.variations,
.saqi-book__buy table.variations tbody,
.saqi-book__buy table.variations tr,
.saqi-book__buy table.variations th,
.saqi-book__buy table.variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	text-align: start;
}

.saqi-book__buy table.variations {
	margin: 0 0 1rem;
}

.saqi-book__buy table.variations tr + tr {
	margin-block-start: 1rem;
}

.saqi-book__buy table.variations th.label label {
	display: block;
	margin-block-end: 0.4rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
}

.saqi-book__buy table.variations select {
	display: block;
	width: 100%;
	padding: 0.75rem 2.5rem 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 3px;
	background: var(--wp--preset--color--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 0.875rem center / 1rem no-repeat;
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.2;
	color: var(--wp--preset--color--foreground);
	appearance: none;
	cursor: pointer;
}

.saqi-book__buy table.variations select:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent);
}

.saqi-book__buy .reset_variations {
	display: inline-block;
	margin-block-start: 0.4rem;
	font-size: var(--wp--preset--font-size--xs);
	color: var(--saqi-link);
	transition: color var(--saqi-rollover);
}

.saqi-book__buy .reset_variations:hover,
.saqi-book__buy .reset_variations:focus-visible {
	color: var(--saqi-link-hover);
}

.saqi-book__buy .woocommerce-variation-availability,
.saqi-book__buy .stock,
.saqi-book__buy .woocommerce-variation-description {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--muted);
}

.saqi-book__buy .stock.out-of-stock {
	color: var(--wp--preset--color--orange);
}

/* The quantity and the button, one row. */
.saqi-book__buy .woocommerce-variation-add-to-cart,
.saqi-book__buy form.cart:not(.variations_form) {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
}

/* Woo hides the row until an edition is chosen; keep its way of doing so. */
.saqi-book__buy .woocommerce-variation-add-to-cart-disabled {
	opacity: 0.5;
}

/*
 * The quantity: a decrement, the number, an increment, in one 42px-high
 * bordered group as the dev site has it. The two steps are `view.js`'s;
 * without it the number field stands alone and still works.
 */
.saqi-book__buy .quantity {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: stretch;
	margin: 0;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 3px;
	background-color: var(--wp--preset--color--background);
}

.saqi-book__buy .quantity input.qty {
	width: 2.5rem;
	height: 100%;
	min-height: 2.625rem;
	padding: 0.5rem 0.25rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-size: var(--wp--preset--font-size--sm);
	text-align: center;
	color: inherit;
	-moz-appearance: textfield;
	appearance: textfield;
}

.saqi-book__buy .saqi-qty-step {
	width: 1.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: var(--wp--preset--font-size--base);
	line-height: 1;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.saqi-book__buy .saqi-qty-step:hover,
.saqi-book__buy .saqi-qty-step:focus-visible {
	color: var(--wp--preset--color--accent);
}

.saqi-book__buy .quantity input.qty::-webkit-inner-spin-button,
.saqi-book__buy .quantity input.qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.saqi-book__buy .quantity:focus-within {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent);
}

.saqi-book__buy .quantity input.qty:focus-visible {
	outline: none;
}

.saqi-book__buy .single_add_to_cart_button {
	display: inline-flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 2.625rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 3px;
	background-color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--sans);
	/* 14px at 500 in sentence case — the dev site's buy button, which is not
	   the tracked small-caps button the rest of the site uses. The one
	   commerce action on the page follows the spec for that page. */
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1;
	color: var(--wp--preset--color--background);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.saqi-book__buy .single_add_to_cart_button:hover,
.saqi-book__buy .single_add_to_cart_button:focus-visible {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--accent);
}

.saqi-book__buy .single_add_to_cart_button:disabled,
.saqi-book__buy .single_add_to_cart_button.disabled {
	opacity: 0.4;
	cursor: default;
}

/* "Added to your basket": Woo's link back, after the button. */
.saqi-book__buy .added_to_cart {
	display: inline-block;
	margin-block-start: 0.75rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--accent);
}

.saqi-book__buy .saqi-product-card__preorder {
	margin: 0.75rem 0 0;
	font-size: var(--wp--preset--font-size--sm);
}
