/* mm-glossary
   Interactive glossary enhancements: A-Z jump bar, live search filter,
   see-also chips, mobile accordion. Pairs with mm-glossary.js. */

/* ---------- A-Z jump bar ---------- */
/* Toolbar normal state: sits inline in the glossary section. */
.mm-glossary-toolbar {
	background: #050507;
	padding: 16px 15px 12px;
	margin: 0 -15px 32px;
}

/* Spacer prevents layout jump when the toolbar goes fixed. */
.mm-glossary-toolbar-spacer { display: none; }
.mm-glossary-toolbar-spacer.is-active { display: block; }

/* Fixed state: pinned 12px below the site header, full viewport width. */
.mm-glossary-toolbar.is-fixed {
	position: fixed;
	top: 87px;
	left: 0;
	right: 0;
	z-index: 50;
	margin: 0;
	padding: 16px 20px 12px;
}

/* Center the fixed toolbar inner content so it aligns with page container. */
.mm-glossary-toolbar.is-fixed .mm-glossary-search,
.mm-glossary-toolbar.is-fixed .mm-glossary-jumpbar {
	max-width: 1140px;
	margin-left: auto;
	margin-right: auto;
}

.mm-glossary-search {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 52px;
	padding: 0 18px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 16px;
	font-family: inherit;
	border-radius: 0;
	outline: none;
	margin-bottom: 14px;
}

.mm-glossary-search:focus { border-color: var(--mm-accent, #4ea3ff); }
.mm-glossary-search::placeholder { color: rgba(255, 255, 255, 0.4); }

.mm-glossary-jumpbar {
	display: grid;
	grid-template-columns: repeat(26, 1fr);
	gap: 3px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.mm-glossary-jumpbar li { margin: 0; }

.mm-glossary-jumpbar a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.15);
	transition: background 120ms, color 120ms, border-color 120ms;
}

/* Mobile: back to 9 columns, 3 rows for tappable tiles. */
@media (max-width: 767px) {
	.mm-glossary-jumpbar {
		grid-template-columns: repeat(9, 1fr);
		gap: 4px;
	}
	.mm-glossary-jumpbar a { font-size: 14px; letter-spacing: 0.1em; }
}

.mm-glossary-jumpbar a:hover,
.mm-glossary-jumpbar a:focus {
	background: var(--mm-accent, #4ea3ff);
	color: #fff;
	border-color: var(--mm-accent, #4ea3ff);
}

.mm-glossary-jumpbar li.is-dim a {
	color: rgba(255, 255, 255, 0.2);
	pointer-events: none;
	cursor: default;
}

/* ---------- See-also chips ---------- */
.mm-glossary-seealso {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mm-glossary-seealso-label {
	color: rgba(255, 255, 255, 0.4);
	padding: 4px 0;
	margin-right: 4px;
}

.mm-glossary-seealso a {
	display: inline-block;
	padding: 4px 10px;
	color: var(--mm-accent, #4ea3ff);
	border: 1px solid var(--mm-accent, #4ea3ff);
	text-decoration: none !important;
	font-weight: 600;
	transition: background 120ms, color 120ms;
}

.mm-glossary-seealso a:hover,
.mm-glossary-seealso a:focus {
	background: var(--mm-accent, #4ea3ff);
	color: #fff;
	text-decoration: none !important;
}

/* ---------- Search filter: hide non-matching entries ---------- */
.mm-glossary dt.is-hidden,
.mm-glossary dd.is-hidden { display: none; }

.mm-glossary-noresults {
	padding: 40px 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.5);
	font-size: 18px;
	display: none;
}

.mm-glossary-noresults.is-visible { display: block; }

/* ---------- Mobile accordion ---------- */
@media (max-width: 767px) {
	.mm-glossary dt {
		cursor: pointer;
		position: relative;
		padding-right: 32px;
		user-select: none;
		font-size: 18px;
		font-weight: 500;
		line-height: 1.3;
	}

	.mm-glossary dt::after {
		content: "+";
		position: absolute;
		right: 0;
		top: 0;
		font-size: 28px;
		font-weight: 300;
		color: var(--mm-accent, #4ea3ff);
		line-height: 1;
		transition: transform 180ms;
	}

	.mm-glossary dt.is-open::after {
		content: "–";
	}

	.mm-glossary dd {
		max-height: 0;
		overflow: hidden;
		margin-bottom: 0;
		transition: max-height 240ms ease-out, margin-bottom 240ms;
	}

	.mm-glossary dt.is-open + dd {
		max-height: 1000px;
		margin-bottom: 24px;
	}

	/* Hide see-also chips when collapsed. */
	.mm-glossary dd .mm-glossary-seealso { opacity: 0; transition: opacity 180ms; }
	.mm-glossary dt.is-open + dd .mm-glossary-seealso { opacity: 1; }

	.mm-glossary-toolbar.is-fixed { top: 72px; padding: 12px 15px 10px; }
}

/* ---------- Compact glossary (section-level, not full page) ----------
   Lightweight term/def pattern used by tool, service, resource, main
   pages. Pairs with DefinedTermSet / DefinedTerm JSON-LD so AI assistants
   extract term + definition cleanly. No interactive features (no search,
   no A-Z jumpbar, no accordion) because these are 4-term micro-glossaries
   embedded inside a larger page, not standalone glossary pages.

   Usage:
     <dl class="mm-glossary">
       <dt class="mm-glossary-term" id="term-slug">Term</dt>
       <dd class="mm-glossary-def">Definition with optional <a>link</a>.</dd>
     </dl>
*/
.mm-glossary-term {
	margin: 0 0 8px;
	padding: 14px 0 10px 18px;
	border-left: 3px solid #00B4FF;
	background: linear-gradient(90deg, rgba(0, 180, 255, 0.08) 0%, transparent 60%);
	color: #ffffff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
}

.mm-glossary-def {
	margin: 0 0 28px 0;
	padding: 0 0 0 18px;
	color: rgba(255, 255, 255, 0.78);
	font-size: 15px;
	line-height: 1.65;
	font-weight: 300;
}

.mm-glossary-def:last-child { margin-bottom: 0; }

.mm-glossary-def a {
	color: #00B4FF;
	text-decoration: none;
	border-bottom: 1px solid rgba(0, 180, 255, 0.35);
	transition: border-color 0.2s ease, color 0.2s ease;
}

.mm-glossary-def a:hover {
	color: #4dc9ff;
	border-bottom-color: #4dc9ff;
}

@media (max-width: 991px) {
	.mm-glossary-term { font-size: 16px; }
	.mm-glossary-def { font-size: 14.5px; margin-bottom: 22px; }
}

/* Compact glossary should NOT inherit the mobile accordion behavior
   from the full glossary page — the micro-glossaries are already short
   and don't need collapse/expand. Reset dt styles on compact mode. */
@media (max-width: 767px) {
	.mm-glossary .mm-glossary-term {
		cursor: default;
		padding-right: 18px;
		user-select: auto;
	}
	.mm-glossary .mm-glossary-term::after { content: none; }
	.mm-glossary dd.mm-glossary-def {
		max-height: none;
		overflow: visible;
		margin-bottom: 22px;
		transition: none;
	}
}
