/*
 * Trellis base — reset + shared components, authored RTL-native.
 * Page-specific rules go in assets/css/app.css (later steps).
 * Mirrors the buttons / badges / fields / list-row of the UI kit's
 * design-system.html.
 */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--surface);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--fs-body);
	line-height: var(--lh);
}
h1, h2, h3, h4, p, figure { margin: 0; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-900); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }
[hidden] { display: none !important; }

/* latin runs inside Persian text (codes, sizes) */
.lat { font-family: var(--font-latin); letter-spacing: .5px; }

/* ---------- layout ---------- */
.container {
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section--white { background: var(--white); }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-bar { width: 44px; height: 3px; background: var(--accent); margin-bottom: 8px; }
.section-head h2 { font-size: var(--fs-h2); font-weight: var(--fw-black); }
.section-head p { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }

/* ---------- typography helpers ---------- */
.h1 { font-size: var(--fs-h1); font-weight: var(--fw-black); line-height: 1.4; text-wrap: balance; }
.h2 { font-size: var(--fs-h2); font-weight: var(--fw-black); }
.h3 { font-size: var(--fs-h3); font-weight: var(--fw-bold); }
.meta { font-size: var(--fs-meta); color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: var(--tap); padding: 0 22px;
	border: 1px solid transparent; border-radius: var(--r-control);
	font-size: 15px; font-weight: var(--fw-bold); white-space: nowrap;
	transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-accent { background: var(--accent); color: var(--on-accent, var(--navy-800)); }
.btn-accent:hover { background: var(--accent-shade, #e0940a); color: var(--on-accent, var(--navy-800)); }
.btn-primary { background: var(--navy-700); color: var(--white); }
.btn-primary:hover { background: var(--navy-900); color: var(--white); }
.btn-ghost { border-color: var(--line-strong); color: var(--navy-700); background: transparent; }
.btn-ghost:hover { border-color: var(--navy-700); color: var(--navy-900); }
.btn-text { padding-inline: 6px; color: var(--navy-700); }
.btn-text:hover { color: var(--navy-900); }
.btn[disabled], .btn.is-disabled { background: #E9EEF5; color: #A3AFBF; border-color: transparent; pointer-events: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }

/* ---------- badges & chips ---------- */
.badge {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 5px 10px; border-radius: var(--r-chip);
	font-size: 12px; font-weight: var(--fw-bold); line-height: 1;
}
.badge svg { width: 14px; height: 14px; }
.badge-verified { background: var(--verified); color: var(--white); }
.badge-muted { background: var(--fill); color: var(--text-soft); font-weight: var(--fw-semibold); }
.badge-alert { background: var(--alert-soft); color: var(--alert); border: 1px solid var(--alert-soft-border); }
.badge-reportage { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-soft-border); }
.badge-rank { background: var(--navy-800); color: var(--white); }

.chip {
	display: inline-flex; align-items: center;
	padding: 5px 9px; border-radius: var(--r-chip);
	font-size: 12px; color: var(--text-soft); background: var(--fill);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- cards ---------- */
.card {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	overflow: hidden;
}
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.thumb {
	background-color: var(--placeholder);
	background-image: linear-gradient(135deg, color-mix(in srgb, var(--navy-800) 9%, transparent) 25%, transparent 25%, transparent 50%, color-mix(in srgb, var(--navy-800) 9%, transparent) 50%, color-mix(in srgb, var(--navy-800) 9%, transparent) 75%, transparent 75%);
	background-size: 16px 16px;
}

/* ---------- rating ---------- */
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.rating svg { width: 16px; height: 16px; fill: var(--rating); }
.rating .count { color: var(--muted); font-weight: var(--fw-regular); font-size: 12px; }
.rating--none { color: var(--muted); font-weight: var(--fw-semibold); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field > label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-soft); }
.field-hint { color: var(--muted); font-weight: var(--fw-regular); }
.field input,
.field select,
.field textarea {
	width: 100%; min-height: var(--tap);
	padding: 10px 14px;
	border: 1px solid var(--line-strong); border-radius: var(--r-control);
	background: var(--white); color: var(--text);
	font: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); outline: none; }

/* honeypot — visually gone, still in the a11y tree off-screen */
.trellis-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* form status lines (?lead=, ?sent=, ?concierge=, ?subscribed=) */
.form-notice { padding: 12px 14px; border-radius: var(--r-control); font-size: var(--fs-sm); }
.form-notice.ok { background: var(--verified-soft); color: #0B5C45; border: 1px solid var(--verified-soft-border); }
.form-notice.err { background: var(--alert-soft); color: var(--alert); border: 1px solid var(--alert-soft-border); }
.form-notice.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-soft-border); }

/* ---------- newsletter block (markup from trellis-core/class-trellis-blocks.php) ---------- */
.newsletter-cta { background: var(--navy-900); border-radius: var(--r-card); padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.newsletter-cta .nc-copy h3 { font-size: 18px; font-weight: var(--fw-black); color: var(--on-dark); }
.newsletter-cta .nc-copy p { font-size: var(--fs-sm); color: var(--on-dark-muted); margin-top: 4px; }
.newsletter-cta .nc-row { display: flex; gap: 8px; }
.newsletter-cta .nc-row input { min-height: var(--tap); padding: 0 14px; border: 0; border-radius: var(--r-control); min-width: 240px; }
.newsletter-cta .nc-consent { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--on-dark-muted); }
.newsletter-cta .nc-notice { font-size: var(--fs-sm); }
.newsletter-cta .nc-notice.ok { color: #7fe0c2; }
.newsletter-cta .nc-notice.err { color: #f2b8ad; }

/* ---------- ad slot (markup from trellis-core) ---------- */
.ad-slot, .ad-slot-filled {
	border: 1px dashed var(--line-strong); border-radius: var(--r-card);
	min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 6px; background: var(--white); color: var(--muted); font-size: var(--fs-meta); font-weight: var(--fw-bold);
}
.ad-slot-filled { border-style: solid; padding: 0; }

/* ---------- a11y ---------- */
/* Visually hidden via the clip/1px technique (same as .screen-reader-text
   below), not an off-canvas left offset — in this RTL document `left:
   -9999px` sits outside the left edge and gets counted as scrollable
   content, giving every page a horizontal scrollbar. inset-inline-start
   also keeps the focused position correct if the site ever ships an LTR
   locale. */
.skip-link {
	position: absolute; top: 0; inset-inline-start: 0;
	width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
	background: var(--navy-900); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus {
	width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
	top: 8px; inset-inline-start: 8px;
}
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ================= site header =================
 *
 * One bar on every page: brand · primary nav · the search capsule (with the
 * sitewide city switcher built into it) · account.
 *
 * Sticky, so search and city stay reachable part-way down a long archive.
 * Deliberately a solid ground rather than the translucent + backdrop-filter
 * treatment in the design file: blurring whatever scrolls underneath
 * re-composites that strip on every frame, which is the most expensive thing
 * a sticky header can do on a mid-range phone, and it buys nothing over the
 * plain page surface the bar actually sits on.
 *
 * Radii, colours and type are tokens.css values rather than the design
 * file's own scale, so the bar stays in the same family as the cards under
 * it — one radius for the whole site, not a rounder header.
 */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--white);
	border-bottom: 1px solid var(--line);
}
/* In-page anchors (#main, #concierge, the blog TOC) would otherwise land
   underneath the sticky bar. */
html { scroll-padding-top: calc(var(--header-h) + 12px); }

/* The logged-in toolbar is fixed above us, at two heights. Below 601px WP
   switches it to position:absolute, where top:0 is already correct. */
@media screen and (min-width: 783px) { body.admin-bar .site-header { top: 32px; } }
@media screen and (min-width: 601px) and (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

.site-header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.brand-name { font-size: 20px; font-weight: var(--fw-black); letter-spacing: -0.3px; }
.brand-latin { font-size: 10px; font-weight: var(--fw-medium); letter-spacing: 3px; color: var(--muted); }
.brand .custom-logo { height: 44px; width: auto; }

/* ---------- primary nav ---------- */
.primary-nav { flex-shrink: 0; }
.nav-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { display: inline-flex; align-items: center; }
.nav-menu > li > a {
	display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 10px;
	border-radius: var(--r-control); font-size: 15px; font-weight: var(--fw-medium);
	color: var(--navy-500); white-space: nowrap;
}
.nav-menu > li > a:hover { background: var(--surface); color: var(--navy-900); }

/* Browse dropdowns. The whole label is one button that opens the panel —
   on click or tap, on Enter/Space, and after a short hover on a mouse
   (assets/js/nav.js). The hub page it used to link to is the panel's last
   link, so the crawlable path to the term archives is still in the HTML. */
.menu-item--mega { position: relative; }
.nav-mega-toggle {
	display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px 0 10px;
	border: 0; border-radius: var(--r-control); background: transparent;
	font: inherit; font-size: 15px; font-weight: var(--fw-medium);
	color: var(--navy-500); white-space: nowrap; cursor: pointer;
}
.nav-mega-toggle:hover,
.nav-mega-toggle[aria-expanded="true"] { background: var(--surface); color: var(--navy-900); }
.nav-mega-toggle .caret { color: var(--icon); transition: transform .15s ease; }
.nav-mega-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
/* Fills the gap between the label and the panel, so the pointer crossing
   it on the way down doesn't count as leaving the menu. */
.primary-nav .nav-mega::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 12px; }

.nav-mega { inset-inline-start: 0; width: 440px; padding: 14px; }
.nav-mega-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.nav-mega-item { display: block; padding: 9px 10px; border-radius: var(--r-control); font-size: 14px; font-weight: var(--fw-medium); color: var(--text); }
.nav-mega-item:hover { background: var(--fill); color: var(--navy-900); }
.nav-mega-all {
	display: block; margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--line);
	font-size: 13.5px; font-weight: var(--fw-bold); color: var(--navy-700);
}
.nav-mega-all:hover { color: var(--navy-900); }

/* ---------- one dropdown shape for all three (mega · city · account) ----------
   assets/js/nav.js drives every one of them from a single controller, so the
   only thing that differs between them is what is inside. */
.pop {
	position: absolute; top: calc(100% + 10px); z-index: 10;
	background: var(--white); border: 1px solid var(--line);
	border-radius: var(--r-card); box-shadow: var(--shadow-pop);
	animation: trellis-pop .16s cubic-bezier(.2, .8, .2, 1);
}
@keyframes trellis-pop { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }

/* ---------- search capsule ---------- */
/* Shrinks before anything else in the bar does, so a long nav or a long
   display name can never push the row wider than the container. */
.site-finder { position: relative; flex: 1 1 320px; min-width: 0; max-width: 560px; margin-inline: auto; }
.site-search { position: relative; }
.site-search-field {
	display: flex; align-items: center; gap: 4px; height: 52px; padding: 4px;
	border: 1.5px solid var(--line-strong); border-radius: var(--r-control); background: var(--white);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.site-search-field:hover { border-color: var(--navy-500); }
.site-search-field:focus-within {
	border-color: var(--brand-accent, var(--accent));
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-accent, var(--accent)) 22%, transparent);
}

/* The city sits inside the capsule because that is where a visitor looks for
   "where" — but it is still the sitewide switcher, not a search field, and it
   never travels in the query string. */
.site-search-city {
	position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
	height: 100%; padding: 0 12px; border: 0; border-radius: var(--r-chip);
	background: var(--fill); color: var(--text-soft);
	font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap;
	transition: background .15s ease, color .15s ease;
}
.site-search-city:hover { background: var(--line); color: var(--navy-900); }
/* Nothing frozen yet — a soft accent nudge inviting the first pick. */
.site-search-city--empty { background: var(--accent-soft); color: var(--accent-ink); }
.site-search-city--empty:hover { background: var(--accent-soft-border); color: var(--accent-ink); }
.site-search-city svg { flex-shrink: 0; }
.site-search-city-label { max-width: 104px; overflow: hidden; text-overflow: ellipsis; }
.site-search-city .caret { transition: transform .15s ease; }
.site-search-city[aria-expanded="true"] .caret { transform: rotate(180deg); }

.site-search-input {
	flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0;
	font: inherit; font-size: 15px; color: var(--text); background: transparent;
}
.site-search-input::placeholder { color: var(--muted); }

.site-search-clear {
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-chip);
	background: transparent; color: var(--muted);
}
.site-search-clear:hover { background: var(--fill); color: var(--text); }

/* Mirrors the "/" shortcut assets/js/nav.js binds. */
.site-search-kbd {
	display: inline-grid; place-items: center; flex-shrink: 0; min-width: 24px; height: 24px; padding: 0 6px;
	border: 1px solid var(--line); border-radius: var(--r-chip);
	font-size: 12px; color: var(--muted); background: var(--surface);
}

.site-search-submit {
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 42px; height: 42px; padding: 0; border: 0; border-radius: var(--r-chip);
	background: var(--brand-primary, var(--navy-900)); color: var(--white);
	transition: background .15s ease, color .15s ease, transform .12s ease;
}
.site-search-submit:hover { background: var(--brand-accent, var(--accent)); color: var(--on-accent, var(--navy-900)); }
.site-search-submit:active { transform: scale(.94); }

/* Live suggestions (assets/js/site-search.js). */
.site-search-suggest {
	position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 20;
	max-height: min(60vh, 460px); overflow-y: auto; padding: 8px;
	background: var(--white); border: 1px solid var(--line);
	border-radius: var(--r-card); box-shadow: var(--shadow-pop);
}
.site-search-suggest-group + .site-search-suggest-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.site-search-suggest-label { padding: 4px 8px; font-size: 11.5px; font-weight: var(--fw-semibold); color: var(--muted); }
.site-search-suggest-item {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 9px 8px; border-radius: var(--r-control); font-size: 14px; color: var(--text);
}
.site-search-suggest-item:hover, .site-search-suggest-item.is-active { background: var(--fill); }
.site-search-suggest-item--listing { flex-direction: column; align-items: flex-start; gap: 2px; }
.site-search-suggest-meta { font-size: 12px; color: var(--muted); }
.site-search-suggest-all {
	display: block; margin-top: 4px; padding: 10px 8px; border-top: 1px solid var(--line);
	text-align: center; font-size: 13.5px; font-weight: var(--fw-bold); color: var(--navy-700);
}
.site-search-suggest-all:hover { color: var(--navy-900); }
.site-search-suggest-empty { padding: 14px 0; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ---------- city popover ---------- */
/* Anchored under the city button, which is the capsule's leading edge. */
.city-pop {
	inset-inline-start: 0; width: min(380px, calc(100vw - 2 * var(--gutter)));
	display: flex; flex-direction: column; max-height: min(72vh, 520px); padding: 12px;
}
.city-pop-search {
	display: flex; align-items: center; gap: 8px; flex-shrink: 0; height: 40px; padding: 0 12px;
	background: var(--surface); border-radius: var(--r-control);
}
.city-pop-search svg { flex-shrink: 0; color: var(--icon); }
.city-pop-search input {
	flex: 1; min-width: 0; height: 100%; border: 0; outline: 0;
	font: inherit; font-size: var(--fs-sm); color: var(--text); background: transparent;
}
.city-pop-scroll { overflow-y: auto; margin-inline: -4px; padding-inline: 4px; }
.city-pop-label { margin: 12px 4px 6px; font-size: 12px; font-weight: var(--fw-semibold); color: var(--muted); }
.city-pop-block:first-child .city-pop-label { margin-top: 6px; }
.city-pop-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* A chip and a row are the same choice in two shapes; the row just carries
   the count. Both are a <label> wrapping a real checkbox. */
.city-chip {
	position: relative; display: inline-flex; align-items: center; height: 34px; padding: 0 12px;
	border: 1px solid var(--line); border-radius: var(--r-chip);
	font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.city-chip:hover { border-color: var(--brand-accent, var(--accent)); background: var(--accent-soft); }
.city-chip.is-on { border-color: var(--navy-800); background: var(--navy-800); color: var(--white); }
/* The checkbox keeps its place in the tab order and its keyboard behaviour;
   only its box is out of sight, because the chip is the visual control. */
.city-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.city-chip:focus-within { outline: 2px solid var(--navy-700); outline-offset: 2px; }

.city-row {
	display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 8px;
	border-radius: var(--r-control); font-size: var(--fs-sm); color: var(--text); cursor: pointer;
}
.city-row:hover { background: var(--surface); }
.city-row input { flex-shrink: 0; margin: 0; accent-color: var(--navy-800); }
.city-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-row small { flex-shrink: 0; font-size: 12px; color: var(--muted); }

.city-pop-empty { padding: 16px 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.city-pop-foot {
	display: flex; align-items: center; gap: 8px; flex-shrink: 0;
	margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.city-pop-clear {
	flex: 1; height: var(--tap); border: 0; border-radius: var(--r-control); background: none;
	font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--navy-700);
}
.city-pop-clear:hover { background: var(--surface); color: var(--navy-900); }
.city-pop-foot .btn { flex: 1; }

/* ---------- account ---------- */
.site-header-acct { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.acct-link { font-size: 15px; font-weight: var(--fw-semibold); color: var(--navy-500); }
.acct-link:hover { color: var(--navy-900); }

.header-login {
	display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px;
	border: 1.5px solid var(--line-strong); border-radius: var(--r-control);
	font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); white-space: nowrap;
}
.header-login:hover { border-color: var(--navy-700); color: var(--navy-900); }
.header-login svg { flex-shrink: 0; color: var(--icon); }
.header-cta { height: 52px; flex-shrink: 0; white-space: nowrap; }

.user-menu { position: relative; }
.user-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 52px; padding-inline: 4px 12px;
	border: 1.5px solid var(--line-strong); border-radius: var(--r-control); background: var(--white);
	font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text);
}
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--navy-700); }
.user-btn-name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .caret { flex-shrink: 0; color: var(--icon); transition: transform .15s ease; }
.user-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.user-avatar {
	display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px;
	border-radius: var(--r-control); line-height: 1; font-size: 16px; font-weight: var(--fw-bold);
	background: var(--brand-primary, var(--navy-900)); color: var(--accent-on-dark, var(--brand-accent, var(--accent)));
}

.user-pop { inset-inline-end: 0; width: 264px; padding: 8px; }
.user-pop-head {
	display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 6px;
	background: var(--surface); border-radius: var(--r-control);
}
.user-pop-who { min-width: 0; }
.user-pop-who b { display: block; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop-who small { font-size: 12px; color: var(--muted); }
.user-pop-item {
	display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px;
	border-radius: var(--r-control); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text);
}
.user-pop-item svg { flex-shrink: 0; color: var(--icon); }
.user-pop-item:hover { background: var(--surface); }
.user-pop-item--primary {
	margin-bottom: 4px; font-weight: var(--fw-semibold);
	background: var(--brand-primary, var(--navy-900)); color: var(--white);
}
.user-pop-item--primary svg { color: var(--brand-accent, var(--accent)); }
.user-pop-item--primary:hover { background: var(--navy-700); color: var(--white); }
.user-pop-item--danger { color: var(--alert); }
.user-pop-item--danger svg { color: var(--alert); }
.user-pop-item--danger:hover { background: var(--alert-soft); }
.user-pop-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* ---------- compact buttons (narrow screens only) ---------- */
.icon-btn {
	display: none; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0;
	border: 1px solid var(--line-strong); border-radius: var(--r-control);
	background: var(--white); color: var(--text);
}
.icon-btn:hover { border-color: var(--navy-700); }

.nav-toggle {
	display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	flex-shrink: 0; width: 44px; height: 44px; padding: 0;
	border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--white);
}
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--navy-800); }

/* ---------- hamburger panel ---------- */
.mobile-nav {
	border-top: 1px solid var(--line); background: var(--white); padding: 12px 0 20px;
	max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.mobile-nav .nav-menu { flex-direction: column; align-items: stretch; gap: 2px; }
.mobile-nav .nav-menu > li { display: block; }
.mobile-nav .nav-menu > li > a { height: auto; padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
.mobile-nav .nav-mega-toggle {
	width: 100%; height: auto; justify-content: space-between; padding: 12px 4px;
	border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: start;
}
/* Inside the panel a dropdown is simply the next block of the list. */
.mobile-nav .nav-mega {
	position: static; width: auto; flex-basis: 100%; padding: 10px 0 14px;
	border: 0; border-radius: 0; box-shadow: none; animation: none;
}
/* In the list the "all" link would read as one more row of the panel, so
   it gets a tinted, full-width tap target with a forward chevron. */
.mobile-nav .nav-mega-all {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	margin-top: 8px; padding: 12px 14px; border: 0; border-radius: var(--r-control);
	background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--navy-900);
}
.mobile-nav .nav-mega-all::after {
	content: ""; flex-shrink: 0; width: 7px; height: 7px;
	border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(225deg); /* points left: forward in RTL */
}
.mobile-nav .nav-mega-all:active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mobile-nav-acct { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
/* Signed in: the avatar menu's card (.user-pop-*), printed inline. */
.mobile-acct-card { padding: 8px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--white); }

/* ---------- responsive ---------- */
@media (max-width: 1140px) {
	.primary-nav { display: none; }
	.nav-toggle { display: flex; }
}
@media (min-width: 1141px) { .mobile-nav { display: none; } }

@media (max-width: 760px) {
	.site-header-inner { gap: 10px; }
	.brand { margin-inline-end: auto; }
	.brand-mark { width: 38px; height: 38px; }
	.brand-name { font-size: 18px; }
	.brand-latin { display: none; }
	.brand .custom-logo { height: 36px; }

	.site-finder-toggle { display: grid; }

	/* The same element, re-anchored as a strip under the bar — there is no
	   second search box and no overlay that has to be kept in sync with the
	   one in the bar. */
	.site-finder {
		display: none;
		position: fixed; inset-block-start: var(--header-h); inset-inline: 0;
		max-width: none; margin: 0; padding: 10px var(--gutter);
		background: var(--white); border-bottom: 1px solid var(--line);
	}
	.site-finder.is-open { display: block; }
	.site-search-kbd { display: none; }
	.city-pop { top: 100%; inset-inline: var(--gutter); width: auto; max-height: 60vh; }

	.user-btn { height: 44px; gap: 0; padding-inline: 2px; }
	.user-btn-name, .user-btn .caret { display: none; }
	.user-avatar { width: 36px; height: 36px; font-size: 15px; }
	.header-login { width: 44px; height: 44px; padding: 0; justify-content: center; }
	.header-login span { display: none; }
	/* The CTA is the widest thing in the bar; on a phone it lives in the
	   hamburger panel instead, where trellis_account_links('mobile') puts it. */
	.site-header-acct .header-cta { display: none; }
}
/* Narrow, but wide enough that WP still fixes its toolbar above the bar. */
@media screen and (min-width: 601px) and (max-width: 760px) {
	body.admin-bar .site-finder { inset-block-start: calc(46px + var(--header-h)); }
}

/* ================= site footer ================= */
.site-footer { background: var(--brand-primary-deep); color: var(--on-dark-faint); padding-top: 52px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.foot-brand .brand { color: var(--on-dark); }
.foot-brand .brand { --brand-mark-bg: var(--navy-600); --brand-mark-ink: var(--accent-on-dark, var(--brand-accent, var(--accent))); }
.foot-blurb { font-size: var(--fs-sm); line-height: 2; color: var(--on-dark-faint); max-width: 320px; margin-top: 14px; }
.foot-social { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.foot-social a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--on-dark-line); border-radius: var(--r-control); color: var(--on-dark-faint); }
.foot-social a:hover { color: var(--on-dark); border-color: rgba(255,255,255,0.3); }

.foot-col-title { font-size: 15px; font-weight: var(--fw-bold); color: var(--on-dark); margin-bottom: 12px; }
.foot-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.foot-menu a { font-size: var(--fs-sm); color: var(--on-dark-faint); }
.foot-menu a:hover { color: var(--on-dark); }

.foot-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 0 26px; border-top: 1px solid var(--on-dark-line); }
.foot-legal { font-size: var(--fs-meta); color: #6F819A; }
.foot-badges { display: flex; align-items: center; gap: 12px; }
.foot-badge { min-width: 96px; min-height: 46px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 1px dashed rgba(255,255,255,0.2); border-radius: var(--r-control); font-size: 11px; line-height: 1.5; color: #6F819A; }

@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* ================= search form ================= */
.search-form-row { display: flex; gap: 8px; }
.search-form .search-field { flex: 1; min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); font: inherit; background: var(--white); }
.search-form .search-submit { flex-shrink: 0; }

/* ---------- generic small utilities ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
