/* Mortgage Pipeline Glossary — brand-aligned display for the [glossary] shortcode. */
.mpg {
	--mpg-navy: #2C0050;
	--mpg-blue: #0064FF;
	--mpg-well: #f3f4f6;
	--mpg-border: #e5e7eb;
	--mpg-muted: #6b7280;
	--mpg-body: #374151;

	/* Sticky offsets. If your theme has its own sticky header, set --mpg-top to its
	   height, and bump --mpg-scroll so anchored letters clear both bars. */
	--mpg-top: 0px;
	--mpg-scroll: 150px;

	color: var(--mpg-navy);
	font-family: inherit;
}
.mpg *, .mpg *::before, .mpg *::after { box-sizing: border-box; }

/* All-in-one [glossary] gets a readable centered column. The separate-shortcode
   pieces stay fluid so they fit whatever container you drop them in. */
.mpg--full { max-width: 900px; margin: 0 auto; }

/* Opt-in sticky for a standalone [glossary_search]/[glossary_nav] (sticky="yes"). */
.mpg--sticky {
	position: sticky;
	top: var(--mpg-top);
	z-index: 5;
	background: #fff;
	padding: 12px 0;
}

/* ---- sticky toolbar: search + A–Z rail ---- */
.mpg__toolbar {
	position: sticky;
	top: var(--mpg-top);
	z-index: 5;
	background: #fff;
	padding: 16px 0 14px;
	border-bottom: 1px solid var(--mpg-border);
}

.mpg__search { position: relative; margin-bottom: 14px; }
.mpg__search-icon {
	position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
	display: inline-flex; color: var(--mpg-muted); pointer-events: none;
}
.mpg__search-input {
	width: 100%;
	padding: 14px 44px 14px 44px;
	font-size: 16px; font-family: inherit; line-height: 1.2;
	color: var(--mpg-navy);
	background: var(--mpg-well);
	border: 2px solid var(--mpg-border);
	border-radius: 12px;
	outline: none;
	transition: border-color .15s, background .15s;
	-webkit-appearance: none; appearance: none;
}
.mpg__search-input:focus { border-color: var(--mpg-blue); background: #fff; }
.mpg__search-input::placeholder { color: var(--mpg-muted); }
/* hide the native search "x" so ours is the only one */
.mpg__search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.mpg__search-clear {
	position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
	width: 30px; height: 30px; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; cursor: pointer;
	background: transparent; color: var(--mpg-muted);
	font-size: 24px; line-height: 1;
	transition: color .15s, background .15s;
}
.mpg__search-clear:hover { color: var(--mpg-navy); background: var(--mpg-border); }

.mpg__nav { display: flex; flex-wrap: wrap; gap: 6px; }
.mpg__nav-link {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 32px; height: 32px; padding: 0 7px;
	border-radius: 8px;
	font-weight: 700; font-size: 14px; text-decoration: none;
	color: var(--mpg-blue); background: var(--mpg-well);
	transition: background .15s, color .15s, opacity .15s;
}
.mpg__nav-link:hover, .mpg__nav-link:focus-visible { background: var(--mpg-blue); color: #fff; outline: none; }
.mpg__nav-link:focus-visible { box-shadow: 0 0 0 3px rgba(0,100,255,.35); }
.mpg__nav-link.is-empty { opacity: .3; pointer-events: none; color: var(--mpg-muted); background: transparent; }

/* ---- result count ---- */
.mpg__count { margin: 18px 0 4px; color: var(--mpg-muted); font-size: 14px; }

/* ---- letter groups ---- */
.mpg__group { scroll-margin-top: var(--mpg-scroll); }
.mpg__group.is-hidden { display: none; }

.mpg__letter {
	margin: 30px 0 14px;
	padding-bottom: 8px;
	font-size: 28px; font-weight: 800; line-height: 1;
	color: var(--mpg-blue);
	border-bottom: 2px solid var(--mpg-border);
}

.mpg__terms { display: grid; gap: 12px; }

.mpg__term {
	background: var(--mpg-well);
	border-radius: 14px;
	padding: 20px 22px;
	transition: box-shadow .15s;
}
.mpg__term.is-hidden { display: none; }
.mpg__term-name { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--mpg-navy); }
.mpg__term-def { color: var(--mpg-body); line-height: 1.6; }
.mpg__term-def p { margin: 0; }
.mpg__term-def p + p { margin-top: 10px; }

/* highlight on the term you jumped to via a letter link */
.mpg__term.is-target { box-shadow: 0 0 0 2px var(--mpg-blue) inset; }

/* ---- empty state ---- */
.mpg__empty,
.mpg__noresults { padding: 44px 20px; text-align: center; color: var(--mpg-muted); font-size: 15px; }

/* ---- responsive ---- */
@media (max-width: 600px) {
	.mpg__letter { font-size: 24px; margin-top: 24px; }
	.mpg__term { padding: 16px 18px; }
	.mpg__term-name { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
	.mpg__term, .mpg__nav-link, .mpg__search-input, .mpg__search-clear { transition: none; }
}
