/*
Theme Name: Sasanian
Theme URI: https://sasanian.info
Author: Sasanian.info
Author URI: https://sasanian.info
Description: The Sasanian.info look for WordPress: a warm parchment palette, Libre Baskerville headings and Inter body text. Designed to work with the Sasanian Archive plugin (kings, coins and timeline), and fully usable on its own for ordinary pages and posts. Home page text, stats and footer are editable in Appearance > Customize.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sasanian
Tags: custom-menu, featured-images, threaded-comments, translation-ready, one-column, custom-colors, blog, education
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
	--background: #f9f4ee;
	--foreground: #1e130e;
	--card: #fefbf8;
	--card-foreground: #1e130e;
	--popover: #fefbf8;
	--primary: #8b3722;
	--primary-foreground: #fcf8f1;
	--secondary: #f0eae0;
	--secondary-foreground: #372b26;
	--muted: #e8e4dd;
	--muted-foreground: #5f524c;
	--accent: #9e6033;
	--accent-foreground: #fcf8f1;
	--destructive: #e40014;
	--border: #dfd6c9;
	--input: #efebe4;
	--ring: #8b3722;
	--radius: 0.5rem;

	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-serif: "Libre Baskerville", "Georgia", serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
	border: 0 solid var(--border);
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	tab-size: 4;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background-color: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

ul, ol {
	list-style: none;
	padding: 0;
}

a {
	color: inherit;
	text-decoration: inherit;
}

img, svg, video, canvas {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

button, input, select, textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
	margin: 0;
}

button {
	cursor: pointer;
	background: none;
	padding: 0;
	border: 0;
}

table {
	border-collapse: collapse;
	border-color: inherit;
	text-indent: 0;
}

:focus-visible {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
}

::selection {
	background: var(--primary);
	color: var(--primary-foreground);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 20px;
	clip: auto;
	background: var(--card);
	color: var(--foreground);
	font-size: 0.875rem;
	border: 1px solid var(--border);
}

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.sa-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.sa-main {
	flex: 1 1 0%;
	padding-top: 5rem;
}

.sa-main--home {
	padding-top: 0;
}

.sa-container {
	width: 100%;
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

.sa-container--5xl { max-width: 64rem; }
.sa-container--4xl { max-width: 56rem; }
.sa-container--3xl { max-width: 48rem; }

@media (min-width: 1024px) {
	.sa-container {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

.sa-center { text-align: center; }
.sa-serif { font-family: var(--font-serif); }

.sa-section {
	padding-top: 4rem;
	padding-bottom: 4rem;
}

.sa-section--12 {
	padding-top: 3rem;
	padding-bottom: 3rem;
}

.sa-section--card {
	background: var(--card);
}

.sa-bt { border-top: 1px solid var(--border); }
.sa-bb { border-bottom: 1px solid var(--border); }
.sa-bty { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

@media (min-width: 1024px) {
	.sa-section--lg-20 { padding-top: 5rem; padding-bottom: 5rem; }
	.sa-section--lg-24 { padding-top: 6rem; padding-bottom: 6rem; }
	.sa-section--lg-32 { padding-top: 8rem; padding-bottom: 8rem; }
	.sa-section--12.sa-section--lg-16 { padding-top: 4rem; padding-bottom: 4rem; }
}

/* ==========================================================================
   4. Typography components
   ========================================================================== */
.sa-eyebrow {
	margin: 0 0 0.5rem;
	color: var(--primary);
	font-size: 0.875rem;
	line-height: 1.25rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.sa-eyebrow--wide {
	margin-bottom: 1rem;
	letter-spacing: 0.3em;
}

.sa-eyebrow--mb3 { margin-bottom: 0.75rem; }

.sa-h1 {
	margin: 0 0 1.5rem;
	font-family: var(--font-serif);
	color: var(--foreground);
	font-size: 2.25rem;
	line-height: 2.5rem;
}

.sa-h2 {
	font-family: var(--font-serif);
	color: var(--foreground);
	font-size: 1.5rem;
	line-height: 2rem;
	margin: 0 0 1rem;
}

.sa-h2--xl {
	font-size: 1.25rem;
	line-height: 1.75rem;
}

.sa-h2--section {
	font-size: 1.875rem;
	line-height: 2.25rem;
	margin: 0;
}

@media (min-width: 768px) {
	.sa-h1 { font-size: 3rem; line-height: 1; }
	.sa-h2 { font-size: 1.875rem; line-height: 2.25rem; }
	.sa-h2--xl { font-size: 1.25rem; line-height: 1.75rem; }
	.sa-h2--section { font-size: 2.25rem; line-height: 2.5rem; }
}

@media (min-width: 1024px) {
	.sa-h1 { font-size: 3.75rem; line-height: 1; }
}

.sa-lead {
	max-width: 42rem;
	margin: 0 auto;
	color: var(--muted-foreground);
	font-size: 1.125rem;
	line-height: 1.625;
	text-wrap: pretty;
}

.sa-muted { color: var(--muted-foreground); }
.sa-primary { color: var(--primary); }

.sa-hero {
	padding: 4rem 0;
	border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
	.sa-hero { padding: 6rem 0; }
}

.sa-hero--404 {
	display: flex;
	align-items: center;
	min-height: 60vh;
	border-bottom: 0;
}

.sa-lead--mb { margin-bottom: 2.5rem; }

.sa-head-center {
	text-align: center;
	margin-bottom: 4rem;
}

.sa-head-center .sa-eyebrow { margin-bottom: 0.75rem; }

/* ==========================================================================
   5. Buttons and links
   ========================================================================== */
.sa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 1rem 2rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--primary);
	color: var(--primary-foreground);
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.sa-btn:hover {
	background: color-mix(in oklab, var(--primary) 90%, transparent);
}

.sa-btn--outline {
	background: transparent;
	color: var(--foreground);
	border: 1px solid var(--border);
}

.sa-btn--outline:hover {
	background: var(--secondary);
}

.sa-btn--sm {
	min-height: 2rem;
	padding: 0 0.75rem;
	gap: 0.375rem;
	border-radius: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
}

.sa-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--primary);
	font-size: 0.875rem;
	line-height: 1.25rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.sa-link-arrow:hover { text-decoration: underline; }

.sa-back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--muted-foreground);
	transition: color 0.15s;
}

.sa-back:hover { color: var(--primary); }
.sa-backbar { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* Icons: Lucide, drawn inline. */
.sa-icon {
	flex-shrink: 0;
	width: 1.5rem;
	height: 1.5rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sa-i-3 { width: 0.75rem; height: 0.75rem; }
.sa-i-4 { width: 1rem; height: 1rem; }
.sa-i-5 { width: 1.25rem; height: 1.25rem; }
.sa-i-6 { width: 1.5rem; height: 1.5rem; }
.sa-i-12 { width: 3rem; height: 3rem; }
.sa-i-16 { width: 4rem; height: 4rem; }
.sa-i-24 { width: 6rem; height: 6rem; }
.sa-i-faint { color: color-mix(in oklab, var(--primary) 30%, transparent); }

/* ==========================================================================
   6. Header
   ========================================================================== */
.sa-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	background: color-mix(in oklab, var(--background) 80%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid color-mix(in oklab, var(--border) 50%, transparent);
}

.admin-bar .sa-header { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .sa-header { top: 46px; }
}

@media (max-width: 600px) {
	.admin-bar .sa-header { top: 0; }
}

.sa-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	margin: 0 auto;
	padding: 1rem;
}

@media (min-width: 1024px) {
	.sa-nav { padding-left: 2rem; padding-right: 2rem; }
}

.sa-logo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sa-logo__name {
	font-family: var(--font-serif);
	color: var(--primary);
	font-size: 1.25rem;
	line-height: 1.75rem;
	letter-spacing: 0.025em;
}

.sa-logo__tld {
	color: var(--muted-foreground);
	font-size: 0.75rem;
	line-height: 1rem;
	letter-spacing: 0.1em;
}

@media (min-width: 1024px) {
	.sa-logo__name { font-size: 1.5rem; line-height: 2rem; }
	.sa-logo__tld { font-size: 0.875rem; line-height: 1.25rem; }
}

.sa-nav__desktop {
	display: none;
	align-items: center;
	gap: 2rem;
}

@media (min-width: 768px) {
	.sa-nav__desktop { display: flex; }
	.sa-nav__toggle { display: none !important; }
	.sa-mobile { display: none !important; }
}

.sa-menu {
	display: flex;
	align-items: center;
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sa-menu a {
	font-size: 0.875rem;
	line-height: 1.25rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted-foreground);
	transition: color 0.15s;
}

.sa-menu a:hover,
.sa-menu .is-current > a,
.sa-menu .current-menu-item > a,
.sa-menu .current-menu-ancestor > a,
.sa-menu .current_page_item > a {
	color: var(--primary);
}

.sa-nav__account {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.sa-nav__signout {
	font-size: 0.875rem;
	color: var(--muted-foreground);
}

.sa-nav__signout:hover { color: var(--primary); }

.sa-nav__toggle {
	padding: 0.5rem;
	color: var(--foreground);
}

.sa-nav__toggle .sa-icon-close { display: none; }
.sa-nav__toggle[aria-expanded="true"] .sa-icon-open { display: none; }
.sa-nav__toggle[aria-expanded="true"] .sa-icon-close { display: block; }

.sa-mobile {
	border-top: 1px solid color-mix(in oklab, var(--border) 50%, transparent);
	background: var(--background);
}

.sa-mobile[hidden] { display: none; }

.sa-mobile__inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 1rem;
}

.sa-mobile .sa-menu {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.sa-mobile .sa-menu a {
	display: block;
	padding: 0.75rem 0;
	font-size: 0.875rem;
}

.sa-mobile__account {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-top: 1rem;
	margin-top: 0.5rem;
	border-top: 1px solid var(--border);
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
.sa-footer {
	background: var(--card);
	border-top: 1px solid var(--border);
}

.sa-footer__inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 3rem 1rem;
}

@media (min-width: 1024px) {
	.sa-footer__inner { padding-left: 2rem; padding-right: 2rem; }
}

.sa-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 768px) {
	.sa-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sa-footer__brand > * + * { margin-top: 1rem; }

.sa-footer__brand .sa-logo__name { font-size: 1.25rem; line-height: 1.75rem; }
.sa-footer__brand .sa-logo__tld { font-size: 0.875rem; line-height: 1.25rem; }

.sa-footer__blurb {
	max-width: 20rem;
	font-size: 0.875rem;
	line-height: 1.625;
	color: var(--muted-foreground);
}

.sa-footer__title {
	margin-bottom: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--foreground);
}

.sa-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sa-footer__list > * + * { margin-top: 0.75rem; }

.sa-footer__list a {
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--muted-foreground);
	transition: color 0.15s;
}

.sa-footer__list a:hover { color: var(--primary); }

.sa-footer__bottom {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border);
}

.sa-footer__copy {
	font-size: 0.75rem;
	line-height: 1rem;
	text-align: center;
	color: var(--muted-foreground);
}

/* ==========================================================================
   8. Cards and grids
   ========================================================================== */
.sa-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 640px) {
	.sa-grid--sm-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sa-grid--sm-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
	.sa-grid--md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sa-grid--md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.sa-grid--lg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.sa-grid--gap-lg { gap: 2rem; }
}

.sa-card-link { display: block; }

.sa-card {
	background: var(--card);
	border: 1px solid var(--border);
	transition: border-color 0.15s;
}

.sa-card--hover:hover,
.sa-card-link:hover .sa-card {
	border-color: color-mix(in oklab, var(--primary) 50%, transparent);
}

.sa-card--h-full { height: 100%; }
.sa-card--p6 { padding: 1.5rem; }
.sa-card--p8 { padding: 2rem; }
.sa-card--p4 { padding: 1rem; }
.sa-card--bg { background: var(--background); }

.sa-iconbox {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 3rem;
	height: 3rem;
	background: var(--secondary);
	color: var(--primary);
}

.sa-card__title {
	font-family: var(--font-serif);
	color: var(--foreground);
	transition: color 0.15s;
}

.sa-card-link:hover .sa-card__title { color: var(--primary); }

/* Home: hero */
.sa-home-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 90vh;
	padding-top: 4rem;
}

.sa-home-hero__bg {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, color-mix(in oklab, var(--secondary) 20%, transparent), var(--background), var(--background));
}

.sa-home-hero__inner {
	position: relative;
	z-index: 10;
	width: 100%;
	max-width: 64rem;
	margin: 0 auto;
	padding: 5rem 1rem;
	text-align: center;
}

.sa-home-hero__title {
	margin-bottom: 1.5rem;
	font-family: var(--font-serif);
	font-size: 2.25rem;
	line-height: 2.5rem;
	letter-spacing: -0.025em;
	color: var(--foreground);
	text-wrap: balance;
}

@media (min-width: 768px) {
	.sa-home-hero__title { font-size: 3.75rem; line-height: 1; }
}

@media (min-width: 1024px) {
	.sa-home-hero__title { font-size: 4.5rem; }
}

.sa-home-hero__lead {
	max-width: 42rem;
	margin: 0 auto 2.5rem;
	font-size: 1.125rem;
	line-height: 1.625;
	color: var(--muted-foreground);
	text-wrap: pretty;
}

@media (min-width: 768px) {
	.sa-home-hero__lead { font-size: 1.25rem; line-height: 1.75rem; line-height: 1.625; }
}

.sa-home-hero__actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	justify-content: center;
}

@media (min-width: 640px) {
	.sa-home-hero__actions { flex-direction: row; }
}

.sa-home-hero__rule {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* Home: sections */
.sa-section--home { padding-top: 5rem; padding-bottom: 5rem; }

@media (min-width: 1024px) {
	.sa-section--home { padding-top: 8rem; padding-bottom: 8rem; }
}

.sa-eyebrow--home { margin-bottom: 1.5rem; }
.sa-about__title { margin-bottom: 1.5rem; }
.sa-about__text { margin-bottom: 2rem; line-height: 1.625; }
.sa-feature__more:hover { text-decoration: none; }

/* Home: discover cards */
.sa-feature__icon { margin-bottom: 1.5rem; }
.sa-feature__title { font-size: 1.25rem; line-height: 1.75rem; margin-bottom: 0.75rem; }
.sa-feature__text { margin-bottom: 1.5rem; font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); }
.sa-feature__more .sa-icon { transition: transform 0.15s; }
.sa-card-link:hover .sa-feature__more .sa-icon { transform: translateX(0.25rem); }

/* Home: stats */
.sa-stats {
	padding: 5rem 0;
	background: var(--card);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.sa-stats__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem;
	text-align: center;
}

@media (min-width: 768px) {
	.sa-stats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.sa-stat__value {
	margin-bottom: 0.5rem;
	font-family: var(--font-serif);
	font-size: 1.875rem;
	line-height: 2.25rem;
	color: var(--primary);
}

@media (min-width: 768px) {
	.sa-stat__value { font-size: 2.25rem; line-height: 2.5rem; }
}

.sa-stat__label {
	font-size: 0.875rem;
	line-height: 1.25rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
}

/* Kings */
.sa-era__head { margin-bottom: 2rem; }
.sa-era__head p.sa-era__desc { max-width: 42rem; color: var(--muted-foreground); }
.sa-era__title { margin-bottom: 0.75rem; }

.sa-king-card__top {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1rem;
}

.sa-king-card__name {
	font-size: 1.125rem;
	line-height: 1.75rem;
}

.sa-king-card__persian {
	font-size: 0.75rem;
	line-height: 1rem;
	color: var(--primary);
}

.sa-king-card__epithet {
	margin-bottom: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--muted-foreground);
}

.sa-king-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.sa-king-card__years {
	font-size: 0.75rem;
	line-height: 1rem;
	color: var(--muted-foreground);
}

.sa-king-card__arrow {
	color: var(--primary);
	opacity: 0;
	transition: opacity 0.15s, transform 0.15s;
}

.sa-card-link:hover .sa-king-card__arrow {
	opacity: 1;
	transform: translateX(0.25rem);
}

.sa-cta {
	margin-top: 0;
	padding: 4rem 0;
	background: var(--card);
	border-top: 1px solid var(--border);
	text-align: center;
}

.sa-cta--mt { margin-top: 3rem; }

@media (min-width: 1024px) {
	.sa-cta { padding: 5rem 0; }
}

.sa-cta p { margin-bottom: 2rem; color: var(--muted-foreground); }

/* King profile */
.sa-king-hero {
	padding-bottom: 3rem;
	border-bottom: 1px solid var(--border);
}

.sa-king-hero__row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2rem;
}

@media (min-width: 768px) {
	.sa-king-hero__row { flex-direction: row; }
}

.sa-king-hero__icon {
	width: 6rem;
	height: 6rem;
	border: 1px solid var(--border);
	overflow: hidden;
}

.sa-king-hero__icon img { width: 100%; height: 100%; object-fit: cover; }

.sa-king-hero__body { flex: 1 1 0%; }

.sa-king-hero__title {
	margin-bottom: 0.5rem;
	font-size: 1.875rem;
	line-height: 2.25rem;
}

@media (min-width: 768px) { .sa-king-hero__title { font-size: 2.25rem; line-height: 2.5rem; } }
@media (min-width: 1024px) { .sa-king-hero__title { font-size: 3rem; line-height: 1; } }

.sa-king-hero__epithet {
	margin-bottom: 1rem;
	font-size: 1.25rem;
	line-height: 1.75rem;
	color: var(--muted-foreground);
}

.sa-king-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--muted-foreground);
}

.sa-king-hero__meta > span,
.sa-king-hero__meta > div {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sa-king-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem;
}

@media (min-width: 1024px) {
	.sa-king-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.sa-king-layout__main { grid-column: span 2 / span 2; }
}

.sa-stack-8 > * + * { margin-top: 2rem; }
.sa-stack-6 > * + * { margin-top: 1.5rem; }

.sa-bio { color: var(--muted-foreground); line-height: 1.625; }
.sa-bio p + p { margin-top: 1rem; }

.sa-checklist { margin: 0; padding: 0; }
.sa-checklist > li { display: flex; align-items: flex-start; gap: 0.75rem; }
.sa-checklist > li + li { margin-top: 0.75rem; }

.sa-checklist__dot {
	flex-shrink: 0;
	width: 0.375rem;
	height: 0.375rem;
	margin-top: 0.5rem;
	border-radius: 9999px;
	background: var(--primary);
}

.sa-checklist__text { color: var(--muted-foreground); }

.sa-rowhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.sa-rowhead--mb4 { margin-bottom: 1rem; }
.sa-rowhead--mb8 { margin-bottom: 2rem; }
.sa-rowhead .sa-h2 { margin: 0; }

.sa-viewall {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--primary);
}

.sa-viewall:hover { text-decoration: underline; }

.sa-grid--tight { gap: 1rem; }

.sa-minicoin__top {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.sa-minicoin__top .sa-icon { color: var(--primary); }

.sa-minicoin__name {
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: var(--foreground);
	transition: color 0.15s;
}

.sa-card-link:hover .sa-minicoin__name { color: var(--primary); }

.sa-minicoin__meta {
	font-size: 0.75rem;
	line-height: 1rem;
	color: var(--muted-foreground);
}

.sa-side-title {
	margin-bottom: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--foreground);
}

.sa-dl { font-size: 0.875rem; line-height: 1.25rem; }
.sa-dl > div + div { margin-top: 1rem; }
.sa-dl dt { color: var(--muted-foreground); }
.sa-dl dd { margin: 0; color: var(--foreground); font-weight: 500; }

.sa-succession > * + * { margin-top: 1rem; }
.sa-succession__label { margin-bottom: 0.25rem; font-size: 0.75rem; line-height: 1rem; color: var(--muted-foreground); }

.sa-succession__link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--foreground);
	transition: color 0.15s;
}

.sa-succession__link:hover { color: var(--primary); }

/* Coins: filter bar */
.sa-filterbar {
	padding: 2rem 0;
	background: var(--card);
	border-bottom: 1px solid var(--border);
}

.sa-filterbar__row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 1rem;
}

@media (min-width: 640px) {
	.sa-filterbar__row { flex-direction: row; align-items: center; }
}

.sa-search {
	position: relative;
	flex: 1 1 0%;
}

.sa-search .sa-icon {
	position: absolute;
	top: 50%;
	left: 0.75rem;
	transform: translateY(-50%);
	color: var(--muted-foreground);
	pointer-events: none;
}

.sa-input,
.sa-select {
	width: 100%;
	min-height: 48px;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--foreground);
	background: var(--input);
	border: 1px solid var(--border);
	border-radius: 0;
	outline: none;
	transition: border-color 0.15s;
}

.sa-search .sa-input { padding-left: 2.5rem; }

.sa-input::placeholder { color: var(--muted-foreground); }

.sa-input:focus,
.sa-select:focus { border-color: var(--primary); }

.sa-select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.25rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f524c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.sa-filterbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--foreground);
	background: transparent;
	border: 1px solid var(--border);
	transition: border-color 0.15s, background-color 0.15s;
}

.sa-filterbtn:hover { border-color: var(--primary); }

.sa-filterbtn[aria-expanded="true"] {
	background: var(--primary);
	color: var(--primary-foreground);
	border-color: var(--primary);
}

.sa-filterpanel {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.sa-filterpanel[hidden] { display: none; }

.sa-filterpanel__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 640px) { .sa-filterpanel__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sa-filterpanel__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sa-filterpanel label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.75rem;
	line-height: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
}

.sa-filterpanel__actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

.sa-filterpanel__clear {
	font-size: 0.875rem;
	color: var(--muted-foreground);
	text-decoration: underline;
}

.sa-filterpanel__clear:hover { color: var(--primary); }

.sa-count { margin-bottom: 2rem; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }
.sa-count strong { color: var(--foreground); font-weight: 500; }

/* Coin card */
.sa-coin-card__media,
.sa-coin-media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--secondary);
	color: var(--primary);
}

.sa-coin-card__media img,
.sa-coin-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sa-coin-card__body { padding: 1.5rem; }

.sa-coin-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.sa-coin-card__title { font-size: 1.125rem; line-height: 1.75rem; }
.sa-coin-card__king { font-size: 0.875rem; line-height: 1.25rem; color: var(--primary); }

.sa-coin-card__desc {
	margin-bottom: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--muted-foreground);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sa-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.75rem;
	line-height: 1rem;
}

.sa-tags span {
	padding: 0.25rem 0.5rem;
	background: var(--secondary);
	color: var(--muted-foreground);
}

.sa-empty {
	padding: 4rem 0;
	text-align: center;
	color: var(--muted-foreground);
}

.sa-empty .sa-icon { margin: 0 auto 1rem; }
.sa-empty p { margin-bottom: 1rem; }

.sa-pagination { margin-top: 3rem; }

.sa-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.sa-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	font-size: 0.875rem;
	color: var(--foreground);
	background: var(--card);
	border: 1px solid var(--border);
	transition: border-color 0.15s, color 0.15s;
}

.sa-pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary); }

.sa-pagination .page-numbers.current {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--primary-foreground);
}

/* Coin page */
.sa-coin-main { padding-bottom: 4rem; }
.sa-mb6 { margin-bottom: 1.5rem; }
.sa-coin-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 1024px) {
	.sa-coin-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
}

.sa-coin-gallery > * + * { margin-top: 1rem; }

.sa-coin-media--main { border: 1px solid var(--border); }

.sa-thumbs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
}

.sa-thumb {
	display: block;
	padding: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--secondary);
	border: 1px solid var(--border);
	opacity: 0.75;
	transition: opacity 0.15s, border-color 0.15s;
}

.sa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sa-thumb:hover, .sa-thumb.is-active { opacity: 1; }
.sa-thumb.is-active { border-color: var(--primary); }

.sa-sourcecard {
	padding: 1rem;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.sa-sourcecard > * + * { margin-top: 0.75rem; }

.sa-sourcecard__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.sa-sourcecard__row a { color: var(--primary); text-decoration: underline; }

.sa-coin-title {
	margin-bottom: 1rem;
	font-size: 1.875rem;
	line-height: 2.25rem;
}

@media (min-width: 768px) { .sa-coin-title { font-size: 2.25rem; line-height: 2.5rem; } }

.sa-coin-profile {
	margin-bottom: 1.5rem;
}

.sa-coin-body {
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.sa-coin-body > * + * { margin-top: 1.5rem; }

.sa-subhead {
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--foreground);
}

.sa-coin-body p { color: var(--muted-foreground); line-height: 1.625; }

.sa-specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.sa-specs__wide { grid-column: span 2 / span 2; }

.sa-specs dt,
.sa-fieldlabel {
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	line-height: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
}

.sa-specs dd { margin: 0; color: var(--foreground); }

.sa-coin-body .sa-block {
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	margin-top: 1.5rem;
}

.sa-mono { font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem; color: var(--foreground); }
.sa-note { font-size: 0.875rem; line-height: 1.25rem; font-style: italic; color: var(--muted-foreground); }

.sa-minicard__media { aspect-ratio: 1 / 1; }
.sa-minicard__body { padding: 1rem; }

.sa-minicard__title {
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: var(--foreground);
	transition: color 0.15s;
}

.sa-card-link:hover .sa-minicard__title { color: var(--primary); }
.sa-minicard__meta { margin-top: 0.25rem; font-size: 0.75rem; line-height: 1rem; color: var(--muted-foreground); }

.sa-table-wrap { border: 1px solid var(--border); overflow-x: auto; }

.sa-table {
	width: 100%;
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.sa-table tr { border-bottom: 1px solid var(--border); }
.sa-table tr:last-child { border-bottom: 0; }
.sa-table th, .sa-table td { padding: 0.75rem 1rem; text-align: left; vertical-align: top; }

.sa-table th {
	width: 33.3333%;
	background: var(--secondary);
	color: var(--muted-foreground);
	font-weight: 500;
}

.sa-table td { color: var(--foreground); }

/* History */
.sa-prose > * + * { margin-top: 1.5rem; }

.sa-prose {
	color: var(--muted-foreground);
	line-height: 1.625;
}

.sa-prose h2,
.sa-prose h3,
.sa-prose h4 {
	font-family: var(--font-serif);
	color: var(--foreground);
	line-height: 1.3;
}

.sa-prose h2 { font-size: 1.5rem; line-height: 2rem; margin-bottom: 0; }
.sa-prose h3 { font-size: 1.25rem; line-height: 1.75rem; }
.sa-prose h4 { font-size: 1.125rem; line-height: 1.75rem; }

@media (min-width: 768px) {
	.sa-prose h2 { font-size: 1.875rem; line-height: 2.25rem; }
}

.sa-prose h2 + *,
.sa-prose h3 + *,
.sa-prose h4 + * { margin-top: 1.5rem; }

.sa-prose a { color: var(--primary); text-decoration: underline; }
.sa-prose a:hover { text-decoration: none; }
.sa-prose strong { color: var(--foreground); font-weight: 600; }

.sa-prose ul,
.sa-prose ol { padding-left: 1.5rem; }
.sa-prose ul { list-style: disc; }
.sa-prose ol { list-style: decimal; }
.sa-prose li + li { margin-top: 0.5rem; }

.sa-prose blockquote {
	padding-left: 1.25rem;
	border-left: 2px solid var(--primary);
	font-style: italic;
}

.sa-prose img,
.sa-prose figure { max-width: 100%; height: auto; }
.sa-prose figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }

.sa-prose hr { border-top: 1px solid var(--border); margin: 2.5rem 0; }

.sa-prose table { width: 100%; font-size: 0.875rem; border: 1px solid var(--border); }
.sa-prose th, .sa-prose td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.sa-prose th { background: var(--secondary); color: var(--foreground); }

.sa-prose code,
.sa-prose pre { font-family: var(--font-mono); font-size: 0.875rem; }
.sa-prose pre { padding: 1rem; overflow-x: auto; background: var(--secondary); border: 1px solid var(--border); }

.sa-phases > * + * { margin-top: 4rem; }

.sa-phase__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
}

.sa-phase__num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	flex-shrink: 0;
	background: var(--secondary);
	border: 1px solid var(--border);
	font-family: var(--font-serif);
	font-size: 1.5rem;
	line-height: 2rem;
	color: var(--primary);
}

.sa-phase__title { margin: 0; font-size: 1.25rem; line-height: 1.75rem; }
.sa-phase__range { font-size: 0.875rem; line-height: 1.25rem; color: var(--primary); }
.sa-phase__desc { margin-bottom: 2rem; color: var(--muted-foreground); }

.sa-events > * + * { margin-top: 1.5rem; }

@media (min-width: 768px) {
	.sa-phase__desc,
	.sa-events { padding-left: 5rem; }
}

.sa-event {
	position: relative;
	padding-left: 2rem;
	border-left: 1px solid var(--border);
}

.sa-event::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 0.5rem;
	height: 0.5rem;
	transform: translateX(-50%);
	border-radius: 9999px;
	background: var(--primary);
}

.sa-event__year {
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	line-height: 1rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--primary);
}

.sa-event__title {
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--foreground);
}

.sa-event__text,
.sa-event__text p { font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }

.sa-aspect__title { margin-bottom: 1rem; font-size: 1.125rem; line-height: 1.75rem; }
.sa-aspect__text { font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); }

/* Contribute page */
.sa-contribute-page { padding-top: 6rem; padding-bottom: 4rem; }

.sa-contribute-page .sa-back--plain {
	margin-bottom: 1.5rem;
}

.sa-contribute-title {
	margin-bottom: 0.5rem;
	font-family: var(--font-serif);
	font-size: 1.875rem;
	line-height: 2.25rem;
	font-weight: 700;
	color: var(--foreground);
}

@media (min-width: 1024px) { .sa-contribute-title { font-size: 2.25rem; line-height: 2.5rem; } }

.sa-contribute-intro { margin-bottom: 2rem; color: var(--muted-foreground); }

/* Posts (blog / search fallback) */
.sa-post-card__meta { margin-bottom: 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); }
.sa-post-card__title { margin-bottom: 0.75rem; font-size: 1.25rem; line-height: 1.75rem; }
.sa-post-card__excerpt { font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); }
.sa-post-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--secondary); }
.sa-post-card__media img { width: 100%; height: 100%; object-fit: cover; }

.sa-entry-meta { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.sa-entry-thumb { margin-bottom: 2rem; }

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0.25rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.25rem 0 1rem 1.5rem; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: var(--muted-foreground); }
.sticky, .bypostauthor, .gallery-caption { display: block; }

/* Motion: keep it calm and honour reduced-motion. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

@media print {
	.sa-header, .sa-footer, .sa-filterbar { display: none !important; }
	.sa-main { padding-top: 0; }
}
