/**
 * The book's own page.
 *
 * The page is Elementor's, and most of what is here belongs to the four things
 * this plugin draws on it that Elementor has no opinion about: the trail, the
 * byline, the two buy buttons, and the bundle.
 */

/* ------------------------------------------------------------- the jacket */

/*
 * A book is about seven inches wide, and a column half the page across is not
 * a book, it is a poster. The cover is held to a sensible measure and pinned to
 * the top of the column so the facts beside it start on the same line.
 */
.diwan-book__jacket .woocommerce-product-gallery {
	margin-inline: 0;
	max-inline-size: 360px;
}

/*
 * The whole cover on the first screen, under the offer bar, the header and
 * the offers strip, with the main logo still showing (Diwan, October 2026):
 * never taller than the screen leaves for it, and never over 440 pixels.
 * Fitted rather than cropped, from the cover's leading edge.
 */
.diwan-book__jacket .woocommerce-product-gallery__image img {
	display: block;
	inline-size: 100%;
	/* Never under 220 pixels: on a phone held sideways, or a short window,
	   the screen's height left the cover a strip (OCR review, 3.7.7). */
	max-block-size: max(220px, min(440px, calc(100svh - 330px)));
	min-block-size: 0;
	object-fit: var(--diwan-fit-book, contain);
	object-position: top left;
}

[dir="rtl"] .diwan-book__jacket .woocommerce-product-gallery__image img {
	object-position: top right;
}

@media (max-width: 767px) {
	.diwan-book__jacket .woocommerce-product-gallery__image img {
		max-block-size: max(220px, min(380px, calc(100svh - 240px)));
		object-position: top center;
	}
}

/* -------------------------------------------------------------- the trail */

.diwan-crumbs {
	color: var(--diwan-text-muted, #6e6e6e);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 6px;
	margin-block-end: 10px;
}

.diwan-crumbs__step {
	color: inherit;
	text-decoration: none;
}

.diwan-crumbs__step:hover,
.diwan-crumbs__step:focus-visible {
	color: var(--diwan-text, #000000);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------- the byline */

.diwan-byline {
	display: flex;
	flex-wrap: wrap;
	font-size: 15px;
	gap: 8px;
	margin: 0 0 6px;
}

.diwan-byline__author {
	color: var(--diwan-blue, #246b8f);
	text-decoration: none;
}

.diwan-byline__author:hover,
.diwan-byline__author:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.diwan-byline__sep {
	color: var(--diwan-border-strong, #d5d5d5);
}

.diwan-byline__translator {
	color: var(--diwan-text-muted, #6e6e6e);
}

/* --------------------------------------------------------- the name and stars */

.diwan-book__head > .elementor-container {
	align-items: baseline;
}

/* The colours are stated rather than inherited. Elementor's kit hands every
   widget a global colour, and these three arrive with it: a title in the
   kit's primary, a price and a stock line in its accent. The kit itself is set
   to the brand elsewhere; this is the page saying what it means regardless. */
.diwan-book__title h1,
.diwan-book__title h2,
.diwan-book__title .product_title {
	color: var(--diwan-text, #000000);
	font-size: 30px;
	line-height: 1.25;
	margin: 0;
}

.diwan-book__rating {
	display: flex;
	justify-content: flex-end;
}

/*
 * WooCommerce paints its own price and stock line green, from a selector with a
 * class, an element and a :where() in it — so ours says the element as well,
 * which puts it one step ahead of theirs rather than one behind.
 */
.elementor-element.diwan-book__price p.price,
.elementor-element.diwan-book__price p.price .woocommerce-Price-amount,
.elementor-element.diwan-book__price p.price ins {
	color: var(--diwan-text, #000000);
	font-size: 24px;
	font-weight: 600;
	margin-block: 14px 0;
	text-decoration: none;
}

.elementor-element.diwan-book__price p.price del,
.elementor-element.diwan-book__price p.price del .woocommerce-Price-amount {
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 18px;
	font-weight: 400;
	/* WooCommerce fades the old price to 0.7 on top of its colour, which took
	   #6e6e6e (5.1 to 1 on white) down to #9a9a9a (2.8 to 1): readable no
	   longer. The muted colour is the softening; the line through says the rest. */
	opacity: 1 !important; /* WooCommerce's own rule is one element stronger */
}

.diwan-book__stock {
	margin-block-start: 6px;
}

.elementor-element.diwan-book__stock p.stock {
	color: var(--diwan-text-soft, #444444);
	font-size: 14px;
	margin: 0;
}

.elementor-element.diwan-book__stock p.out-of-stock {
	color: var(--diwan-danger, #c0392b);
}

/* Pre-order and Coming soon (6 October 2026): what can be done about the book,
   in the palette's green and blue, on the same line as the stock. */
.elementor-element.diwan-book__stock p.diwan-preorder {
	color: var(--diwan-success, #1f7a3d);
	font-weight: 600;
}

.elementor-element.diwan-book__stock p.diwan-coming-soon {
	color: var(--diwan-heading, #246b8f);
	font-weight: 600;
}

/* --------------------------------------------------------- the two buttons */

/*
 * One filled, one outlined, and the filled one first. They do nearly the same
 * thing, and the difference between them is a decision the reader has already
 * made: "I am still shopping" or "I am done".
 */
.diwan-buy {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	/* Half what it was (Ahmad, 25 October 2026): the buttons close under
	   the line about the stock. */
	margin-block-start: 10px;
}

/*
 * The size of Waterstones' (the client's review of 1 October 2026): about
 * 172 x 40, side by side, not stretched across the column. On a phone they
 * take the width again, where a thumb needs the room.
 */
.diwan-buy__cart,
.diwan-buy__now {
	border: 1px solid var(--diwan-black, #000000);
	cursor: pointer;
	flex: 0 0 auto;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.3;
	min-width: 172px;
	padding: 9px 24px;
	text-align: center;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.diwan-buy__cart {
	background-color: var(--diwan-wood, #3b0f00);
	border-color: var(--diwan-wood, #3b0f00);
	color: var(--diwan-white, #ffffff);
}

.diwan-buy__cart:hover,
.diwan-buy__cart:focus-visible {
	background-color: var(--diwan-black, #000000);
	border-color: var(--diwan-black, #000000);
	color: var(--diwan-white, #ffffff);
}

.diwan-buy__now {
	background-color: var(--diwan-white, #ffffff);
	color: var(--diwan-black, #000000);
}

.diwan-buy__now:hover,
.diwan-buy__now:focus-visible {
	background-color: var(--diwan-black, #000000);
	color: var(--diwan-white, #ffffff);
}

@media (max-width: 480px) {
	.diwan-buy__cart,
	.diwan-buy__now {
		flex: 1 1 140px;
	}
}

/* The currency the size of the price it belongs to, everywhere (the theme
   draws it smaller). */
.woocommerce-Price-amount .woocommerce-Price-currencySymbol {
	font-size: inherit;
}

.diwan-buy__gone {
	color: var(--diwan-danger, #c0392b);
	font-weight: 600;
	margin-block-start: 20px;
}

.diwan-buy__quantity {
	flex: 0 0 auto;
}

/* The heart that speaks is a line of type, not the round glass control that
   sits on a cover: no pane, no border, no fixed square, and the brand's ink
   rather than the cream that reads on a jacket. */
.diwan-book__wish .diwan-wish--words,
.diwan-wish--words {
	backdrop-filter: none;
	background: none;
	block-size: auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--diwan-text, #000000);
	display: inline-flex;
	gap: 8px;
	inline-size: fit-content;
	justify-content: flex-start;
	margin-block-start: 16px;
	padding: 0;
}

.diwan-wish--words:hover,
.diwan-wish--words:focus-visible {
	color: var(--diwan-blue, #246b8f);
}

.diwan-wish--words.is-on {
	color: var(--diwan-wood, #3b0f00);
}

.diwan-wish__words {
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------- the details */

/* The lines between the rows run the whole width of the tab, as the tab's own
   rule does; only the words keep to their two columns. */
.diwan-details {
	display: grid;
	gap: 0;
	margin: 0;
	inline-size: 100%;
}

.diwan-details__row {
	border-block-end: 1px solid var(--diwan-border-soft, #f0f0f0);
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	padding-block: 10px;
}

.diwan-details__label {
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 13px;
	margin: 0;
}

.diwan-details__value {
	font-size: 14px;
	margin: 0;
}

.diwan-details__value a {
	color: var(--diwan-blue, #246b8f);
	text-decoration: none;
}

.diwan-details__value a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 767px) {
	.diwan-details__row {
		gap: 2px;
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ----------------------------------------------------------------- the bio */

.diwan-bio {
	display: flex;
	gap: 22px;
}

.diwan-bio__photo {
	block-size: 110px;
	border-radius: 50%;
	flex: 0 0 auto;
	inline-size: 110px;
	overflow: hidden;
	position: relative;
}

.diwan-bio__photo img {
	block-size: 100%;
	inline-size: 100%;
	object-fit: cover;
}

.diwan-bio__initials {
	align-items: center;
	background: var(--diwan-surface-sunken, #f4f3f1);
	block-size: 100%;
	display: flex;
	font-size: 30px;
	inline-size: 100%;
	justify-content: center;
}

.diwan-bio__name {
	font-size: 18px;
	margin: 0 0 8px;
}

.diwan-bio__name a {
	color: inherit;
	text-decoration: none;
}

.diwan-bio__name a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.diwan-bio__body p {
	margin: 0 0 10px;
}

.diwan-bio__more {
	color: var(--diwan-blue, #246b8f);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.diwan-bio__more:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 600px) {
	.diwan-bio {
		flex-direction: column;
		gap: 14px;
	}
}

/* -------------------------------------------------------------- the bundle */

.diwan-bundle__title {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.04em;
	margin: 0 0 14px;
	text-transform: uppercase;
}

/* Inset from both edges of the band (Diwan, October 2026: more room right
   and left of Frequently Bought Together). */
.diwan-bundle__form {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	justify-content: space-between;
	margin: 0;
	padding-inline: clamp(0px, 4vw, 64px);
}

.diwan-bundle__books {
	align-items: flex-start;
	display: flex;
	gap: 14px;
}

/* The books at the shop's size (Diwan, 16 October 2026: at 84 pixels they
   were too small to read): a shop card's cover is about 150 wide on a
   computer and 170 on a tablet. */
.diwan-bundle__book {
	display: flex;
	flex-direction: column;
	gap: 6px;
	inline-size: 150px;
}

@media (min-width: 768px) and (max-width: 1024px) {
	.diwan-bundle__book {
		inline-size: 140px;
	}
}

.diwan-bundle__cover {
	display: block;
}

/* The box is two by three whatever the jacket is, and the jacket is fitted
   inside it rather than cropped to fill it: the same rule as every other cover
   on the site, so three books in a row line up. */
.diwan-bundle__cover {
	aspect-ratio: var(--diwan-book-ratio, 2 / 3);
	background: var(--diwan-surface, #ffffff);
	border: 1px solid var(--diwan-border, #e6e6e6);
	display: block;
	overflow: hidden;
	position: relative;
}

/* Held at the frame's edges, so a taller cover fits inside the frame rather
   than stretching it past the two beside it. */
.diwan-bundle__cover img {
	block-size: 100%;
	display: block;
	inline-size: 100%;
	inset: 0;
	max-inline-size: none;
	object-fit: var(--diwan-fit-book, contain);
	position: absolute;
}

/* A book the reader has unticked is still in the row, greyed: taking it out
   would move the two beside it and lose the reader's place. */
.diwan-bundle__book:has(input:not(:checked)) .diwan-bundle__cover {
	opacity: 0.45;
}

.diwan-bundle__tick {
	align-items: center;
	cursor: pointer;
	display: flex;
	font-size: 12px;
	gap: 6px;
}

.diwan-bundle__plus {
	align-self: center;
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 20px;
}

.diwan-bundle__label {
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 12px;
	letter-spacing: 0.06em;
	margin: 0 0 4px;
	text-transform: uppercase;
}

.diwan-bundle__total {
	font-size: 28px;
	font-weight: 600;
	margin: 0 0 16px;
}

.diwan-bundle__total .woocommerce-Price-amount {
	font-size: inherit;
}

/* The bundle's discount (Store settings → Bought together): the saving
   said under the title, the price before it struck through over the total. */
.diwan-bundle__save {
	color: var(--diwan-wood, #3b0f00);
	font-size: 14px;
	font-weight: 600;
	margin: -6px 0 14px;
}

.diwan-bundle__was {
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 15px;
	margin: 0 0 2px;
}

.diwan-bundle__was[hidden] {
	display: none;
}

.diwan-bundle__go {
	background-color: var(--diwan-black, #000000);
	border: 1px solid var(--diwan-black, #000000);
	color: var(--diwan-white, #ffffff);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	padding: 14px 26px;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.diwan-bundle__go:hover,
.diwan-bundle__go:focus-visible {
	background-color: var(--diwan-blue, #246b8f);
	border-color: var(--diwan-blue, #246b8f);
	color: var(--diwan-white, #ffffff);
}

/* Nothing ticked is not a bundle, so the button says so by being unavailable
   rather than by taking the reader to an empty basket. */
.diwan-bundle__go[disabled] {
	background-color: var(--diwan-border-strong, #d5d5d5);
	border-color: var(--diwan-border-strong, #d5d5d5);
	cursor: not-allowed;
}

@media (max-width: 767px) {
	.diwan-bundle__form {
		gap: 24px;
	}

	.diwan-bundle__books {
		flex-wrap: wrap;
		inline-size: 100%;
	}

	/* Two to a line, as the shop's cards stand on a phone (the row is the
	   band's width, so the half is the screen's half). */
	.diwan-bundle__book {
		inline-size: min(150px, calc(50% - 22px));
	}
}

/* ------------------------------------------------------------- the reviews */

.diwan-reviews {
	max-inline-size: 760px;
}

.diwan-reviews__note {
	color: var(--diwan-text-muted, #6e6e6e);
}

.diwan-reviews .comment-reply-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	margin-block: 18px 8px;
}

.diwan-reviews .commentlist {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.diwan-reviews .comment_container {
	border-block-end: 1px solid var(--diwan-border-soft, #f0f0f0);
	display: flex;
	gap: 14px;
	padding-block: 14px;
}

/* ------------------------------------------------------------ the last row */

.diwan-book__collection .e-n-tabs-heading {
	justify-content: flex-end;
}

.diwan-book__run {
	margin-block-start: 6px;
}

/*
 * Frequently Bought Together and Complete the Collection on one laptop screen
 * together (Diwan, October 2026). The tabs go up into the heading's own row,
 * at its far end, rather than a row of their own under it; the cards start
 * close under them; and the covers in the run stand a little shorter than on
 * the home page.
 */
.elementor-widget:has(+ .diwan-book__collection) {
	--kit-widget-spacing: 0px;
	margin-block-end: 0;
}

@media (min-width: 768px) {
	.diwan-book__collection .e-n-tabs-heading {
		margin-block-start: -34px;
	}
}

.diwan-book__collection .e-n-tabs-content > .e-con {
	padding-block-start: 8px;
}

/* Since 15 October 2026 (Diwan) the cards take their columns, as on the home
   page: held to 164, and smaller again on a short laptop so the row shared
   one screen with Frequently Bought Together, they stood far apart. Since 16
   October the bundle's books are the shop's size, so the two bands no longer
   share a laptop's screen and neither cover is cut down to make them. */

/* --------------------------------------- the page of something else entirely */

/*
 * The same square as the cards, for the same reason: the photograph of a
 * notebook has no fixed proportions, and a page built around a jacket leaves it
 * either enormous or lost. The frame is the site's, the picture is whatever
 * shape it is, and it is centred inside.
 *
 * WooCommerce states the gallery's own sizes through the product wrapper and
 * the gallery inside it — four classes and three elements deep — so each of
 * these repeats that path with the page's own mark in front of it. Anything
 * shorter is outranked and the picture goes back to filling the frame.
 *
 * Both Elementor and the product overview block carry the product class.
 */
body.diwan-not-book :is(div, section).product div.images .woocommerce-product-gallery {
	max-inline-size: 420px;
}

body.diwan-not-book :is(div, section).product div.images .woocommerce-product-gallery__image {
	align-items: center;
	aspect-ratio: var(--diwan-thing-ratio, 1 / 1);
	background: var(--diwan-surface-alt, #fafaf8);
	border: 1px solid var(--diwan-border, #e6e6e6);
	border-radius: var(--diwan-radius, 8px);
	display: flex;
	justify-content: center;
	overflow: hidden;
}

/* The link to the full-size file is what the picture measures its height
   against, so it has to fill the frame before the picture can. */
body.diwan-not-book :is(div, section).product div.images .woocommerce-product-gallery__image > a {
	align-items: center;
	block-size: 100%;
	display: flex;
	inline-size: 100%;
	justify-content: center;
}

body.diwan-not-book :is(div, section).product div.images .woocommerce-product-gallery__image img {
	block-size: 100%;
	inline-size: 100%;
	object-fit: var(--diwan-fit-thing, contain);
	padding: 18px;
}

/* The thumbnails under it follow the same square. */
body.diwan-not-book :is(div, section).product div.images .flex-control-thumbs li img {
	aspect-ratio: var(--diwan-thing-ratio, 1 / 1);
	object-fit: var(--diwan-fit-thing, contain);
}

/* ------------------------------------------------- tell me when it is back */

.diwan-alert {
	margin-block-start: 14px;
	max-inline-size: 460px;
}

.diwan-alert__lead {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 8px;
}

.diwan-alert__row {
	display: flex;
	gap: 8px;
}

.diwan-alert__row[hidden] {
	display: none;
}

.diwan-alert__email {
	border: 1px solid var(--diwan-border, #e6e6e6);
	border-radius: 0;
	flex: 1 1 auto;
	font: inherit;
	min-inline-size: 0;
	padding: 12px 14px;
}

.diwan-alert__send {
	background: var(--diwan-black, #000);
	border: 0;
	border-radius: 0;
	color: var(--diwan-white, #fff);
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 12px 22px;
	text-transform: uppercase;
}

.diwan-alert__send:hover,
.diwan-alert__send:focus-visible {
	background: var(--diwan-papyrus, #e0b070);
	color: var(--diwan-wood, #3b0f00);
}

.diwan-alert__error {
	color: var(--diwan-danger, #c0392b);
	font-size: 13px;
	margin: 8px 0 0;
}

.diwan-alert__thanks,
.diwan-alert__done {
	background: var(--diwan-grey-50, #fafafa);
	border-inline-start: 3px solid var(--diwan-papyrus, #e0b070);
	font-size: 14px;
	margin: 0;
	padding: 12px 14px;
}

.diwan-alert__trap {
	block-size: 1px;
	inline-size: 1px;
	inset-inline-start: -9999px;
	opacity: 0;
	position: absolute;
}

/* ----------------------------------------------------------------- share */

.diwan-share {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-block-start: 18px;
}

.diwan-share__word {
	color: var(--diwan-text-muted, #6e6e6e);
	font-size: 13px;
	margin-inline-end: 4px;
}

/* The footer's marks (Diwan, October 2026): the network's own solid shape
   in a square to press, no circle round it; Papyrus under the pointer, as the
   footer's turn. */
.diwan-share__link {
	align-items: center;
	background: none;
	border: 0;
	border-radius: var(--diwan-radius-sm, 4px);
	block-size: 32px;
	color: var(--diwan-text, #000);
	cursor: pointer;
	display: inline-flex;
	inline-size: 32px;
	justify-content: center;
	padding: 0;
	position: relative;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.diwan-share__link svg {
	block-size: 18px;
	inline-size: 18px;
}

.diwan-share__link:hover,
.diwan-share__link:focus-visible,
.diwan-share__link.is-copied {
	background: var(--diwan-papyrus, #e0b070);
	color: var(--diwan-wood, #3b0f00);
}

/* "Link copied", for a moment, beside the button that did it. */
.diwan-share__copied:empty {
	display: none;
}

.diwan-share__copied {
	background: var(--diwan-black, #000);
	color: var(--diwan-white, #fff);
	font-size: 12px;
	inset-block-end: calc(100% + 8px);
	inset-inline-start: 50%;
	padding: 5px 9px;
	position: absolute;
	transform: translateX(-50%);
	white-space: nowrap;
}

[dir="rtl"] .diwan-share__copied {
	transform: translateX(50%);
}

/* ------------------------------------------------- the description's words */

/* Each paragraph, list and heading of a description reads in its own
   direction (dir="auto", Product_Page::own_directions; Ahmad, 22 October
   2026), and lines up with it: an Arabic paragraph on the English page starts
   at the right, its list's bullets on the right too. */
.elementor-widget-woocommerce-product-content [dir="auto"],
.elementor-widget-woocommerce-product-short-description [dir="auto"],
.woocommerce-product-details__short-description [dir="auto"] {
	text-align: start;
}

/*
 * Add to Cart and Buy Now on a laptop's first screen (Diwan, October 2026).
 * The column of facts stood each line 20 pixels from the next, Elementor's
 * gap between any two widgets; closer together, the buttons come up by some
 * 44 pixels. The two lines over the title on computers only: a tablet or
 * phone reads the column under the cover, where they keep their room.
 */
@media (min-width: 1025px) {
	.diwan-book__facts .elementor-widget-diwan-book-breadcrumb.elementor-widget {
		--kit-widget-spacing: 8px;
		margin-block-end: 8px;
	}

	.diwan-book__facts .elementor-widget-diwan-book-byline.elementor-widget {
		--kit-widget-spacing: 10px;
		margin-block-end: 10px;
	}
}

/*
 * The price, the line under it (Pre-order, In stock…) and the buttons closer
 * again, on every screen (Ahmad, 25 October 2026): 7 pixels from the price to
 * the line and 15 from the line to the buttons, half what they were.
 */
.diwan-book__facts .diwan-book__price.elementor-widget {
	--kit-widget-spacing: 1px;
	margin-block-end: 1px;
}

.diwan-book__facts .diwan-book__stock.elementor-widget {
	--kit-widget-spacing: 5px;
	margin-block-end: 5px;
}

/* The tabs' titles (Description, Product Details, About the Author, Reviews)
   in the headings' face, as the bands' titles are (NEW RELEASES): TAY, and
   Tajawal for their Arabic (Diwan, November 2026). Elementor writes the tabs'
   face on the title and on its text, so both are given it. */
.diwan-book__tabs .e-n-tab-title,
.diwan-book__tabs .e-n-tab-title-text {
	font-family: var(--diwan-font-display, "TAY", "Tajawal", system-ui, sans-serif);
}
