/*
 * Alisaab theme: refinements that theme.json cannot express.
 * Colours, fonts and sizes live in theme.json (edit them in Appearance → Editor → Styles).
 * Every colour below uses the palette variables, so style variations recolour it all.
 */

/* ---------- Base ---------- */
body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	font-kerning: normal;
	font-variant-ligatures: common-ligatures;
	font-variant-numeric: oldstyle-nums proportional-nums;
	/* Faint paper grain (inline SVG, ~400 bytes, no request). */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.26 0 0 0 0 0.15 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
	background: color-mix(in srgb, var(--wp--preset--color--gilt) 38%, transparent);
	color: var(--wp--preset--color--ink);
}

:where(a) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

:where(a):hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--oxblood);
	outline-offset: 3px;
}

:where(.wp-site-blocks) :where(p, li) {
	hyphens: auto;
	overflow-wrap: break-word;
}

:where(h1, h2, h3) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

table,
.alisaab-lining {
	font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- Utility classes (add in Block → Advanced → Additional CSS class) ---------- */
.alisaab-center {
	text-align: center;
}

.alisaab-label,
.is-style-label {
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--oxblood);
	font-variant-numeric: lining-nums;
}

.alisaab-muted {
	color: var(--wp--preset--color--sepia);
}

@media (max-width: 781px) {
	.alisaab-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 782px) {
	.alisaab-hide-desktop {
		display: none !important;
	}
}

/* ---------- Header ---------- */
.alisaab-topbar {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--sepia);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.alisaab-topbar a {
	color: inherit;
	text-decoration: none;
}

.alisaab-topbar a:hover {
	color: var(--wp--preset--color--oxblood);
}

.alisaab-masthead .wp-block-site-title {
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.alisaab-navrow {
	border-top: 1px solid var(--wp--preset--color--ink);
	border-bottom: 3px double var(--wp--preset--color--ink);
}

.alisaab-header-compact {
	border-bottom: 3px double var(--wp--preset--color--ink);
}

/* Newsletter item in the menu becomes a quiet button. */
.wp-block-navigation .alisaab-nav-cta > .wp-block-navigation-item__content {
	border: 1px solid currentColor;
	padding: 0.35em 0.9em !important;
	border-radius: 2px;
}

.wp-block-navigation .alisaab-nav-cta > .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--parchment) !important;
}

.wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--paper) !important;
	border: 1px solid var(--wp--preset--color--rule) !important;
	box-shadow: var(--wp--preset--shadow--paper);
	padding: 0.4rem 0 !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55em 1.2em !important;
}

/* Mobile overlay menu */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--parchment) !important;
	color: var(--wp--preset--color--ink) !important;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: var(--wp--preset--font-size--small);
	gap: 1.1rem;
}

/* ---------- Breadcrumbs, byline, reading time ---------- */
.alisaab-breadcrumbs {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--sepia);
	font-variant-numeric: lining-nums;
}

.alisaab-breadcrumbs p {
	margin: 0;
}

.alisaab-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.alisaab-breadcrumbs a:hover {
	color: var(--wp--preset--color--oxblood);
}

.alisaab-breadcrumbs .separator,
.alisaab-breadcrumbs .alisaab-sep {
	margin: 0 0.5em;
	color: var(--wp--preset--color--gilt);
}

.alisaab-meta {
	color: var(--wp--preset--color--sepia);
	font-size: var(--wp--preset--font-size--small);
}

.alisaab-meta > * {
	margin: 0 !important;
}

.alisaab-meta > * + *::before {
	content: "·";
	margin-right: 0.6em;
	color: var(--wp--preset--color--gilt);
}

.alisaab-meta .alisaab-meta-pair {
	display: inline-flex;
	gap: 0.35em;
	align-items: baseline;
}

.alisaab-meta .alisaab-meta-pair > * {
	margin: 0;
}

/* ---------- Separator styles ---------- */
hr.wp-block-separator.is-style-fleuron {
	border: 0 !important;
	height: 1.6em;
	max-width: 16rem;
	margin-inline: auto !important;
	background:
		linear-gradient(var(--wp--preset--color--gilt), var(--wp--preset--color--gilt)) left center / calc(50% - 1.4em) 1px no-repeat,
		linear-gradient(var(--wp--preset--color--gilt), var(--wp--preset--color--gilt)) right center / calc(50% - 1.4em) 1px no-repeat !important;
	color: var(--wp--preset--color--gilt) !important;
	opacity: 1;
	overflow: visible;
	text-align: center;
	position: relative;
}

hr.wp-block-separator.is-style-fleuron::before {
	content: "\2766";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-family: "EB Garamond", "Segoe UI Symbol", "DejaVu Sans", serif;
	font-size: 1.15em;
	line-height: 1;
}

hr.wp-block-separator.is-style-double-rule {
	border: 0 !important;
	border-top: 3px double currentColor !important;
	height: 0;
	opacity: 1;
}

hr.wp-block-separator.is-style-asterism {
	border: 0 !important;
	height: 1.6em;
	background: none !important;
	opacity: 1;
	text-align: center;
	color: var(--wp--preset--color--gilt) !important;
	position: relative;
}

hr.wp-block-separator.is-style-asterism::before {
	content: "\2042";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 1.4em;
}

/* ---------- Group styles ---------- */
.is-style-card {
	background-color: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule);
	box-shadow: var(--wp--preset--shadow--paper);
	padding: var(--wp--preset--spacing--40);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.is-style-card:has(a):hover {
	box-shadow: var(--wp--preset--shadow--lifted);
	transform: translateY(-2px);
}

.is-style-bordered-box {
	background-color: var(--wp--preset--color--paper);
	border: 4px double var(--wp--preset--color--rule);
	padding: var(--wp--preset--spacing--50);
}

.is-style-takeaways {
	background-color: var(--wp--preset--color--vellum);
	border-left: 3px solid var(--wp--preset--color--oxblood);
	padding: var(--wp--preset--spacing--40);
}

.is-style-takeaways ul {
	margin-top: 0.5rem;
	padding-left: 1.2em;
}

.is-style-takeaways li + li {
	margin-top: 0.45em;
}

.is-style-definition {
	border-top: 1px solid var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--wp--preset--color--ink);
	padding-block: var(--wp--preset--spacing--30);
}

.is-style-definition p:not(.is-style-label) {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

/* ---------- Paragraph styles ---------- */
.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	font-style: italic;
	color: var(--wp--preset--color--sepia);
}

.is-style-urdu {
	font-family: var(--wp--preset--font-family--urdu) !important;
	direction: rtl;
	text-align: right;
	line-height: 2.3;
	font-size: 1.35em;
	font-style: normal;
}

.has-drop-cap:not(:focus)::first-letter {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	color: var(--wp--preset--color--oxblood);
	font-size: 4.4em;
	line-height: 0.78;
	margin: 0.08em 0.1em 0 0;
}

/* ---------- Quotes ---------- */
.wp-block-quote cite {
	display: block;
	margin-top: 0.6em;
	font-style: normal;
}

.wp-block-quote.is-style-epigraph {
	border: 0 !important;
	padding: 0 !important;
	max-width: 34rem;
	margin-inline: auto !important;
	text-align: center;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.wp-block-quote.is-style-epigraph cite {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--sepia);
}

.wp-block-quote.is-style-epigraph cite::before {
	content: "— ";
}

/* ---------- Tables ---------- */
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	background: var(--wp--preset--color--paper);
}

.wp-block-table thead {
	border-bottom: 0 !important;
}

.wp-block-table th {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.1em;
	text-align: left;
	border: 0 !important;
	border-bottom: 2px solid var(--wp--preset--color--ink) !important;
	padding: 0.7em 0.85em;
}

.wp-block-table td {
	border: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--rule) !important;
	padding: 0.7em 0.85em;
	vertical-align: top;
}

.wp-block-table tbody td:first-child {
	font-weight: 600;
	color: var(--wp--preset--color--oxblood);
}

/* ---------- FAQ (Details block) ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding-block: 0.9rem;
}

.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 2rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 1.3;
}

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

.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 0;
	color: var(--wp--preset--color--oxblood);
	font-family: var(--wp--preset--font-family--body);
}

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

.wp-block-details > :not(summary) {
	margin-top: 0.75rem;
}

/* ---------- Lists ---------- */
.is-style-plain-links {
	list-style: none;
	padding-left: 0 !important;
}

.is-style-plain-links li + li {
	margin-top: 0.45em;
}

.is-style-plain-links a {
	text-decoration: none;
}

.is-style-plain-links a:hover {
	text-decoration: underline;
}

.is-style-citations {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	padding-left: 1.6em;
}

.is-style-citations li {
	padding-left: 0.3em;
}

.is-style-citations li + li {
	margin-top: 0.6em;
}

.is-style-roman {
	list-style-type: upper-roman;
}

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid currentColor;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--parchment);
	border-color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-text-link > .wp-block-button__link {
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	padding: 0 0 0.15em;
	color: var(--wp--preset--color--oxblood);
}

.wp-block-button.is-style-text-link > .wp-block-button__link::after {
	content: " \2192";
}

.wp-block-button.is-style-text-link > .wp-block-button__link:hover {
	background: none;
	color: var(--wp--preset--color--oxblood-deep);
}

/* ---------- Images ---------- */
.wp-block-image.is-style-framed img,
.wp-block-post-featured-image.is-style-framed img {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule);
	padding: 0.5rem;
	box-shadow: var(--wp--preset--shadow--paper);
}

/* Monogram (used when there is no editor photo yet). */
.alisaab-monogram {
	width: 7.5rem;
	height: 7.5rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	margin: 0;
	background: var(--wp--preset--color--vellum);
	border: 4px double var(--wp--preset--color--gilt);
	font-family: var(--wp--preset--font-family--display);
	font-size: 2.4rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--oxblood);
}

/* ---------- Cards in post lists ---------- */
.alisaab-post-card .wp-block-post-title {
	margin-top: 0.35rem;
}

.alisaab-post-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.alisaab-list-item {
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding-bottom: var(--wp--preset--spacing--40);
}

/* ---------- Author box ---------- */
.alisaab-author-box .wp-block-avatar img {
	border: 3px double var(--wp--preset--color--gilt);
}

.alisaab-author-box .wp-block-post-author-biography {
	color: var(--wp--preset--color--sepia);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Footer ---------- */
.alisaab-footer a {
	color: inherit;
}

.alisaab-footer a:hover {
	color: var(--wp--preset--color--gilt);
}

.alisaab-footer .wp-block-site-title a {
	color: inherit;
}

.alisaab-footer .is-style-label {
	color: var(--wp--preset--color--gilt);
}

.alisaab-footer hr.wp-block-separator.is-style-fleuron {
	max-width: 100%;
}

.alisaab-footer .wp-block-button.is-style-outline > .wp-block-button__link {
	color: inherit;
}

.alisaab-footer .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--parchment);
	color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--parchment);
}

/* ---------- Search ---------- */
.wp-block-search__input {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule) !important;
	color: var(--wp--preset--color--ink);
	padding: 0.6em 0.8em;
	font-family: inherit;
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	body {
		background: #fff !important;
		color: #000 !important;
	}

	header.wp-block-template-part,
	footer.wp-block-template-part,
	.wp-block-navigation,
	.alisaab-newsletter,
	.wp-block-buttons {
		display: none !important;
	}

	a {
		color: #000 !important;
	}

	.wp-block-post-content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
	}
}

/* Author archive intro */
.alisaab-author-intro {
	display: flex;
	gap: var(--wp--preset--spacing--30);
	align-items: flex-start;
	color: var(--wp--preset--color--sepia);
}

.alisaab-author-intro img {
	border-radius: 50%;
	border: 3px double var(--wp--preset--color--gilt);
	flex-shrink: 0;
}

.alisaab-author-intro p {
	margin: 0;
}

/* Linked headings inside cards read as titles, not as body links. */
:where(.is-style-card, .is-style-bordered-box) :is(h2, h3, h4) a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

:where(.is-style-card, .is-style-bordered-box) :is(h2, h3, h4) a:hover {
	color: var(--wp--preset--color--oxblood);
	text-decoration: underline;
}

/* Breathing room in long-form text. */
.wp-block-post-content > h2,
.wp-block-post-content .wp-block-group > h2 {
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-post-content > h3 {
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-post-content > h2 + *,
.wp-block-post-content > h3 + * {
	margin-top: var(--wp--preset--spacing--20);
}

/* Keep the footer at the bottom of short pages. */
.wp-site-blocks {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > footer.wp-block-template-part {
	margin-top: auto;
}

.wp-site-blocks > * {
	flex-shrink: 0;
}

/* Rules span their container (core limits plain separators to 100px). */
hr.wp-block-separator.is-style-double-rule {
	width: 100%;
	max-width: none;
}

/* Submenus inside the mobile overlay are plain lists, not floating cards. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0.4rem 0 0 !important;
	font-size: 0.92em;
}
