/* NarratiaVerse child theme styles. Loaded after Fictioneer's styles. */

/* --- Poems -------------------------------------------------------------------
 * A poem is a one-chapter story in the Poetry genre (body class .nv-poem).
 * Each stanza is its own paragraph; lines inside a stanza are broken with
 * Shift+Enter. Line breaks and stanza gaps are kept. Centred on tablet and
 * desktop, left-aligned on phones.
 */
.nv-poem :is(#chapter-content, .chapter__content) :is(p, .wp-block-verse) {
	text-indent: 0 !important;
	text-align: left !important;
	margin: 0 0 1.75em !important;
	hyphens: manual;
	overflow-wrap: break-word;
}

.nv-poem :is(#chapter-content, .chapter__content) .wp-block-verse {
	white-space: pre-wrap;
	font: inherit;
	background: none;
	padding: 0;
	border: 0;
}

@media (min-width: 768px) {
	.nv-poem :is(#chapter-content, .chapter__content) :is(p, .wp-block-verse) {
		text-align: center !important;
	}
}

/* --- Brand -------------------------------------------------------------------
 * Ember #ff6a3d is the one accent. Link colours per mode (AA) are set in
 * Appearance > Customize (light #A63D15, dark #ff6a3d).
 */
:root {
	--nv-ember: #ff6a3d;
	--nv-night: #141317;
	--nv-mist: #f6f2ea;
	--nv-bar-height: 58px;
}

/* Text logo placeholder; replace with an image in Customize > Site Identity. */
:root {
	--site-title-heading-color: var(--nv-ember);
}

:root[data-mode="light"] {
	--site-title-heading-color: #d11f12;
}

.top-header__link {
	font-weight: 800;
	letter-spacing: -0.01em;
	text-decoration: none;
}

/* Sign up stands out from the other menu links. */
.main-navigation__list > .nv-menu-signup > a {
	color: var(--primary-500);
	font-weight: 700;
}

/* Fictioneer shows the Genres dropdown from 1024px; below that the plain Genres page link stands in. */
@media (min-width: 1024px) {
	.main-navigation__list > .nv-mobile-only {
		display: none;
	}
}

/* --- Responsive safety -------------------------------------------------------
 * No sideways scrolling: media scales, wide tables scroll inside their box.
 */
html,
body {
	overflow-x: clip;
}

:is(.content-section, .chapter__content, #chapter-content, .story__summary) :is(img, video) {
	max-width: 100%;
	height: auto;
}

:is(.content-section, .chapter__content, #chapter-content) :is(iframe, embed, object) {
	max-width: 100%;
}

:is(.content-section, .chapter__content, #chapter-content) figure.wp-block-table,
:is(.content-section, .chapter__content, #chapter-content) table:not(figure table) {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

:is(.content-section, .chapter__content, #chapter-content) :is(pre, code) {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* --- Phones: readable text and thumb-sized targets --------------------------- */
@media (max-width: 767px) {
	:is(.content-section, .chapter__content, #chapter-content, .story__summary) :is(p, li) {
		font-size: max(1em, 16px);
	}

	.icon-menu .menu-item-icon > :is(button, a),
	.mobile-menu__item,
	#mobile-navigation .menu-item > a,
	.footer__menu-list a {
		min-height: 44px;
		min-width: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}

@media (pointer: coarse) {
	.chapter__actions :is(button, a),
	.story__actions :is(button, a),
	.button,
	button.button {
		min-height: 44px;
		min-width: 44px;
	}
}

/* --- Bottom bar (phones) ----------------------------------------------------- */
.nv-bottom-bar {
	display: none;
}

@media (max-width: 767px) {
	.nv-bottom-bar {
		position: fixed;
		inset: auto 0 0 0;
		z-index: 90;
		display: flex;
		padding-bottom: env(safe-area-inset-bottom);
		background: var(--navigation-background, hsl(220 20% 12%));
		border-top: 1px solid var(--card-frame-border-color, rgb(127 127 127 / 0.2));
	}

	.nv-bottom-bar__item {
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: var(--nv-bar-height);
		font-size: 13px;
		font-weight: 600;
		line-height: 1.1;
		color: var(--fg-500);
		text-decoration: none;
	}

	.nv-bottom-bar__item i {
		font-size: 19px;
	}

	.nv-bottom-bar__item[aria-current="page"] {
		color: var(--primary-500);
	}

	.nv-bottom-bar__item:focus-visible {
		outline: 2px solid var(--primary-500);
		outline-offset: -4px;
	}

	body {
		padding-bottom: calc(var(--nv-bar-height) + env(safe-area-inset-bottom));
	}
}

/* Footer links: readable size, thumb-sized on phones. */
.footer .footer__menu-list a {
	font-size: 15px;
}

@media (max-width: 767px) {
	.footer .footer__menu-list a {
		font-size: 16px;
		padding-inline: 6px;
	}

	.footer .footer__copyright a {
		display: inline-block;
		padding-block: 13px;
	}
}

/* --- Story page on phones ---------------------------------------------------
 * Chapter titles at 16px and every control at least 44px tall to tap.
 */
@media (max-width: 767px) {
	.chapter-group__list-item-link {
		font-size: 16px;
		padding-block: 12px;
	}

	:is(.chapter-group__list-item-date, .chapter-group__list-item-words, .chapter-group__list-item-subrow, .list-view) {
		font-size: 13px;
	}

	.media-buttons__item,
	.story__toggle,
	.list-button {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.micro-menu__item {
		min-width: 44px;
		min-height: 44px;
	}

	.tabs__item {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	.breadcrumbs a,
	.story__identity-meta a,
	.chapter__author a,
	.chapter__story-link {
		display: inline-block;
		padding-block: 15px;
		margin-block: -15px;
	}

	.footer .footer__copyright a {
		padding-block: 14px;
	}
}

/* Genres and tags list: thumb-sized rows on phones. */
@media (max-width: 767px) {
	a.glossary__entry-head {
		display: flex;
		align-items: center;
		min-height: 44px;
	}
}

/* --- Dark mode: Midnight Ember palette ---------------------------------------
 * Backgrounds and text colours are set in Customize (dark mode). Ember stays the
 * main accent; Soft Mint is the second accent for tags, the current tab and
 * success states.
 */
:root {
	--nv-mint: #f4b52a;
}

:root[data-mode="dark"] .tabs__item._current {
	background: var(--nv-mint);
	color: #141317;
}

:root[data-mode="dark"] :is(.tag-pill, .story__taxonomies a, .card__tag-list a) {
	color: var(--nv-mint);
}

:root[data-mode="dark"] :is(.tag-pill, .story__taxonomies a, .card__tag-list a):hover {
	color: #f8cd6b;
}

/* ---------------------------------------------------------------------------
 * Creator profiles and the Founding Creator badge (prompt 8)
 * ------------------------------------------------------------------------- */

.nv-creator__header {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	margin: 0 0 2rem;
}

.nv-creator__avatar {
	flex: 0 0 auto;
}

.nv-creator__avatar img {
	display: block;
	width: 128px;
	height: 128px;
	border-radius: 50%;
	object-fit: cover;
}

.nv-creator__intro {
	min-width: 0;
	flex: 1 1 auto;
}

.nv-creator .nv-creator__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 5vw, 2rem);
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.nv-founding-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.3em 0.75em;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.2;
	background: var(--primary-500);
	color: #fff;
}

:root[data-mode="dark"] .nv-founding-pill {
	background: #ff6a3d;
	color: #141317;
}

.nv-creator__counts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
	font-size: 1rem;
}

.nv-creator__counts li {
	margin: 0;
}

:root[data-mode="dark"] .nv-creator__counts {
	color: #b3ada1;
}

:root[data-mode="dark"] .nv-creator__counts strong {
	color: #fbf8f3;
}

.nv-creator__bio {
	max-width: 62ch;
	margin: 0 0 1rem;
	font-size: 1rem;
	line-height: 1.65;
}

.nv-creator__bio p {
	margin: 0 0 0.75em;
}

.nv-creator__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nv-creator__social li {
	margin: 0;
}

.nv-creator__social-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 44px;
	padding: 0 0.95rem;
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 999px;
	font-size: 0.95rem;
	text-decoration: none;
}

.nv-creator__social-link:hover,
.nv-creator__social-link:focus-visible {
	border-color: var(--primary-500);
}

:root[data-mode="dark"] .nv-creator__social-link {
	color: #efe9dd;
	border-color: #45424d;
	background: #211f26;
}

:root[data-mode="dark"] .nv-creator__social-link:hover {
	border-color: #f4b52a;
	color: #f8cd6b;
}

.nv-creator__section {
	margin-top: 2rem;
}

.nv-creator .nv-creator__heading {
	margin: 0 0 1rem;
	font-size: 1.3rem;
}

.nv-founding {
	display: inline-block;
	margin-left: 0.3em;
	font-size: 0.85em;
	color: var(--primary-500);
}

:root[data-mode="dark"] .nv-founding {
	color: #ff6a3d;
}

@media (max-width: 640px) {
	.nv-creator__header {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.nv-creator__avatar img {
		width: 104px;
		height: 104px;
	}

	.nv-creator .nv-creator__name,
	.nv-creator__counts,
	.nv-creator__social {
		justify-content: center;
	}

	.nv-creator__bio {
		margin-left: auto;
		margin-right: auto;
		text-align: left;
	}
}

/* --- Semurai palette and type (Dec 2026) --------------------------------------
 * Matches semur.ai: paper #f6f2ea, card #fffdf9, ink #141317, red #d11f12
 * (light accent, AA on paper), ember #ff6a3d (dark accent), gold #f4b52a
 * (second accent). Inter for all text, Instrument Serif italic for accents.
 * The light and dark colour scales live in Appearance > Customize.
 */
@font-face {
	font-family: "Instrument Serif";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

:root {
	--nv-paper: #f6f2ea;
	--nv-card: #fffdf9;
	--nv-ink: #141317;
	--nv-ink-2: #211f26;
	--nv-bone: #f6f2ea;
	--nv-red: #d11f12;
	--nv-gold: #f4b52a;
	--nv-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

:is(h1, h2, h3, .story__identity-title, .chapter__title, .nv-row__title, .nv-creator__name) {
	font-weight: 600;
	letter-spacing: -0.02em;
}

.top-header__link {
	font-weight: 700;
	letter-spacing: -0.03em;
}

:is(h1, h2, h3) em,
.nv-hero__title em {
	font-family: var(--nv-serif);
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.01em;
}

/* Home hero: an ink panel with bone text in both modes, like semur.ai's hero. */
.nv-hero {
	background: radial-gradient(560px at 88% 0%, rgba(236, 42, 28, 0.24), transparent 62%), linear-gradient(160deg, #211f26, #141317);
	color: var(--nv-bone);
	border-radius: 26px;
}

.nv-hero__title {
	font-weight: 600;
	letter-spacing: -0.035em;
	color: var(--nv-bone);
}

.nv-hero__title em {
	color: #ff6a3d;
}

.nv-hero__eyebrow {
	color: #c6bfb2;
	opacity: 1;
}

.nv-hero__text {
	color: #e5ddcd;
	opacity: 1;
}

.nv-hero .button {
	border-radius: 999px;
	font-weight: 600;
}

.nv-hero .nv-hero__primary {
	background: var(--nv-bone);
	color: var(--nv-ink);
	border-color: var(--nv-bone);
}

.nv-hero .nv-hero__primary:hover {
	background: #fffdf9;
}

.nv-hero .nv-hero__secondary {
	background: rgba(246, 242, 234, 0.08);
	color: var(--nv-bone);
	border: 1px solid rgba(246, 242, 234, 0.35);
}

.nv-hero .button:focus-visible {
	outline-color: #ff6a3d;
}

/* Tiles without a cover: ink panel, bone initial. */
.nv-tile__cover {
	background: #211f26;
}

.nv-tile__placeholder {
	color: var(--nv-bone);
	background: linear-gradient(160deg, #2d2b33, #141317);
}

/* Light mode: menus and chips sit on card white, not on dark panels. */
:root[data-mode="light"] .nv-creator-chip {
	background: var(--nv-card);
	border: 1px solid #e5ddcd;
}

:root[data-mode="light"] :is(.nv-share__menu, .nv-poem-dialog) {
	background: var(--nv-card);
	border: 1px solid #e5ddcd;
	box-shadow: 0 10px 30px rgba(20, 19, 23, 0.16);
}

:root[data-mode="light"] .nv-share__item:is(:hover, :focus-visible) {
	background: rgba(22, 21, 26, 0.06);
}

:root[data-mode="light"] .tabs__item._current {
	background: var(--nv-ink);
	color: var(--nv-bone);
}

.nv-pages span {
	background: var(--primary-500);
	color: #fff;
}

:root[data-mode="dark"] .nv-pages span {
	color: var(--nv-ink);
}
/* Cookie banner is ink in both modes: use the light ember for its links (8:1). */
.consent-banner a {
	color: #ff8a63;
}

/* Chapter rows inside story cards: the theme fades them to 50%, which fails contrast. */
body .card__link-list-item .card__right {
	opacity: 1;
	color: var(--fg-800);
}
