/*
 * BROKEN EDITORIAL GRID — header, mobile navigation, footer, and the
 * header star. Ported from the approved prototype's header/nav/footer/
 * star rules (design-exploration/site-foundation/concept-1-broken-grid/
 * concept.css) onto real WordPress markup — class names match the
 * prototype directly wherever the underlying structure is the same, so
 * this reads as a direct port, not a re-styling. Every directional rule
 * uses logical properties, so Persian (RTL) and English (LTR) mirror
 * naturally.
 *
 * The homepage/archive/detail-page *compositions* are out of scope this
 * stage — see foundation.css and assets/css/public-content.css for what
 * already exists below the shell; neither is redesigned here.
 */

/* --- header --------------------------------------------------------------- */

.site-head {
	display: flex;
	/*
	 * The brand block, nav links and language switcher used to align on
	 * their own text baselines — since .brand is itself a row (icon beside
	 * name beside tagline, not a stacked wordmark), its flex-computed
	 * "baseline" sat well below the hub icon's own vertical center, which
	 * dragged the nav/lang-switcher rows down with it and inflated the
	 * header's height in the process (their own baseline sits lower again
	 * than a single line of nav text alone would). A shared optical center
	 * puts the hub, wordmark, nav and language switch on one horizontal
	 * axis and — as a direct result, not a separate change — brings the
	 * row back down to its content's real height.
	 */
	align-items: center;
	gap: clamp( 20px, 4vw, 64px );
	padding-block: 22px 14px;
	border-block-end: 1px solid var( --ink );
}

.brand {
	display: flex;
	align-items: center;
	gap: 13px;
	flex: none;
	color: inherit;
	text-decoration: none;
}

.brand-mark {
	color: var( --accent );
	/* .brand already centers the hub against the wordmark's own line
	   (align-items:center above) — no extra optical nudge needed. */
}

.brand-name {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.brand-note {
	font-size: 12px;
	color: var( --ink-3 );
	letter-spacing: 0.02em;
}

.site-nav {
	display: flex;
	gap: clamp( 14px, 2vw, 34px );
	font-size: 14.5px;
	margin-inline-start: auto;
}

.site-nav li {
	list-style: none;
}

.site-nav a {
	position: relative;
	padding-block: 2px;
	color: var( --ink-2 );
	text-decoration: none;
	transition: color 0.18s ease;
}

.site-nav a::after {
	content: '';
	position: absolute;
	inset-inline: 0;
	inset-block-end: -1px;
	height: 1px;
	background: var( --accent );
	transform: scaleX( 0 );
	transform-origin: inline-start;
	transition: transform 0.22s ease;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
	color: var( --ink );
}

.site-nav a:hover::after,
.site-nav a[aria-current='page']::after {
	transform: scaleX( 1 );
}

.lang-switcher {
	flex: none;
}

.lang-switcher-list {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 12.5px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lang-switcher-list a {
	color: var( --ink-3 );
	text-decoration: none;
	letter-spacing: 0.04em;
	transition: color 0.18s ease;
}

.lang-switcher-list a[aria-current='true'] {
	color: var( --ink );
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: var( --accent );
}

.lang-switcher-list a:hover {
	color: var( --ink );
}

/* --- mobile nav toggle + overlay -------------------------------------------
 * Below 760px the inline nav and language switcher are replaced by a
 * single toggle button. The overlay is full-bleed paper, so it reads as
 * another page of the same document rather than a bolted-on drawer. It
 * never renders in the DOM flow until opened (`hidden`), so it costs
 * nothing above the breakpoint.
 */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	margin-inline-start: auto;
	flex: none;
	background: none;
	border: 0;
	cursor: pointer;
}

.nav-toggle-bar {
	display: block;
	height: 1px;
	background: var( --ink );
	transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child( 1 ) {
	transform: translateY( 6px ) rotate( 45deg );
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child( 2 ) {
	opacity: 0;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child( 3 ) {
	transform: translateY( -6px ) rotate( -45deg );
}

.nav-overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	background: var( --paper );
	opacity: 0;
	transition: opacity 0.22s ease;
	overflow-y: auto;
}

.nav-overlay.is-open {
	opacity: 1;
}

.nav-overlay-inner {
	position: relative;
	min-height: 100%;
	padding: 22px var( --pad ) 40px;
}

.nav-overlay-top {
	display: flex;
	align-items: center;
	gap: 20px;
	border-block-end: 1px solid var( --ink );
	padding-block-end: 14px;
}

.nav-close {
	margin-inline-start: auto;
	font-size: 13px;
	letter-spacing: 0.04em;
	color: var( --ink-2 );
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	cursor: pointer;
}

.nav-close:hover {
	color: var( --accent );
}

.nav-overlay-list {
	margin-block-start: clamp( 40px, 9vh, 90px );
	display: grid;
	gap: 4px;
	list-style: none;
	padding: 0;
	counter-reset: fehrest-nav-item;
}

.nav-overlay-list li {
	border-block-end: 1px solid var( --rule );
	counter-increment: fehrest-nav-item;
}

.nav-overlay-list a {
	display: flex;
	align-items: baseline;
	gap: 16px;
	padding-block: 14px;
	font-size: clamp( 30px, 8vw, 48px );
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var( --ink );
	text-decoration: none;
	transition: color 0.18s ease, padding 0.18s ease;
}

.nav-overlay-list a::before {
	content: counter( fehrest-nav-item, decimal-leading-zero );
	font-size: 13px;
	font-weight: 400;
	color: var( --ink-3 );
	align-self: center;
}

.nav-overlay-list a:hover,
.nav-overlay-list a:focus-visible {
	color: var( --accent );
	padding-inline-start: 10px;
}

.nav-overlay-foot {
	margin-block-start: clamp( 40px, 8vh, 80px );
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 13px;
	color: var( --ink-2 );
}

.nav-overlay-foot .lang-switcher-list {
	font-size: 15px;
}

body.nav-locked {
	overflow: hidden;
}

@media ( max-width: 760px ) {
	.site-nav,
	.site-head > .lang-switcher {
		display: none;
	}

	.nav-toggle {
		display: flex;
	}
}

@media ( min-width: 761px ) {
	.nav-overlay {
		display: none;
	}
}

@media ( max-width: 640px ) {
	body {
		font-size: 16px;
	}

	.site-head {
		flex-wrap: wrap;
		row-gap: 12px;
	}

	.brand-note {
		display: none;
	}
}

/* --- generative identity: shared star motion -------------------------------
 * Motion and visible display size for every seeded star generated by
 * assets/js/identity.js (header hub here; homepage marker/decorative roles
 * in assets/css/homepage.css). Ported from the prototype's own tuning: the
 * SVG viewBox is fitted tightly around each star's own generated path, so
 * the box below is the star's real visible size, not a box with dead
 * margin. Breathe amplitude is per-role (identity.js sets --star-breathe-min/
 * -max inline on every star it renders) — the fallback values here are the
 * header hub's own range, used only if a star somehow renders without them.
 */
@keyframes fx-star-rotate {
	to {
		rotate: 360deg;
	}
}

@keyframes fx-star-breathe {
	0%,
	100% {
		scale: var( --star-breathe-min, 0.985 );
	}
	50% {
		scale: var( --star-breathe-max, 1.015 );
	}
}

.mark-star {
	width: 1em;
	height: 1em;
	flex: none;
	transform-origin: center;
	animation-name: fx-star-rotate, fx-star-breathe;
	animation-duration:
		var( --star-rotate-dur, 100s ),
		var( --star-breathe-dur, 90s );
	animation-timing-function: linear, ease-in-out;
	animation-iteration-count: infinite, infinite;
	animation-direction: var( --star-rotate-dir, normal ), normal;
	animation-delay: var( --star-rotate-delay, 0s ), var( --star-breathe-delay, 0s );
}

@media ( prefers-reduced-motion: reduce ) {
	.mark-star {
		animation: none !important;
		rotate: 0deg !important;
		scale: 1 !important;
	}
}

/* Box sized ~4% larger than the target visible diameter, to hold it after
   fitViewBox's own pad (identity-hub.js: 4% for the hub) — a 43px box
   holds a ~41px visible star. */
.brand-mark .mark-star {
	width: 43px;
	height: 43px;
}

@media ( max-width: 1000px ) {
	.brand-mark .mark-star {
		width: 34px;
		height: 34px;
	}
}

/* --- shared editorial primitives (section head, CTA) -----------------------
 * Used by the homepage's "Selected Artists" strip, the Exhibition archive's
 * per-state group headers, and the Exhibition detail's works/gallery/artists
 * sub-headers and "All Exhibitions" back-link — loaded on every page so all
 * three stay in sync.
 */
.section-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	border-block-start: 1px solid var( --ink );
	padding-block-start: 12px;
	margin-block-end: clamp( 22px, 3vw, 42px );
}

.section-head h2 {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var( --ink-2 );
}

.section-head [data-star] {
	font-size: 9px;
	color: var( --accent );
}

.section-head .count {
	font-size: 12px;
	color: var( --ink-3 );
	margin-inline-start: auto;
}

.arrow {
	display: inline-block;
	transition: transform 0.22s ease;
}

[dir='rtl'] .arrow {
	transform: scaleX( -1 );
}

.cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14.5px;
	color: var( --ink );
	border-block-end: 1px solid var( --ink );
	padding-block-end: 3px;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.cta:hover {
	color: var( --accent );
	border-color: var( --accent );
}

.cta:hover .arrow {
	transform: translateX( 5px );
}

[dir='rtl'] .cta:hover .arrow {
	transform: scaleX( -1 ) translateX( 5px );
}

/* --- footer ----------------------------------------------------------------- */

.site-foot {
	border-block-start: 1px solid var( --ink );
	padding-block: clamp( 28px, 3.6vw, 52px ) 30px;
	margin-block-start: clamp( 30px, 5vw, 80px );
	row-gap: 26px;
	font-size: 13.5px;
	color: var( --ink-2 );
}

.foot-brand {
	grid-column: 1 / span 3;
}

.foot-brand .brand-name {
	font-size: 17px;
	color: var( --ink );
}

.foot-tagline {
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var( --ink-3 );
}

.foot-col {
	grid-column: span 3;
	display: grid;
	gap: 7px;
	align-content: start;
}

.foot-col--contact {
	grid-column: span 4;
}

.foot-col li {
	list-style: none;
}

.foot-col h3 {
	font-size: 11.5px;
	letter-spacing: 0.06em;
	color: var( --ink-3 );
	font-weight: 500;
	margin-block-end: 4px;
}

.foot-col a {
	color: inherit;
	text-decoration: none;
	width: fit-content;
	border-block-end: 1px solid transparent;
	transition: border-color 0.18s ease, color 0.18s ease;
}

.foot-col a:hover,
.foot-col a:focus-visible {
	color: var( --accent );
	border-color: var( --accent );
}

.foot-note {
	grid-column: 1 / -1;
	border-block-start: 1px solid var( --rule );
	padding-block-start: 16px;
	font-size: 11.5px;
	color: var( --ink-3 );
	display: flex;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

@media ( max-width: 1000px ) {
	.foot-brand,
	.foot-col {
		grid-column: 1 / -1;
	}
}
