/* Text us: the desktop header button and its panel (inc/text-us.php).

   The mobile docked bar and the mobile menu tiles live in style.css with the rest of those
   components. Link rules here start with `.custom-header .nav-primary`: the header's own
   `.custom-header .nav-primary li a` (16px, inline-block, cream) outranks any shorter
   selector (docs/blocks-and-templates.md §4).

   Colours come from the palette variables, so the panel follows the visitor's theme; the
   handful of light-only fixes are in css/theme-light.css. */

/* ---- The phone icon in front of the header number ---------------------- */

#menu-main-menu-right > .menu-contact > a > span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

#menu-main-menu-right > .menu-contact .lm-action-icon {
	width: 16px;
	height: 16px;
	flex: none;
	color: var(--color-text-accent);
}

/* ---- The button --------------------------------------------------------- */

#menu-main-menu-right > .menu-text-us {
	position: relative;
	display: flex;
	align-items: center;
}

/* The mobile menu and the 881px+ header are separate menus; this one only exists in the
   desktop bar, which style.css hides at 880px and below. */
.menu-text-us > .text-us {
	position: static;
}

/* .pseudo-button.outline (style.css ~7450) draws the gold ring, the fill and the hover.
   A <summary> is a list item with a disclosure triangle by default. */
.menu-text-us .text-us__toggle {
	list-style: none;
	cursor: pointer;
	color: #F7F7F2;
	font-size: 12px;
	font-weight: 400;
	line-height: 14px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}

.menu-text-us .text-us__toggle::-webkit-details-marker {
	display: none;
}

.menu-text-us .text-us__toggle::marker {
	content: "";
}

/* Shorter than Get in touch beside it (11px 24px), as drawn: the secondary of the two. */
.menu-text-us .text-us__toggle > span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
}

.menu-text-us .text-us__toggle .lm-action-icon {
	width: 16px;
	height: 16px;
	flex: none;
	color: var(--color-text-accent);
}

.menu-text-us .text-us__toggle:focus-visible {
	outline: 2px solid var(--color-text-accent);
	outline-offset: 3px;
}

/* ---- The panel ---------------------------------------------------------- */

.menu-text-us .text-us__panel {
	position: absolute;
	top: calc(100% + 14px);
	right: 0;
	z-index: 120;
	width: 290px;
	box-sizing: border-box;
	padding: 22px 20px 18px;
	border: 1px solid rgba(136, 114, 68, 0.45);
	border-radius: 6px;
	background: var(--color-bg-primary);
	/* A shade off the header behind it, in whichever theme is showing. */
	background: color-mix(in srgb, var(--color-bg-primary) 94%, var(--color-text-primary));
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
	color: var(--color-text-primary);
	text-align: left;
	white-space: normal;
	cursor: default;
}

@media (prefers-reduced-motion: no-preference) {
	.menu-text-us .text-us[open] > .text-us__panel {
		animation: text-us-in 0.18s ease-out;
	}
}

@keyframes text-us-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.menu-text-us .text-us__panel p {
	margin: 0;
	padding: 0;
}

.menu-text-us .text-us__eyebrow {
	color: var(--color-text-accent);
	font-size: 11px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.custom-header .nav-primary .menu-text-us a.text-us__number {
	display: block;
	margin: 12px 0 14px;
	color: var(--color-text-primary);
	font-family: var(--font-serif);
	font-size: 30px;
	line-height: 1.1;
	font-weight: 400;
	letter-spacing: 0;
}

.custom-header .nav-primary .menu-text-us a.text-us__number:hover,
.custom-header .nav-primary .menu-text-us a.text-us__number:focus-visible {
	color: var(--color-text-accent);
}

.menu-text-us .text-us__scan {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* Always dark on white, in both themes: the code has to scan. The SVG carries its own
   four-module quiet zone, so the tile needs no padding. */
.menu-text-us .text-us__qr {
	display: block;
	flex: none;
	width: 96px;
	height: 96px;
	border-radius: 4px;
	background: #FFFFFF;
}

.menu-text-us .text-us__panel .text-us__hint {
	font-size: 13px;
	line-height: 1.5;
	color: color-mix(in srgb, var(--color-text-primary) 82%, transparent);
}

.menu-text-us .text-us__panel .text-us__legal {
	margin-top: 14px;
	font-size: 11px;
	line-height: 1.5;
	color: color-mix(in srgb, var(--color-text-primary) 66%, transparent);
}

.custom-header .nav-primary .menu-text-us .text-us__legal a {
	display: inline;
	color: var(--color-text-primary);
	font-size: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.custom-header .nav-primary .menu-text-us .text-us__legal a:hover {
	color: var(--color-text-accent);
}

/* ---- Narrow desktop ----------------------------------------------------- */

/* The right-hand menu gets about half the bar, and before this button it held the number,
   Sign In and Get in touch on one line down to roughly 990px. Measured needs, in px of
   that half: 594 with everything, 489 with the button as an icon and no phone icon, 453
   with the menu's 32px gap at 20px. The tiers below keep the row on one line down to the
   same width as before; under that the labels wrap to two lines, as they already did. */

/* Under 1260px the button keeps its icon and drops its label (still read out: the text
   stays in the accessibility tree), and the number loses its icon. */
@media (min-width: 881px) and (max-width: 1259px) {
	.menu-text-us .text-us__toggle > span {
		gap: 0;
		padding: 9px 10px;
		font-size: 0;
		letter-spacing: 0;
	}

	#menu-main-menu-right > .menu-contact .lm-action-icon {
		display: none;
	}
}

/* style.css ~13476  .menu-primary { gap: 32px }, and ~25145 hangs the "|" before Sign In
   16.5px to its left: half the gap. Same selector as that rule, so this file's later
   position decides. */
@media (min-width: 881px) and (max-width: 1150px) {
	#menu-main-menu-right {
		gap: 20px;
	}

	#menu-main-menu-right > li:not(:first-child):not(:last-child):not(.menu-text-us):before {
		left: -12px;
	}
}

@media (min-width: 881px) and (max-width: 1023px) {
	#menu-main-menu-right {
		gap: 12px;
	}

	#menu-main-menu-right > li:not(:first-child):not(:last-child):not(.menu-text-us):before {
		left: -8px;
	}
}
