/* ==========================================================================
   JCU Glossary — A–Z index, styled to the JCU purple brand.
   ========================================================================== */

.jcu-glossary {
	--jcug-purple: #68267e;
	--jcug-purple-soft: rgba(104, 38, 126, 0.08);
	max-width: 1100px;
	margin: 0 auto;
}

.jcu-glossary__page {
	background: #fff;
}

.jcu-glossary__page-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 3rem 1.25rem 4rem;
}

.jcu-glossary__page-head h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(2rem, 4vw, 2.8rem);
	font-weight: 800;
	color: #1c1c1f;
}

.jcu-glossary__page-head p {
	margin: 0 0 2rem;
	color: #555;
	font-size: 1.05rem;
}

/* Toolbar: search + letter nav */

.jcu-glossary__toolbar {
	position: sticky;
	top: 0;
	z-index: 5;
	background: #fff;
	padding: 1rem 0;
	border-bottom: 1px solid #eee;
	margin-bottom: 1.5rem;
}

.jcu-glossary__search {
	width: 100%;
	max-width: 420px;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	padding: 0.6rem 1.2rem;
	font-family: inherit;
	font-size: 0.95rem;
	outline: none;
	margin-bottom: 0.9rem;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.jcu-glossary__search:focus {
	border-color: var(--jcug-purple);
	box-shadow: 0 0 0 3px var(--jcug-purple-soft);
}

.jcu-glossary__letters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.jcu-glossary__letters a,
.jcu-glossary__letters span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 0.4rem;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
}

/* !important: Elementor's kit-wide link colors otherwise override these */
.jcu-glossary__letters a {
	color: var(--jcug-purple) !important;
	background: var(--jcug-purple-soft);
	transition: background 0.15s, color 0.15s;
}

.jcu-glossary__letters a:hover,
.jcu-glossary__letters a:focus {
	background: var(--jcug-purple);
	color: #fff !important;
}

.jcu-glossary__letters span {
	color: #bbb;
	background: #f4f4f5;
}

.jcu-glossary__count {
	color: #777;
	font-size: 0.88rem;
	margin: 0 0 1.5rem;
}

/* Letter groups */

.jcu-glossary__group {
	margin-bottom: 2.25rem;
}

.jcu-glossary__letter {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0 0 1rem;
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--jcug-purple);
	scroll-margin-top: 130px;
}

.jcu-glossary__letter::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #e8e2ec;
}

.jcu-glossary__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem 2rem;
}

.jcu-glossary__item a {
	font-size: 1.05rem;
	font-weight: 700;
	color: #1c1c1f !important;
	text-decoration: none;
	text-transform: capitalize;
}

.jcu-glossary__item a:hover {
	color: var(--jcug-purple) !important;
	text-decoration: underline;
}

.jcu-glossary__item p {
	margin: 0.3rem 0 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: #666;
}

.jcu-glossary__empty {
	padding: 2rem 0;
	color: #777;
	font-size: 1rem;
}

/* --- Auto-linked terms in posts/pages (with definition tooltip) --------- */

.jcu-glossary-term {
	position: relative;
	color: #68267e !important;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1.5px dotted #68267e;
}

.jcu-glossary-term:hover,
.jcu-glossary-term:focus {
	background: rgba(104, 38, 126, 0.07);
}

/* Hidden tooltips use display:none (not visibility) so the 300px box can
   never widen the page's scrollable area when a term sits near the edge. */
.jcu-glossary-term::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%) translateY(5px);
	width: 300px;
	max-width: 76vw;
	background: #3c1449;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 400;
	line-height: 1.55;
	text-align: left;
	white-space: normal;
	padding: 0.75rem 0.95rem;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(20, 5, 25, 0.35);
	display: none;
	opacity: 0;
	transition: opacity 0.18s, transform 0.18s, display 0.18s allow-discrete;
	pointer-events: none;
	z-index: 100;
}

.jcu-glossary-term::before {
	content: "";
	position: absolute;
	bottom: calc(100% + 5px);
	left: 50%;
	transform: translateX(-50%);
	border: 7px solid transparent;
	border-top-color: #3c1449;
	display: none;
	opacity: 0;
	transition: opacity 0.18s, display 0.18s allow-discrete;
	pointer-events: none;
	z-index: 100;
}

.jcu-glossary-term:hover::after,
.jcu-glossary-term:focus::after {
	display: block;
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.jcu-glossary-term:hover::before,
.jcu-glossary-term:focus::before {
	display: block;
	opacity: 1;
}

@starting-style {
	.jcu-glossary-term:hover::after,
	.jcu-glossary-term:focus::after {
		opacity: 0;
		transform: translateX(-50%) translateY(5px);
	}

	.jcu-glossary-term:hover::before,
	.jcu-glossary-term:focus::before {
		opacity: 0;
	}
}

/* --- Single term details page ------------------------------------------ */

.jcu-glossary-single .jcu-glossary__page-inner {
	max-width: 860px;
}

.jcu-glossary-single__crumbs {
	margin-bottom: 1.75rem;
}

.jcu-glossary-single__crumbs a {
	color: #68267e !important;
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none;
}

.jcu-glossary-single__crumbs a:hover {
	text-decoration: underline;
}

.jcu-glossary-single__head {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
	margin-bottom: 1.75rem;
}

.jcu-glossary-single__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 14px;
	background: linear-gradient(150deg, #68267e, #8b3ba6);
	color: #fff;
	font-size: 1.9rem;
	font-weight: 800;
	box-shadow: 0 6px 18px rgba(104, 38, 126, 0.3);
}

.jcu-glossary-single__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	font-weight: 800;
	line-height: 1.1;
	color: #1c1c1f;
	text-transform: capitalize;
}

.jcu-glossary-single__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.jcu-glossary-single__cat {
	display: inline-block;
	background: rgba(104, 38, 126, 0.08);
	color: #68267e !important;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
}

.jcu-glossary-single__cat:hover {
	background: #68267e;
	color: #fff !important;
}

.jcu-glossary-single__updated {
	color: #999;
	font-size: 0.85rem;
}

.jcu-glossary-single__content {
	font-size: 1.08rem;
	line-height: 1.8;
	color: #333;
	text-align: justify;
	hyphens: auto;
	-webkit-hyphens: auto;
}

.jcu-glossary-single__content h1,
.jcu-glossary-single__content h2,
.jcu-glossary-single__content h3,
.jcu-glossary-single__content h4,
.jcu-glossary-single__content li {
	text-align: left;
}

.jcu-glossary-single__content p {
	margin: 0 0 1.2rem;
}

/* Neutralize legacy inline styling pasted into old definitions
   (hand-picked colors, oversized text). Bold/italic is preserved. */
.jcu-glossary-single__content [style*="font-size"],
.jcu-glossary-single__content [style*="color"],
.jcu-glossary-single__content font {
	font-size: inherit !important;
	color: inherit !important;
	line-height: inherit !important;
}

/* In-content headings sized as section labels, matching the rest of the site */
.jcu-glossary-single__content h1,
.jcu-glossary-single__content h2,
.jcu-glossary-single__content h3,
.jcu-glossary-single__content h4 {
	color: #1c1c1f;
	font-weight: 700;
	line-height: 1.3;
	margin: 2rem 0 0.8rem;
}

.jcu-glossary-single__content h1,
.jcu-glossary-single__content h2 {
	font-size: 1.3rem;
}

.jcu-glossary-single__content h3,
.jcu-glossary-single__content h4 {
	font-size: 1.12rem;
}

/* Alphabetical previous / next */

.jcu-glossary-single__adjacent {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 2.5rem 0;
	padding: 1.25rem 0;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
}

.jcu-glossary-single__adj {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	text-decoration: none;
	max-width: 46%;
}

.jcu-glossary-single__adj--next {
	text-align: right;
	margin-left: auto;
}

.jcu-glossary-single__adj small {
	color: #999;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.jcu-glossary-single__adj span {
	color: #68267e;
	font-weight: 700;
	text-transform: capitalize;
}

.jcu-glossary-single__adj:hover span {
	text-decoration: underline;
}

.jcu-glossary-single__related-wrap h2 {
	margin: 0 0 0.8rem;
	font-size: 1.15rem;
	font-weight: 800;
	color: #1c1c1f;
}

/* Help CTA card */

.jcu-glossary-single__help {
	position: relative;
	display: flex;
	align-items: center;
	gap: 2rem;
	margin-top: 3rem;
	padding: 2rem 2.25rem;
	background:
		radial-gradient(420px 220px at 90% -30%, rgba(227, 163, 205, 0.25), transparent),
		linear-gradient(135deg, #40173a, #5a2148 55%, #68267e);
	border-radius: 18px;
	color: #fff;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(40, 10, 45, 0.28);
}

/* Giant scales watermark */
.jcu-glossary-single__help-mark {
	position: absolute;
	right: -28px;
	bottom: -42px;
	width: 210px;
	height: 210px;
	color: rgba(255, 255, 255, 0.07);
	pointer-events: none;
}

.jcu-glossary-single__help-text {
	position: relative;
	flex: 1;
	min-width: 0;
}

.jcu-glossary-single__help-kicker {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: #e3a3cd;
	margin-bottom: 0.45rem;
}

.jcu-glossary-single__help-title {
	margin: 0 0 0.3rem;
	font-size: clamp(1.15rem, 2.4vw, 1.5rem);
	font-weight: 800;
	line-height: 1.25;
}

.jcu-glossary-single__help-sub {
	margin: 0;
	font-size: 0.92rem;
	color: rgba(255, 255, 255, 0.82);
}

.jcu-glossary-single__help-actions {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.7rem;
	flex-shrink: 0;
}

.jcu-glossary-single__help-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	background: #fff;
	color: #5a2148 !important;
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-decoration: none;
	padding: 0.7rem 1.5rem;
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s, box-shadow 0.2s;
	white-space: nowrap;
}

.jcu-glossary-single__help-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.jcu-glossary-single__help-btn svg {
	width: 17px;
	height: 17px;
}

.jcu-glossary-single__help-link {
	color: rgba(255, 255, 255, 0.88) !important;
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
	padding-left: 0.3rem;
}

.jcu-glossary-single__help-link:hover {
	color: #fff !important;
	text-decoration: underline;
}

@media (max-width: 700px) {
	.jcu-glossary-single__help {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.25rem;
		padding: 1.6rem 1.5rem;
	}
}

@media (max-width: 640px) {
	.jcu-glossary-single__head {
		flex-direction: column;
	}

	.jcu-glossary-single__adjacent {
		flex-direction: column;
	}

	.jcu-glossary-single__adj {
		max-width: none;
	}

	.jcu-glossary-single__adj--next {
		text-align: left;
		margin-left: 0;
	}
}

/* Single term footer */

.jcu-glossary__single-footer {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #eee;
}

.jcu-glossary__back {
	display: inline-block;
	color: #68267e !important;
	font-weight: 700;
	text-decoration: none;
	margin-bottom: 1rem;
}

.jcu-glossary__back:hover {
	text-decoration: underline;
}

.jcu-glossary__single-footer h3 {
	margin: 1rem 0 0.6rem;
	font-size: 1.1rem;
	font-weight: 800;
}

.jcu-glossary__related {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.jcu-glossary__related a {
	display: inline-block;
	background: rgba(104, 38, 126, 0.08);
	color: #68267e !important;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	text-transform: capitalize;
	padding: 0.35rem 0.9rem;
	border-radius: 999px;
	transition: background 0.15s, color 0.15s;
}

.jcu-glossary__related a:hover {
	background: #68267e;
	color: #fff !important;
}

@media (max-width: 640px) {
	.jcu-glossary__list {
		grid-template-columns: 1fr;
	}
}
