/*
 * Concept 3: Romantasy. Styles on top of Author Base.
 *
 * Colours, fonts and dials come from theme.json (blush silk, deep plum,
 * violane, emerald and rose gold). This file adds the textures, the hero with
 * floating motes of light, the script accents and the concept features the
 * content plugin places on pages (classes starting with "cs-").
 *
 * 1. Grounds and textures      7. Characters
 * 2. Header and footer         8. Series, books, spice and badges
 * 3. Type details              9. Signed copies
 * 4. Hero                     10. Forms and the welcome email
 * 5. Page intros              11. Motion
 * 6. Home sections            12. Phones and tablets (last, so it wins)
 */

:root {
	--cs-plum: var(--wp--preset--color--contrast);
	--cs-silk: var(--wp--preset--color--base);
	--cs-petal: var(--wp--preset--color--base-2);
	--cs-violane: var(--wp--preset--color--accent-1);
	--cs-emerald: var(--wp--preset--color--accent-2);
	--cs-rose: var(--wp--preset--color--accent-3);
	--cs-rose-deep: #b76e79; /* decorative only (lines, dots, ornaments), never text */
	--cs-line: var(--wp--preset--color--border);
	--cs-night: #1c0a1a;
	--cs-velvet: url(../images/texture-velvet.jpg);
	--cs-silk-texture: url(../images/texture-silk.jpg);
	--cs-glow: 0 0 0 1px rgb(183 110 121 / 0.35), 0 18px 40px rgb(28 10 26 / 0.22);
}

/* 1. Grounds and textures ---------------------------------------------------- */

body {
	background-image: var(--cs-silk-texture);
	background-size: 640px;
}

::selection {
	background: var(--cs-rose);
	color: var(--cs-plum);
}

.is-style-section-alt {
	background-image: linear-gradient(rgb(238 225 219 / 0.7), rgb(238 225 219 / 0.7)), var(--cs-silk-texture);
	background-size: auto, 640px;
}

.is-style-section-dark,
.cs-site-footer {
	background-image: var(--cs-velvet);
	background-size: 640px;
}

/* Emerald velvet for the signup sections (kept dark enough for rose-gold text). */
.is-style-section-accent {
	background-color: #143f33;
	background-image:
		radial-gradient(110% 80% at 18% 0%, rgb(224 170 156 / 0.16), transparent 60%),
		linear-gradient(140deg, #123a2f 0%, #184637 55%, #1b4d3e 100%);
}

/* Rose-gold buttons on dark grounds. */
:is(.is-style-section-dark, .is-style-section-accent, .cs-hero, .authorbase-accent-on-base) .wp-block-button:not(.is-style-outline) > .wp-element-button,
:is(.is-style-section-dark, .is-style-section-accent, .cs-hero, .authorbase-accent-on-base) .atk-buy .wp-element-button {
	background-color: var(--cs-rose);
	color: var(--cs-plum);
	box-shadow: none;
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero, .authorbase-accent-on-base) .wp-block-button:not(.is-style-outline) > .wp-element-button:is(:hover, :focus-visible),
:is(.is-style-section-dark, .is-style-section-accent, .cs-hero, .authorbase-accent-on-base) .atk-buy .wp-element-button:is(:hover, :focus-visible) {
	background-color: var(--cs-silk);
	color: var(--cs-plum);
}

/* Plum buttons on light book colours (the gold prequel). */
.authorbase-accent-on-contrast .wp-block-button:not(.is-style-outline) > .wp-element-button,
.authorbase-accent-on-contrast .atk-buy .wp-element-button {
	background-color: var(--cs-plum);
	color: var(--cs-silk);
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero) a:where(:not(.wp-element-button)):hover {
	color: var(--cs-rose);
}

/* 2. Header and footer ------------------------------------------------------- */

.cs-header {
	background-color: var(--cs-plum);
	background-image: var(--cs-velvet);
	background-size: 640px;
	color: var(--cs-silk);
	border-bottom: 1px solid rgb(224 170 156 / 0.25);
}

body:is(.home, .page-template-page-no-title) .cs-header {
	border-bottom-color: transparent;
}

/* A small rose-gold ribbon knot before the site title, in header and footer. */
.cs-brand .wp-block-site-title {
	display: flex;
	align-items: center;
	gap: 0.55em;
	margin: 0;
	line-height: 1.1;
}

.cs-brand .wp-block-site-title::before {
	content: "";
	flex: none;
	width: 1.5em;
	height: 1.5em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23E0AA9C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 14C11 6 4 8 5 13.5S12 19 16 14z'/%3E%3Cpath d='M16 14c5-8 12-6 11-.5S20 19 16 14z'/%3E%3Cpath d='M14.6 15.5 10 27M17.4 15.5 22 27'/%3E%3C/g%3E%3Ccircle cx='16' cy='14' r='2.3' fill='%23E0AA9C'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cs-brand .wp-block-site-title a {
	color: inherit;
	text-decoration: none;
}

.cs-header .wp-block-navigation-item__content:hover,
.cs-header .current-menu-item > .wp-block-navigation-item__content {
	color: var(--cs-rose);
	text-decoration: none;
}

.cs-header .current-menu-item > .wp-block-navigation-item__content {
	box-shadow: 0 2px 0 var(--cs-rose);
}

/* Free Prequel comes first in the menu: a rose-gold pill. */
.cs-main-menu .wp-block-navigation__container > .wp-block-navigation-item:first-child > .wp-block-navigation-item__content {
	padding: 0.5em 1.1em;
	border: 1px solid var(--cs-rose);
	border-radius: 999px;
	color: var(--cs-rose);
	box-shadow: none;
}

.cs-main-menu .wp-block-navigation__container > .wp-block-navigation-item:first-child > .wp-block-navigation-item__content:is(:hover, :focus-visible) {
	background: var(--cs-rose);
	color: var(--cs-plum);
}

/* Mobile menu panel: plum velvet, like the header. */
.cs-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--cs-plum);
	background-image: var(--cs-velvet);
	color: var(--cs-silk);
}

.cs-footer-newsletter {
	border-top: 1px solid rgb(224 170 156 / 0.25);
}

.cs-site-footer {
	background-color: var(--cs-night);
	color: var(--cs-silk);
	border-top: 1px solid rgb(224 170 156 / 0.18);
}

.cs-site-footer a:where(:not(.wp-element-button)) {
	color: inherit;
}

.cs-site-footer .wp-block-site-tagline {
	opacity: 0.85;
	font-style: italic;
}

.cs-site-footer .authorbase-footer__rule {
	color: rgb(224 170 156 / 0.3);
	border-color: rgb(224 170 156 / 0.3);
}

.cs-footer-bottom {
	row-gap: var(--wp--preset--spacing--40);
}

.cs-concept-line {
	opacity: 0.9;
	letter-spacing: 0.02em;
}

/* These pages have their own signup, so the footer band would repeat it. */
:is(.cs-page-free-prequel, .cs-page-welcome-email) .cs-footer-newsletter {
	display: none;
}

/* 3. Type details ------------------------------------------------------------ */

p.is-style-eyebrow {
	letter-spacing: 0.18em;
	color: var(--cs-emerald);
}

/*
 * Script accent: section labels are set in the script face (Pinyon Script when
 * its file is in assets/fonts, Cardo Italic until then). Small labels inside
 * cards keep the plain uppercase style.
 */
:is(.authorbase-section, .wp-block-column, .wp-block-cover__inner-container, .authorbase-book-hero__text) > p.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--script);
	font-style: italic;
	font-size: 1.4rem;
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 1.25;
	text-transform: none;
	color: var(--cs-violane);
}

.cs-has-script :is(.authorbase-section, .wp-block-column, .wp-block-cover__inner-container, .authorbase-book-hero__text) > p.is-style-eyebrow {
	font-style: normal;
	font-size: 2.1rem;
	line-height: 1.1;
	letter-spacing: 0;
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero, .cs-site-footer) p.is-style-eyebrow {
	color: var(--cs-rose);
}

/* On a book's own colour, labels take the readable text colour the parent picked. */
:is(.authorbase-accent-on-base, .authorbase-accent-on-contrast) p.is-style-eyebrow {
	color: inherit;
}

h1,
.wp-block-post-title {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

p:is(.has-large-font-size, .has-x-large-font-size) {
	line-height: 1.45;
}

/* A signup form inside a column lines up with the text beside it. */
.wp-block-column .authorbase-newsletter-form > * {
	max-width: none;
	margin-left: 0 !important;
}

.wp-block-separator.is-style-ornament {
	color: var(--cs-rose-deep);
}

/* Drop cap on the first paragraph of the sample chapter. */
.cs-page-read-the-first-chapter .wp-block-post-content h2 + p::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 4.4em;
	line-height: 0.8;
	padding: 0.06em 0.1em 0 0;
	color: var(--cs-violane);
}

.cs-chapter-note,
.cs-concept-note,
.cs-accolades-note {
	color: var(--wp--preset--color--contrast-2);
	font-style: italic;
}

.cs-concept-note {
	text-align: center;
}

:is(.is-style-section-dark, .is-style-section-accent) .cs-concept-note {
	color: inherit;
	opacity: 0.9;
}

.cs-quote {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	line-height: 1.4;
}

.wp-block-details {
	padding-block: 0.35rem;
	border-bottom: 1px solid var(--cs-line);
}

.wp-block-details summary {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	flex: none;
	color: var(--cs-violane);
	font-size: 1.3em;
	line-height: 1;
}

.wp-block-details[open] summary::after {
	content: "\2212";
}

/* "Sample" labels on reviews and on the hook line. */
.cs-sample-label {
	display: table;
	margin-inline: auto;
	padding: 0.25em 0.9em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--cs-emerald);
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero) .cs-sample-label {
	color: var(--cs-rose);
}

/* "Series complete" badge. */
.cs-badge {
	display: flex;
	align-items: center;
	gap: 0.6em;
	width: fit-content;
	padding: 0.45em 1.2em;
	border: 1px solid var(--cs-rose-deep);
	border-radius: 999px;
	background: rgb(224 170 156 / 0.14);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--cs-violane);
}

.cs-badge::before,
.cs-badge::after {
	content: "";
	flex: none;
	width: 0.45em;
	height: 0.45em;
	background: currentColor;
	transform: rotate(45deg);
}

.cs-hero .cs-badge {
	margin-inline: auto;
	border-color: var(--cs-rose);
	background: rgb(28 10 26 / 0.45);
	color: var(--cs-rose);
}

/* In page content the badge sits at the left edge of the text column. */
.wp-block-post-content > .cs-badge {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}

/* 4. Hero -------------------------------------------------------------------- */

.cs-hero {
	isolation: isolate;
	overflow: hidden;
}

/* The header floats over the hero: keep the hero's first line below it. */
.wp-block-cover.cs-hero {
	padding-top: calc(var(--wp--custom--header--height) + var(--wp--preset--spacing--50));
	padding-bottom: var(--wp--preset--spacing--60);
}

.cs-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 70% 60% at 50% 45%, transparent 35%, rgb(28 10 26 / 0.7) 100%),
		linear-gradient(to top, rgb(28 10 26 / 0.75), transparent 38%);
}

.cs-hero .wp-block-cover__inner-container {
	z-index: 3;
}

.cs-hero h1 {
	color: var(--cs-silk);
	text-shadow: 0 2px 24px rgb(0 0 0 / 0.55);
}

.cs-hero p:not(.is-style-eyebrow, .cs-badge, .cs-sample-label) {
	text-shadow: 0 1px 12px rgb(0 0 0 / 0.6);
}

.cs-hero .cs-sample-label {
	margin-bottom: 0;
	background: rgb(28 10 26 / 0.45);
}

/*
 * Floating motes of light: two layers drifting slowly upwards, each twice the
 * hero's height so the loop has no seam. Shown only when motion is allowed.
 */
.cs-hero::after,
.cs-hero .wp-block-cover__background::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 200%;
	z-index: 2;
	pointer-events: none;
	opacity: 0;
	background-repeat: repeat;
	background-size: 100% 50%;
}

.cs-hero::after {
	background-image:
		radial-gradient(circle at 8% 82%, rgb(255 226 214 / 0.95) 0 1.5px, rgb(224 170 156 / 0.4) 2.5px, transparent 5px),
		radial-gradient(circle at 21% 34%, rgb(255 226 214 / 0.9) 0 1px, rgb(224 170 156 / 0.35) 2px, transparent 4px),
		radial-gradient(circle at 37% 71%, rgb(240 210 160 / 0.95) 0 1.5px, rgb(224 170 156 / 0.35) 3px, transparent 6px),
		radial-gradient(circle at 52% 18%, rgb(255 226 214 / 0.9) 0 1px, rgb(224 170 156 / 0.35) 2px, transparent 4px),
		radial-gradient(circle at 64% 88%, rgb(255 226 214 / 0.95) 0 1.5px, rgb(224 170 156 / 0.4) 2.5px, transparent 5px),
		radial-gradient(circle at 78% 46%, rgb(240 210 160 / 0.9) 0 1px, rgb(224 170 156 / 0.35) 2px, transparent 4px),
		radial-gradient(circle at 91% 64%, rgb(255 226 214 / 0.95) 0 1.5px, rgb(224 170 156 / 0.4) 3px, transparent 6px),
		radial-gradient(circle at 46% 52%, rgb(255 226 214 / 0.8) 0 1px, transparent 3px);
}

.cs-hero .wp-block-cover__background::after {
	background-image:
		radial-gradient(circle at 14% 58%, rgb(224 170 156 / 0.5) 0 2px, rgb(224 170 156 / 0.18) 5px, transparent 10px),
		radial-gradient(circle at 33% 12%, rgb(240 210 160 / 0.45) 0 2px, rgb(240 210 160 / 0.15) 5px, transparent 9px),
		radial-gradient(circle at 58% 76%, rgb(224 170 156 / 0.5) 0 2.5px, rgb(224 170 156 / 0.16) 6px, transparent 11px),
		radial-gradient(circle at 84% 28%, rgb(240 210 160 / 0.45) 0 2px, rgb(240 210 160 / 0.15) 5px, transparent 9px),
		radial-gradient(circle at 71% 94%, rgb(224 170 156 / 0.45) 0 2px, transparent 8px);
}

/* 5. Page intros ------------------------------------------------------------- */

/* Pages without a title start under the see-through header. */
body.page-template-page-no-title .wp-block-post-content > .alignfull:first-child.authorbase-section {
	padding-top: calc(var(--wp--custom--header--height) + var(--wp--custom--section--padding));
}

.cs-page-intro {
	text-align: center;
	border-bottom: 1px solid rgb(224 170 156 / 0.25);
}

.cs-page-intro h1::after {
	content: "";
	display: block;
	height: 1.5rem;
	margin-top: var(--wp--preset--spacing--40);
	background: var(--wp--custom--ornament) center / auto 100% no-repeat;
}

/* 6. Home sections ----------------------------------------------------------- */

/* Covers beside text stay book-sized, whatever the column width. */
:is(.cs-magnet, .cs-magnet-landing) .is-style-book-cover-3d {
	max-width: 20rem;
	margin-inline: auto;
}

/* The three covers: always side by side. */
.cs-trio {
	gap: var(--wp--preset--spacing--60);
	margin-block: var(--wp--preset--spacing--60);
}

.cs-trio__book {
	text-align: center;
}

.cs-trio__book .wp-block-image {
	max-width: 15rem;
	margin-inline: auto;
}

.cs-trio__number {
	margin: var(--wp--preset--spacing--40) 0 0;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cs-emerald);
}

.cs-trio__title {
	margin-top: 0.2rem;
}

.cs-trio__title a {
	color: inherit;
	text-decoration: none;
}

.cs-trio__title a:is(:hover, :focus-visible) {
	color: var(--cs-violane);
}

.cs-trio--post {
	gap: var(--wp--preset--spacing--40);
}

/* Sample review carousel: a row that scrolls sideways with snap points. */
.cs-accolades {
	display: flex;
	gap: var(--wp--preset--spacing--50);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--wp--preset--spacing--20);
	scrollbar-width: thin;
	scrollbar-color: var(--cs-rose-deep) transparent;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
}

.cs-accolades > .cs-accolade {
	flex: 0 0 min(22rem, 82%);
	margin: 0;
	padding: var(--wp--preset--spacing--50);
	scroll-snap-align: start;
	border: 1px solid var(--cs-line);
	border-top: 3px solid var(--cs-rose-deep);
	border-radius: var(--wp--custom--radius--card);
	background: rgb(255 251 248 / 0.75);
	box-shadow: 0 10px 28px rgb(42 16 39 / 0.08);
}

.cs-accolades:focus-visible {
	outline: 2px solid var(--cs-violane);
	outline-offset: 2px;
}

.cs-accolade .cs-sample-label {
	margin: 0 0 var(--wp--preset--spacing--30);
}

.cs-accolade .authorbase-praise-quote p {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
	line-height: 1.4;
}

.cs-accolade .authorbase-praise-quote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	color: var(--wp--preset--color--contrast-2);
}

.cs-signed-teaser .wp-block-image img,
.cs-signed-how .wp-block-image img {
	box-shadow: var(--cs-glow);
}

.cs-news-cards .wp-block-post-date {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cs-emerald);
}

.cs-news-cards .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--card);
	box-shadow: 0 10px 24px rgb(42 16 39 / 0.16);
}

.cs-identity-line {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	color: var(--cs-violane);
}

.is-style-section-dark .cs-identity-line {
	color: var(--cs-rose);
}

.cs-inbox {
	height: 100%;
}

/* 7. Characters -------------------------------------------------------------- */

.cs-character-card {
	height: 100%;
	padding: 0.7rem 0.7rem 1.25rem;
	border: 1px solid var(--cs-line);
	border-radius: var(--wp--custom--radius--card);
	background: rgb(255 251 248 / 0.7);
	box-shadow: 0 1px 2px rgb(42 16 39 / 0.06), 0 10px 24px rgb(42 16 39 / 0.08);
	transition: transform var(--wp--custom--motion--speed) ease, box-shadow var(--wp--custom--motion--speed) ease;
}

.cs-character-card > :not(.wp-block-post-featured-image) {
	padding-inline: 0.4rem;
}

.cs-character-card .wp-block-post-featured-image {
	margin-bottom: var(--wp--preset--spacing--40);
}

.cs-character-card .wp-block-post-featured-image img {
	border-radius: calc(var(--wp--custom--radius--card) - 4px);
	outline: 1px solid rgb(224 170 156 / 0.9);
	outline-offset: -7px;
}

.cs-character-card .wp-block-post-title {
	margin-top: 0.2rem;
}

:is(.authorbase-characters, .cs-news-cards) .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

:is(.authorbase-characters, .cs-news-cards) .wp-block-post-title a:is(:hover, :focus-visible) {
	color: var(--cs-violane);
}

.cs-character-card__hook {
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
	line-height: 1.45;
}

.cs-character-card__hook .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.cs-character-hook {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	color: var(--cs-violane);
}

/* 8. Series, books, spice and badges ----------------------------------------- */

.atk-series-books--grid .atk-series-books__list {
	grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 15rem));
	justify-content: center;
	gap: var(--wp--preset--spacing--60);
}

.atk-series-books__item {
	text-align: center;
}

.atk-series-books__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.atk-series-books__number {
	display: block;
	margin-top: var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cs-emerald);
}

.atk-series-books__title {
	display: block;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.2;
}

.atk-series-books__link:is(:hover, :focus-visible) .atk-series-books__title {
	color: var(--cs-violane);
}

.atk-series-books__hook {
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
	line-height: 1.45;
}

.atk-series-books__cover img {
	box-shadow: var(--wp--preset--shadow--book);
}

.cs-status-list {
	padding: 0;
	list-style: none;
}

.cs-status-list li {
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--cs-line);
}

.cs-status {
	display: inline-block;
	min-width: 8.5rem;
	margin: 0 0.8rem 0.3rem 0;
	padding: 0.3em 0.8em;
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-align: center;
	text-transform: uppercase;
}

.cs-status--free {
	border: 1px solid var(--cs-emerald);
	color: var(--cs-emerald);
}

.cs-status--out {
	background: var(--cs-violane);
	color: var(--wp--preset--color--on-accent-1);
}

/* Spice level and content notes. */
.cs-note-card {
	margin-block: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border: 1px solid var(--cs-line);
	border-left: 3px solid var(--cs-rose-deep);
	border-radius: var(--wp--custom--radius--card);
	background: rgb(255 251 248 / 0.7);
}

.cs-note-card > * {
	margin-block: 0.4rem;
}

.cs-note-card h3 a {
	color: inherit;
	text-decoration: none;
}

.cs-note-card h3 a:is(:hover, :focus-visible) {
	color: var(--cs-violane);
}

.cs-spice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.8rem;
}

.cs-spice__meter {
	display: inline-flex;
	gap: 0.35rem;
}

.cs-spice__dot {
	width: 0.8rem;
	height: 0.8rem;
	border: 1.5px solid var(--cs-violane);
	border-radius: 50%;
}

.cs-spice__dot.is-on {
	background: var(--cs-violane);
}

.cs-spice__text {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cs-violane);
}

#content-notes {
	scroll-margin-top: calc(var(--wp--custom--header--height) + 1rem);
}

.atk-praise__text {
	font-style: italic;
}

.atk-praise__source {
	font-family: var(--wp--preset--font-family--accent);
	letter-spacing: 0.02em;
}

/* "More stores" list: dark links on the light box, with room around them. */
.atk-buy__more[open] .atk-buy__list {
	padding: 0.5rem 1.25rem;
	gap: 0;
}

.atk-buy .atk-buy__more .atk-buy__list a:where(:not(.wp-element-button)) {
	display: block;
	padding-block: 0.6rem;
	color: var(--cs-plum);
	text-decoration: underline;
	text-decoration-color: var(--cs-rose-deep);
	text-underline-offset: 0.25em;
}

.atk-buy .atk-buy__more .atk-buy__list a:where(:not(.wp-element-button)):is(:hover, :focus-visible) {
	color: var(--cs-violane);
	text-decoration-color: currentColor;
}

.atk-buy .atk-buy__more .atk-buy__item + .atk-buy__item {
	border-top: 1px solid var(--cs-line);
}

/* 9. Signed copies ----------------------------------------------------------- */

.cs-editions {
	gap: var(--wp--preset--spacing--50);
}

.cs-edition {
	display: flex;
	flex-direction: column;
	padding: 0.7rem 0.7rem 1.1rem;
	background: rgb(255 251 248 / 0.75);
	border: 1px solid var(--cs-line);
}

.cs-edition > * {
	margin-block: 0.35rem;
	padding-inline: 0.4rem;
}

.cs-edition > .wp-block-image {
	margin: 0 0 0.5rem;
	padding: 0;
}

.cs-edition > .wp-block-image img {
	border-radius: calc(var(--wp--custom--radius--card) - 4px);
}

.cs-edition__price {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.1;
	color: var(--cs-violane);
}

.cs-edition > .wp-block-buttons {
	margin-top: auto;
	padding-top: 0.5rem;
}

.cs-edition .wp-block-button {
	width: 100%;
}

.cs-edition .wp-block-button__link {
	display: block;
	box-sizing: border-box;
	width: 100%;
	padding: 0.7em 0.8em;
	font-size: var(--wp--preset--font-size--x-small);
	text-align: center;
}

#order {
	scroll-margin-top: calc(var(--wp--custom--header--height) + 1rem);
}

/* 10. Forms and the welcome email -------------------------------------------- */

.cs-demo-form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--30);
}

.cs-demo-form > p {
	margin: 0;
}

.cs-demo-form__field {
	flex: 1 1 14rem;
}

.cs-demo-form__field label {
	display: block;
	margin-bottom: 0.3rem;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cs-demo-form__submit {
	flex: 0 0 auto;
}

.cs-demo-form .cs-demo-form__submit button {
	margin-top: 0;
	min-height: 3.1rem;
}

.cs-demo-form__note,
.cs-demo-form__thanks {
	flex-basis: 100%;
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.9;
}

.cs-demo-form__thanks {
	font-size: var(--wp--preset--font-size--small);
	font-style: italic;
	opacity: 1;
}

.cs-demo-form.is-sent .cs-demo-form__note {
	display: none;
}

:is(.cs-contact-form, .cs-order-form) {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

:is(.cs-contact-form, .cs-order-form) :is(input, select, textarea) {
	box-sizing: border-box;
	width: 100%;
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero) .cs-demo-form button {
	background-color: var(--cs-rose);
	border-color: var(--cs-rose);
	color: var(--cs-plum);
}

:is(.is-style-section-dark, .is-style-section-accent, .cs-hero) .cs-demo-form button:hover {
	background-color: var(--cs-silk);
	border-color: var(--cs-silk);
	color: var(--cs-plum);
}

.cs-email {
	max-width: 40rem;
	margin: var(--wp--preset--spacing--50) auto;
	overflow: hidden;
	border: 1px solid var(--cs-line);
	border-radius: var(--wp--custom--radius--card);
	background: #fffbf8;
	box-shadow: 0 24px 60px rgb(42 16 39 / 0.16);
}

.cs-email p {
	margin: 0 0 1em;
}

.cs-email__meta {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--cs-line);
	background: var(--cs-petal);
	font-size: var(--wp--preset--font-size--small);
}

.cs-email__meta p {
	margin: 0.15rem 0;
}

.cs-email__body {
	padding: 2rem clamp(1.25rem, 5vw, 2.5rem);
}

.cs-email__brand {
	padding-bottom: 0.8rem;
	border-bottom: 1px solid var(--cs-rose-deep);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: 0.06em;
	text-align: center;
	color: var(--cs-violane);
}

.cs-email__cover {
	display: block;
	width: 9rem;
	margin: 1.5rem auto;
	box-shadow: var(--wp--preset--shadow--book);
}

.cs-email__cta {
	text-align: center;
}

.cs-email__button {
	display: inline-block;
	padding: 0.85em 1.8em;
	border-radius: 999px;
	background: var(--cs-violane);
	color: var(--wp--preset--color--on-accent-1);
	font-family: var(--wp--preset--font-family--accent);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
}

.cs-email__button:is(:hover, :focus-visible) {
	background: var(--cs-plum);
	color: var(--cs-rose);
}

.cs-email__ps {
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
}

.cs-email__footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--cs-line);
	font-size: var(--wp--preset--font-size--x-small);
	text-align: center;
	color: var(--wp--preset--color--contrast-2);
}

/* 11. Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	body:not(.authorbase-motion-off) .cs-hero::after {
		opacity: 1;
		animation: cs-motes 38s linear infinite;
	}

	body:not(.authorbase-motion-off) .cs-hero .wp-block-cover__background::after {
		opacity: 1;
		animation: cs-motes 60s linear infinite;
	}

	body:not(.authorbase-motion-off) :is(.cs-character-card, .cs-edition, .cs-accolade):is(:hover, :focus-within) {
		transform: translateY(-5px);
		box-shadow: 0 2px 4px rgb(42 16 39 / 0.08), 0 18px 36px rgb(42 16 39 / 0.16);
	}

	body:not(.authorbase-motion-off) :is(.cs-edition, .cs-accolade) {
		transition: transform var(--wp--custom--motion--speed) ease, box-shadow var(--wp--custom--motion--speed) ease;
	}
}

/* Moves up by exactly one tile (half the layer's height), so the loop is seamless. */
@keyframes cs-motes {
	from { transform: translateY(0); }
	to { transform: translateY(-50%); }
}

/* 12. Phones and tablets ------------------------------------------------------
 * Kept at the end of the file on purpose: these rules must come after the
 * desktop rules they adjust. Selectors follow the markup WordPress outputs
 * (to be checked on the live site at 375 px, iPhone SE, in step 8).
 */

@media (max-width: 781px) {
	/* Smaller type scale, so long words fit on one line. */
	html:root {
		--wp--custom--section--padding: var(--wp--preset--spacing--60);
		--wp--preset--font-size--display: 2.2rem;
		--wp--preset--font-size--xx-large: 1.85rem;
		--wp--preset--font-size--x-large: 1.5rem;
		--wp--preset--font-size--large: 1.2rem;
	}

	/* Never split a word across lines (the type scale makes them fit). */
	:is(h1, h2, h3, h4, .wp-block-post-title, .atk-series-books__title, .wp-block-site-title) {
		overflow-wrap: normal;
		word-break: normal;
		hyphens: manual;
	}

	/* Header: one line for the name, menu button beside it. */
	.cs-header .wp-block-site-title {
		font-size: 1.15rem;
		white-space: nowrap;
	}

	/* Phone menu: plum velvet panel, large readable links, comfortable taps. */
	.cs-header .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
		background-color: var(--cs-plum);
		background-image: var(--cs-velvet);
		background-size: 640px;
		color: var(--cs-silk);
	}

	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
		align-items: center;
		gap: 0;
		width: 100%;
	}

	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100%;
		justify-content: center;
		border-bottom: 1px solid rgb(224 170 156 / 0.22);
	}

	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		padding: 0.85rem 0;
		color: var(--cs-silk);
		font-size: 1.1rem;
		letter-spacing: 0.14em;
		text-align: center;
	}

	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:is(:hover, :focus-visible) {
		color: var(--cs-rose);
	}

	/* In the phone menu, Free Prequel stays a pill, centred, with room around it. */
	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:first-child {
		padding-block: 0.6rem 1rem;
	}

	.cs-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:first-child > .wp-block-navigation-item__content {
		width: auto;
		padding: 0.7rem 1.6rem;
		color: var(--cs-rose);
	}

	.cs-header .wp-block-navigation__responsive-container-close,
	.cs-header .wp-block-navigation__responsive-container-open {
		color: var(--cs-silk);
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Hero: comfortable on short phone screens. */
	.wp-block-cover.cs-hero {
		min-height: 100svh !important;
	}

	/* Script labels: a little smaller. */
	:is(.authorbase-section, .wp-block-column, .wp-block-cover__inner-container, .authorbase-book-hero__text) > p.is-style-eyebrow {
		font-size: 1.25rem;
	}

	.cs-has-script :is(.authorbase-section, .wp-block-column, .wp-block-cover__inner-container, .authorbase-book-hero__text) > p.is-style-eyebrow {
		font-size: 1.75rem;
	}

	.cs-badge {
		letter-spacing: 0.1em;
	}

	/* Covers and portraits beside text: book-sized, centred. */
	:is(.cs-magnet, .cs-magnet-landing) .is-style-book-cover-3d,
	.authorbase-book-hero .is-style-book-cover-3d {
		max-width: 12rem;
		margin-inline: auto;
	}

	:is(.cs-about-top, .authorbase-about-teaser) .wp-block-image {
		max-width: 16rem;
		margin-inline: auto;
	}

	/* The three covers stay in one row: small covers, short titles. */
	.cs-trio {
		gap: var(--wp--preset--spacing--30);
	}

	.cs-trio__number {
		font-size: 0.8125rem;
		letter-spacing: 0.08em;
	}

	.cs-trio__title {
		font-size: 0.9375rem !important;
		line-height: 1.25;
	}

	/* Carousel: one card and a peek of the next. */
	.cs-accolades > .cs-accolade {
		flex-basis: 84%;
		padding: var(--wp--preset--spacing--40);
	}

	/* A thin spacer keeps room after the last card. */
	.cs-accolades-section .cs-accolades::after {
		content: "";
		flex: 0 0 1px;
	}

	.cs-accolades-section .cs-accolades-note::before {
		content: "\2194  Swipe for more  \00B7  ";
		font-style: normal;
		font-weight: 700;
		letter-spacing: 0.06em;
	}

	/* Buy buttons: one clean full-width stack with space between. */
	.atk-buy .atk-buy__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0.6rem;
	}

	.atk-buy .atk-buy__link {
		display: block;
		box-sizing: border-box;
		width: 100%;
		text-align: center;
	}

	.atk-buy__toggle,
	.atk-warnings__toggle,
	.wp-block-details summary {
		min-height: 44px;
		display: flex;
		align-items: center;
	}

	.wp-block-post-terms a {
		display: inline-block;
		padding-block: 0.65rem;
	}

	/* Books, characters and editions: two per row. */
	.atk-series-books--grid .atk-series-books__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	}

	.atk-series-books__title {
		font-size: var(--wp--preset--font-size--medium);
	}

	.atk-series-books__hook {
		font-size: var(--wp--preset--font-size--small);
	}

	.authorbase-characters .wp-block-post-template.is-layout-grid,
	.cs-editions.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--40);
	}

	.cs-character-card,
	.cs-edition {
		padding: 0.4rem 0.4rem 0.9rem;
	}

	.cs-character-card > :not(.wp-block-post-featured-image),
	.cs-edition > :not(.wp-block-image) {
		padding-inline: 0.2rem;
	}

	.cs-character-card .wp-block-post-featured-image {
		margin-bottom: var(--wp--preset--spacing--30);
	}

	.cs-character-card .wp-block-post-featured-image img {
		outline-offset: -4px;
	}

	.authorbase-characters p.is-style-eyebrow {
		font-size: 0.8125rem;
		letter-spacing: 0.04em;
		line-height: 1.35;
	}

	.authorbase-characters .wp-block-post-title,
	.cs-edition h3 {
		font-size: 1.05rem !important;
	}

	.cs-character-card__hook,
	.cs-edition p.has-small-font-size {
		font-size: 0.875rem !important;
		line-height: 1.4;
	}

	.cs-edition__price {
		font-size: 1.35rem;
	}

	.cs-edition .wp-block-button__link {
		padding: 0.75em 0.4em;
		min-height: 44px;
		letter-spacing: 0.04em;
	}

	/* News: small picture beside each title. */
	.cs-news-cards .wp-block-post {
		display: grid;
		grid-template-columns: 7rem 1fr;
		column-gap: var(--wp--preset--spacing--40);
		align-items: start;
	}

	.cs-news-cards .wp-block-post > * {
		margin: 0;
		grid-column: 2;
	}

	.cs-news-cards .wp-block-post-featured-image {
		grid-column: 1;
		grid-row: 1 / span 3;
	}

	.cs-news-cards .wp-block-post-featured-image img {
		aspect-ratio: 1 !important;
	}

	.cs-news-cards .wp-block-post-title {
		font-size: var(--wp--preset--font-size--medium) !important;
	}

	.cs-news-cards .wp-block-post-excerpt {
		display: none;
	}

	/* Lists read comfortably on a narrow screen. */
	.cs-status {
		min-width: 0;
	}

	.cs-note-card {
		padding: var(--wp--preset--spacing--40);
	}

	.cs-email__body {
		padding: 1.5rem 1.1rem;
	}

	/* Footer menu: easy to tap. */
	.authorbase-footer__menu .wp-block-navigation-item__content {
		display: inline-block;
		padding-block: 0.7rem;
	}
}

@media (max-width: 599px) {
	/* Side-by-side buttons become a clean full-width stack. */
	.wp-block-buttons > .wp-block-button {
		flex: 1 1 100%;
	}

	.wp-block-buttons > .wp-block-button > .wp-block-button__link {
		display: block;
		box-sizing: border-box;
		width: 100%;
		text-align: center;
	}

	.cs-demo-form__submit,
	.cs-demo-form__submit button {
		flex-basis: 100%;
		width: 100%;
	}
}
