/* ==========================================================================
   Tarhee — main.css
   Tokens · Base · Layout · Header · Footer · Content · Forms · Notices
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
	--navy: #0d1a38;
	--navy-2: #16254d;
	--cta: var(--navy);
	--cta-2: var(--navy-2);
	--footer-bg: var(--navy);
	--gold: #c9a227;
	--gold-light: #e6c65c;
	--gold-soft: #faf3dd;
	--gold-dark: #7a5f00;
	--bg: #f6f7fb;
	--bg-2: #eef1f8;
	--card: #fff;
	--text: #131a2e;
	--muted: #6b7280;
	--border: #e8ebf2;
	--success: #059669;
	--danger: #dc2626;

	--radius: 16px;
	--radius-sm: 10px;
	--shadow-sm: 0 2px 10px rgba(13, 26, 56, .05);
	--shadow: 0 8px 32px rgba(13, 26, 56, .08);
	--shadow-lg: 0 20px 60px rgba(13, 26, 56, .14);
	--shadow-gold: 0 12px 32px rgba(201, 162, 39, .28);
	--ease: cubic-bezier(.4, 0, .2, 1);

	--font: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, -apple-system, sans-serif;
	/* Font weights (Settings > General > Font). Defaults match the original design. */
	--fw-body: 400;
	--fw-medium: 500;
	--fw-label: 600;
	--fw-strong: 700;
	--fw-heading: 800;
	--container: 1220px;
	--header-h: 72px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	background: var(--bg);
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font);
	font-weight: var(--fw-body);
	color: var(--text);
	line-height: 1.75;
	text-rendering: optimizeLegibility;
}

/* Soft dotted texture + golden halo (behind everything, no extra DOM). */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 849px 566px at 50% calc(400px - 30vh), color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
		radial-gradient(circle, color-mix(in srgb, var(--navy) 4.5%, transparent) 1px, transparent 1px) 0 0 / 24px 24px;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: var(--fw-strong); }
ul, ol { padding: 0; }

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; }
img { height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.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;
}

.skip-link:focus {
	position: fixed !important;
	top: 12px;
	inset-inline-start: 12px;
	width: auto;
	height: auto;
	margin: 0;
	padding: 10px 16px;
	clip: auto;
	z-index: 1000;
	background: var(--navy);
	color: #fff;
	border-radius: var(--radius-sm);
}

/* ---------- Layout ---------- */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; padding-bottom: 40px; }

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: 24px;
}
.container--narrow { max-width: 860px; }

/* ---------- Buttons ---------- */
:where(.button, button.button, input[type='submit'], .wp-element-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: #fff;
	font-weight: var(--fw-label);
	font-size: .92rem;
	line-height: 1.5;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
.comment-form input[type='submit'] { color: #fff; } /* `input { color: inherit }` above would otherwise win over :where() and print dark text on the dark button */
:where(.button, button.button, input[type='submit'], .wp-element-button):hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
	background: var(--navy-2);
}

/* Branded buttons (header, home page) */
.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border: 1.5px solid transparent;
	border-radius: var(--radius-sm);
	font-size: .92rem;
	font-weight: var(--fw-strong);
	line-height: 1.5;
	white-space: nowrap;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .tarhee-icon { flex: none; }
.btn--sm { padding: 8px 16px; font-size: .84rem; }
.btn--lg { padding: 15px 28px; font-size: 1rem; border-radius: 14px; }
.btn--gold {
	background: linear-gradient(135deg, var(--gold), var(--gold-light));
	color: var(--navy);
	box-shadow: var(--shadow-gold);
}
.btn--gold:hover { box-shadow: 0 16px 38px color-mix(in srgb, var(--gold) 40%, transparent); }
.btn--navy { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: 0 10px 30px rgba(13, 26, 56, .28); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* Badges (price card, hero) */
.tarhee-top-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--gold), var(--gold-light));
	color: var(--navy);
	font-size: .75rem;
	font-weight: var(--fw-strong);
	box-shadow: var(--shadow-gold);
	animation: tarhee-float 3s ease-in-out infinite;
}
.tarhee-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tarhee-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
	border-radius: 999px;
	background: var(--gold-soft);
	color: var(--gold-dark);
	font-size: .75rem;
	font-weight: var(--fw-label);
	transition: transform .2s, box-shadow .2s;
}
.tarhee-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 20%, transparent); }
.tarhee-badge.is-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.tarhee-badge .tarhee-icon { flex: none; }

@keyframes tarhee-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

/* ---------- Forms ---------- */
:where(input[type='text'], input[type='email'], input[type='url'], input[type='tel'], input[type='number'], input[type='password'], input[type='search'], select, textarea) {
	width: 100%;
	padding: 11px 14px;
	background: #fff;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color .2s, box-shadow .2s;
}
:where(input, select, textarea):focus {
	outline: 0;
	border-color: var(--gold);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
textarea { min-height: 120px; resize: vertical; }

.search-form { display: flex; gap: 10px; max-width: 480px; }
.search-form .search-field { flex: 1; }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
	border-bottom: 1px solid var(--border);
}
.admin-bar .site-header { top: 32px; }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--header-h);
}

.site-branding img { max-height: 44px; width: auto; }
.site-title { font-size: 1.25rem; font-weight: var(--fw-heading); color: var(--navy); }

.site-nav { flex: 1; }
.site-nav .menu,
.footer-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav a {
	display: block;
	padding: 8px 2px;
	font-size: .92rem;
	font-weight: var(--fw-label);
	color: var(--text);
	transition: color .2s;
}
.site-nav a:hover,
.site-nav .current-menu-item > a { color: var(--gold); }

.site-nav .menu-item { position: relative; }
.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	inset-inline-start: 0;
	min-width: 200px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s, transform .2s, visibility .2s;
}
.site-nav .menu-item:hover > .sub-menu,
.site-nav .menu-item:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.site-nav .sub-menu a { padding: 8px 12px; border-radius: 8px; }
.site-nav .sub-menu a:hover { background: var(--gold-soft); }

.site-header__actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.site-header__cta { margin-inline-end: 4px; }

.tarhee-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--navy);
	transition: background-color .2s;
}
.tarhee-cart:hover { background: var(--gold-soft); }
.tarhee-cart__count {
	position: absolute;
	top: 2px;
	inset-inline-end: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--gold);
	color: var(--navy);
	font-size: .68rem;
	font-weight: var(--fw-strong);
	line-height: 18px;
	text-align: center;
}
.tarhee-cart__count.is-empty { display: none; }

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--navy);
}

/* ---------- Footer ---------- */
.site-footer {
	margin-top: auto;
	background: var(--footer-bg);
	color: rgba(255, 255, 255, .78);
	font-size: .88rem;
}
.site-footer__top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 28px 48px;
	padding-block: 40px 28px;
}
.site-footer__about { flex: 1 1 320px; max-width: 520px; }
.site-footer__about img { max-height: 44px; width: auto; margin-bottom: 12px; }
.site-footer__name { display: block; margin-bottom: 10px; font-size: 1.15rem; font-weight: var(--fw-heading); color: #fff; }
.site-footer__text p + p { margin-top: 8px; }
.site-footer__text a { color: var(--gold-light); }
.footer-nav .menu { justify-content: flex-start; }
.footer-nav a { display: block; padding: 4px 0; transition: color .2s; }
.footer-nav a:hover { color: var(--gold-light); }
.site-footer__bottom {
	padding-block: 18px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	text-align: center;
}
.site-footer__top + .site-footer__bottom { margin-top: 0; }
.site-footer > .site-footer__bottom:first-child { border-top: 0; padding-block: 28px; }
.site-footer__copy { font-size: .8rem; opacity: .8; }

/* ---------- Breadcrumb (WooCommerce, theme and SEO plugin markup) ---------- */
.crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	width: fit-content;
	max-width: 100%;
	margin-top: 20px;
	padding: 8px 16px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 999px;
	box-shadow: var(--shadow-sm);
	font-size: .82rem;
	line-height: 1.7;
	color: var(--muted);
}
.crumb :is(p, ol, ul, nav) { display: contents; margin: 0; padding: 0; list-style: none; }
.crumb__list { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumb__item { display: inline-flex; align-items: center; }
.crumb__item + .crumb__item::before,
.crumb .sep::before,
.crumb .separator::before {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-inline: 10px;
	border: solid currentColor;
	border-width: 0 0 1.5px 1.5px;
	opacity: .45;
	transform: rotate(45deg);
}
.crumb .sep,
.crumb .separator { display: inline-flex; align-items: center; font-size: 0; }
.crumb a { color: var(--text); font-weight: var(--fw-medium); transition: color .2s; }
.crumb a:hover,
.crumb a:focus-visible { color: var(--gold-dark); }
.crumb [aria-current='page'],
.crumb .last,
.crumb .breadcrumb_last { color: var(--navy); font-weight: var(--fw-strong); }
.crumb .crumb__item.is-current span { display: inline-block; max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (max-width: 560px) {
	.crumb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: var(--radius-sm); white-space: nowrap; }
	.crumb::-webkit-scrollbar { display: none; }
	.crumb__list { flex-wrap: nowrap; }
	.crumb .crumb__item.is-current span { max-width: 22ch; }
}

/* ---------- Content ---------- */
.entry { padding: 36px 0; }
.entry-header { margin-bottom: 24px; }
.entry-title,
.archive-header h1 { font-size: 1.7rem; font-weight: var(--fw-heading); line-height: 1.5; color: var(--navy); }
.entry-meta { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.entry-thumb { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }

.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 1.8em; color: var(--navy); line-height: 1.5; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content a:not(.button) { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.entry-content blockquote { padding: 4px 18px; border-inline-start: 4px solid var(--gold); color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--border); text-align: start; }
.alignwide { max-width: min(100vw - 48px, var(--container)); }

.archive-header { padding: 36px 0 8px; }
.archive-description { margin-top: 8px; color: var(--muted); }

.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 28px 0; }
.post-card {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(13, 26, 56, .14); }
.post-card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-card__body { padding: 16px 18px 20px; }
.post-card__title { font-size: 1rem; font-weight: var(--fw-strong); line-height: 1.6; }
.post-card__title a:hover { color: var(--gold); }
.post-card__excerpt { margin-top: 8px; font-size: .88rem; color: var(--muted); }

.navigation.pagination { margin: 8px 0 32px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers {
	min-width: 40px;
	padding: 6px 14px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 999px;
	text-align: center;
	font-weight: var(--fw-label);
	transition: border-color .2s, background-color .2s;
}
a.page-numbers:hover { border-color: var(--gold); background: var(--gold-soft); }
.page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }

.not-found { padding: 80px 0; text-align: center; }
.not-found h1, .not-found h2 { margin-bottom: 8px; color: var(--navy); }
.not-found .search-form { margin: 24px auto 0; }

/* Comments */
.comments-area { padding: 24px 0 48px; }
.comments-title { margin-bottom: 20px; font-size: 1.15rem; color: var(--navy); }
.comment-list { list-style: none; display: grid; gap: 14px; margin-bottom: 28px; }
.comment-list .children { list-style: none; margin-top: 14px; padding-inline-start: 24px; display: grid; gap: 14px; }
.comment-body { padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-strong); }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: .76rem; color: var(--muted); }
.tarhee-comments-pagination { margin: 0 0 28px; }
.tarhee-comments-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	list-style: none;
}
.tarhee-comments-pagination ul.page-numbers li { margin: 0; border: 0; float: none; }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: 4px; font-size: .86rem; font-weight: var(--fw-label); color: var(--navy); }
.comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.comment-form-cookies-consent label { margin: 0; font-weight: var(--fw-body); }
/* 0.4.0: the textarea's cols attribute gave it a fixed intrinsic width that stretched the grid column and pushed the field out of narrow screens. */
.comment-form { grid-template-columns: minmax(0, 1fr); }
.comment-form > * { min-width: 0; }
.comment-form textarea,
.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'] { width: 100%; max-width: 100%; min-width: 0; }
.comment-respond { min-width: 0; max-width: 100%; }

/* ---------- Notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
	padding: 14px 18px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--border);
	border-inline-start: 4px solid var(--gold);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-sm);
	font-size: .92rem;
}
.woocommerce-message { border-inline-start-color: var(--success); background: color-mix(in srgb, var(--success) 7%, #fff); color: var(--text); }
.woocommerce-info { background: var(--gold-soft); color: var(--text); }
.woocommerce-error { border-inline-start-color: var(--danger); display: grid; gap: 4px; background: color-mix(in srgb, var(--danger) 6%, #fff); color: var(--text); }
.woocommerce-message .button { order: 2; margin-inline-start: auto; padding: 8px 16px; font-size: .82rem; }
/* Notice buttons (e.g. «مشاهده سبد خرید»): readable gold button instead of dark text on a dark background. */
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	background: linear-gradient(135deg, var(--gold), var(--gold-light));
	color: var(--navy);
}
.woocommerce-message .button:hover,
.woocommerce-info .button:hover,
.woocommerce-error .button:hover {
	background: linear-gradient(135deg, var(--gold), var(--gold-light));
	color: var(--navy);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
	.nav-toggle { display: inline-flex; }

	.site-nav {
		position: absolute;
		top: 100%;
		inset-inline: 0;
		display: none;
		padding: 8px 24px 20px;
		background: #fff;
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
	}
	.site-nav.is-open { display: block; max-height: calc(100vh - var(--header-h) - 16px); overflow-y: auto; overscroll-behavior: contain; }
	.site-nav .menu { flex-direction: column; gap: 0; }
	.site-nav a { padding: 12px 2px; border-bottom: 1px solid var(--border); }
	.site-nav .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 14px 0 0;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

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

@media (max-width: 560px) {
	.site-header__cta { display: none; }
	.site-footer__top { padding-block: 32px 20px; }
	.container { padding-inline: 16px; }
	.posts-grid { grid-template-columns: 1fr; }
	.entry-title, .archive-header h1 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* ==========================================================================
   Header menu (0.0.3): sub menu toggles, mega menu, mobile accordion, header colors
   ========================================================================== */
.site-header--static { position: relative; }
.site-header.hdr-bg { background: var(--hdr-bg); }
.site-header.hdr-text .site-title,
.site-header.hdr-text .nav-toggle,
.site-header.hdr-text .tarhee-cart,
.site-header.hdr-text .site-nav .menu > .menu-item > a,
.site-header.hdr-text .submenu-toggle { color: var(--hdr-text); }
.site-header.hdr-hover .site-nav .menu > .menu-item > a:hover,
.site-header.hdr-hover .site-nav .menu > .current-menu-item > a,
.site-header.hdr-hover .site-nav .menu > .current-menu-ancestor > a { color: var(--hdr-hover); }

.submenu-toggle {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: inherit;
	transition: background-color .2s, color .2s;
}
.submenu-toggle:hover { background: var(--gold-soft); color: var(--gold-dark); }
.submenu-toggle svg { transition: transform .25s var(--ease); }
.is-sub-open > .submenu-toggle svg { transform: rotate(180deg); }
.site-nav .has-submenu > a { flex: 0 1 auto; }

@media (min-width: 861px) {
	.site-nav .menu > .has-submenu { display: flex; align-items: center; gap: 2px; }
	.site-nav .menu > .has-submenu:hover > .submenu-toggle svg,
	.site-nav--hover .menu > .has-submenu:focus-within > .submenu-toggle svg { transform: rotate(180deg); }
	.submenu-toggle--sub { display: none; }

	/* Keeps the sub menu open while the pointer travels from the link to the panel. */
	.site-nav .menu > .has-submenu > .sub-menu::before {
		content: '';
		position: absolute;
		inset-inline: 0;
		bottom: 100%;
		height: 22px;
	}

	/* Click mode: hover never opens anything. */
	.site-nav--click .menu-item:not(.is-sub-open):hover > .sub-menu,
	.site-nav--click .menu-item:not(.is-sub-open):focus-within > .sub-menu {
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
	}
	.site-nav--click .menu > .has-submenu:hover:not(.is-sub-open) > .submenu-toggle svg,
	.site-nav--click .menu > .has-submenu:focus-within:not(.is-sub-open) > .submenu-toggle svg { transform: none; }
	.site-nav .menu-item.is-sub-open > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	/* Level 3 and deeper are listed inside their parent panel. */
	.site-nav .sub-menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 12px 0 0;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	/* Mega menu */
	.site-nav--mega .menu > .has-mega { position: static; }
	.site-nav--mega .menu > .has-mega > .sub-menu {
		inset-inline: 0;
		display: grid;
		grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr));
		align-items: start;
		gap: 20px 32px;
		max-height: calc(100vh - var(--header-h) - 40px);
		margin: 0;
		padding: 28px max(24px, calc((100% - var(--container)) / 2 + 24px)) 32px;
		overflow-y: auto;
		border-width: 1px 0 0;
		border-radius: 0;
		box-shadow: var(--shadow-lg);
	}
	.site-nav--mega .has-mega > .sub-menu > .menu-item > a {
		padding: 6px 12px 10px;
		font-size: .95rem;
		font-weight: var(--fw-heading);
		color: var(--navy);
	}
	.site-nav--mega .has-mega > .sub-menu > .menu-item > a::before {
		content: '';
		display: inline-block;
		width: 4px;
		height: 14px;
		margin-inline-end: 8px;
		border-radius: 2px;
		background: linear-gradient(180deg, var(--gold), var(--gold-light));
		vertical-align: -2px;
	}
	.site-nav--mega .has-mega .sub-menu .sub-menu { padding: 0; }
	.site-nav--mega .has-mega .sub-menu .sub-menu a {
		padding: 6px 12px;
		font-size: .86rem;
		font-weight: var(--fw-medium);
		color: var(--muted);
	}
	.site-nav--mega .has-mega .sub-menu a:hover { background: none; color: var(--gold-dark); }
	.site-nav--mega .has-mega .sub-menu .current-menu-item > a { color: var(--gold-dark); }
}

@media (max-width: 860px) {
	.site-header.hdr-bg .site-nav { background: var(--hdr-bg); }
	.site-header.hdr-text .site-nav a { color: var(--hdr-text); }

	.site-nav .has-submenu { display: flex; flex-wrap: wrap; align-items: center; }
	.site-nav .has-submenu > a { flex: 1 1 0; min-width: 0; }
	.submenu-toggle { align-self: stretch; width: 44px; height: auto; min-height: 44px; border-bottom: 1px solid var(--border); border-radius: 0; }
	.site-nav .has-submenu > .sub-menu { display: none; flex: 0 0 100%; }
	.site-nav .has-submenu.is-sub-open > .sub-menu { display: block; }
	.site-nav--m-open .has-submenu > .sub-menu { display: block; }
	.site-nav--m-open .submenu-toggle { display: none; }
	.site-nav .sub-menu .sub-menu { padding-inline-start: 14px; }
}

/* ==========================================================================
   Header (0.0.4): plain dropdown position, mobile drawer, mobile button side
   ========================================================================== */
.nav-close,
.nav-overlay { display: none; }

@media (min-width: 861px) {
	/* Top-level items with a sub menu are as tall as the header, so the dropdown opens right under it. */
	.site-nav .menu { align-items: center; }
	.site-nav .menu > .has-submenu { min-height: var(--header-h); }
	.site-nav .sub-menu .sub-menu a { font-size: .86rem; font-weight: var(--fw-medium); color: var(--muted); }
	.site-nav .sub-menu .sub-menu a:hover { color: var(--gold-dark); }
}

@media (max-width: 860px) {
	/* Button on the other side of the header */
	.site-header.hdr-btn-swap .site-header__inner { position: relative; }
	.site-header.hdr-btn-swap .site-branding { padding-inline-start: 56px; }
	.site-header.hdr-btn-swap .nav-toggle { position: absolute; inset-inline-start: 24px; top: 50%; margin-top: -22px; }

	/* The closed drawer waits outside the screen: it must not create a horizontal scrollbar. */
	.site-header { overflow-x: clip; }

	/* Drawer */
	.site-nav--drawer {
		position: fixed;
		top: 0;
		bottom: 0;
		inset-inline: auto;
		z-index: 60;
		display: block;
		width: min(86vw, 360px);
		padding: 0 20px 28px;
		overflow-y: auto;
		overscroll-behavior: contain;
		visibility: hidden;
		border-bottom: 0;
		box-shadow: var(--shadow-lg);
		transition: transform .3s var(--ease), visibility 0s linear .3s;
	}
	.site-nav--from-right.site-nav--drawer { right: 0; left: auto; transform: translateX(105%); }
	.site-nav--from-left.site-nav--drawer { left: 0; right: auto; transform: translateX(-105%); }
	.site-header .site-nav--drawer.is-open {
		max-height: none;
		visibility: visible;
		transform: none;
		transition: transform .3s var(--ease), visibility 0s;
	}
	.admin-bar .site-nav--drawer { top: 32px; }

	.site-nav--drawer .nav-close {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 12px 0 8px;
		padding: 0;
		background: var(--bg-2);
		border: 0;
		border-radius: 50%;
		color: var(--hdr-text, var(--navy));
		transition: background-color .2s;
	}
	/* The close button sits on the side opposite to the edge the drawer opens from. */
	.site-nav--drawer.site-nav--from-right .nav-close { margin-left: 0; margin-right: auto; }
	.site-nav--drawer.site-nav--from-left .nav-close { margin-left: auto; margin-right: 0; }
	.site-nav--drawer .nav-close:hover { background: var(--gold-soft); }
	.site-header.hdr-bg .site-nav--drawer .nav-close { background: rgba(255, 255, 255, .14); }

	.nav-overlay { z-index: 49; background: rgba(13, 26, 56, .5); animation: tarhee-nav-fade .3s var(--ease); }
	body.nav-open .nav-overlay { position: fixed; inset: 0; display: block; }
	body.nav-open { overflow: hidden; }
	/* A blurred header would become the containing block of the fixed drawer. */
	body.nav-anim .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (max-width: 782px) {
	.admin-bar .site-nav--drawer { top: 46px; }
}

@media (max-width: 560px) {
	.site-header.hdr-btn-swap .nav-toggle { inset-inline-start: 16px; }
}

@keyframes tarhee-nav-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ==========================================================================
   0.3.9: compatibility fixes for small / older mobile browsers.
   Nothing here changes modern browsers: every block is either a pure
   shrink-only rule or sits inside an @supports-not fallback.
   ========================================================================== */

/* A wide logo may shrink instead of pushing the header buttons over each other. */
.site-header .site-branding { min-width: 0; }
.site-header .tarhee-logo { max-width: 100%; }
.site-header .tarhee-logo__img { min-width: 0; }

/* Browsers without color-mix(): derived colors are invalid, so buttons lost their background. */
@supports not (color: color-mix(in srgb, red 50%, white)) {
	:where(.button, button.button, input[type='submit'], .wp-element-button):hover { background: var(--navy); }
	.btn--gold { background: var(--gold); }
	.btn--navy { background: var(--navy); }
}

/* Browsers without logical properties (inset-inline-*, margin-inline-*): physical fallbacks. */
@supports not (inset-inline-start: 0) {
	html[dir='rtl'] .site-header__actions { margin-right: auto; }
	html:not([dir='rtl']) .site-header__actions { margin-left: auto; }
	html[dir='rtl'] .site-header__cta { margin-left: 4px; }
	html:not([dir='rtl']) .site-header__cta { margin-right: 4px; }
	html[dir='rtl'] .site-nav .sub-menu { right: 0; }
	html:not([dir='rtl']) .site-nav .sub-menu { left: 0; }

	@media (max-width: 860px) {
		.site-nav { left: 0; right: 0; }
		html[dir='rtl'] .site-header.hdr-btn-swap .site-branding { padding-right: 56px; }
		html:not([dir='rtl']) .site-header.hdr-btn-swap .site-branding { padding-left: 56px; }
		html[dir='rtl'] .site-header.hdr-btn-swap .nav-toggle { right: 24px; }
		html:not([dir='rtl']) .site-header.hdr-btn-swap .nav-toggle { left: 24px; }
	}

	@media (max-width: 560px) {
		html[dir='rtl'] .site-header.hdr-btn-swap .nav-toggle { right: 16px; }
		html:not([dir='rtl']) .site-header.hdr-btn-swap .nav-toggle { left: 16px; }
	}
}
