/* =========================================================================
   SwapMeet Cards — Navigation layer
   Loaded after style.css, sections.css, pages.css and v3.css, so every rule
   here wins over the base header/navigation block without editing it.

   Scope: the header bar, the six dropdown panels and the mobile drawer. The
   design intent is a bar that reads as finished furniture rather than a row of
   plain links: a real hover surface on every item, one unambiguous "this menu
   is open" state, and dropdowns that span the content grid instead of floating
   at a fixed pixel width that overflows short desktop viewports.

   Panels are anchored to the header container rather than to the trigger item.
   That removes a whole class of bugs: centring a 1000px panel on a 1024px
   viewport clipped both edges, and per-item anchoring needed pixel math that
   broke whenever a label grew.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Header bar
   ---------------------------------------------------------------------- */
.smc-header {
	--smc-bar: 84px;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--smc-border);
}

/*
 * WordPress's admin bar is fixed at the very top and opaque, so a sticky header
 * parked at top: 0 slides under it and has its first 32px clipped — which cuts
 * the top off the logo. Offset the bar while the admin bar is present. The bar
 * is 46px below the 783px breakpoint.
 */
.admin-bar .smc-header {
	top: 32px;
}

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

/*
 * The mobile drawer stretches from the viewport top as well, so it needs the same
 * offset — otherwise the admin bar covers its own close button. It only renders
 * under 900px, which is why the offset is scoped to that range.
 */
@media screen and (max-width: 900px) {
	.admin-bar .smc-drawer {
		top: 32px;
	}
}

@media screen and (max-width: 782px) {
	.admin-bar .smc-drawer {
		top: 46px;
	}
}

.smc-header.is-stuck {
	border-bottom-color: var(--smc-border-2);
	box-shadow: 0 10px 30px -18px rgba(7, 27, 50, 0.28);
}

.smc-header__inner {
	min-height: var(--smc-bar);
	gap: 20px;
}

/* While a panel is open the bar and the panel are one surface: the bar's own
   rule would otherwise draw a hairline straight through the panel's top edge. */
.smc-header:has(.smc-nav.is-active) {
	border-bottom-color: transparent;
}

.smc-logo img {
	width: 198px;
	transition: opacity 0.18s var(--smc-ease);
}

.smc-logo:hover img {
	opacity: 0.82;
}

/* -------------------------------------------------------------------------
   2. Nav list and links
   ---------------------------------------------------------------------- */
.smc-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.smc-nav__list {
	gap: 2px;
}

/*
 * The bar collapses to the drawer at this width. pages.css already hides the nav
 * there, but this file loads last and the unconditional rule above would keep
 * the desktop nav — and its 696px list — on screen inside a 390px viewport.
 */
@media screen and (max-width: 900px) {
	.smc-nav {
		display: none;
	}
}

.smc-nav__link {
	position: relative;
	gap: 8px;
	padding: 11px 14px;
	border-radius: 8px;
	color: var(--smc-navy);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.004em;
	transition: color 0.16s var(--smc-ease), background-color 0.16s var(--smc-ease);
}

.smc-nav__link:hover,
.smc-nav__link:focus-visible {
	background: var(--smc-surface-2);
	color: var(--smc-crimson);
}

/* "You are here" — a hairline underscore under the label. It is deliberately
   quieter than the open state so the two never read as the same thing. */
.smc-nav__item.is-current > .smc-nav__link::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 5px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	opacity: 0.32;
}

/* "This menu is open" — a filled pill. The panel below carries the same
   crimson on its top edge, so the pair reads as one object. */
.smc-nav__item.is-open > .smc-nav__link {
	background: var(--smc-crimson-tint);
	color: var(--smc-crimson);
	font-weight: 600;
	box-shadow: none;
}

.smc-nav__item.is-open > .smc-nav__link::after {
	display: none;
}

/* The open item owns the crimson, so the page marker steps back to plain text
   and the pointer's target is never ambiguous. */
.smc-nav.is-active .smc-nav__item.is-current:not(.is-open) > .smc-nav__link {
	color: var(--smc-navy);
	font-weight: 500;
}

.smc-nav.is-active .smc-nav__item.is-current:not(.is-open) > .smc-nav__link::after {
	opacity: 0.32;
}

.smc-chevron {
	width: 11px;
	height: 11px;
	opacity: 0.55;
}

/* Hover bridge: the link's own box stops above the bar's bottom edge, so the
   pointer crossed a dead band on its way to the panel and the close timer
   started. This invisible strip belongs to the link, which keeps the pointer
   inside the item all the way down to the panel's top edge. */
.smc-nav__item--panel > .smc-nav__link::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 26px;
}

.smc-nav__link:hover .smc-chevron,
.smc-nav__item.is-open .smc-chevron {
	opacity: 1;
}

/* -------------------------------------------------------------------------
   3. Header actions
   ---------------------------------------------------------------------- */
.smc-header__actions {
	gap: 12px;
}

.smc-searchbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--smc-border-2);
	border-radius: 8px;
	color: var(--smc-navy);
	background: var(--smc-white);
	transition: border-color 0.16s var(--smc-ease), color 0.16s var(--smc-ease),
		background-color 0.16s var(--smc-ease);
}

.smc-searchbtn svg {
	width: 17px;
	height: 17px;
}

.smc-searchbtn:hover,
.smc-searchbtn[aria-expanded="true"] {
	border-color: var(--smc-crimson);
	background: var(--smc-crimson-tint);
	color: var(--smc-crimson);
}

.smc-btn--quote {
	padding-inline: 20px;
}

/* -------------------------------------------------------------------------
   4. Panel shell — a rounded card centred under the bar

   A full-bleed sheet stretched a two-column menu across the whole width of the
   header and read as a page section rather than a menu. Each panel type now
   gets a width sized to its own content and floats as a card on the bar.
   ---------------------------------------------------------------------- */
.smc-panel {
	top: 100%;
	left: 50%;
	right: auto;
	max-width: calc(100vw - 40px);
	transform: translate(-50%, -6px);
	border: 1px solid var(--smc-border-2);
	/* Larger than --smc-radius-xl: a card this size needs a visibly softer
	   corner than the 12px controls inside it. */
	border-radius: 18px;
	box-shadow: 0 26px 52px -22px rgba(7, 27, 50, 0.26), 0 2px 6px -2px rgba(7, 27, 50, 0.06);
	transition: opacity 0.16s var(--smc-ease), transform 0.16s var(--smc-ease),
		visibility 0s linear 0.16s;
}

.smc-nav__item.is-open > .smc-panel {
	transform: translate(-50%, 0);
}

/* One width per panel type, sized to its content rather than the viewport. */
.smc-panel--mega {
	width: 940px;
}

.smc-panel--steps,
.smc-steps-panel {
	width: 900px;
}

.smc-panel--split-promos,
.smc-panel--split-promo {
	width: 860px;
}

.smc-panel--work {
	width: 920px;
}

.smc-panel--twocol {
	width: 700px;
}

/* The plain list is the fallback for a top-level item nobody has given a panel
   type yet. It hangs from the container's left edge rather than the centre. */
.smc-panel--list {
	width: 340px;
	left: 0;
	transform: translateY(-6px);
}

.smc-nav__item.is-open > .smc-panel--list {
	transform: translateY(0);
}

/* The card already fixes the measure, so the inner boxes only pad. */
.smc-panel__inner {
	max-width: none;
	margin-inline: 0;
	padding: 26px 32px 28px;
}

.smc-panel--list .smc-panel__inner {
	padding: 14px;
}

.smc-panel__foot {
	max-width: none;
	margin-inline: 0;
	padding: 15px 32px 17px;
	border-top: 1px solid var(--smc-border);
	background: linear-gradient(180deg, rgba(250, 249, 246, 0) 0%, rgba(250, 249, 246, 0.7) 100%);
	border-radius: 0 0 18px 18px;
}

.smc-panel__note,
.smc-panel__sub {
	letter-spacing: 0.01em;
}

/* -------------------------------------------------------------------------
   5. Custom Cards mega panel
   ---------------------------------------------------------------------- */
.smc-mega__search {
	margin-bottom: 22px;
}

.smc-mega__search input {
	height: 46px;
	padding-left: 42px;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.16s var(--smc-ease), box-shadow 0.16s var(--smc-ease);
}

.smc-mega__search input:focus {
	outline: 0;
	border-color: var(--smc-crimson);
	box-shadow: 0 0 0 3px rgba(170, 0, 50, 0.1);
}

.smc-mega__body {
	grid-template-columns: 268px minmax(0, 1fr);
	gap: 26px;
}

.smc-mega__rail {
	gap: 3px;
	padding-right: 22px;
}

.smc-railbtn {
	gap: 11px;
	padding: 11px 13px;
	font-size: 14px;
	font-weight: 500;
}

.smc-railbtn:hover {
	background: var(--smc-surface-2);
}

.smc-railbtn.is-active {
	background: var(--smc-crimson-tint);
	color: var(--smc-crimson);
	font-weight: 700;
	box-shadow: inset 3px 0 0 var(--smc-crimson);
}

/* Count badge: tells the visitor how deep each group is before they open it. */
.smc-railbtn__count {
	margin-left: auto;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--smc-surface-2);
	color: var(--smc-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.smc-railbtn.is-active .smc-railbtn__count {
	background: var(--smc-white);
	color: var(--smc-crimson);
}

/* The count replaces the chevron in the rail: both on one row crowded the
   label and left the group name truncated at 268px. */
.smc-railbtn .smc-railbtn__chev {
	display: none;
}

.smc-mega__grouphead {
	margin-bottom: 12px;
	padding-bottom: 11px;
}

.smc-mega__grouptitle {
	font-size: 12px;
	letter-spacing: 0.1em;
}

.smc-linklist {
	gap: 1px 26px;
}

.smc-megalink {
	gap: 10px;
	padding: 10px 11px;
}

.smc-megalink__label {
	font-size: 14px;
	font-weight: 500;
}

.smc-megalink__meta {
	font-size: 11.5px;
}

.smc-megalink:hover {
	background: var(--smc-surface-2);
	color: var(--smc-crimson);
}

.smc-megalink:hover .smc-megalink__label {
	color: var(--smc-crimson);
}

.smc-megalink__chev {
	opacity: 0.6;
	transition: transform 0.16s var(--smc-ease), opacity 0.16s var(--smc-ease);
}

.smc-megalink:hover .smc-megalink__chev {
	opacity: 1;
	transform: translateX(2px);
}

.smc-megaprompt {
	margin-top: 16px;
	padding: 12px 18px;
	font-size: 13px;
	border-radius: 8px;
}

/* -------------------------------------------------------------------------
   6. Split / list / two-column panels
   ---------------------------------------------------------------------- */
.smc-list__link {
	padding: 10px 11px;
	border-radius: 8px;
}

.smc-list__link b {
	font-size: 14px;
}

.smc-list__link span {
	font-size: 12.5px;
}

.smc-promo {
	border-radius: 10px;
	transition: border-color 0.18s var(--smc-ease), background-color 0.18s var(--smc-ease),
		transform 0.18s var(--smc-ease), box-shadow 0.18s var(--smc-ease);
}

.smc-promo:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px -18px rgba(7, 27, 50, 0.35);
}

.smc-promo--stack:hover {
	transform: none;
	box-shadow: none;
}

.smc-twocol {
	width: auto;
	gap: 36px;
}

.smc-twocol h4 {
	margin-bottom: 14px;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.smc-steps__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--smc-border);
}

.smc-steps__title {
	margin: 0;
	color: var(--smc-navy);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.smc-steps__lead {
	margin: 5px 0 0;
	max-width: 62ch;
	color: var(--smc-muted);
	font-size: 13px;
	line-height: 1.45;
}

.smc-steps__head .smc-linkarrow {
	flex: 0 0 auto;
	padding-bottom: 2px;
}

.smc-steps__body {
	display: grid;
	grid-template-columns: minmax(0, 2.15fr) minmax(0, 0.85fr);
	gap: 26px;
	/* Both columns stretch: the steps list has to be able to reach the rail's
	   height for its 1fr rows to absorb the difference. */
	align-items: stretch;
}

/* .smc-panel a { color: inherit } in style.css is more specific than the button
   classes, so a button inside a panel rendered its inherited dark text on the
   crimson fill. Each variant restates its own colour here. */
.smc-panel .smc-btn--primary,
.smc-panel .smc-btn--primary:hover,
.smc-panel .smc-btn--primary:focus-visible {
	color: #fff;
}

.smc-panel .smc-btn--outline {
	color: var(--smc-crimson);
}

.smc-panel .smc-btn--outline:hover,
.smc-panel .smc-btn--outline:focus-visible {
	color: #fff;
}

.smc-steps__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	/* Rows share the rail's height, so the steps column ends level with the
	   artwork instead of leaving a dead band under the last card. */
	grid-auto-rows: 1fr;
	gap: 10px;
}

/* Every step is an anchor, so it carries the same hover affordance as the other
   panel links instead of reading as a heading that happens to be clickable. */
.smc-stepcard {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) 15px;
	align-items: center;
	gap: 12px;
	height: 100%;
	padding: 14px 14px 15px;
	background: var(--smc-white);
	border: 1px solid var(--smc-border);
	border-radius: 10px;
	transition: border-color 0.18s var(--smc-ease), box-shadow 0.18s var(--smc-ease),
		transform 0.18s var(--smc-ease);
}

.smc-stepcard:hover {
	border-color: rgba(170, 0, 50, 0.32);
	box-shadow: 0 14px 28px -20px rgba(7, 27, 50, 0.45);
	transform: translateY(-2px);
}

.smc-stepcard__n {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--smc-surface-2);
	color: var(--smc-navy);
	font-size: 12.5px;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.02em;
	transition: background-color 0.18s var(--smc-ease), color 0.18s var(--smc-ease);
}

.smc-stepcard:hover .smc-stepcard__n {
	background: var(--smc-crimson);
	color: #fff;
}

.smc-stepcard__body b {
	display: block;
	color: var(--smc-navy);
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.3;
	transition: color 0.18s var(--smc-ease);
}

.smc-stepcard__body > span {
	display: block;
	margin-top: 4px;
	color: var(--smc-muted);
	font-size: 11.8px;
	line-height: 1.45;
}

.smc-stepcard:hover .smc-stepcard__body b {
	color: var(--smc-crimson);
}

.smc-stepcard__arrow {
	width: 14px;
	height: 14px;
	color: var(--smc-muted-2);
	transition: color 0.18s var(--smc-ease), transform 0.18s var(--smc-ease);
}

.smc-stepcard:hover .smc-stepcard__arrow {
	color: var(--smc-crimson);
	transform: translateX(3px);
}

.smc-steps__rail {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.smc-steps__figure {
	margin: 0;
}

.smc-steps__figure .smc-panelimg {
	width: 100%;
	height: 130px;
	object-fit: cover;
	border-radius: 10px;
	background: var(--smc-surface-2);
}

.smc-steps__figure figcaption {
	margin-top: 9px;
	color: var(--smc-muted);
	font-size: 12px;
	line-height: 1.45;
}

.smc-steps__links {
	padding-top: 12px;
	border-top: 1px solid var(--smc-border);
}

.smc-steps__links h4 {
	margin: 0 0 8px;
	color: var(--smc-navy);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.smc-steps__links .smc-list__link {
	padding: 7px 8px;
}

.smc-steps__links .smc-list__link svg {
	width: 16px;
	height: 16px;
}

.smc-steps__links .smc-list__link b {
	font-size: 13px;
}

.smc-work__grid {
	gap: 22px;
}

/* -------------------------------------------------------------------------
   7. Search overlay — a real search surface, not a dead control
   ---------------------------------------------------------------------- */
.smc-searchbox {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 94;
	background: var(--smc-white);
	border-top: 2px solid var(--smc-crimson);
	border-bottom: 1px solid var(--smc-border-2);
	box-shadow: 0 28px 56px -22px rgba(7, 27, 50, 0.26);
}

.smc-searchbox[hidden] {
	display: none;
}

.smc-searchbox__inner {
	max-width: 1240px;
	margin-inline: auto;
	padding: 24px 32px 26px;
}

.smc-searchbox__form {
	display: flex;
	align-items: center;
	gap: 12px;
}

.smc-searchbox__field {
	position: relative;
	flex: 1 1 auto;
}

.smc-searchbox__field svg {
	position: absolute;
	left: 15px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: var(--smc-muted-2);
}

.smc-searchbox__field input {
	width: 100%;
	height: 52px;
	padding: 0 16px 0 46px;
	background: var(--smc-white);
	border: 1px solid var(--smc-border-2);
	border-radius: 8px;
	color: var(--smc-navy);
	font-size: 15.5px;
}

.smc-searchbox__field input:focus {
	outline: 0;
	border-color: var(--smc-crimson);
	box-shadow: 0 0 0 3px rgba(170, 0, 50, 0.1);
}

.smc-searchbox__quick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

.smc-searchbox__quick span {
	color: var(--smc-muted);
	font-size: 12.5px;
	font-weight: 500;
}

.smc-searchbox__quick a {
	padding: 6px 14px;
	border: 1px solid var(--smc-border-2);
	border-radius: 999px;
	color: var(--smc-navy);
	font-size: 12.5px;
	font-weight: 500;
	transition: border-color 0.16s var(--smc-ease), color 0.16s var(--smc-ease);
}

.smc-searchbox__quick a:hover {
	border-color: var(--smc-crimson);
	color: var(--smc-crimson);
}

/* -------------------------------------------------------------------------
   8. Mobile drawer
   ---------------------------------------------------------------------- */
.smc-drawer__bar {
	padding: 15px 20px;
}

.smc-drawer__bar img {
	width: 158px;
	height: auto;
}

.smc-drawer__row {
	padding: 16px 20px;
	font-weight: 600;
}

.smc-drawer__row:active {
	background: var(--smc-surface-2);
}

.smc-drawer__head {
	background: var(--smc-surface-2);
	font-weight: 700;
}

.smc-drawer__cta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
}

/* -------------------------------------------------------------------------
   9. Responsive
   The nav itself stays visible to 900px, where pages.css hands over to the
   burger and the drawer. Between 900px and 1180px the six labels plus the
   actions no longer fit at full size, so the bar tightens instead of wrapping.
   ---------------------------------------------------------------------- */
@media (max-width: 1360px) {
	.smc-nav__list {
		gap: 0;
	}

	.smc-nav__link {
		padding: 11px 11px;
		font-size: 14.2px;
	}

	.smc-nav__item.is-current > .smc-nav__link::after {
		left: 11px;
		right: 11px;
	}
}

@media (max-width: 1180px) {
	.smc-logo img {
		width: 176px;
	}

	.smc-nav__link {
		padding: 10px 9px;
		font-size: 13.5px;
	}

	.smc-searchbtn {
		width: 38px;
		height: 38px;
	}

	.smc-btn--quote {
		padding-inline: 15px;
		font-size: 13.5px;
	}

	.smc-panel__inner {
		padding: 22px 24px 24px;
	}

	.smc-panel__foot {
		padding: 13px 24px 15px;
	}

	.smc-mega__body {
		grid-template-columns: 232px minmax(0, 1fr);
		gap: 20px;
	}

	.smc-steps__body {
		grid-template-columns: minmax(0, 1fr) 244px;
		gap: 20px;
	}

	.smc-stepcard {
		grid-template-columns: 30px minmax(0, 1fr);
		gap: 10px;
		padding: 12px;
	}

	.smc-stepcard__n {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}

	.smc-stepcard__arrow {
		display: none;
	}
}

/* The dropdown only exists above 900px, where pages.css hands over to the
   drawer. Between 900px and 1020px the step grid keeps two columns and the rail
   turns into a strip beside it, because a stacked rail made the panel taller
   than the viewport. */
@media (max-width: 1020px) {
	.smc-steps__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	.smc-steps__figure {
		display: none;
	}

	.smc-steps__rail {
		flex-direction: row;
		align-items: center;
		gap: 18px;
	}

	.smc-steps__rail .smc-btn {
		flex: 0 0 auto;
	}

	.smc-steps__links {
		flex: 1 1 auto;
		padding-top: 0;
		border-top: 0;
	}

	.smc-steps__links .smc-list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 2px 14px;
	}
}

/* Below the drawer breakpoint the panels never render, so their rules are
   scoped away and the search overlay becomes a full-height sheet. */
@media (max-width: 900px) {
	.smc-header {
		--smc-bar: 66px;
	}

	/* pages.css hides the desktop bar below 900px, but the base .smc-nav
	   rule earlier in this file is a later source of equal specificity, so it
	   re-showed the row and made the document wider than the phone viewport. */
	.smc-nav {
		display: none;
	}

	.smc-panel,
	.smc-searchbox {
		display: none;
	}

	.smc-header__actions .smc-searchbtn {
		display: inline-flex;
	}

	.smc-searchbox__inner {
		padding: 18px 20px 20px;
	}

	.smc-searchbox__form {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (max-width: 620px) {
	.smc-logo img {
		width: 150px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.smc-nav__link,
	.smc-panel,
	.smc-megalink__chev,
	.smc-promo,
	.smc-logo img {
		transition: none;
	}
}
