/*
 * The A.N Life — Notebook (Concept 03). Component styles.
 *
 * Source of the visual intention: concept03/an-life-design/styles.css, ported
 * to WordPress block markup. Colours, fonts and sizes come from theme.json
 * presets so Site Editor changes flow through. Preview-only styles of the
 * prototype (.prototype-note, .state-lab, demo cards) are deliberately absent.
 */

/* ---------- Base ---------- */

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 20px;
}

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

body {
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
	font-synthesis-weight: none;
	font-synthesis-style: none;
}

/* Literata ships 400–600: bold maps to the real semibold, never a fake bold. */
:where(.wp-block-post-content, .an-page-body, h1, h2, h3, h4, .wp-block-post-title) :where(strong, b) {
	font-weight: 600;
}

img {
	max-width: 100%;
	height: auto;
}

/* Component display rules must never un-hide something marked hidden. */
[hidden] {
	display: none !important;
}

a,
button,
input,
textarea,
select {
	touch-action: manipulation;
}

::selection {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent);
}

.wp-block-post-content a,
.wp-block-post-content code {
	overflow-wrap: anywhere;
}

pre,
.wp-block-code,
.wp-block-preformatted {
	overflow-x: auto;
	max-width: 100%;
}

iframe,
video {
	max-width: 100%;
}

hr.wp-block-separator {
	border-top: 0;
	opacity: 1;
}

/* ---------- Focus, skip link, motion ---------- */

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--moss);
	outline-offset: 4px;
}

:where(a, button, input, select, textarea):focus:not(:focus-visible) {
	outline: none;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--text);
	color: #fff;
	font-family: var(--wp--preset--font-family--sans);
	padding: 12px;
	outline: 3px solid var(--wp--preset--color--moss);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

.an-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Instructions for editors; removed from the site by functions.php. */
.an-editor-hint {
	border: 1px dashed var(--wp--preset--color--control);
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
}

/* ---------- Labels: eyebrow, folio, meta ---------- */

.an-eyebrow,
.is-style-an-eyebrow,
.is-style-an-folio,
.an-folio {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.16em;
	line-height: 1.6;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0;
}

.an-eyebrow a,
.is-style-an-eyebrow a {
	color: inherit;
}

.an-meta {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.an-meta > * + *::before {
	content: "·";
	margin-inline-end: 0.6em;
}

.an-meta a {
	color: inherit;
}

.an-dek,
.an-standfirst {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.0625rem;
	line-height: 1.9;
	color: var(--wp--preset--color--secondary);
}

/* "Read more" style link: small caps-like, ruled underneath. */
.an-more,
p.an-more a,
a.an-more {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--text);
	padding-bottom: 1px;
}

p.an-more {
	border: 0;
}

.an-signature {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--accent);
}

/* ---------- Header ---------- */

.an-site-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.an-topline {
	padding: 10px 5vw;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: 0.6875rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.an-topline p {
	margin: 0;
}

.an-masthead {
	padding: 28px 16px;
}

.an-masthead > * {
	margin-block: 0;
}

.an-masthead .wp-block-site-tagline {
	margin-top: 7px;
}

/* The asterisk: a marginal-note marker beside the wordmark. Decorative. */
.an-brand a::after,
.an-footer-brand a::after {
	content: "*";
	content: "*" / "";
	color: var(--wp--preset--color--accent);
	font-size: 0.8em;
	vertical-align: top;
	margin-left: 6px;
}

.an-brand a:hover {
	text-decoration: none;
}

/* Scoped to <nav>: WordPress copies the block's class onto the inner <ul> too. */
nav.an-primary-nav {
	border-top: 1px solid var(--wp--preset--color--border);
	padding: 15px;
	margin-block-start: 0;
}

.an-primary-nav .wp-block-navigation__container {
	gap: 6px 28px;
}

.an-site-header > * + * {
	margin-block-start: 0;
}

.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	justify-content: center;
}

.wp-block-navigation [aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 5px;
}

.an-primary-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50) clamp(1rem, 4vw, 2rem);
	font-size: var(--wp--preset--font-size--large);
}

/* ---------- Homepage: lead ---------- */

.an-home > * + * {
	margin-block-start: 0;
}

.an-hero .wp-block-post-template,
.an-section .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}

.an-hero .wp-block-post {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 7%;
	align-items: center;
	min-height: 520px;
	padding-block: 65px 58px;
}

.an-hero__text > * {
	margin-block: 0;
}

.an-hero__text > * + * {
	margin-top: 18px;
}

.an-hero .wp-block-post-title {
	font-size: clamp(2.3rem, 4.1vw, 4rem);
	line-height: 1.28;
	letter-spacing: -0.04em;
}

.an-hero .wp-block-post-date {
	margin-top: 20px;
}

.an-hero__art {
	position: relative;
	height: 540px;
	margin: 0;
	padding: 0 0 20px 20px;
	border-left: 1px solid var(--wp--preset--color--border);
}

.an-hero__art img,
.an-hero__art a {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 57%;
}

/* ---------- Homepage: author's opening letter ---------- */

.an-editor-letter {
	display: grid;
	grid-template-columns: 60px minmax(0, 680px) 1fr;
	gap: 24px;
	align-items: center;
	padding-block: 30px 60px;
}

.an-editor-letter::before {
	content: "*";
	content: "*" / "";
	font: 80px/1 var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--accent);
}

.an-editor-letter > *,
.an-editor-letter__body > * {
	margin-block: 0;
}

.an-editor-letter__text {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.1875rem;
	line-height: 1.85;
	margin-top: 8px !important;
}

.an-editor-letter .an-signature {
	text-align: right;
}

/* ---------- Homepage: sections ---------- */

.an-section {
	padding-block: 60px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-section-heading {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 16px;
	margin-bottom: 28px;
}

.an-section-heading__title {
	font: 400 clamp(1.875rem, 3vw, 2.6875rem) / 1.4 var(--wp--preset--font-family--serif);
	margin: 5px 0 0;
}

.an-section-heading__title a {
	text-decoration: none;
}

.an-section .wp-block-post > * {
	margin-block: 0;
}

/* Grid items: the flow layout's block gap would push every item after the
 * first one down. The scent stagger uses padding, not margins. */
.an-section .wp-block-post-template > .wp-block-post,
.an-hero .wp-block-post-template > .wp-block-post {
	margin-block-start: 0;
}

.an-section .wp-block-post-featured-image {
	margin: 0;
}

.an-section .wp-block-post-featured-image img {
	width: 100%;
	object-fit: cover;
}

.an-section .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.an-section .wp-block-post-excerpt__more-text {
	display: none;
}

/* 01 — Scent: staggered compositions, the first image taller. */
.an-layout-scent .wp-block-post-template {
	display: grid;
	grid-template-columns: 1.25fr 1fr 1fr;
	gap: 22px;
}

.an-layout-scent .wp-block-post {
	min-width: 0;
}

.an-layout-scent .wp-block-post:nth-child(2) {
	padding-top: 55px;
}

.an-layout-scent .wp-block-post:nth-child(3) {
	padding-top: 110px;
}

.an-layout-scent .wp-block-post-featured-image img {
	aspect-ratio: 4 / 4.2;
	filter: saturate(0.8);
}

.an-layout-scent .wp-block-post:first-child .wp-block-post-featured-image img {
	aspect-ratio: 4 / 4.85;
}

.an-layout-scent .wp-block-post-featured-image + * {
	margin-top: 12px;
}

.an-layout-scent .wp-block-post-title {
	font-size: 1.5625rem;
	line-height: 1.5;
	margin: 6px 0 5px;
}

.an-layout-scent .wp-block-post-excerpt,
.an-layout-notes .wp-block-post-excerpt {
	color: var(--wp--preset--color--secondary);
	font-size: 0.8125rem;
}

/* 02 — Literature: a book image with the newest piece, then a ruled list. */
.an-layout-literature .wp-block-post-template {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 44px;
	align-items: start;
}

.an-layout-literature .wp-block-post:first-child {
	grid-row: span 9;
	display: grid;
	gap: 24px;
	align-items: center;
}

.an-layout-literature .wp-block-post:first-child:has(.wp-block-post-featured-image) {
	grid-template-columns: 42% 1fr;
}

.an-layout-literature .wp-block-post:first-child .wp-block-post-featured-image img {
	aspect-ratio: 3 / 4;
}

.an-layout-literature .wp-block-post-title {
	font-size: 1.75rem;
	line-height: 1.45;
	margin: 8px 0 !important;
}

.an-layout-literature .wp-block-post:first-child .wp-block-post-excerpt {
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--secondary);
}

.an-layout-literature .wp-block-post:not(:first-child) {
	padding-block: 22px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.an-layout-literature .wp-block-post:nth-child(2) {
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-layout-literature .wp-block-post:not(:first-child) :is(.wp-block-post-featured-image, .wp-block-post-excerpt) {
	display: none;
}

.an-layout-literature .wp-block-post:not(:first-child) .wp-block-post-title {
	font-size: 1.4375rem;
	margin: 4px 0 0 !important;
}

/* 03 — Product Thinking: a moss lead and two ruled columns. */
.an-layout-thinking .wp-block-post-template {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr;
	gap: 25px;
}

.an-layout-thinking .wp-block-post:first-child {
	background: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--background);
	padding: 32px;
	min-height: 280px;
}

.an-layout-thinking .wp-block-post:first-child .wp-block-post-date {
	color: #ece5cf;
}

.an-layout-thinking .wp-block-post:first-child a {
	color: inherit;
}

.an-layout-thinking .wp-block-post:first-child a:hover {
	color: #fff;
}

.an-layout-thinking .wp-block-post:first-child .wp-block-post-title {
	font-size: 2.0625rem;
}

.an-layout-thinking .wp-block-post:not(:first-child) {
	border-top: 2px solid var(--wp--preset--color--text);
	padding-top: 22px;
}

.an-layout-thinking .wp-block-post-title {
	font-size: 1.75rem;
	line-height: 1.5;
	margin: 12px 0 !important;
}

/* 04 — Short notes: open fragments under a hairline in the accent colour. */
.an-layout-notes .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.an-layout-notes .wp-block-post {
	border-top: 1px solid var(--wp--preset--color--accent);
	padding: 20px 5px;
}

.an-layout-notes .wp-block-post-title {
	font-size: 1.1875rem;
	line-height: 1.7;
	margin: 8px 0 6px !important;
}

/* 05 — Writing project ("Bàn viết"): a manuscript sheet.
 * Left: the project statement, pinned while the entries scroll past.
 * Right: a paper sheet with a margin rule; each entry is numbered (§ 01),
 * its kind and date annotated in the margin. Quotes from the manuscript are
 * set as quotations, analyses as reading notes, inspirations as fragments.
 * Kind styling keys on the default category slugs (trich-doan, phan-tich,
 * cam-hung); other slugs get the neutral entry style. */
.an-layout-project {
	display: grid;
	grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.6fr);
	column-gap: clamp(28px, 5vw, 72px);
	align-items: start;
}

/* Explicit placement: heading (or a stray folio label) on the first row,
 * statement and sheet side by side on the second — whatever else the
 * section contains. */
.an-layout-project > .an-section-heading,
.an-layout-project > .is-style-an-folio,
.an-layout-project > .wp-block-query-no-results {
	grid-column: 1 / -1;
	grid-row: 1;
}

.an-layout-project > .an-project-intro {
	grid-column: 1;
	grid-row: 2;
}

.an-layout-project > .an-manuscript {
	grid-column: 2;
	grid-row: 2;
}

/* Anything else the author adds to the section goes below, full width. */
.an-layout-project > :not(.an-section-heading):not(.is-style-an-folio):not(.wp-block-query-no-results):not(.an-project-intro):not(.an-manuscript) {
	grid-column: 1 / -1;
}

.an-layout-project > * {
	margin-block: 0;
}

.an-layout-project > .an-section-heading {
	margin-bottom: 28px;
}

.an-project-intro {
	position: sticky;
	top: 24px;
	border-top: 1px solid var(--wp--preset--color--text);
	padding-top: 18px;
}

.an-project-intro > * {
	margin-block: 0;
}

.an-project-statement {
	margin-top: 12px !important;
	font: italic 400 1.1875rem / 1.8 var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--text);
}

.an-project-legend {
	margin-top: 18px !important;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--secondary);
}

.an-layout-project .an-manuscript {
	--an-margin: 8.75rem;
	counter-reset: an-folio;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	/* The margin rule: a fine double line in the accent colour. */
	background-image:
		linear-gradient(to right, transparent calc(var(--an-margin) - 4px), color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent) calc(var(--an-margin) - 4px), color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent) calc(var(--an-margin) - 3px), transparent calc(var(--an-margin) - 3px)),
		linear-gradient(to right, transparent var(--an-margin), color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent) var(--an-margin), color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent) calc(var(--an-margin) + 1px), transparent calc(var(--an-margin) + 1px));
}

.an-layout-project .an-manuscript > .wp-block-post {
	counter-increment: an-folio;
	display: grid;
	grid-template-columns: var(--an-margin) minmax(0, 1fr);
	margin: 0;
	padding: 22px 26px 22px 0;
}

.an-layout-project .an-manuscript > .wp-block-post + .wp-block-post {
	border-top: 1px dashed var(--wp--preset--color--border);
}

/* Margin: "§ 01", the kind, the date. */
.an-layout-project .an-margin {
	padding: 4px 18px 0 14px;
	text-align: right;
	font-size: 0.6875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--secondary);
}

.an-layout-project .an-margin::before {
	content: "§ " counter(an-folio, decimal-leading-zero);
	display: block;
	font: italic 1.125rem / 1.2 var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--accent);
	margin-bottom: 6px;
}

.an-layout-project .an-margin > * {
	margin-block: 0;
}

.an-layout-project .an-kind,
.an-layout-project .an-kind a {
	color: var(--wp--preset--color--accent);
	font-weight: 600;
	letter-spacing: 0.06em;
	overflow-wrap: normal; /* Break between words only ("PRODUCT / MANAGEMENT"). */
	hyphens: manual;
	text-transform: uppercase;
	text-decoration: none;
}

.an-layout-project .an-margin .wp-block-post-date {
	margin-top: 4px;
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

.an-layout-project .an-entry {
	padding-left: 24px;
}

.an-layout-project .an-entry > * {
	margin-block: 0;
}

.an-layout-project .an-entry .wp-block-post-title {
	font-size: 1.375rem;
	line-height: 1.5;
}

.an-layout-project .an-entry-text {
	margin-top: 8px !important;
	font: 0.9375rem / 1.85 var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--secondary);
}

.an-layout-project .an-entry-text p {
	margin: 0;
}

/* Trích đoạn: a passage from the manuscript, set as a quotation. */
.an-layout-project .category-trich-doan .an-entry-text {
	position: relative;
	padding-left: 22px;
	font-size: 1.1875rem;
	font-style: italic;
	line-height: 1.75;
	color: var(--wp--preset--color--text);
}

.an-layout-project .category-trich-doan .an-entry-text::before {
	content: "“";
	position: absolute;
	left: -2px;
	top: -10px;
	font: 2.5rem / 1 var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--accent);
}

.an-layout-project .category-trich-doan .wp-block-post-title {
	font-size: 0.8125rem;
	font-family: var(--wp--preset--font-family--sans);
	letter-spacing: 0.04em;
	order: 2;
	margin-top: 8px !important;
}

.an-layout-project .category-trich-doan .an-entry {
	display: flex;
	flex-direction: column;
}

.an-layout-project .category-trich-doan .an-entry-text {
	order: 1;
	margin-top: 0 !important;
}

/* Đọc tác giả khác: a reading note with a fine rule, like a slip in a book. */
.an-layout-project .category-phan-tich .an-entry {
	border-left: 2px solid var(--wp--preset--color--moss);
	margin-left: 24px;
	padding-left: 16px;
}

.an-layout-project .category-phan-tich .an-kind,
.an-layout-project .category-phan-tich .an-kind a {
	color: var(--wp--preset--color--moss);
}

/* Cảm hứng: a brief fragment, lighter and shorter. */
.an-layout-project .category-cam-hung .wp-block-post-title {
	font-style: italic;
	font-weight: 400;
}

.an-layout-project .category-cam-hung .an-entry-text {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	max-width: 34em;
}

/* Contact invitation */
.an-contact-strip {
	gap: 30px;
	border-top: 2px solid var(--wp--preset--color--text);
	padding-block: 42px 55px;
}

.an-contact-strip h2 {
	font-size: clamp(1.6875rem, 3vw, 2.625rem);
	line-height: 1.5;
	margin: 10px 0;
}

.an-contact-strip p {
	margin-block: 0;
}

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

.an-article-head {
	text-align: center;
	margin: 72px auto 42px;
}

.an-article-head > * {
	margin-block: 0;
}

.an-article-head > * + * {
	margin-top: 16px;
}

.an-article-head .wp-block-post-title {
	font-size: clamp(2.5rem, 5vw, 4.0625rem);
	line-height: 1.35;
	letter-spacing: -0.035em;
}

.an-article-head .an-meta,
.an-article-head .wp-block-post-terms {
	justify-content: center;
}

.an-article-cover {
	margin-block: 0 40px;
}

.an-article-cover img {
	width: 100%;
	max-height: 600px;
	object-fit: cover;
	object-position: center 55%;
}

.an-article-body {
	line-height: 1.95;
}

.an-article-body > p,
.an-page-body > p {
	margin-block: 0 26px;
}

.an-article-body h2 {
	font: 500 2rem / 1.4 var(--wp--preset--font-family--serif);
	margin: 54px 0 20px;
}

.an-article-body h3 {
	font-weight: 500;
	margin: 40px 0 16px;
}

.an-article-body a:not(.wp-element-button):not(.wp-block-file__button),
.an-page-body a:not(.wp-element-button) {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.an-article-body > .alignwide,
.an-article-body > .alignfull {
	margin-block: 40px;
}

.an-article-body figcaption,
.an-page-body figcaption {
	margin-top: 10px;
}

/* Native Markdown-style quote inside prose. */
.an-article-body .wp-block-quote:not(.is-style-an-source) {
	font-size: 1.75rem;
	line-height: 1.55;
	margin-block: 42px;
	padding: 10px 0 10px 30px;
}

.wp-block-quote cite,
.wp-block-pullquote cite {
	display: block;
	margin-top: 15px;
	color: var(--wp--preset--color--secondary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--x-small);
	font-style: normal;
}

/* Fragrance diary entry */
.an-scent-kicker > * + *::before {
	content: "·";
	margin-inline-end: 0.6em;
	color: var(--wp--preset--color--secondary);
}

.an-scent-entry hr.is-style-an-asterism {
	margin-block: 0 40px;
}

.an-scent-entry__content > p:first-of-type {
	font-size: 1.3125rem;
	line-height: 1.7;
}

.an-tag-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.an-tag-chips .wp-block-post-terms__separator {
	display: none;
}

.an-tag-chips a {
	display: inline-block;
	padding: 0.3em 0.8em;
	border: 1px solid var(--wp--preset--color--control);
	border-radius: 999px;
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}

hr.is-style-an-asterism {
	border: 0;
	text-align: center;
	height: auto;
	background: none !important;
}

hr.is-style-an-asterism::before {
	content: "⁂";
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--large);
}

/* After the article */
.an-post-footer {
	margin-top: 60px;
	padding-top: 25px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-tags,
.an-tags a {
	color: var(--wp--preset--color--secondary);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wp-block-post-author-biography:empty {
	display: none;
}

.an-post-nav {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: var(--wp--preset--spacing--40);
}

.an-post-nav a {
	display: inline-block;
	text-decoration: none;
}

.an-post-nav .post-navigation-link__label {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
}

.an-post-nav .post-navigation-link__title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.125rem;
}

.an-post-nav .post-navigation-link-next {
	margin-inline-start: auto;
	text-align: end;
}

/* Article tools: save offline, print (rendered by the Contact plugin). */
.an-article-tools {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 20px !important;
}

.an-btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 11px 17px;
	border: 1px solid var(--wp--preset--color--text);
	background: transparent;
	color: var(--wp--preset--color--text);
	font: 0.75rem / 1.4 var(--wp--preset--font-family--sans);
	letter-spacing: 0.05em;
	cursor: pointer;
	text-decoration: none;
}

.an-btn:hover,
.an-btn:focus-visible {
	background: var(--wp--preset--color--text);
	color: #fff;
	text-decoration: none;
}

.an-btn[disabled],
.an-btn[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.65;
}

.an-btn--primary {
	background: var(--wp--preset--color--moss);
	border-color: var(--wp--preset--color--moss);
	color: #fff;
}

.an-tool-status {
	flex-basis: 100%;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--secondary);
	margin: 0;
}

.an-tool-status:empty {
	display: none;
}

/* Related */
.an-related {
	margin-top: 70px;
	padding-top: 40px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-card-row .wp-block-post-title {
	font-size: 1.375rem;
	line-height: 1.45;
	margin: 6px 0 !important;
}

.an-card-row .wp-block-post > * {
	margin-block: 0;
}

/* ---------- Comments (moderated, three levels) ---------- */

.an-comments-section {
	margin-top: 60px;
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--border);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
}

.an-comments .wp-block-comments-title {
	font-size: 1.75rem;
}

.an-comment {
	padding-block: 16px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-comment .wp-block-comment-content {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1rem;
	line-height: 1.8;
}

.an-comments .wp-block-comment-template ol {
	padding-inline-start: clamp(12px, 4vw, 32px);
	border-inline-start: 1px solid var(--wp--preset--color--border);
}

.an-comments .comment-reply-title {
	font-size: 1.5rem;
}

.an-comments .comment-form label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
}

.an-private-contact {
	margin-top: 30px;
	color: var(--wp--preset--color--secondary);
}

.an-private-contact a {
	text-decoration: underline;
}

/* ---------- Forms (control borders: #85877C, WCAG 1.4.11) ---------- */

input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.wp-block-search__input {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	border: 1px solid var(--wp--preset--color--control);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	border-radius: 0;
	padding: 12px;
	font: 1rem / 1.6 var(--wp--preset--font-family--sans);
}

[aria-invalid="true"] {
	border: 2px solid var(--wp--preset--color--error) !important;
}

.wp-block-search__inside-wrapper {
	gap: 0.5rem;
}

.wp-block-search__button {
	margin-inline-start: 0;
}

/* Contact form (markup from the Contact plugin). */
.an-contact-layout {
	gap: 10% !important;
	padding-bottom: 75px;
	align-items: start;
}

.an-contact-aside {
	border-top: 1px solid var(--wp--preset--color--text);
	padding-top: 20px;
}

.an-contact-aside h2 {
	font-size: 1.625rem;
	line-height: 1.5;
}

.an-contact-aside p:not(.is-style-an-folio):not(.an-signature) {
	color: var(--wp--preset--color--secondary);
}

.an-contact-form {
	border-top: 2px solid var(--wp--preset--color--moss);
	padding-top: 25px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
}

.an-field {
	margin-bottom: 22px;
}

.an-field label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
}

.an-field label small {
	display: inline;
	font-weight: 400;
	color: var(--wp--preset--color--secondary);
}

.an-field small,
.an-field .an-field-help {
	display: block;
	font-size: 0.75rem;
	margin-top: 5px;
	color: var(--wp--preset--color--secondary);
}

.an-field .an-field-error {
	color: var(--wp--preset--color--error);
}

.an-form-status {
	padding: 16px;
	border: 1px solid var(--wp--preset--color--moss);
	margin: 0 0 18px;
}

.an-form-status:empty {
	display: none;
}

.an-form-status--error {
	border-color: var(--wp--preset--color--error);
}

.an-form-status ul {
	margin: 8px 0 0;
}

.an-contact-form .an-btn--primary:hover,
.an-contact-form .an-btn--primary:focus-visible {
	background: var(--wp--preset--color--text);
	border-color: var(--wp--preset--color--text);
}

.an-contact-closed {
	padding: 16px;
	border-left: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--panel);
}

/* ---------- Pages and archives ---------- */

.an-page,
.an-archive {
	padding-block: 55px 75px;
}

.an-page-title,
.an-page-intro h1,
.an-page-intro .wp-block-query-title {
	font-size: clamp(2.375rem, 5vw, 4.25rem);
	line-height: 1.3;
	letter-spacing: -0.035em;
	margin: 14px 0 22px;
}

.an-page-body {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.0625rem;
	line-height: 1.95;
}

.an-page-body h2 {
	font-size: 1.75rem;
	line-height: 1.5;
	margin-top: 35px;
}

.an-page-body :is(.an-contact-form, .an-offline-library, .an-contact-aside, .wp-block-search, .an-section-index, .an-archive-index) {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
}

.an-page-intro {
	max-width: 760px;
	padding-bottom: 40px;
}

.an-page-intro > * {
	margin-block: 0;
}

.an-page-intro > * + * {
	margin-top: 14px;
}

.an-archive-list .wp-block-post-template {
	list-style: none;
	padding: 0;
}

.an-archive-list .wp-block-post {
	padding-block: 22px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.an-archive-list .wp-block-post > * {
	margin-block: 0;
}

.an-archive-list .wp-block-post-title {
	font-size: 1.75rem;
	line-height: 1.45;
	margin: 6px 0 !important;
}

.an-archive-list .wp-block-post-excerpt {
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--secondary);
}

.an-archive-index .wp-block-post-template {
	list-style: none;
	padding: 0;
}

.an-archive-index .wp-block-post {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-block: 14px;
}

.an-archive-index .wp-block-post-title {
	font-size: 1.25rem;
	margin: 0;
}

.an-archive-index .wp-block-post-date {
	font-variant-numeric: tabular-nums;
	min-width: 6.5em;
}

.wp-block-categories.an-section-index {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: 0 var(--wp--preset--spacing--50);
}

.wp-block-categories.an-section-index li {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--secondary);
}

.wp-block-categories.an-section-index li a {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--text);
	margin-inline-end: 0.35em;
}

.wp-block-categories.an-section-index ul.children {
	display: none;
}

ol.is-style-an-reading-path,
ul.is-style-an-reading-path {
	list-style: none;
	padding-inline-start: 0;
	counter-reset: an-path;
}

.is-style-an-reading-path > li {
	counter-increment: an-path;
	position: relative;
	padding-block: var(--wp--preset--spacing--30);
	padding-inline-start: 2.5rem;
	border-top: 1px solid var(--wp--preset--color--border);
}

.is-style-an-reading-path > li::before {
	content: counter(an-path, decimal-leading-zero);
	position: absolute;
	inset-inline-start: 0;
	top: var(--wp--preset--spacing--30);
	font: 600 var(--wp--preset--font-size--x-small) / 2.2 var(--wp--preset--font-family--sans);
	color: var(--wp--preset--color--accent);
}

.an-note-small {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--secondary);
}

/* ---------- Editorial blocks (styles registered by Editorial Core) ---------- */

/* Note / aside */
.is-style-an-panel {
	background: var(--wp--preset--color--panel);
	padding: 24px 28px;
	font: 0.8125rem / 1.8 var(--wp--preset--font-family--sans);
}

.is-style-an-panel > :first-child {
	margin-top: 0;
}

.is-style-an-panel > :last-child {
	margin-bottom: 0;
}

/* Pull quote: large, centred, no rules. */
.wp-block-pullquote.is-style-an-pull {
	text-align: center;
	max-width: 850px;
	margin-inline: auto;
}

.wp-block-pullquote.is-style-an-pull blockquote p {
	font-size: inherit;
	line-height: inherit;
}

/* Source quote: an attributed quotation with a margin rule. */
.wp-block-quote.is-style-an-source {
	border-left: 2px solid var(--wp--preset--color--accent);
	padding: 6px 0 6px 24px;
	margin-block: 35px;
	max-width: 700px;
	font: 400 1.4375rem / 1.7 var(--wp--preset--font-family--serif);
	font-style: normal;
}

.wp-block-quote.is-style-an-source p {
	margin: 0;
}

/* Gallery: editorial grid, the first image featured. */
.wp-block-gallery.is-style-an-editorial {
	display: grid !important;
	grid-template-columns: 1.35fr 1fr;
	gap: 14px !important;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image {
	width: auto !important;
	margin: 0 !important;
	flex-direction: column !important;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image:first-child {
	grid-row: span 2;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image img {
	width: 100%;
	height: 210px !important;
	object-fit: cover;
	flex: none !important;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image:first-child img {
	height: 480px !important;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image figcaption,
.wp-block-gallery.is-style-an-player > .wp-block-image figcaption {
	position: static !important;
	background: none !important;
	color: var(--wp--preset--color--secondary) !important;
	padding: 0 !important;
	margin-top: 5px !important;
	max-height: none !important;
	text-align: start !important;
	font: 0.75rem / 1.6 var(--wp--preset--font-family--sans) !important;
	text-shadow: none !important;
}

.wp-block-gallery.is-style-an-editorial > .wp-block-image:only-child {
	grid-column: 1 / -1;
}

/* The lightbox trigger the Editorial Core script adds to each image. */
.an-lightbox-trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
	position: relative;
}

/* Image player (gallery style "Trình xem"): one large image, counter and a
 * button to open the viewer. Without JS all images stay stacked and visible. */
.wp-block-gallery.is-style-an-player {
	display: block !important;
	max-width: 850px;
}

.wp-block-gallery.is-style-an-player > .wp-block-image {
	width: 100% !important;
	margin: 0 0 14px !important;
	flex-direction: column !important;
}

.wp-block-gallery.is-style-an-player > .wp-block-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	flex: none !important;
}

.wp-block-gallery.an-js-player > .wp-block-image:not(:first-child),
.wp-block-gallery.an-js-player > .wp-block-image:first-child figcaption {
	display: none !important;
}

.an-player-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 16px;
	max-width: 850px;
	margin-top: 10px;
	font: 0.75rem var(--wp--preset--font-family--sans);
	color: var(--wp--preset--color--secondary);
}

.an-text-action {
	min-height: 44px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--text);
	background: none;
	padding: 0;
	color: var(--wp--preset--color--text);
	font: inherit;
	cursor: pointer;
}

.an-player-hint {
	position: absolute;
	right: 15px;
	bottom: 15px;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	padding: 7px 12px;
	font: 0.75rem var(--wp--preset--font-family--sans);
}

/* Lightbox dialog (Editorial Core). */
.an-lightbox {
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	border: 0;
	margin: 0;
	padding: 18px 28px;
	background: #191917;
	color: #fff;
	font-family: var(--wp--preset--font-family--sans);
}

.an-lightbox::backdrop {
	background: #191917;
}

.an-lightbox__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.75rem;
}

.an-lightbox button {
	min-width: 44px;
	min-height: 44px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
}

.an-lightbox button:focus-visible {
	outline: 2px solid #fff;
}

.an-lightbox__stage {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) 44px;
	align-items: center;
	gap: 8px;
	height: calc(100% - 115px);
	min-height: 0;
}

.an-lightbox__stage button {
	font-size: 1.625rem;
}

.an-lightbox__stage img {
	width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
}

.an-lightbox__caption {
	text-align: center;
	color: #d0ccc4;
	font-size: 0.75rem;
}

/* Table with a pinned header inside a named, keyboard-scrollable region. */
.an-table-scroll {
	max-height: 26rem;
	overflow: auto;
	border: 1px solid var(--wp--preset--color--border);
	margin-top: 20px;
	scrollbar-gutter: stable;
}

.wp-block-table table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	text-align: left;
}

.wp-block-table :is(th, td),
.wp-block-table.is-style-an-pinned :is(th, td) {
	padding: 15px 17px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	vertical-align: top;
}

.wp-block-table.is-style-an-pinned table {
	min-width: 620px;
}

.wp-block-table.is-style-an-pinned thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #e8e3da;
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
	font-weight: 600;
}

.wp-block-table tbody th {
	font-weight: 600;
}

.wp-block-table.is-style-an-pinned tbody tr:nth-child(even) {
	background: #f0eee9;
}

.wp-block-table figcaption {
	text-align: start;
}

.wp-block-table {
	overflow-x: auto;
}

/* Attachment (core File block). */
.wp-block-file {
	border: 1px solid var(--wp--preset--color--border);
	padding: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px 20px;
	font: 0.8125rem var(--wp--preset--font-family--sans);
}

.wp-block-file > a:first-child {
	font-weight: 600;
	text-decoration: none !important;
}

.an-file-meta {
	display: block;
	flex-basis: 100%;
	order: 2;
	color: var(--wp--preset--color--secondary);
	font-size: 0.75rem;
	margin-top: -8px;
}

.wp-block-file .wp-block-file__button {
	order: 3;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	background: transparent;
	color: var(--wp--preset--color--text);
	border: 1px solid var(--wp--preset--color--text);
	border-radius: 0;
	padding: 11px 17px;
	font-size: 0.75rem;
}

.wp-block-file .wp-block-file__button:hover {
	background: var(--wp--preset--color--text);
	color: #fff;
}

/* ---------- Offline library (Contact plugin) ---------- */

.an-offline-library ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.an-offline-item {
	border-top: 1px solid var(--wp--preset--color--border);
	padding: 18px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	justify-content: space-between;
	align-items: baseline;
}

.an-offline-item a {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.25rem;
}

.an-offline-item small {
	color: var(--wp--preset--color--secondary);
}

/* ---------- Footer ---------- */

.an-site-footer {
	padding-block: 45px;
	border-top: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--secondary);
	font-size: 0.75rem;
}

.an-footer-grid {
	gap: 32px;
}

.an-footer-brand {
	font: 1.875rem / 1.3 var(--wp--preset--font-family--serif);
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--text);
}

.an-site-footer a {
	line-height: 2.2;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
	/* Writing project: intro above the sheet, no longer pinned. */
	.an-layout-project {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 24px;
	}

	.an-project-intro {
		position: static;
	}

	.an-layout-project > .an-project-intro {
		grid-column: 1;
		grid-row: 2;
	}

	.an-layout-project > .an-manuscript {
		grid-column: 1;
		grid-row: 3;
	}
}

@media (max-width: 560px) {
	/* Narrow sheet: margin notes move above each entry; the rule stays left. */
	.an-layout-project .an-manuscript {
		--an-margin: 14px;
	}

	.an-layout-project .an-manuscript > .wp-block-post {
		grid-template-columns: minmax(0, 1fr);
		padding: 18px 18px 18px 30px;
	}

	.an-layout-project .an-margin {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 4px 10px;
		padding: 0 0 6px;
		text-align: left;
	}

	.an-layout-project .an-margin::before {
		display: inline;
		margin: 0;
	}

	.an-layout-project .an-margin .wp-block-post-date {
		margin-top: 0;
	}

	.an-layout-project .an-entry {
		padding-left: 0;
	}

	.an-layout-project .category-phan-tich .an-entry {
		margin-left: 0;
	}
}

@media (max-width: 800px) {
	.an-hero .wp-block-post {
		grid-template-columns: 1fr;
		gap: 38px;
		min-height: 0;
		padding-top: 30px;
	}

	.an-hero__art {
		height: 420px;
	}

	.an-editor-letter {
		grid-template-columns: 35px 1fr;
		gap: 15px;
	}

	.an-editor-letter::before {
		font-size: 56px;
	}

	.an-editor-letter .an-signature {
		grid-column: 2;
		text-align: left;
	}

	.an-section {
		padding-block: 40px;
	}

	.an-layout-scent .wp-block-post-template {
		grid-template-columns: 1fr 1fr;
	}

	.an-layout-scent .wp-block-post:first-child {
		grid-column: span 2;
	}

	.an-layout-scent .wp-block-post:first-child .wp-block-post-featured-image img {
		aspect-ratio: 16 / 10;
	}

	.an-layout-scent .wp-block-post:nth-child(2),
	.an-layout-scent .wp-block-post:nth-child(3) {
		padding-top: 0;
	}

	.an-layout-literature .wp-block-post-template,
	.an-layout-thinking .wp-block-post-template {
		grid-template-columns: 1fr;
	}

	.an-layout-literature .wp-block-post:first-child {
		grid-row: auto;
		margin-bottom: 24px;
	}

	.an-layout-notes .wp-block-post-template {
		grid-template-columns: 1fr 1fr;
	}

	.an-contact-strip {
		flex-direction: column;
		align-items: flex-start !important;
	}

	.an-article-head {
		margin-top: 45px;
	}

	.an-contact-layout {
		gap: 30px !important;
	}

	.an-page-title {
		overflow-wrap: break-word;
	}
}

@media (max-width: 600px) {
	.wp-block-gallery.is-style-an-editorial {
		grid-template-columns: 1fr 1fr;
		gap: 10px !important;
	}

	.wp-block-gallery.is-style-an-editorial > .wp-block-image:first-child {
		grid-column: span 2;
		grid-row: auto;
	}

	.wp-block-gallery.is-style-an-editorial > .wp-block-image:first-child img {
		height: 270px !important;
	}

	.wp-block-gallery.is-style-an-editorial > .wp-block-image img {
		height: 150px !important;
	}

	.an-lightbox {
		padding: 12px;
	}
}

@media (max-width: 500px) {
	.wp-block-group.an-topline {
		display: none;
	}

	nav.an-primary-nav {
		padding: 12px 18px;
	}

	.an-primary-nav .wp-block-navigation__container {
		gap: 8px 19px;
	}

	.an-hero__art {
		height: 350px;
		padding-left: 12px;
	}

	.an-section-heading {
		flex-direction: column;
		align-items: flex-start;
	}

	.an-layout-scent .wp-block-post-template,
	.an-layout-notes .wp-block-post-template {
		grid-template-columns: 1fr;
	}

	.an-layout-scent .wp-block-post:first-child {
		grid-column: auto;
	}

	.an-layout-literature .wp-block-post:first-child:has(.wp-block-post-featured-image) {
		grid-template-columns: 1fr;
	}

	.an-layout-literature .wp-block-post:first-child .wp-block-post-featured-image img {
		max-width: 230px;
	}

	.an-layout-literature .wp-block-post-title {
		font-size: 1.25rem;
	}

	.an-editor-letter__text {
		font-size: 1.0625rem;
	}

	.wp-block-post-content.an-article-body {
		font-size: 1.0625rem;
	}

	.an-article-body .wp-block-quote:not(.is-style-an-source) {
		font-size: 1.5rem;
	}
}

/* ---------- Print ---------- */

@media print {
	.an-site-header,
	.an-site-footer,
	.an-article-tools,
	.an-comments-section,
	.an-related,
	.an-post-nav,
	.an-player-meta,
	.an-player-hint,
	.wp-block-file__button {
		display: none !important;
	}

	/* Print every image and caption of a player gallery. */
	.wp-block-gallery.an-js-player > .wp-block-image:not(:first-child),
	.wp-block-gallery.an-js-player > .wp-block-image:first-child figcaption {
		display: flex !important;
	}

	.an-article-body {
		max-width: none;
	}

	.an-table-scroll {
		max-height: none;
		overflow: visible;
		border: 0;
	}

	.wp-block-table.is-style-an-pinned table {
		min-width: 0;
	}

	.wp-block-table.is-style-an-pinned thead th {
		position: static;
	}

	.wp-block-gallery.is-style-an-editorial > .wp-block-image img {
		height: auto !important;
	}
}
