/*
 * Author Base: theme styles.
 *
 * This file reads only design names (--wp--preset--*) and design dials
 * (--wp--custom--*) from theme.json, so a child theme restyles everything by
 * changing theme.json values. It is loaded on the front end and in the editor.
 *
 * Contents
 * 1. Page frame
 * 2. Headers (logo left, centered split, overlay) and footer
 * 3. Block styles: book covers, ornament, eyebrow, card
 * 4. Section styles helpers
 * 5. Heroes
 * 6. Books, series and the book page
 * 7. Author Toolkit blocks (.atk-*)
 * 8. Other sections (praise, press, events, downloads, FAQ, stats)
 * 9. Forms: newsletter and contact slots (common providers)
 * 10. The Events Calendar
 * 11. Focus, motion and reduced motion
 */

/* 1. Page frame ------------------------------------------------------------ */

.wp-site-blocks > * {
	margin-block-start: 0;
}

.authorbase-section {
	padding-block: var(--wp--custom--section--padding);
}

/* Full-width sections sit edge to edge, with no gap between them. */
.alignfull:is(.authorbase-section, .authorbase-hero, .authorbase-newsletter, .authorbase-footer),
.wp-block-post-content > .alignfull:first-child {
	margin-block: 0;
}

.authorbase-rounded img {
	border-radius: var(--wp--custom--radius--card);
}

/* Quiet text (dates, captions, labels) becomes plain text color on dark grounds. */
:is(.is-style-section-dark, .is-style-section-accent, .is-style-section-overlay, .authorbase-has-book-accent, .wp-block-cover.is-dark)
	:is(p.is-style-eyebrow, .authorbase-release-line, .wp-block-post-date, .wp-element-caption, .atk-praise__source, .atk-details__row dt, .atk-buy__group-title) {
	color: inherit;
}

/* Buttons that share their color with a dark ground get a fine ring so they stay visible. */
:is(.is-style-section-overlay, .wp-block-cover.is-dark) .wp-block-button:not(.is-style-outline) > .wp-element-button {
	box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent);
}

/* 2. Headers and footer ------------------------------------------------------ */

.authorbase-header {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	transition: background-color var(--wp--custom--motion--speed) ease, color var(--wp--custom--motion--speed) ease, box-shadow var(--wp--custom--motion--speed) ease;
}

.authorbase-header__inner {
	min-height: calc(var(--wp--custom--header--height) - 2 * var(--wp--preset--spacing--30));
	align-items: center;
}

.authorbase-header .wp-block-site-title,
.authorbase-header .wp-block-site-title a {
	color: inherit;
}

/* Core's mobile menu panel uses fixed white; use the palette instead. */
.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.wp-block-navigation .wp-block-navigation__submenu-container {
	border-color: var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Centered split: two menus with the logo between them. */
.authorbase-header--split .authorbase-header__side {
	flex: 1 1 0;
	min-width: 0;
}

.authorbase-header--split .authorbase-header__brand--center {
	flex: 0 1 auto;
	text-align: center;
}

/* Split header: the side menus show from 600px; below that one menu button
   (the third Navigation block, set to "always" use the overlay) replaces them. */
.authorbase-header--split .authorbase-header__mobile-nav {
	display: none;
}

@media (max-width: 599px) {
	.authorbase-header__button {
		display: none;
	}

	.authorbase-header--split .authorbase-header__side > .wp-block-navigation:not(.authorbase-header__mobile-nav) {
		display: none;
	}

	.authorbase-header--split .authorbase-header__mobile-nav {
		display: flex;
	}
}

/* Overlay: see-through on the homepage and on pages without a title. */
body:is(.home, .page-template-page-no-title) .wp-site-blocks > header:has(.authorbase-header--overlay) {
	position: absolute;
	inset-inline: 0;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 40;
}

@media (max-width: 600px) {
	body:is(.home, .page-template-page-no-title) .wp-site-blocks > header:has(.authorbase-header--overlay) {
		top: 0;
	}
}

body:is(.home, .page-template-page-no-title) .authorbase-header--overlay {
	background-color: transparent;
	background-image: linear-gradient(to bottom, var(--wp--custom--scrim), transparent);
	color: var(--wp--preset--color--base);
}

body:is(.home, .page-template-page-no-title) .authorbase-header--overlay .wp-block-navigation__responsive-container-open {
	color: inherit;
}

.authorbase-footer .wp-block-navigation {
	font-size: var(--wp--preset--font-size--small);
}

.authorbase-footer__rule {
	margin-block: var(--wp--preset--spacing--50);
}

.authorbase-footer .wp-block-social-links {
	color: inherit;
}

.authorbase-footer .wp-block-social-links.is-style-logos-only .wp-social-link {
	color: inherit;
}

/* 3. Block styles ------------------------------------------------------------ */

/* Book cover flat: the book shadow only. */
:is(.wp-block-image, .wp-block-post-featured-image).is-style-book-cover-flat img {
	box-shadow: var(--wp--preset--shadow--book);
	border-radius: 2px 3px 3px 2px;
}

/* Book cover 3D: book shadow, spine highlight and the tilt dial. */
:is(.wp-block-image, .wp-block-post-featured-image).is-style-book-cover-3d {
	position: relative;
	max-width: 100%;
	transform: perspective(1600px) rotateY(var(--wp--custom--book--tilt));
	transform-origin: left center;
	transform-style: preserve-3d;
	transition: transform calc(var(--wp--custom--motion--speed) * 2) ease;
}

.wp-block-image.is-style-book-cover-3d {
	width: fit-content;
	max-width: min(100%, 24rem);
}

:is(.wp-block-image, .wp-block-post-featured-image).is-style-book-cover-3d img {
	display: block;
	box-shadow: var(--wp--preset--shadow--book);
	border-radius: 2px 5px 5px 2px;
}

:is(.wp-block-image, .wp-block-post-featured-image).is-style-book-cover-3d::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 2px 5px 5px 2px;
	pointer-events: none;
	background-image: linear-gradient(
		90deg,
		transparent 0,
		var(--wp--custom--book--highlight) 1%,
		var(--wp--custom--book--shade) 2.6%,
		var(--wp--custom--book--highlight) 4%,
		transparent 7%,
		transparent 94%,
		var(--wp--custom--book--shade) 100%
	);
}

.wp-block-image.is-style-book-cover-3d:has(figcaption)::after {
	display: none;
}

/* Ornament separator: the child's ornament image over a fine line. With no
   ornament (the base value "none") only the line shows. A child that wants a
   gap in the line under its ornament sets settings.custom.ornamentGap. */
.wp-block-separator.is-style-ornament {
	border: 0;
	height: 2rem;
	width: min(100%, 18rem);
	max-width: 100%;
	margin-inline: auto;
	color: var(--wp--preset--color--accent-3);
	background-color: transparent;
	background-image:
		var(--wp--custom--ornament),
		linear-gradient(currentColor, currentColor),
		linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-size:
		auto 100%,
		calc(50% - var(--wp--custom--ornament-gap, 0px) / 2) 1px,
		calc(50% - var(--wp--custom--ornament-gap, 0px) / 2) 1px;
	background-position: center, left center, right center;
	opacity: 1;
}

.wp-block-separator.is-style-ornament.alignwide,
.wp-block-separator.is-style-ornament.alignfull {
	width: 100%;
}

/* Eyebrow: a small label above a heading. */
p.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: var(--wp--custom--label--transform);
	color: var(--wp--preset--color--accent-2);
}

:where(.is-layout-flow, .is-layout-constrained) > p.is-style-eyebrow + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Card: base-2 ground, card radius, soft shadow. Resets colors so a card reads
   the same inside any section style. */
.wp-block-group.is-style-card {
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--soft);
	overflow: hidden;
}

.wp-block-group.is-style-card:not(.has-background) {
	background-color: var(--wp--preset--color--base-2);
}

.wp-block-group.is-style-card:not(.has-text-color) {
	color: var(--wp--preset--color--contrast);
}

.wp-block-group.is-style-card:not(.has-text-color) :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--contrast);
}

.wp-block-group.is-style-card:not(.has-text-color) a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--accent-1);
}

.wp-block-group.is-style-card:not(.has-text-color) .wp-element-button {
	background-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--on-accent-1);
	border-color: var(--wp--preset--color--accent-1);
}

.wp-block-group.is-style-card:not(.has-text-color) .wp-element-button:is(:focus, :focus-visible) {
	outline-color: var(--wp--preset--color--contrast);
}

.wp-block-group.is-style-card:not(.has-text-color) a:where(:not(.wp-element-button)):is(:focus, :focus-visible) {
	outline-color: currentColor;
}

.wp-block-group.is-style-card:not(.has-text-color) .is-style-eyebrow {
	color: var(--wp--preset--color--accent-2);
}

.wp-block-group.is-style-card .wp-block-post-featured-image img {
	border-radius: 0;
}

/* 4. Section style helpers --------------------------------------------------- */

/* Image overlay on a Group or Columns: a scrim over its background image. */
:is(.wp-block-group, .wp-block-columns).is-style-section-overlay {
	position: relative;
	isolation: isolate;
	background-size: cover;
	background-position: center;
}

:is(.wp-block-group, .wp-block-columns).is-style-section-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: var(--wp--custom--scrim);
}

/* Outline buttons follow the text color of their section. */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background-color: transparent;
	border: 2px solid currentColor;
	color: inherit;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: currentColor;
}

/* 5. Heroes ------------------------------------------------------------------ */

.authorbase-hero h1 {
	text-wrap: balance;
}

/* Photo slider: scroll-snap, no script. The next slide peeks in to show there is more. */
.authorbase-slider {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.authorbase-slider > * {
	flex: 0 0 88%;
	margin: 0;
	scroll-snap-align: start;
}

.authorbase-slider > :last-child {
	flex-basis: 100%;
}

/* Pause/play button on the video hero (added by inc/helpers.php, script assets/js/video-toggle.js). */
.authorbase-video-toggle {
	position: absolute;
	right: var(--wp--preset--spacing--50);
	bottom: var(--wp--preset--spacing--50);
	z-index: 3;
	cursor: pointer;
	padding: 0.5em 1em;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--button);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: var(--wp--custom--label--transform);
}

.authorbase-video-toggle[hidden] {
	display: none;
}

.authorbase-video-toggle:focus-visible {
	outline: 3px solid var(--wp--preset--color--base);
	outline-offset: 3px;
}

/* Expanding panels: the hovered or focused panel grows. */
.authorbase-panels .wp-block-cover {
	height: 100%;
	position: relative;
}

.authorbase-panels h2 a {
	color: inherit;
	text-decoration: none;
}

/* The heading link covers the whole panel. */
.authorbase-panels h2 a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.authorbase-panels h2 a:focus-visible {
	outline: none;
	text-decoration: underline;
}

/* Focus ring drawn inside the focused panel, above the image, overlay and the
   stretched link, at every width: a ring in the panel's text color with a halo in
   the overlay color, so it shows on light and dark palettes. */
.authorbase-panels .wp-block-cover:focus-within::before {
	content: "";
	position: absolute;
	inset: var(--wp--preset--spacing--20);
	z-index: 3;
	pointer-events: none;
	border: 3px solid currentColor;
	border-radius: var(--wp--custom--radius--card);
	box-shadow: 0 0 0 2px var(--wp--preset--color--contrast), inset 0 0 0 2px var(--wp--preset--color--contrast);
}

@media (min-width: 782px) {
	.authorbase-panels > .wp-block-column {
		flex: 1 1 0;
		min-width: 0;
		transition: flex-grow calc(var(--wp--custom--motion--speed) * 2) ease;
	}

	.authorbase-panels > .wp-block-column:is(:hover, :focus-within) {
		flex-grow: 2.2;
	}
}

/* Framed text over a fixed image. */
.authorbase-frame {
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--soft);
	outline: 1px solid var(--wp--preset--color--border);
	outline-offset: calc(-1 * var(--wp--preset--spacing--30));
}

.authorbase-hero--split .wp-block-image,
.authorbase-hero--split .wp-block-image img {
	height: 100%;
	margin: 0;
}

/* 6. Books, series and the book page ----------------------------------------- */

.authorbase-release-line {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.02em;
}

.authorbase-book-hook {
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1.3;
}

.authorbase-book-subtitle {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
}

.authorbase-book-hero .is-style-book-cover-3d,
.authorbase-featured-release .is-style-book-cover-3d,
.authorbase-coming-soon .is-style-book-cover-3d {
	max-width: min(100%, 26rem);
	margin-inline: auto;
}

.authorbase-book-hero--centered .is-style-book-cover-3d {
	max-width: min(100%, 20rem);
}

.authorbase-book-hero--centered .atk-buy {
	justify-content: center;
	margin-inline: auto;
	width: fit-content;
}

/* Per-book (or per-series) accent, set on that page's hero only. The text color
   (base or contrast) is chosen in PHP by contrast against the active palette. */
.authorbase-has-book-accent {
	background-color: var(--authorbase-book-accent);
}

.authorbase-accent-on-base,
.authorbase-accent-on-base :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--base);
}

.authorbase-accent-on-contrast,
.authorbase-accent-on-contrast :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--contrast);
}

.authorbase-has-book-accent a:where(:not(.wp-element-button)) {
	color: inherit;
}

/* Focus rings take the readable text color of the accent ground. */
.authorbase-accent-on-base :is(.wp-element-button, a):is(:focus, :focus-visible) {
	outline-color: var(--wp--preset--color--base);
}

.authorbase-accent-on-contrast :is(.wp-element-button, a):is(:focus, :focus-visible) {
	outline-color: var(--wp--preset--color--contrast);
}

/* A book without a cover: the text column takes the full width. */
.authorbase-book-hero .wp-block-columns > .authorbase-book-hero__text:only-child {
	flex-basis: 100% !important; /* stylelint-disable-line declaration-no-important -- beats the column's inline flex-basis */
}

/* Book cards in grids and carousels. */
.authorbase-books .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.authorbase-books .wp-block-post > * {
	margin: 0;
}

.authorbase-books .wp-block-post-featured-image {
	margin-block-end: var(--wp--preset--spacing--30);
}

/* Side-scrolling rows (books carousel). */
.authorbase-scroller .wp-block-post-template {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(10.5rem, 14rem);
	gap: var(--wp--preset--spacing--50);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
	margin: 0;
}

.authorbase-scroller .wp-block-post {
	scroll-snap-align: start;
}

/* Filter chips on the books archive. */
.authorbase-filter-list,
.authorbase-filter-list .wp-block-post-template {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	list-style: none;
	margin: 0;
	padding: 0;
}

.authorbase-filter-list li,
.authorbase-filter-list .wp-block-post-title {
	margin: 0;
}

.authorbase-filter-list a {
	display: inline-block;
	padding: 0.35em 0.9em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	color: inherit;
	text-decoration: none;
	transition: border-color var(--wp--custom--motion--speed) ease;
}

.authorbase-filter-list a:hover,
.authorbase-filter-list .current-cat > a {
	border-color: currentColor;
}

.authorbase-series-row + .authorbase-series-row {
	border-top: 1px solid var(--wp--preset--color--border);
}

/* 7. Author Toolkit blocks --------------------------------------------------- */
/* The plugin ships structure only; colors, fonts and shapes come from here. */

.atk-buy__group-title {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: var(--wp--custom--label--transform);
	color: var(--wp--preset--color--contrast-2);
}

.atk-buy--text-links a {
	color: inherit;
	text-decoration-color: var(--wp--preset--color--accent-3);
	text-underline-offset: 0.2em;
}

.atk-buy--text-links a:hover {
	text-decoration-color: currentColor;
}

.atk-buy__more > summary {
	cursor: pointer;
}

.atk-buy__more > summary:not(.wp-element-button) {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: var(--wp--custom--label--transform);
	letter-spacing: 0.04em;
}

.atk-buy--dropdown .atk-buy__more[open] .atk-buy__list,
.atk-buy--featured-plus-more .atk-buy__more[open] .atk-buy__list {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--soft);
}

.atk-buy--dropdown .atk-buy__more[open] .atk-buy__list a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--accent-1);
}

.atk-buy__tabs {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.atk-buy__tab {
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: inherit;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
	text-transform: var(--wp--custom--label--transform);
	padding: 0.6em 0.9em;
}

.atk-buy--tabs.atk-is-tabbed .atk-buy__tab[aria-selected="true"] {
	border-bottom-color: currentColor;
	font-weight: 600;
}

.atk-buy--logo-grid .atk-buy__item a {
	display: block;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	transition: border-color var(--wp--custom--motion--speed) ease;
}

.atk-buy--logo-grid .atk-buy__item a:hover {
	border-color: var(--wp--preset--color--contrast);
}

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

.atk-details__row {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--20);
}

.atk-details__row dt {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: var(--wp--custom--label--transform);
	color: var(--wp--preset--color--contrast-2);
}

.atk-series-books__item img {
	box-shadow: var(--wp--preset--shadow--book);
	border-radius: 2px 3px 3px 2px;
}

.atk-series-books__item :is(h2, h3, h4) {
	font-size: var(--wp--preset--font-size--medium);
}

.atk-praise__quote {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.4;
	margin: 0;
	border: 0;
	padding: 0;
}

.atk-praise__quote::before,
.authorbase-praise-quote::before,
.authorbase-pullquote blockquote::before {
	content: "\201C";
	display: block;
	height: 0.55em;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 3em;
	line-height: 1;
	color: var(--wp--preset--color--accent-3);
}

.atk-praise__source {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}

.atk-praise__source a {
	color: inherit;
}

.atk-warnings summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* 8. Other sections ---------------------------------------------------------- */

.authorbase-praise-quote,
.authorbase-pullquote {
	border: 0;
	padding: 0;
	margin: 0;
	text-align: start;
}

.authorbase-praise-quote cite,
.authorbase-pullquote 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;
}

.authorbase-logo img {
	filter: grayscale(1);
	opacity: 0.85;
}

.authorbase-stat__value {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--wp--custom--heading--weight);
	line-height: 1;
	margin-block-end: 0;
}

.authorbase-stats__row {
	text-align: center;
}

.authorbase-event {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.authorbase-event:first-child {
	border-top: 1px solid var(--wp--preset--color--border);
}

.authorbase-event__date {
	min-width: 9rem;
	margin: 0;
}

.authorbase-event__info {
	flex: 1 1 14rem;
}

.authorbase-event__info > * {
	margin: 0;
}

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: var(--wp--custom--heading--weight);
}

.authorbase-map img {
	border-radius: var(--wp--custom--radius--card);
}

.authorbase-author-bio .wp-block-post-author-name {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--wp--custom--heading--weight);
}

.authorbase-post-item + .authorbase-post-item {
	border-top: 1px solid var(--wp--preset--color--border);
}

/* 9. Forms: newsletter and contact slots ------------------------------------- */
/* Pasted provider forms (Mailchimp, MailerLite, Kit, MailPoet, Substack and
   others) take the theme's inputs and buttons. */

:is(.authorbase-newsletter-form, .authorbase-form-slot) {
	text-align: start;
}

:is(.authorbase-newsletter-form, .authorbase-form-slot) :is(input[type="email"], input[type="text"], input[type="tel"], input[type="url"], input[type="number"], select, textarea) {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 0.75em 1em;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.3;
}

:is(.authorbase-newsletter-form, .authorbase-form-slot) :is(input, select, textarea):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

:is(.authorbase-newsletter-form, .authorbase-form-slot) label {
	display: block;
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	margin-block-end: 0.35em;
}

:is(.authorbase-newsletter-form, .authorbase-form-slot) :is(button, input[type="submit"], .button, .formkit-submit, .mailpoet_submit, .ml-form-embedSubmit button) {
	cursor: pointer;
	display: inline-block;
	margin-block-start: var(--wp--preset--spacing--30);
	padding: 0.8em 1.6em;
	background-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--on-accent-1);
	border: 2px solid var(--wp--preset--color--accent-1);
	border-radius: var(--wp--custom--radius--button);
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: var(--wp--custom--label--transform);
	transition: background-color var(--wp--custom--motion--speed) ease, color var(--wp--custom--motion--speed) ease;
}

:is(.authorbase-newsletter-form, .authorbase-form-slot) :is(button, input[type="submit"], .button, .formkit-submit, .mailpoet_submit, .ml-form-embedSubmit button):hover {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* On accent and dark grounds the submit button follows that section's buttons. */
:where(.is-style-section-accent, .is-style-section-dark, .is-style-section-overlay, .wp-block-cover.is-dark) .authorbase-newsletter-form :is(button, input[type="submit"], .button, .formkit-submit, .mailpoet_submit, .ml-form-embedSubmit button) {
	background-color: transparent;
	border-color: currentColor;
	color: inherit;
}

:where(.is-style-section-accent, .is-style-section-dark, .is-style-section-overlay, .wp-block-cover.is-dark) .authorbase-newsletter-form :is(button, input[type="submit"], .button, .formkit-submit, .mailpoet_submit, .ml-form-embedSubmit button):hover {
	background-color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Mailchimp classic embed. */
.authorbase-newsletter-form #mc_embed_signup {
	background: transparent;
	color: inherit;
	font: inherit;
	width: auto;
}

.authorbase-newsletter-form #mc_embed_signup .mc-field-group {
	width: 100%;
	padding-bottom: var(--wp--preset--spacing--20);
}

/* Kit (ConvertKit) and MailerLite cards drop their own boxes. */
.authorbase-newsletter-form :is(.formkit-form, .ml-form-embedWrapper, .ml-form-embedBody) {
	background: transparent !important; /* stylelint-disable-line declaration-no-important -- provider inline styles */
	border: 0 !important; /* stylelint-disable-line declaration-no-important -- provider inline styles */
	box-shadow: none !important; /* stylelint-disable-line declaration-no-important -- provider inline styles */
	max-width: 100% !important; /* stylelint-disable-line declaration-no-important -- provider inline styles */
	color: inherit;
}

/* Substack and other iframe embeds. */
:is(.authorbase-newsletter-form, .authorbase-form-slot) iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
	border-radius: var(--wp--custom--radius--card);
	background: transparent;
}

@media (min-width: 600px) {
	/* Simple email + button forms sit on one line. */
	.authorbase-newsletter-form form:has(> input[type="email"]):has(> :is(button, input[type="submit"])) {
		display: flex;
		gap: var(--wp--preset--spacing--30);
		align-items: stretch;
	}

	.authorbase-newsletter-form form:has(> input[type="email"]) > :is(button, input[type="submit"]) {
		margin-block-start: 0;
		flex: 0 0 auto;
	}
}

/* 10. The Events Calendar ---------------------------------------------------- */
/* Its views read these custom properties; set on body so load order does not matter. */

body {
	--tec-color-background: var(--wp--preset--color--base);
	--tec-color-background-secondary: var(--wp--preset--color--base-2);
	--tec-color-background-events: var(--wp--preset--color--base);
	--tec-color-text-primary: var(--wp--preset--color--contrast);
	--tec-color-text-secondary: var(--wp--preset--color--contrast-2);
	--tec-color-text-event-title: var(--wp--preset--color--contrast);
	--tec-color-text-events-title: var(--wp--preset--color--contrast);
	--tec-color-accent-primary: var(--wp--preset--color--accent-1);
	--tec-color-accent-primary-hover: var(--wp--preset--color--contrast);
	--tec-color-accent-primary-active: var(--wp--preset--color--contrast);
	--tec-color-accent-primary-background: var(--wp--preset--color--base-2);
	--tec-color-button-primary: var(--wp--preset--color--accent-1);
	--tec-color-button-primary-hover: var(--wp--preset--color--contrast);
	--tec-color-button-primary-active: var(--wp--preset--color--contrast);
	--tec-color-button-primary-background: var(--wp--preset--color--base-2);
	--tec-color-button-secondary: var(--wp--preset--color--accent-2);
	--tec-color-link-primary: var(--wp--preset--color--contrast);
	--tec-color-link-accent: var(--wp--preset--color--accent-1);
	--tec-color-link-accent-hover: var(--wp--preset--color--contrast);
	--tec-color-border-default: var(--wp--preset--color--border);
	--tec-color-border-secondary: var(--wp--preset--color--border);
	--tec-color-border-active: var(--wp--preset--color--contrast);
	--tec-color-icon-active: var(--wp--preset--color--accent-1);
	--tec-color-icon-primary: var(--wp--preset--color--contrast-2);
	--tec-color-icon-secondary: var(--wp--preset--color--accent-3);
	--tec-font-family-sans-serif: var(--wp--preset--font-family--body);
	--tec-font-family-base: var(--wp--preset--font-family--body);
	--tec-border-radius-default: var(--wp--custom--radius--card);
}

.tribe-common :is(.tribe-common-h1, .tribe-common-h2, .tribe-common-h3, .tribe-common-h4, .tribe-common-h5, .tribe-common-h6),
.tribe-events-widget-events-list__event-title,
.tribe-events-calendar-list__event-title,
.tribe-events-single-event-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--wp--custom--heading--weight);
	letter-spacing: var(--wp--custom--heading--letter-spacing);
	text-transform: var(--wp--custom--heading--transform);
}

.tribe-common .tribe-common-c-btn,
.tribe-common a.tribe-common-c-btn,
.tribe-events .tribe-events-c-search__button {
	border-radius: var(--wp--custom--radius--button);
	font-family: var(--wp--preset--font-family--accent);
	text-transform: var(--wp--custom--label--transform);
	letter-spacing: 0.04em;
}

.authorbase-events .tribe-events-widget-events-list__header {
	display: none;
}

/* 11. Focus, motion and reduced motion --------------------------------------- */

/* Motion dial at 0 (body class from inc/extras.php): fixed ("parallax") cover images scroll. */
.authorbase-motion-off .wp-block-cover.has-parallax,
.authorbase-motion-off .wp-block-cover__image-background.has-parallax {
	background-attachment: scroll;
}

/* Fallback ring for anything theme.json does not style. Zero specificity, so the
   per-section rings from theme.json and styles/sections/ always win. */
:where(a, button, summary, input, select, textarea, [tabindex]):where(:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

:where(.authorbase-slider, .authorbase-scroller .wp-block-post-template):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

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

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important; /* stylelint-disable-line declaration-no-important -- reduce motion */
		animation-iteration-count: 1 !important; /* stylelint-disable-line declaration-no-important -- reduce motion */
		transition-duration: 0.01ms !important; /* stylelint-disable-line declaration-no-important -- reduce motion */
		scroll-behavior: auto !important; /* stylelint-disable-line declaration-no-important -- reduce motion */
	}

	/* Autoplaying cover videos stop; the dark cover ground and text remain. */
	.wp-block-cover__video-background,
	.authorbase-video-toggle {
		display: none;
	}

	/* Fixed ("parallax") cover images scroll with the page. */
	.wp-block-cover.has-parallax,
	.wp-block-cover__image-background.has-parallax {
		background-attachment: scroll;
	}
}
