/*
Theme Name: LotusShelf
Theme URI: https://lotusshelf.com/blog
Author: LotusShelf
Description: Block theme for the LotusShelf blog. All design tokens live in theme.json.
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.4.0
License: Proprietary
Text Domain: lotusshelf
*/

/*
 * Only rules that theme.json cannot express belong here.
 * Use preset variables (var(--wp--preset--...)), never raw values.
 */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

:where(a, button, input, select, textarea, summary, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--action-accent);
	outline-offset: 2px;
}

/* The footer stays at the bottom of the window on short pages (404, empty search). */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main,
.wp-site-blocks > .ls-grow {
	flex-grow: 1;
}

::selection {
	background: var(--wp--preset--color--action-primary-soft);
	color: var(--wp--preset--color--text-primary);
}

:where(a, .wp-element-button) {
	text-underline-offset: 0.18em;
	transition: color var(--wp--custom--transition), background-color var(--wp--custom--transition);
}

/* Header (Figma "Page header": bar 85px, lotus mark 48x37.3). Edge to edge as on the platform
   (client feedback 31.10.): no outer margin and no corner radius, only the Figma header shadow below.
   Side padding as in Figma, 118 left and 105 right at 1728 and wider, scaled with the window below that
   (at least 28), so the logo sits near the window edge as on the platform.
   Client feedback 28.10.: more breathing room, "Blog Home" first, one action by login status. */
.ls-header {
	position: relative;
	z-index: 1;
	padding: 0;
}

.ls-footer__inner {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

.ls-header__bar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--60);
	min-height: var(--wp--custom--header--height);
	padding: var(--wp--custom--header--padding-top) var(--wp--custom--header--padding-right) var(--wp--custom--header--padding-top) var(--wp--custom--header--padding-left);
	background: var(--wp--preset--color--background-surface);
	box-shadow: var(--wp--preset--shadow--header);
}

.ls-header__bar > * {
	margin-block: 0;
}

.ls-header__logo {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	line-height: 0;
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
}

/* Full LotusShelf logo with a small "Blog" label (client feedback 28.10.). */
.ls-wordmark {
	display: block;
	width: auto;
	height: var(--wp--custom--wordmark--height);
	shape-rendering: geometricPrecision;
}

.ls-header__label {
	display: inline-flex;
	align-items: center;
	height: var(--wp--custom--badge--height);
	padding: 0 var(--wp--custom--badge--padding-x);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--preset--color--action-accent-soft);
	/* The darker accent: action-accent on accent-soft is 4.07:1, below WCAG AA for 13px text. */
	color: var(--wp--preset--color--action-accent-hover);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--13);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: 1;
}

.ls-logo {
	display: block;
	width: var(--wp--custom--logo-mark--width);
	height: var(--wp--custom--logo-mark--height);
	shape-rendering: geometricPrecision;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Navigation: Figma "menu-options" item (40px, radius 12, padding 8 16, Poppins 500 16, text-menu).
   Items have no fill until hover, so the bar reads lighter; selected = action-accent with white text. */
.ls-header__nav {
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
	gap: var(--wp--preset--spacing--30);
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ls-header__nav a {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	height: var(--wp--custom--menu-item--height);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--lg);
	background: transparent;
	color: var(--wp--preset--color--text-menu);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.ls-header__nav a:hover {
	background: var(--wp--preset--color--action-accent-soft);
	color: var(--wp--preset--color--text-menu);
}

.ls-header__nav .current-cat > a {
	background: var(--wp--preset--color--action-accent);
	color: var(--wp--preset--color--background-surface);
}

.ls-header__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

/* One action: visitors see "Join LotusShelf", members (html.ls-member) "Back to LotusShelf". */
.ls-header__actions .ls-header__back,
.ls-member .ls-header__actions .ls-header__join {
	display: none;
}

.ls-member .ls-header__actions .ls-header__back {
	display: inline-flex;
}

/* Safety net for long or new categories: the row scrolls sideways instead of covering the logo and the
   action. "safe center" keeps the first item reachable when the row is too long. A scrolling row clips
   at its edges, so it gets room for the focus ring (2px + 2px offset) that the negative margin takes back. */
.ls-header__nav {
	justify-content: safe center;
	margin: calc(-1 * var(--wp--preset--spacing--10));
	padding: var(--wp--preset--spacing--10);
	overflow-x: auto;
	scrollbar-width: none;
}

.ls-header__nav::-webkit-scrollbar {
	display: none;
}

/* When the navigation does not fit next to the logo and the action, it moves to its own scrollable row,
   as on mobile (no Figma reference for tablets). Below 1320px it never fits (four categories need 1280px,
   1320px with the wider "Back to LotusShelf"). Above it, the header script in functions.php first narrows the side
   padding (.is-compact) and adds .is-stacked only when the categories are still wider than their place, so a
   new category never needs a design change. */
@media (max-width: 1319px) {
	.ls-header__bar {
		flex-wrap: wrap;
		row-gap: var(--wp--custom--header--padding-top);
		padding-inline: var(--wp--preset--spacing--card-lg);
	}

	.ls-header__nav {
		order: 3;
		flex-basis: 100%;
		justify-content: flex-start;
	}
}

.ls-header__bar.is-compact {
	padding-inline: var(--wp--preset--spacing--card-lg);
}

.ls-header__bar.is-stacked {
	flex-wrap: wrap;
	row-gap: var(--wp--custom--header--padding-top);
	padding-inline: var(--wp--preset--spacing--card-lg);
}

.ls-header__bar.is-stacked .ls-header__nav {
	order: 3;
	flex-basis: 100%;
	justify-content: flex-start;
}

/* Mobile (Figma iPhone frames): full-width white bar, 72px, padding 0 16, no radius. */
@media (max-width: 781px) {
	/* Logo and action share the first row (they wrapped onto two rows at 390 with the 32px gap). */
	.ls-header__bar {
		flex-wrap: wrap;
		gap: 0 var(--wp--preset--spacing--40);
		min-height: var(--wp--custom--header--mobile-height);
		padding: 0 var(--wp--custom--header--mobile-padding-x);
	}

	.ls-header__brand,
	.ls-header__actions {
		height: var(--wp--custom--header--mobile-height);
	}

	.ls-wordmark {
		height: var(--wp--custom--wordmark--mobile-height);
	}

	/* The navigation keeps its own scrollable row under the bar (no Figma reference for mobile). */
	.ls-header__nav {
		gap: var(--wp--preset--spacing--20);
		margin-bottom: 0;
		padding-bottom: var(--wp--custom--header--mobile-padding-x);
	}
}

/* Cookie consent (inc/analytics.php). Figma has no banner: a white card with the header shadow (it
   floats over white cards), the body text style and the Primary and Secondary buttons, fixed bottom left
   (full width on phones). It does not block the page; while it is open, focused elements scroll above it. */
.ls-consent {
	position: fixed;
	z-index: 100;
	left: var(--wp--preset--spacing--gutter);
	bottom: var(--wp--preset--spacing--gutter);
	box-sizing: border-box;
	width: min(var(--wp--custom--consent--width), calc(100% - 2 * var(--wp--preset--spacing--gutter)));
	padding: var(--wp--preset--spacing--card);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--background-surface);
	box-shadow: var(--wp--preset--shadow--header);
	color: var(--wp--preset--color--text-primary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-consent[hidden] {
	display: none;
}

.ls-consent__text {
	margin: 0 0 var(--wp--preset--spacing--40);
}

.ls-consent__actions {
	display: flex;
	gap: var(--wp--preset--spacing--30);
}

.ls-consent__actions .ls-button {
	flex: 1 1 0;
}

html.has-consent {
	scroll-padding-bottom: calc(var(--ls-consent-height, 0px) + 2 * var(--wp--preset--spacing--gutter));
}

/* "Cookie settings" in the footer looks like the footer links. */
.ls-cookie-settings {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--custom--palette--gray--500);
	font: inherit;
	cursor: pointer;
	transition: color var(--wp--custom--transition);
}

.ls-cookie-settings:hover {
	color: var(--wp--preset--color--background-surface);
}

/* Footer (client feedback 28.10.): compact, full width, dark charcoal, white lotus, subtle grey links. */
.ls-footer {
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--gutter);
	background: var(--wp--preset--color--background-inverse);
	color: var(--wp--custom--palette--gray--500);
}

.ls-footer__inner {
	display: grid;
	gap: var(--wp--preset--spacing--50);
}

.ls-footer__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--50);
}

.ls-footer__brand {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-footer__brand a {
	line-height: 0;
	color: var(--wp--preset--color--background-surface);
}

.ls-footer__nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-footer__nav ul {
	display: contents;
}

.ls-footer__nav li {
	margin: 0;
	list-style: none;
}

.ls-footer a:where(:not(.ls-footer__brand a)) {
	color: var(--wp--custom--palette--gray--500);
	text-decoration: none;
}

.ls-footer a:where(:not(.ls-footer__brand a)):hover {
	color: var(--wp--preset--color--background-surface);
}

.ls-footer__bottom {
	margin: 0;
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--custom--palette--gray--800);
	color: var(--wp--custom--palette--gray--600);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}


/* Homepage accents (client feedback 28.10.: more purple and orange, still editorial) -------- */

/* Call to action on the brand's soft purple (action/accent soft), so each page ends with a touch of colour. */
.ls-cta.is-style-card {
	background: var(--wp--preset--color--action-accent-soft);
	box-shadow: none;
}

/* The homepage title (client request 28.10.): "LotusShelf Blog" in Poppins SemiBold, a balanced size. */
.ls-home-title {
	font-size: var(--wp--preset--font-size--40);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--40);
	letter-spacing: var(--wp--custom--letter-spacing--display);
}

.ls-home-title + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

@media (max-width: 781px) {
	.ls-home-title {
		font-size: var(--wp--preset--font-size--28);
		line-height: var(--wp--custom--line-height--heading);
	}
}

/* Article cards ----------------------------------------------------------- */

/* Equal-height cards in a query grid. */
.wp-block-post-template.is-layout-grid > li {
	display: flex;
}

.wp-block-post-template.is-layout-grid > li > .ls-card {
	flex: 1 1 auto;
}

.ls-card {
	overflow: hidden;
}

.ls-meta > * {
	margin: 0;
}

.ls-meta > * + *::before {
	content: "·";
	margin-right: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--muted);
}

/* Byline in article cards (client request 28.10.), after the Figma quote card ("Jane Doe"): author photo 40
   and name linking to the author's stories, a thin divider, then a clock and the reading time as plain
   secondary text, so only the author reads as clickable. */
.ls-byline {
	align-items: center;
	min-width: 0;
}

.ls-byline > * {
	margin: 0;
}

/* The name link also covers the photo, so the whole author is one click target and one tab stop. */
.ls-byline__author {
	position: relative;
	min-width: 0;
	border-radius: var(--wp--preset--border-radius--md);
}

.ls-byline__author > * {
	margin: 0;
}

.ls-byline .wp-block-post-author-name {
	min-width: 0;
	overflow: hidden;
	font-weight: var(--wp--custom--font-weight--medium);
	line-height: var(--wp--custom--line-height--14);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ls-byline .wp-block-post-author-name a {
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
}

.ls-byline .wp-block-post-author-name a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ls-byline__author:hover .wp-block-post-author-name a {
	color: var(--wp--preset--color--action-accent);
}

.ls-byline .wp-block-post-author-name a:focus-visible {
	outline: none;
}

.ls-byline__author:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--action-accent);
	outline-offset: 2px;
}

.ls-byline__time {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	padding-left: var(--wp--preset--spacing--30);
	border-left: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-secondary);
	line-height: var(--wp--custom--line-height--14);
	white-space: nowrap;
}

.ls-byline__time::before {
	content: "";
	flex: 0 0 auto;
	width: var(--wp--custom--icon--size-small);
	height: var(--wp--custom--icon--size-small);
	background: currentColor;
	-webkit-mask: url(assets/icons/clock.svg) center / contain no-repeat;
	mask: url(assets/icons/clock.svg) center / contain no-repeat;
}


/* Article and archive pages ------------------------------------------------
   Figma has no blog pages. Both are composed from the platform's book page and Quotes page:
   content 900 wide, back link, hero 900x489 radius 16, section heading, cards. */

/* Back link (Quotes page "Back to The Alchemist"): arrow 24, gap 8, Poppins 400 16 text-secondary. */
.ls-back-link {
	margin: 0;
	font-size: var(--wp--preset--font-size--16);
	line-height: var(--wp--custom--line-height--16);
}

.ls-back-link a {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--text-secondary);
	text-decoration: none;
}

.ls-back-link a:hover {
	color: var(--wp--preset--color--text-primary);
}

/* Hero (book page): featured image with the Figma gradient overlay/0 -> overlay/100 towards the
   bottom left, where the white text sits. */
.ls-hero.wp-block-cover {
	min-height: var(--wp--custom--hero--height);
	padding: var(--wp--custom--hero--padding);
	border-radius: var(--wp--preset--border-radius--xl);
	overflow: hidden;
}

/* Beats the core dim rule, which paints the overlay black. Under the Figma gradient a second one
   darkens the part behind the text: with the Figma gradient alone, white text on a light photo fell to
   2.1:1 (title) and 2.4:1 (excerpt), below WCAG AA (3:1 and 4.5:1). */
.wp-block-cover.ls-hero .wp-block-cover__background.has-background-dim {
	opacity: 1;
	background:
		linear-gradient(251deg, transparent 10%, var(--wp--preset--color--overlay) 85%),
		linear-gradient(to top, color-mix(in srgb, var(--wp--preset--color--overlay) 60%, transparent), transparent 90%);
}

/* On tablets and phones the text fills more of the photo, so the darker part reaches higher. */
@media (max-width: 781px) {
	.wp-block-cover.ls-hero .wp-block-cover__background.has-background-dim {
		background:
			linear-gradient(251deg, transparent 10%, var(--wp--preset--color--overlay) 85%),
			linear-gradient(to top, color-mix(in srgb, var(--wp--preset--color--overlay) 60%, transparent) 70%, transparent);
	}
}

.ls-hero .wp-block-cover__inner-container {
	max-width: var(--wp--custom--hero--text-width);
	color: var(--wp--preset--color--background-surface);
}

.ls-hero__content > * {
	margin: 0;
}

/* Article title (client feedback 31.10.: lighter and more refined than the Figma H1 700 48/58):
   Poppins SemiBold 600, 40/48, slightly tighter letter spacing. */
.ls-hero__title {
	color: var(--wp--preset--color--background-surface);
	font-size: var(--wp--preset--font-size--40);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--40);
	letter-spacing: var(--wp--custom--letter-spacing--display);
}

.ls-hero__excerpt,
.ls-hero__byline,
.ls-hero__byline :where(.ls-person__meta > *, a) {
	color: var(--wp--preset--color--background-surface);
}

.ls-hero__byline:hover .ls-person__name a {
	color: var(--wp--preset--color--action-primary-soft);
}

.ls-hero__byline .ls-person__meta > * + *::before {
	color: var(--wp--preset--color--background-surface);
}

/* Author row (client feedback 28.10.: photo next to the name and date), after the Figma "Community
   Reviews" reviewer: photo 40 and, 10 to the right, the name in Shelf / Label / 13 with the date in
   Shelf / Caption / 12 2 below it. The name link covers the whole row, so photo and name are one
   click target and one tab stop, as in the article cards. */
.wp-block-group.ls-person {
	position: relative;
	align-items: center;
	gap: var(--wp--custom--person--gap);
	border-radius: var(--wp--preset--border-radius--md);
}

.wp-block-group.ls-person__text {
	gap: var(--wp--custom--person--text-gap);
	min-width: 0;
}

.ls-person > *,
.ls-person__text > * {
	margin: 0;
}

.ls-person__name {
	font-size: var(--wp--preset--font-size--13);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--13);
}

.ls-person__name a {
	text-decoration: none;
}

.ls-person__name a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ls-person__name a:focus-visible {
	outline: none;
}

.ls-person:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--action-accent);
	outline-offset: 2px;
}

.ls-person__meta,
.ls-person__meta > * {
	font-size: var(--wp--preset--font-size--12);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--12);
}

/* Genre badge on the dark hero: 25 high, pill, white 10% fill and white 15% outline,
   Poppins 600 11 uppercase in Figma; 12 here, the smallest size in the type scale. */
.ls-hero__badge {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.ls-hero__badge a {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	height: var(--wp--custom--hero--badge-height);
	padding: 0 var(--wp--custom--badge--padding-x);
	border: 1px solid var(--wp--custom--hero--badge-border);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--custom--hero--badge-fill);
	color: var(--wp--preset--color--background-surface);
	font-size: var(--wp--preset--font-size--12);
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.ls-hero__badge a:hover {
	background: var(--wp--custom--hero--badge-border);
}

.ls-hero__badge .wp-block-post-terms__separator {
	display: none;
}

/* Light article header (book reviews, client feedback 18.11.: the dark photo with text over it felt out of
   character with the light, card-based blog). The featured card of the blog home: photo on the left,
   then the category badge, the title with the orange bar, the excerpt and the author row; on phones and
   tablets the photo sits on top at 3:2, as in the category cards. On wider screens it fills the height
   of the text. Template book-review.html, chosen in functions.php. */
/* Without a featured image the text takes the whole card instead of leaving an empty half. */
.ls-article-header__media:not(:has(img)) {
	display: none;
}

.ls-article-header__media .wp-block-post-featured-image {
	height: 100%;
	margin: 0;
}

.ls-article-header__media .wp-block-post-featured-image img {
	height: 100%;
}

.ls-article-header__content.wp-block-column {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--card-gap);
	padding: var(--wp--preset--spacing--card-lg);
}

.ls-article-header__content > * {
	margin: 0;
}

.ls-article-header__title {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--28);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--heading);
}

.ls-article-header__byline .ls-person__name a {
	color: var(--wp--preset--color--text-primary);
}

.ls-article-header__byline:hover .ls-person__name a {
	color: var(--wp--preset--color--action-accent);
}

.ls-article-header__byline .ls-person__meta,
.ls-article-header__byline .ls-person__meta > * {
	color: var(--wp--preset--color--text-secondary);
}

@media (max-width: 781px) {
	.ls-article-header__content.wp-block-column {
		padding: var(--wp--preset--spacing--card);
	}
}

/* Article body: white card (Synopsis card), text column of contentSize (720) centred inside it.
   On phones the card keeps 16 at the sides so the text column stays wide enough. */
.ls-article-card {
	padding-inline: var(--wp--preset--spacing--card-lg);
}

@media (max-width: 781px) {
	.ls-article-card {
		padding-inline: var(--wp--preset--spacing--40);
	}
}

.ls-article-body > :first-child {
	margin-top: 0;
}

.ls-article-body > :last-child {
	margin-bottom: 0;
}

.ls-article-body :where(h2, h3) {
	margin-top: var(--wp--preset--spacing--60);
	font-weight: var(--wp--custom--font-weight--semibold);
}

/* Section headings in the reading column (client feedback 31.10.: less heavy): 24/32 and 18/28
   instead of the page-level 28 and 24, so they lead the text without shouting. */
.ls-article-body h2 {
	font-size: var(--wp--preset--font-size--24);
	line-height: var(--wp--custom--line-height--heading);
}

.ls-article-body h3 {
	font-size: var(--wp--preset--font-size--18);
	line-height: var(--wp--custom--line-height--18);
}

/* Author card: avatar 40, round (review card in Figma). The 14px card gap between the title, the
   person row and the bio comes from the block gap, so no margin reset on the children here. */
.ls-avatar img {
	display: block;
	width: var(--wp--custom--avatar--size);
	height: var(--wp--custom--avatar--size);
	border-radius: var(--wp--preset--border-radius--full);
	object-fit: cover;
}

/* Author without a profile photo (inc/author-photo.php), as the reviewers without a photo in Figma
   ("Community Reviews"): initials in a 40px circle, Poppins 700 14 white, on action/accent,
   action/primary or status/success (success/400), the same colour for an author everywhere. */
.ls-initials {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--avatar--size);
	height: var(--wp--custom--avatar--size);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--preset--color--action-accent);
	color: var(--wp--preset--color--background-surface);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--14);
	font-weight: var(--wp--custom--font-weight--bold);
	line-height: 1;
	user-select: none;
}

.ls-initials--primary {
	background: var(--wp--preset--color--action-primary);
}

.ls-initials--success {
	background: var(--wp--custom--palette--success--400);
}

/* Share bar (client feedback 28.10.: WhatsApp, LinkedIn, X and Copy link, easy to reach without
   distracting from reading). Figma has no share bar: it uses the Secondary small icon-only button
   (36x36, radius 8) and the Caption / 12 text style. Brand logos are the official files in the colours
   the brands allow, at 20px, the drawing size of a 24px Lucide icon. Phones and tablets: a row between
   the hero and the article. Desktop: a column left of the article card that stays in view while reading. */
.ls-share {
	margin: 0;
}

.ls-share__inner {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.ls-share__label {
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}

.ls-share__list {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ls-share__list li {
	margin: 0;
}

/* Icon links (client feedback 31.10.): 36x36 touch target, no fill until hover, then a soft circle. */
.ls-share__link {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--button--height-small);
	height: var(--wp--custom--button--height-small);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wp--preset--border-radius--full);
	background: transparent;
	color: var(--wp--preset--color--action-accent);
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), transform var(--wp--custom--transition);
}

.ls-share__link:hover {
	background: var(--wp--preset--color--background-subtle);
	transform: translateY(-1px);
}

.ls-share__logo {
	display: block;
	width: var(--wp--custom--icon--size-brand);
	height: var(--wp--custom--icon--size-brand);
	object-fit: contain;
}

.ls-share__copy .ls-share__icon-done,
.ls-share__copy.is-copied .ls-share__icon-link {
	display: none;
}

.ls-share__copy.is-copied .ls-share__icon-done {
	display: block;
}

/* Article like (client feedback 19.11.). Figma has no article like: the heart is the Lucide heart of the
   comment likes, in the same 36px icon button as the share links, filled once the reader likes the
   article. The count is Caption / 12. A thin line in the border colour separates it from sharing. */
.ls-share__like {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	padding-inline-end: var(--wp--preset--spacing--30);
	border-inline-end: 1px solid var(--wp--preset--color--border);
}

.ls-share__like[hidden] {
	display: none;
}

.ls-like__count {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--12);
	font-variant-numeric: tabular-nums;
}

.ls-like[aria-pressed="true"] .ls-like__heart path {
	fill: currentColor;
}

@media (min-width: 1057px) {
	.ls-article-main {
		position: relative;
	}

	.ls-share {
		position: absolute;
		top: 0;
		right: calc(100% + var(--wp--preset--spacing--40));
		bottom: 0;
	}

	.ls-article-main > .ls-share + * {
		margin-block-start: 0;
	}

	/* Below the WordPress admin bar for signed-in editors (the variable is set only when the bar shows). */
	.ls-share__inner {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--50));
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
	}

	.ls-share__list {
		flex-direction: column;
	}

	.ls-share__like {
		flex-direction: column;
		padding-inline-end: 0;
		padding-block-end: var(--wp--preset--spacing--20);
		border-inline-end: 0;
		border-block-end: 1px solid var(--wp--preset--color--border);
	}
}

/* Table of contents (blocks/toc): long articles only. Figma has no TOC, so it reuses the
   share bar (Caption / 12 label, a column next to the card) and the card style. Smaller screens: a
   collapsible white card between the share row and the article. Wide screens (1360+, the first width
   where a column fits next to the 900px page): a sticky column right of the article card, mirroring
   the share bar on the left. The link of the section being read has aria-current (view.js). */
.ls-toc {
	margin: 0;
}

.ls-toc__details {
	border-radius: var(--wp--preset--border-radius--xl);
	background: var(--wp--preset--color--background-surface);
	box-shadow: var(--wp--preset--shadow--elevation-1);
}

.ls-toc__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	min-height: var(--wp--custom--button--height);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--card);
	border-radius: var(--wp--preset--border-radius--xl);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--14);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--14);
	list-style: none;
	cursor: pointer;
}

.ls-toc__summary::-webkit-details-marker {
	display: none;
}

.ls-toc__chevron {
	flex: none;
	width: var(--wp--custom--icon--size-brand);
	height: var(--wp--custom--icon--size-brand);
	color: var(--wp--preset--color--text-secondary);
	transition: transform var(--wp--custom--transition);
}

.ls-toc__details[open] .ls-toc__chevron {
	transform: rotate(180deg);
}

.ls-toc__list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0 var(--wp--preset--spacing--card) var(--wp--preset--spacing--card);
	list-style: none;
}

.ls-toc__list li {
	margin: 0;
}

.ls-toc__link {
	display: block;
	padding: var(--wp--preset--spacing--20) 0 var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-left: 2px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
	text-decoration: none;
	transition: color var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.ls-toc__link:hover {
	color: var(--wp--preset--color--action-accent);
}

/* Inside, so the scrolling column on wide screens does not clip the focus ring. */
.ls-toc__link:focus-visible {
	outline-offset: -2px;
}

.ls-toc__link[aria-current] {
	border-left-color: var(--wp--preset--color--action-accent);
	color: var(--wp--preset--color--text-primary);
	font-weight: var(--wp--custom--font-weight--medium);
}

/* Section headings stay clear of the window edge (and of the admin bar) after a jump. */
.ls-article-body :where(h2, h3)[id] {
	scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--50));
}

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

/* Keep the breakpoint in sync with blocks/toc/view.js. */
@media (min-width: 1360px) {
	.ls-toc {
		position: absolute;
		top: 0;
		bottom: 0;
		left: calc(100% + var(--wp--preset--spacing--50));
		width: min(var(--wp--custom--toc--width), calc((100vw - 100%) / 2 - var(--wp--preset--spacing--50) * 2));
	}

	.ls-article-main > .ls-toc + * {
		margin-block-start: 0;
	}

	.ls-toc__details {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--50));
		max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - var(--wp--preset--spacing--50) * 2);
		overflow-y: auto;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	/* Always open (view.js): the summary is only the column label, as "Share" on the left. */
	.ls-toc.is-pinned .ls-toc__summary {
		min-height: 0;
		padding: 0 0 var(--wp--preset--spacing--20);
		color: var(--wp--preset--color--text-secondary);
		font-size: var(--wp--preset--font-size--12);
		font-weight: var(--wp--custom--font-weight--regular);
		line-height: var(--wp--custom--line-height--12);
		pointer-events: none;
		cursor: default;
	}

	.ls-toc.is-pinned .ls-toc__chevron {
		display: none;
	}

	.ls-toc.is-pinned .ls-toc__list {
		padding: 0;
	}
}

.ls-author-box__person a {
	text-decoration: none;
}

/* Comments (blocks/comments): filled from the LotusShelf API in the browser. Each thread is a Figma
   review card ("Community Reviews": radius 16, padding 22, gap 14, Elevation 1) with the reviewer row
   (photo 40, gap 10, Label / 13 name, Caption / 12 date) and Body / 14 text. Figma has no comment field,
   likes or replies, so these follow the platform's behaviour and use design system pieces: Link-sized
   actions (32 high, Label / 13), a field in background/subtle like the search field (16px text, so
   phones do not zoom in), purple for a selected like. */
.ls-comments {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

/* Same look as the Section heading style ("Community Reviews (32)"). A block style applies only to a real
   block, and this heading is part of the block's own markup. */
.ls-comments__title {
	margin: 0;
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--18);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: 1;
}

.ls-comments__title:focus {
	outline: none;
}

.ls-comments__composer:empty,
.ls-comments__more:empty {
	display: none;
}

.ls-comments__form,
.ls-comments__signin,
.ls-comments__message,
.ls-comment {
	box-sizing: border-box;
	margin: 0;
	padding: var(--wp--preset--spacing--card);
	border-radius: var(--wp--preset--border-radius--xl);
	background: var(--wp--preset--color--background-surface);
	box-shadow: var(--wp--preset--shadow--elevation-1);
}

.ls-comments__form {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: var(--wp--custom--person--gap);
	row-gap: var(--wp--preset--spacing--30);
	align-items: start;
}

.ls-comments__field {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border: 0;
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--preset--color--background-subtle);
	color: var(--wp--preset--color--text-primary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--16);
	line-height: var(--wp--custom--line-height--16);
	resize: vertical;
}

.ls-comments__field::placeholder {
	color: var(--wp--custom--search--placeholder);
	opacity: 1;
}

.ls-comments__error,
.ls-comments__form-actions {
	grid-column: 2;
	margin: 0;
}

.ls-comments__error {
	color: var(--wp--preset--color--error);
	font-size: var(--wp--preset--font-size--13);
	line-height: var(--wp--custom--line-height--13);
}

.ls-comments__error a {
	color: inherit;
}

.ls-comments__form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: var(--wp--preset--spacing--20);
}

.ls-comments__counter,
.ls-comments__loading,
.ls-comments__note {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}

.ls-comments__counter {
	margin-right: auto;
}

.ls-comments__note {
	margin: 0;
}

.ls-comments__signin {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
}

.ls-comments__signin p {
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-comments__signin-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.ls-comments__message {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-comments__retry {
	vertical-align: middle;
}

.ls-comments__list,
.ls-comment__replies {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ls-comments__list {
	gap: var(--wp--preset--spacing--40);
}

.ls-comments__more {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

.ls-comment {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--card-gap);
	min-width: 0;
}

.ls-comment__head {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--person--gap);
	min-width: 0;
}

/* A photo, or .ls-initials, which keeps its own centring. */
.ls-comment__avatar {
	flex: none;
	width: var(--wp--custom--avatar--size);
	height: var(--wp--custom--avatar--size);
	border-radius: var(--wp--preset--border-radius--full);
}

img.ls-comment__avatar {
	display: block;
	object-fit: cover;
}

.ls-comment__who {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--person--text-gap);
	min-width: 0;
}

.ls-comment__name {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--13);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--13);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ls-comment__name:hover {
	color: var(--wp--preset--color--action-accent-hover);
	text-decoration: underline;
}

.ls-comment__date {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}

.ls-comment__text {
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.ls-comment__actions,
.ls-comment__confirm {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	margin-left: calc(-1 * var(--wp--custom--button--link-padding-x));
}

.ls-comment__action {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	height: var(--wp--custom--button--link-height);
	margin: 0;
	padding: 0 var(--wp--custom--button--link-padding-x);
	border: 0;
	border-radius: var(--wp--preset--border-radius--md);
	background: transparent;
	color: var(--wp--preset--color--text-secondary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--13);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--13);
	text-decoration: none;
	cursor: pointer;
	transition: color var(--wp--custom--transition);
}

.ls-comment__action:hover {
	color: var(--wp--preset--color--text-primary);
}

.ls-comment__action--danger {
	color: var(--wp--preset--color--error);
}

.ls-comment__action--danger:hover {
	color: var(--wp--preset--color--error);
	text-decoration: underline;
}

.ls-comment__action[aria-pressed="true"] {
	color: var(--wp--preset--color--action-accent);
}

.ls-comment__action[aria-pressed="true"]:hover {
	color: var(--wp--preset--color--action-accent-hover);
}

.ls-comment__action .ls-comment__heart {
	width: var(--wp--custom--icon--size-small);
	height: var(--wp--custom--icon--size-small);
}

.ls-comment__action[aria-pressed="true"] .ls-comment__heart path {
	fill: currentColor;
}

.ls-comment__confirm-text {
	padding: 0 var(--wp--custom--button--link-padding-x);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--13);
	line-height: var(--wp--custom--line-height--13);
}

.ls-comment__replies {
	gap: var(--wp--preset--spacing--card-gap);
	padding-left: var(--wp--preset--spacing--30);
	border-left: 1px solid var(--wp--preset--color--border);
}

.ls-comment__replies:empty {
	display: none;
}

.ls-comment--reply {
	padding: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ls-comment--reply .ls-comment__avatar {
	width: var(--wp--custom--avatar--size-small);
	height: var(--wp--custom--avatar--size-small);
}

/* The reply field sits inside the white card, so it needs no card of its own. */
.ls-comment > .ls-comments__form {
	padding: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ls-comment > .ls-comments__form .ls-comment__avatar {
	width: var(--wp--custom--avatar--size-small);
	height: var(--wp--custom--avatar--size-small);
}

/* Author page (client feedback 31.10.): a prominent profile card above the author's stories.
   White card (Elevation 1, radius 16, padding 28), photo 120 round next to the name (Poppins 600 28),
   city and story count (14, text/secondary), bio (16/24) and the LotusShelf profile link.
   Phones: photo 88 above the text. */
.ls-author-profile {
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--60);
	padding: var(--wp--preset--spacing--card-lg);
	border-radius: var(--wp--preset--border-radius--xl);
	background: var(--wp--preset--color--background-surface);
	box-shadow: var(--wp--preset--shadow--elevation-1);
}

.ls-author-profile__photo {
	flex: 0 0 auto;
	line-height: 0;
}

.ls-author-profile__photo :where(img, .ls-initials) {
	display: flex;
	width: var(--wp--custom--avatar--size-large);
	height: var(--wp--custom--avatar--size-large);
	border-radius: var(--wp--preset--border-radius--full);
	object-fit: cover;
}

.ls-author-profile__photo .ls-initials {
	font-size: var(--wp--preset--font-size--40);
	font-weight: var(--wp--custom--font-weight--semibold);
}

.ls-author-profile__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
	min-width: 0;
}

.ls-author-profile__text > * {
	margin: 0;
}

.ls-author-profile__name {
	font-size: var(--wp--preset--font-size--28);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--heading);
}

.ls-author-profile__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-author-profile__city {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
}

.ls-author-profile__city .ls-icon {
	width: var(--wp--preset--font-size--16);
	height: var(--wp--preset--font-size--16);
}

.ls-author-profile__bio {
	max-width: var(--wp--style--global--content-size);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--16);
	line-height: var(--wp--custom--line-height--16);
}

.ls-author-profile__link {
	margin-top: var(--wp--preset--spacing--20);
}

/* Narrow phones (under 390): the action reads "Join", so it stays next to the logo. */
@media (max-width: 389px) {
	.ls-header__join-more {
		display: none;
	}
}

@media (max-width: 781px) {
	.ls-author-profile {
		flex-direction: column;
		gap: var(--wp--preset--spacing--40);
		padding: var(--wp--preset--spacing--card);
	}

	.ls-author-profile__photo :where(img, .ls-initials) {
		width: var(--wp--custom--avatar--size-large-mobile);
		height: var(--wp--custom--avatar--size-large-mobile);
	}

	.ls-author-profile__photo .ls-initials {
		font-size: var(--wp--preset--font-size--28);
	}

	.ls-author-profile__name {
		font-size: var(--wp--preset--font-size--24);
	}
}

/* 404: a centred message card, then the latest stories. */
.ls-notice {
	text-align: center;
}

.ls-notice > * {
	margin: 0;
}

.ls-notice__code {
	color: var(--wp--preset--color--action-primary);
	font-size: var(--wp--preset--font-size--48);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--48);
}

.ls-notice__title {
	font-size: var(--wp--preset--font-size--28);
	font-weight: var(--wp--custom--font-weight--semibold);
}

.ls-notice .ls-search {
	margin-block: var(--wp--preset--spacing--20);
}

/* Search results: the field sits under the title, at the Figma width. */
.ls-archive-head .ls-search {
	margin-top: var(--wp--preset--spacing--30);
}

/* Pages: the title above a white reading card, as on articles, so quotes and callouts
   keep their frame (they are tinted with the page background). */
.ls-page-title {
	font-size: var(--wp--preset--font-size--40);
	line-height: var(--wp--custom--line-height--40);
	letter-spacing: var(--wp--custom--letter-spacing--display);
}

/* Archive title: section heading as on the book page ("Quotes from this book (48)"), Poppins 600 18,
   no background, cards 16 below it (client request 28.10.). The category description follows in 14. */
.ls-archive-head > *,
.ls-section-row > * {
	margin: 0;
}

/* Back link next to a section heading, styled as "See All ->" on the book page: Poppins 600 14/100%,
   text-secondary, small arrow (client request 28.10.). */
.ls-back-link--inline {
	font-size: var(--wp--preset--font-size--14);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: 1;
}

.ls-back-link--inline a {
	gap: var(--wp--preset--spacing--10);
}

.ls-back-link--inline .ls-icon {
	width: var(--wp--custom--icon--size-small);
	height: var(--wp--custom--icon--size-small);
}

/* Archive grid: two cards with 16 between them, as the card rows on the book page, one column on phones.
   The grid layout ignores a blockGap given as a custom variable and sizes its columns with its
   own gap, so both the gap and the columns are set here. */
.ls-archive .wp-block-post-template.is-layout-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
}

@media (max-width: 781px) {
	.ls-archive .wp-block-post-template.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Phones and tablets: the hero keeps the Figma height (489) as its minimum and grows with the text, as the
   mobile book page hero in Figma. A 3:4 ratio made it 941px tall on a 768px tablet. */
@media (max-width: 781px) {
	.ls-hero.wp-block-cover {
		padding: var(--wp--preset--spacing--50);
	}

	.ls-hero__title {
		font-size: var(--wp--preset--font-size--28);
		line-height: var(--wp--custom--line-height--heading);
	}
}

/* Design system components ------------------------------------------------
   Built from the Figma pages Buttons, Checkbox, Toggle, Side Menu and Page header.
   Values come from theme.json (custom.* and presets); the design system page shows them all.
   .is-hover pins the hover look so the design system page can show every state side by side. */

.ls-icon {
	display: block;
	flex: 0 0 auto;
	width: var(--wp--custom--icon--size);
	height: var(--wp--custom--icon--size);
}

/* Buttons (Figma "Buttons"): Large 40 / Small 36, radius 8, Shelf / Label / 13, icon 24, gap 8.
   Filled orange buttons use the brand orange as in Figma and on the platform (client decision 28.10.,
   white 13px text has 3:1 contrast). Orange text on white (Tertiary, Link) keeps the AA shade.
   Icons on Primary and Primary Alt are orange/100 in Figma; on the other variants they follow the text. */
.ls-button {
	--ls-bg: var(--wp--preset--color--action-primary);
	--ls-bg-hover: var(--wp--preset--color--action-primary-hover);
	--ls-bg-disabled: var(--wp--preset--color--action-primary-disabled);
	--ls-text: var(--wp--preset--color--background-surface);
	--ls-text-hover: var(--ls-text);
	--ls-text-disabled: var(--ls-text);
	--ls-border: transparent;
	--ls-border-hover: transparent;
	--ls-border-disabled: transparent;
	--ls-icon: var(--wp--custom--palette--orange--100);

	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--custom--button--gap);
	height: var(--wp--custom--button--height);
	margin: 0;
	padding: 0 var(--wp--custom--button--padding-x);
	border: 0 solid var(--ls-border);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--ls-bg);
	color: var(--ls-text);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--13);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--13);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.ls-button .ls-icon {
	color: var(--ls-icon);
}

.ls-button:hover,
.ls-button.is-hover {
	background: var(--ls-bg-hover);
	border-color: var(--ls-border-hover);
	color: var(--ls-text-hover);
}

.ls-button:disabled,
.ls-button[aria-disabled="true"] {
	background: var(--ls-bg-disabled);
	border-color: var(--ls-border-disabled);
	color: var(--ls-text-disabled);
	cursor: not-allowed;
}

.ls-button--primary-alt {
	--ls-bg: var(--wp--preset--color--action-accent);
	--ls-bg-hover: var(--wp--preset--color--action-accent-hover);
	--ls-bg-disabled: var(--wp--custom--palette--purple--300);
}

.ls-button--secondary,
.ls-button--tertiary,
.ls-button--tertiary-alt,
.ls-button--link,
.ls-button--link-alt,
.ls-button--negative {
	--ls-icon: currentColor;
}

.ls-button--secondary {
	--ls-bg: var(--wp--preset--color--action-secondary);
	--ls-bg-hover: var(--wp--preset--color--action-secondary-hover);
	--ls-bg-disabled: var(--wp--preset--color--action-secondary);
	--ls-text: var(--wp--preset--color--action-secondary-text);
	--ls-text-disabled: var(--wp--custom--palette--gray--600);
}

/* Subtle small (book page "Read Entire Review"): 36 high, padding 0 14, background/subtle, Caption / 12. */
.ls-button--subtle.ls-button--small {
	--ls-bg: var(--wp--preset--color--background-subtle);
	--ls-bg-hover: var(--wp--preset--color--action-secondary);
	--ls-text: var(--wp--preset--color--text-primary);

	padding: 0 var(--wp--custom--button--padding-x-subtle);
	font-size: var(--wp--preset--font-size--12);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--12);
}

/* Tertiary and Link: no fill. Tertiary adds a 1px border, so it is 2px wider, as in Figma. */
.ls-button--tertiary,
.ls-button--tertiary-alt,
.ls-button--link,
.ls-button--link-alt {
	--ls-bg: transparent;
	--ls-bg-hover: transparent;
	--ls-bg-disabled: transparent;
	--ls-text: var(--wp--preset--color--action-primary-aa);
	--ls-text-hover: var(--wp--preset--color--action-primary-aa-hover);
	--ls-text-disabled: var(--wp--preset--color--action-primary-disabled);
}

.ls-button--tertiary {
	border-width: 1px;
	--ls-border: var(--ls-text);
	--ls-border-hover: var(--ls-text-hover);
	--ls-border-disabled: var(--ls-text-disabled);
}

.ls-button--tertiary-alt,
.ls-button--link-alt {
	--ls-text: var(--wp--preset--color--action-accent);
	--ls-text-hover: var(--wp--preset--color--action-accent-hover);
	--ls-text-disabled: var(--wp--custom--palette--purple--300);
}

.ls-button--tertiary-alt {
	border-width: 1px;
	--ls-border: var(--ls-text);
	--ls-border-hover: var(--ls-text-hover);
	--ls-border-disabled: var(--ls-text-disabled);
}

.ls-button--negative {
	--ls-bg: var(--wp--custom--palette--error--500);
	--ls-bg-hover: var(--wp--custom--palette--error--600);
	--ls-bg-disabled: var(--wp--custom--palette--error--300);
}

.ls-button--link,
.ls-button--link-alt {
	height: var(--wp--custom--button--link-height);
	padding: 0 var(--wp--custom--button--link-padding-x);
}

.ls-button--small {
	height: var(--wp--custom--button--height-small);
	padding: 0 var(--wp--custom--button--padding-x-small);
}

/* Icon padding: Large 12 on the icon side (16 on the text side), Small 8 (12). */
.ls-button--icon-left {
	padding-left: var(--wp--custom--button--padding-x-icon);
}

.ls-button--icon-right {
	padding-right: var(--wp--custom--button--padding-x-icon);
}

.ls-button--small.ls-button--icon-left {
	padding-left: var(--wp--custom--button--padding-x-icon-small);
}

.ls-button--small.ls-button--icon-right {
	padding-right: var(--wp--custom--button--padding-x-icon-small);
}

.ls-button--link.ls-button--icon-left,
.ls-button--link.ls-button--icon-right,
.ls-button--link-alt.ls-button--icon-left,
.ls-button--link-alt.ls-button--icon-right {
	padding: 0 var(--wp--custom--button--link-padding-x);
}

.ls-button--icon-only {
	width: var(--wp--custom--button--height);
	padding: 0;
}

.ls-button--small.ls-button--icon-only {
	width: var(--wp--custom--button--height-small);
}

.ls-button--link.ls-button--icon-only,
.ls-button--link-alt.ls-button--icon-only {
	width: var(--wp--custom--button--link-height);
}

/* Special buttons (Figma "Special Buttons"): pill, 1px outline, icon in a 32px circle, Inter 500 18. */
.ls-special {
	--ls-accent: var(--wp--custom--palette--orange--500);
	--ls-accent-disabled: var(--wp--custom--palette--orange--300);

	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: var(--wp--custom--special-button--gap);
	margin: 0;
	padding: var(--wp--custom--special-button--padding-y) var(--wp--custom--special-button--padding-right) var(--wp--custom--special-button--padding-y) var(--wp--custom--special-button--padding-left);
	border: 1px solid var(--ls-accent);
	border-radius: var(--wp--preset--border-radius--full);
	background: transparent;
	color: var(--wp--custom--palette--gray--900);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--18);
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), border-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.ls-special--quote {
	--ls-accent: var(--wp--custom--palette--warning--600);
	--ls-accent-disabled: var(--wp--custom--palette--warning--300);
}

.ls-special--review {
	--ls-accent: var(--wp--custom--palette--purple--500);
	--ls-accent-disabled: var(--wp--custom--palette--purple--300);
}

.ls-special__circle {
	box-sizing: border-box;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--special-button--circle);
	height: var(--wp--custom--special-button--circle);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--ls-accent);
	color: var(--wp--preset--color--background-surface);
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.ls-special__circle .ls-icon {
	width: var(--wp--custom--icon--size-small);
	height: var(--wp--custom--icon--size-small);
}

.ls-special:hover,
.ls-special.is-hover {
	background: var(--wp--custom--palette--gray--200);
}

.ls-special:disabled {
	border-color: var(--ls-accent-disabled);
	background: var(--wp--custom--palette--gray--300);
	color: var(--wp--custom--palette--gray--600);
	cursor: not-allowed;
}

.ls-special:disabled .ls-special__circle {
	background: var(--ls-accent-disabled);
	color: var(--wp--custom--palette--gray--300);
}

/* Checkbox and toggle (Figma "Checkbox" / "Toggle"): native inputs, label Poppins 400 12 text-secondary. */
.ls-checkbox,
.ls-toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--custom--control--label-gap);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}

.ls-checkbox input,
.ls-toggle input {
	position: relative;
	box-sizing: border-box;
	flex: 0 0 auto;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	background: var(--wp--custom--control--fill);
	cursor: pointer;
}

.ls-checkbox input {
	width: var(--wp--custom--control--size);
	height: var(--wp--custom--control--size);
	border: 1px solid var(--wp--custom--control--border);
	border-radius: var(--wp--custom--control--radius);
}

/* Checked: orange 12px square 2px from the edge, white 10px check inside it. */
.ls-checkbox input::before,
.ls-checkbox input::after {
	content: "";
	position: absolute;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity var(--wp--custom--transition), transform var(--wp--custom--transition);
}

.ls-checkbox input::before {
	inset: 1px;
	border-radius: var(--wp--custom--control--check-radius);
	background: var(--wp--preset--color--action-primary);
}

.ls-checkbox input::after {
	inset: 2px;
	background: var(--wp--preset--color--background-surface);
	-webkit-mask: url(assets/icons/check.svg) center / contain no-repeat;
	mask: url(assets/icons/check.svg) center / contain no-repeat;
}

.ls-checkbox input:checked::before,
.ls-checkbox input:checked::after {
	opacity: 1;
	transform: scale(1);
}

/* Toggle: 28x18 track, 1px outline, 12px knob. On = orange, knob left; off = gray, knob right (as in Figma). */
.ls-toggle input {
	width: var(--wp--custom--toggle--width);
	height: var(--wp--custom--toggle--height);
	border: 1px solid var(--wp--custom--palette--gray--600);
	border-radius: var(--wp--custom--toggle--radius);
	transition: border-color var(--wp--custom--transition);
}

.ls-toggle input::before {
	content: "";
	position: absolute;
	top: var(--wp--custom--toggle--padding);
	width: var(--wp--custom--toggle--knob);
	height: var(--wp--custom--toggle--knob);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--custom--palette--gray--600);
	/* Moved with left, not transform: a transform paints in its own layer and at fractional zoom
	   (e.g. 133%) lands a pixel off the track after the first click. */
	left: calc(var(--wp--custom--toggle--padding) + var(--wp--custom--toggle--travel));
	transition: left var(--wp--custom--transition), background-color var(--wp--custom--transition);
}

.ls-toggle input:checked {
	border-color: var(--wp--preset--color--action-primary);
}

.ls-toggle input:checked::before {
	left: var(--wp--custom--toggle--padding);
	background: var(--wp--preset--color--action-primary);
}

/* Header buttons (Figma "header-buttons"): 56x56, radius 16, icon 24; selected = soft fill. */
.ls-header-button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--header-button--size);
	height: var(--wp--custom--header-button--size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wp--preset--border-radius--xl);
	background: transparent;
	color: var(--wp--custom--header-button--icon);
	cursor: pointer;
	transition: background-color var(--wp--custom--transition);
}

.ls-header-button:hover,
.ls-header-button.is-hover,
.ls-header-button[aria-pressed="true"] {
	background: var(--wp--custom--header-button--selected);
}

/* Search field (Figma "Page header"): 442x40, radius 8, Inter 300 16. */
.ls-search {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: var(--wp--custom--search--gap);
	width: 100%;
	max-width: var(--wp--custom--search--width);
	height: var(--wp--custom--search--height);
	margin: 0;
	padding: var(--wp--custom--search--padding-y) var(--wp--custom--search--padding-x);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--preset--color--background-subtle);
	color: var(--wp--preset--color--muted);
}

.ls-search:focus-within {
	outline: 2px solid var(--wp--preset--color--action-accent);
	outline-offset: 2px;
}

.ls-search input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--text-primary);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 300;
	line-height: 1;
}

.ls-search input::placeholder {
	color: var(--wp--custom--search--placeholder);
	opacity: 1;
}

.ls-search input:focus-visible {
	outline: none;
}

/* Side menu (Figma "Side Menu"): 274 wide, items 40 high with 16 between them. */
.ls-menu {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--custom--side-menu--gap);
	width: var(--wp--custom--side-menu--width);
	max-width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ls-menu--collapsed {
	width: var(--wp--custom--menu-item--height);
}

.ls-menu__item {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--custom--menu-item--icon-gap);
	height: var(--wp--custom--menu-item--height);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--background-subtle);
	color: var(--wp--preset--color--text-menu);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.ls-menu__item:hover,
.ls-menu__item.is-hover {
	background: var(--wp--preset--color--action-accent-soft);
	color: var(--wp--preset--color--text-menu);
}

.ls-menu__item[aria-current="page"] {
	background: var(--wp--preset--color--action-accent);
	color: var(--wp--preset--color--background-surface);
}

.ls-menu__item--count {
	padding-right: var(--wp--preset--spacing--20);
}

.ls-menu__label {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--menu-item--icon-gap);
	min-width: 0;
}

.ls-menu--collapsed .ls-menu__item {
	justify-content: center;
	width: var(--wp--custom--menu-item--height);
	padding: var(--wp--preset--spacing--20);
}

.ls-menu--collapsed .ls-menu__text,
.ls-menu--collapsed .ls-menu__count {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.ls-menu__count {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--menu-item--count-width);
	height: var(--wp--custom--menu-item--count-height);
	padding: var(--wp--preset--spacing--10);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--custom--palette--gray--400);
	color: var(--wp--custom--menu-item--count-text);
	font-size: var(--wp--preset--font-size--13);
	font-weight: 600;
	line-height: 1;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

/* Unread dot: 8px error/500, centred on the right edge of the count. */
.ls-menu__count--dot {
	height: var(--wp--custom--menu-item--count-height-dot);
}

.ls-menu__count--dot::after {
	content: "";
	position: absolute;
	top: 50%;
	right: var(--wp--custom--menu-item--dot-offset);
	width: var(--wp--custom--menu-item--dot);
	height: var(--wp--custom--menu-item--dot);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--custom--palette--error--500);
	transform: translateY(-50%);
}

.ls-menu__item[aria-current="page"] .ls-menu__count {
	background: var(--wp--custom--palette--purple--600);
	color: var(--wp--custom--palette--purple--100);
}

.ls-menu__item[aria-current="page"] .ls-menu__count--dot::after {
	background: var(--wp--custom--palette--purple--100);
}

/* The Figma line has no height of its own, so the 1px stroke must not add to the layout. */
.ls-menu__divider {
	margin: 0 0 -1px;
	border: 0;
	border-top: 1px solid var(--wp--custom--side-menu--divider);
}

.ls-menu__heading {
	margin: 0;
	color: var(--wp--preset--color--text-menu);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 400;
	line-height: var(--wp--custom--line-height--16);
}

.ls-menu__club {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: var(--wp--custom--side-menu--club-gap);
	height: var(--wp--custom--side-menu--club-height);
	padding: var(--wp--custom--side-menu--club-padding);
	border-radius: var(--wp--preset--border-radius--md);
	color: var(--wp--preset--color--text-menu);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--16);
	text-decoration: none;
}

.ls-menu--collapsed .ls-menu__club {
	height: auto;
	padding: 0;
}

.ls-menu__club img {
	flex: 0 0 auto;
	width: var(--wp--custom--side-menu--avatar);
	height: var(--wp--custom--side-menu--avatar);
	border-radius: var(--wp--preset--border-radius--lg);
	object-fit: cover;
}

.ls-menu__club span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ls-menu__more {
	color: var(--wp--preset--color--action-accent);
	font-size: var(--wp--preset--font-size--16);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--16);
	text-decoration: none;
}

.ls-menu__more:hover {
	color: var(--wp--preset--color--action-accent-hover);
}

/* Author spotlight (patterns/spotlight-header.php, design guidelines 5). Inside the white article card
   the panel takes the page background with radius lg, like the quote. Portrait round as on the author
   page, book cover with radius sm and Elevation 1 as on the Figma Book page. */
.ls-spotlight {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--card-lg);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--background-page);
}

.ls-spotlight > * {
	margin-block: 0;
}

.ls-spotlight__author,
.ls-spotlight__book {
	gap: var(--wp--preset--spacing--50);
}

.ls-spotlight__book {
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--border);
}

.ls-spotlight :where(.ls-spotlight__portrait, .ls-spotlight__cover) {
	flex: 0 0 auto;
	margin: 0;
}

.ls-spotlight__portrait img {
	display: block;
	width: var(--wp--custom--spotlight--portrait);
	height: var(--wp--custom--spotlight--portrait);
	border-radius: var(--wp--preset--border-radius--full);
	object-fit: cover;
}

.ls-spotlight__cover img {
	display: block;
	width: var(--wp--custom--spotlight--cover);
	height: auto;
	aspect-ratio: 2 / 3;
	border-radius: var(--wp--preset--border-radius--sm);
	box-shadow: var(--wp--preset--shadow--elevation-1);
	object-fit: cover;
}

.ls-spotlight__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
	min-width: 0;
}

.ls-spotlight__text > * {
	margin: 0;
}

.ls-article-body .ls-spotlight__name {
	margin: 0;
	font-size: var(--wp--preset--font-size--28);
	line-height: var(--wp--custom--line-height--heading);
}

.ls-spotlight__bio,
.ls-spotlight__blurb {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--16);
	line-height: var(--wp--custom--line-height--16);
}

.ls-spotlight__label {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--12);
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
}

.ls-article-body .ls-spotlight__book h3 {
	margin: 0;
}

.ls-spotlight__meta {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

/* External link bar (patterns/link-bar.php): a title and a wrapping row of buttons. */
.ls-link-bar {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--border);
}

.ls-link-bar > * {
	margin: 0;
}

.ls-link-bar__title {
	font-size: var(--wp--preset--font-size--18);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--18);
}

.ls-link-bar .wp-block-buttons {
	gap: var(--wp--preset--spacing--30);
}

@media (max-width: 781px) {
	.ls-spotlight {
		padding: var(--wp--preset--spacing--card);
	}

	.ls-spotlight__author,
	.ls-spotlight__book {
		flex-direction: column;
	}

	.ls-spotlight__portrait img {
		width: var(--wp--custom--spotlight--portrait-small);
		height: var(--wp--custom--spotlight--portrait-small);
	}

	.ls-spotlight__cover img {
		width: var(--wp--custom--spotlight--cover-small);
	}

	.ls-article-body .ls-spotlight__name {
		font-size: var(--wp--preset--font-size--24);
	}
}

/* Book review card (patterns/review-header.php, client feedback 19.11.): a compact strip inside the
   article card. Light 1px border instead of a grey panel, a small cover, the title as the Figma card
   title (600 18/28), "by Author" Body 14, one line of details in Caption 12 separated by middle dots,
   genres as Figma Badges and one Primary button to the book on LotusShelf. Phones: cover beside the
   text, the button below on its own row. The ISBN never reaches the page (inc/book-review.php); in the
   editor it is marked as hidden from readers. */
.ls-review.ls-review__book {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--background-surface);
}

.ls-review > *,
.ls-review .ls-review__text > *,
.ls-review .ls-review__details > *,
.ls-review .ls-review__genres > * {
	margin: 0;
}

.wp-block-image.ls-review__cover {
	align-self: start;
	width: var(--wp--custom--review--cover);
	margin: 0;
}

.ls-review__cover img {
	display: block;
	width: var(--wp--custom--review--cover);
	height: auto;
	aspect-ratio: 2 / 3;
	border-radius: var(--wp--preset--border-radius--sm);
	box-shadow: var(--wp--preset--shadow--elevation-1);
	object-fit: cover;
}

.ls-review__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
}

.ls-review__title {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--18);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--18);
}

.ls-review__author {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--14);
	line-height: var(--wp--custom--line-height--14);
}

.ls-review__details.is-layout-flex {
	gap: 0;
}

.ls-review__details > p {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}

.ls-review__details > :is(.ls-review__year, .ls-review__pages) {
	white-space: nowrap;
}

.ls-review__details > p:not(:last-child)::after {
	content: "\00B7";
	padding: 0 var(--wp--preset--spacing--20);
}

.ls-review__details > p:has(+ .ls-review__isbn)::after {
	content: none;
}

/* Only the editor ever shows the ISBN (the page never gets it), so it says why it is there. */
.ls-review__details > .ls-review__isbn {
	flex-basis: 100%;
	color: var(--wp--preset--color--muted);
}

.ls-review__details > .ls-review__isbn::before {
	content: "ISBN, for search engines only (hidden on the page): ";
}

.ls-review__genres.is-layout-flex {
	gap: var(--wp--preset--spacing--20);
	margin-top: var(--wp--preset--spacing--10);
}

.ls-review__action.wp-block-buttons {
	margin: 0;
}

.ls-review__action .wp-block-button__link {
	white-space: nowrap;
}

/* Spoiler warning (patterns/spoiler.php): a Details block styled as the callout in the warning colour.
   Closed, only the warning line shows; the chevron turns when it opens, as in the table of contents. */
.wp-block-details.ls-spoiler {
	display: flow-root;
	border-left: var(--wp--custom--callout--border) solid var(--wp--custom--palette--warning--600);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--custom--palette--warning--100);
	color: var(--wp--preset--color--text-primary);
}

.ls-spoiler > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--50);
	border-radius: var(--wp--preset--border-radius--md);
	font-size: var(--wp--preset--font-size--16);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--16);
	list-style: none;
	cursor: pointer;
}

.ls-spoiler > summary::-webkit-details-marker {
	display: none;
}

.ls-spoiler > summary::after {
	content: "";
	flex: none;
	width: var(--wp--custom--icon--size-brand);
	height: var(--wp--custom--icon--size-brand);
	background: currentColor;
	mask: url(assets/icons/chevron-down.svg) center / contain no-repeat;
	transition: transform var(--wp--custom--transition);
}

.ls-spoiler[open] > summary::after {
	transform: rotate(180deg);
}

.ls-article-body .ls-spoiler > :not(summary) {
	margin: 0 var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.ls-article-body .ls-spoiler > :last-child:not(summary) {
	margin-bottom: var(--wp--preset--spacing--50);
}

@media (max-width: 599px) {
	.ls-review.ls-review__book {
		grid-template-columns: auto minmax(0, 1fr);
		align-items: start;
		column-gap: var(--wp--preset--spacing--40);
		padding: var(--wp--preset--spacing--40);
	}

	.wp-block-image.ls-review__cover,
	.ls-review__cover img {
		width: var(--wp--custom--review--cover-small);
	}

	.ls-review__action.wp-block-buttons {
		grid-column: 1 / -1;
	}

	.ls-review__action .wp-block-button {
		width: 100%;
	}

	.ls-review__action .wp-block-button__link {
		width: 100%;
	}
}

/* Writer profile page (templates/page-writer.html, patterns/writer-page.php, author page B). The profile
   reuses the author page card; the book cards follow the Figma "From the same Author" cards: white card,
   cover 2:3 with radius sm, title Poppins 600 14, meta Caption 12. */
.ls-writer__content {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.ls-writer__content > * {
	margin-block: 0;
}

.ls-writer__content .ls-section-title {
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-image.ls-author-profile__photo {
	margin: 0;
}

.wp-block-image.ls-author-profile__photo img {
	display: block;
	width: var(--wp--custom--avatar--size-large);
	height: var(--wp--custom--avatar--size-large);
	border-radius: var(--wp--preset--border-radius--full);
	object-fit: cover;
}

.ls-author-profile__link.wp-block-buttons {
	gap: var(--wp--preset--spacing--30);
}

.ls-books {
	gap: var(--wp--preset--spacing--40);
}

.ls-book.is-style-card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30);
}

.ls-book > * {
	margin: 0;
}

.ls-book__cover {
	margin-bottom: var(--wp--preset--spacing--20);
}

.ls-book__cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	border-radius: var(--wp--preset--border-radius--sm);
	object-fit: cover;
}

.ls-book__title {
	font-size: var(--wp--preset--font-size--14);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--14);
}

.ls-book__meta {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--12);
	line-height: var(--wp--custom--line-height--12);
}

.ls-book__links {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
	gap: var(--wp--preset--spacing--20);
}

.ls-book__links .wp-block-button__link {
	padding: calc((var(--wp--custom--button--height-small) - var(--wp--custom--line-height--13)) / 2) var(--wp--custom--button--padding-x-small);
}

@media (max-width: 781px) {
	.wp-block-image.ls-author-profile__photo img {
		width: var(--wp--custom--avatar--size-large-mobile);
		height: var(--wp--custom--avatar--size-large-mobile);
	}
}

/* Respect the reader's motion preference for every transition in the theme. */
@media (prefers-reduced-motion: reduce) {
	*,
	::before,
	::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
