/*
 * **********************************************************************
 * Kadence Child Theme — Glossary Page
 *
 * Styles for the alphabetical term list and the single-term detail view
 * (/glossary/{slug}/) rendered on the public Glossary page
 * (slug: glossary). Scoped to .mah-glossary.
 *
 * @package  KadenceChild
 * @version  2.3.4
 * @updated  2026-08-25
 * **********************************************************************
 */

/* =============================================================================
   Page chrome — hide default title bar, round the boxed container
   ============================================================================= */

.mah-glossary-page .entry-title,
.mah-glossary-page .entry-hero-container-inner {
	display: none;
}

/* Kadence's #primary carries a fixed 80px margin-top for its title
   area regardless of whether a title renders — zero it so the hero
   sits flush under the header instead of leaving a gap of tiled
   background between the nav and the hero. */
.mah-glossary-page #primary {
	margin-top: 0;
}

.mah-glossary-page .content-bg {
	border-radius: var(--mah-radius-xl);
	overflow: hidden;
}

/* =============================================================================
   Hero
   ============================================================================= */

.mah-glossary-hero {
	background: linear-gradient(135deg, var(--mah-green) 0%, var(--mah-green-mid) 100%);
	/* Left/right -2rem still bleeds the hero to the edges of the
	   rounded content-bg card; top is 0 (not -2rem) so the hero keeps
	   the same ~32px gap under the header as the teaching/team-building/
	   consulting pages, instead of sitting flush against it. */
	margin: 0 -2rem 24px;
	padding: 64px 24px;
	text-align: center;
}

.mah-glossary-hero__inner {
	max-width: 700px;
	margin: 0 auto;
}

.mah-glossary-hero__title {
	color: var(--mah-white);
	font-size: var(--mah-font-section);
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 16px;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mah-glossary-hero__lead {
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--mah-font-md);
	line-height: 1.7;
	margin: 0;
}

@media ( max-width: 767px ) {
	.mah-glossary-hero {
		margin: -1.5rem -1.5rem 20px;
		padding: 48px 20px;
	}
}

/* =============================================================================
   Floating "back to top" button
   ============================================================================= */

:root:has(.mah-glossary-page) {
	scroll-behavior: smooth;
}

.mah-glossary-top {
	position: fixed;
	top: 96px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 90;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--mah-header-bg);
	color: var(--mah-white);
	font-size: var(--mah-font-sm);
	font-weight: 700;
	padding: 8px 18px;
	border-radius: var(--mah-radius-pill);
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mah-glossary-top:hover {
	background: var(--mah-green-mid);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
	transform: translateX(-50%) translateY(-1px);
}

@media (max-width: 700px) {
	.mah-glossary-top {
		top: 70px;
		padding: 7px 14px;
		font-size: var(--mah-font-xs);
	}
}

/* =============================================================================
   Jump nav
   ============================================================================= */

.mah-glossary__jump {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 32px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0ddd6;
}

.mah-glossary__jump a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--mah-radius-sm);
	background: #f8f4ee;
	color: var(--mah-green-dark);
	font-size: var(--mah-font-sm);
	font-weight: 700;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.mah-glossary__jump a:hover {
	background: var(--mah-green);
	color: var(--mah-white);
}

/* =============================================================================
   Letter groups
   ============================================================================= */

.mah-glossary__group {
	margin-bottom: 36px;
	scroll-margin-top: 90px;
}

.mah-glossary__letter {
	color: var(--mah-green);
	font-size: var(--mah-font-2xl);
	font-weight: 700;
	margin: 0 0 14px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--mah-green);
}

.mah-glossary__list {
	margin: 0;
}

.mah-glossary__entry {
	padding: 14px 0;
	border-bottom: 1px solid #ece8e1;
}

.mah-glossary__entry:last-child {
	border-bottom: none;
}

.mah-glossary__term {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-md);
	font-weight: 700;
	margin: 0 0 4px;
}

.mah-glossary__term a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.mah-glossary__term a:hover {
	color: var(--mah-green);
	border-bottom-color: var(--mah-green);
}

.mah-glossary__definition {
	color: var(--mah-grey-600);
	font-size: var(--mah-font-base-sm);
	line-height: 1.7;
	margin: 0;
}

.mah-glossary__empty {
	color: var(--mah-grey-400);
	font-size: var(--mah-font-base-sm);
	font-style: italic;
}

/* =============================================================================
   Single-term detail view (/glossary/{slug}/)
   ============================================================================= */

.mah-glossary-detail__back {
	display: inline-flex;
	align-items: center;
	gap: var(--mah-space-1);
	color: var(--mah-green);
	font-size: var(--mah-font-sm2);
	font-weight: 700;
	text-decoration: none;
	margin-bottom: 24px;
}

.mah-glossary-detail__back:hover {
	text-decoration: underline;
}

.mah-glossary-detail__term {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-5xl);
	font-weight: 800;
	margin: 0 0 12px;
}

.mah-glossary-detail__definition {
	color: var(--mah-green-dark);
	font-size: var(--mah-font-lg);
	font-weight: 600;
	line-height: 1.6;
	margin: 0 0 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0ddd6;
}

.mah-glossary-detail__explanation {
	color: var(--mah-grey-600);
	font-size: var(--mah-font-base);
	line-height: 1.8;
	margin: 0 0 32px;
}

.mah-glossary-detail__explanation p {
	margin: 0 0 16px;
}

.mah-glossary-detail__explanation p:last-child {
	margin-bottom: 0;
}

.mah-glossary-detail__explanation ul,
.mah-glossary-detail__explanation ol {
	margin: 0 0 16px;
	padding-left: 1.4em;
}

.mah-glossary-detail__explanation li {
	margin-bottom: 6px;
}

.mah-glossary-detail__explanation a {
	color: var(--mah-green);
	text-decoration: underline;
}

.mah-glossary-detail__section {
	margin-bottom: 32px;
}

.mah-glossary-detail__heading {
	color: var(--mah-green);
	font-size: var(--mah-font-md2);
	font-weight: 700;
	margin: 0 0 14px;
}

.mah-glossary-detail__tiles {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.mah-glossary-detail__tile {
	width: 90px;
	margin: 0;
	text-align: center;
}

.mah-glossary-detail__tile img {
	width: 100%;
	height: auto;
	border-radius: var(--mah-radius-md);
	border: 1px solid #e0ddd6;
	background: var(--mah-white);
	display: block;
}

.mah-glossary-detail__tile figcaption {
	font-size: var(--mah-font-xs);
	color: var(--mah-grey-500);
	margin-top: 6px;
}

.mah-glossary-detail__links {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--mah-space-2);
}

.mah-glossary-detail__links a {
	display: inline-flex;
	align-items: center;
	color: var(--mah-green-dark);
	font-weight: 600;
	text-decoration: none;
	padding: 10px 14px;
	background: #f8f4ee;
	border-radius: var(--mah-radius-md);
	transition: background 0.15s ease, color 0.15s ease;
}

.mah-glossary-detail__links a:hover {
	background: var(--mah-green);
	color: var(--mah-white);
}
