/*
 * AI Security Essentials — glossary styles.
 *
 * Built on the theme palette. Reading surfaces stay light because these are
 * long-form reference pages; --bg-deep is reserved for structural elements
 * (masthead, thumb rail) and --secondary-color for interactive state only.
 *
 * wp-content/themes/gruveai/glossary.css
 */

.gl {
	/* Inherited theme tokens, restated so this file is self-contained. */
	--gl-ink:        #062D1F;
	--gl-green:      #21A55E;
	--gl-lime:       #CCFC00;
	--gl-base:       #42DA88;
	--gl-deep:       #041a12;
	--gl-mid:        #062D1F;
	--gl-light:      #0a3d2b;
	--gl-on-dark:    #e8f5ee;
	--gl-muted:      #8aa89a;
	--gl-lime-glow:  rgba(204, 252, 0, 0.45);
	--gl-green-glow: rgba(66, 218, 136, 0.35);

	/* Derived reading surface. */
	--gl-paper:      #FAFCFA;
	--gl-paper-warm: #F1F6F2;
	--gl-rule:       rgba(6, 45, 31, 0.14);
	--gl-rule-soft:  rgba(6, 45, 31, 0.07);
	--gl-ink-soft:   rgba(6, 45, 31, 0.66);

	/* Inter throughout — loaded by the base theme stylesheet. Hierarchy comes
	   from weight, size and tracking rather than a second typeface. */
	--gl-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	--gl-measure: 68ch;
	--gl-gut:     clamp(20px, 5vw, 64px);

	background: var(--gl-paper);
	color: var(--gl-ink);
	font-family: var(--gl-font);
	font-feature-settings: "cv05" 1, "ss03" 1;
	-webkit-font-smoothing: antialiased;
	/* Stop iOS inflating type in landscape, and never allow a stray wide
	   child to create a horizontal scrollbar on the whole page. */
	-webkit-text-size-adjust: 100%;
	overflow-x: clip;
}

/* Glossary terms include long compound words ("machine-credential-exposure").
   At display sizes on a narrow screen those overflow rather than wrap. */
.gl-headword,
.gl-entries__word,
.gx-card__title,
.gx-recent__word,
.gl-q__text,
.gl-misread__claim {
	overflow-wrap: break-word;
	hyphens: auto;
}

.gl *,
.gl *::before,
.gl *::after { box-sizing: border-box; }

.gl-sr {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ============================================================
   Shared apparatus
   ============================================================ */

.gl .gl-eyebrow {
	font-family: var(--gl-font);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--gl-green);
	margin: 0 0 14px;
}

.gl-crumb {
	font-family: var(--gl-font);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	color: var(--gl-ink-soft);
	margin-bottom: 28px;
}

.gl-crumb a {color: var(--text-color);text-decoration: none;}
.gl-crumb a:hover { color: var(--gl-green); }

.gl-empty {
	border: 1px dashed var(--gl-rule);
	border-radius: 4px;
	padding: 40px 28px;
	text-align: center;
	color: var(--gl-ink-soft);
}

.gl-empty p { margin: 0; }

/* ============================================================
   INDEX PAGE — type specimen sheet
   Deep-green ground, dense editorial setting. The alphabet wall
   is the signature; everything else stays disciplined around it.
   ============================================================ */

.gl--index {
	background: var(--gl-deep);
	color: var(--gl-on-dark);
}

.gl--index .gx-eyebrow {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--gl-lime);
	margin: 0 0 18px;
}

.gl--index .gx-eyebrow--dark { color: var(--gl-green); }

.gx-h2 {
	font-size: clamp(1.5rem, 3.4vw, 2.375rem);
	font-weight: 250;
	line-height: 1.06;
	letter-spacing: -0.035em;
	margin: 0;
}

/* ---------- Cover ---------- */

.gx-cover {
	position: relative;
	overflow: hidden;
	padding: 80px 0px;
	border-bottom: 1px solid rgba(232, 245, 238, 0.14);
}

/* Two off-centre glows using the theme's own glow tokens, plus a hairline
   column grid. Depth without a gradient mesh. */
.gx-cover__wash {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(58% 70% at 8% 0%, var(--gl-green-glow), transparent 62%),
		radial-gradient(46% 58% at 96% 88%, var(--gl-lime-glow), transparent 66%),
		linear-gradient(to right, rgba(232, 245, 238, 0.045) 1px, transparent 1px);
	background-size: auto, auto, 92px 100%;
	opacity: 0.5;
	pointer-events: none;
}

.gx-cover__inner {
	position: relative;
	max-width: 1240px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
	gap: clamp(32px, 5vw, 88px);
	align-items: end;
}

@media (max-width: 900px) {
	.gx-cover__inner { grid-template-columns: minmax(0, 1fr); }

	/* Two columns of stats reads better than four stacked rows. */
	.gx-ledger {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 24px;
	}

	.gx-ledger__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
}

.gx-cover__lead { min-width: 0; }

.gx-title {
	display: flex;
	flex-direction: column;
	font-size: 82px;
	line-height: 1;
	/* letter-spacing: -0.05em; */
	margin: 0 0 28px;
}

.gx-title__thin {
	font-weight: 200;
	color: var(--gl-on-dark);
}

/* The second line carries all the mass, so the pair reads as one gesture. */
.gx-title__bold {
	font-weight: 800;
	color: var(--gl-base);
	/* letter-spacing: -0.058em; */
}

.gx-standfirst {
	font-size: clamp(1rem, 1.5vw, 1.1875rem);
	font-weight: 350;
	line-height: 1.62;
	color: var(--gl-muted);
	max-width: 54ch;
	margin: 0 0 40px;
}

/* ---------- Ledger ---------- */

.gx-ledger {
	margin: 0;
	border-top: 1px solid rgba(232, 245, 238, 0.18);
}

.gx-ledger__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-bottom: 1px solid rgba(232, 245, 238, 0.1);
}

.gx-ledger dt {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gl-muted);
}

.gx-ledger dd {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 300;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--gl-on-dark);
}

/* ---------- Look-up field ---------- */

.gx-find { max-width: 580px; }

.gx-find label {
	display: block;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gl-muted);
	margin-bottom: 12px;
}

.gx-find__row {
	display: flex;
	align-items: stretch;
	border-bottom: 1px solid rgba(232, 245, 238, 0.32);
	transition: border-color 0.2s ease;
}

.gx-find__row:focus-within { border-bottom-color: var(--gl-lime); }

.gx-find input[type="search"] {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	padding: 14px 4px;
	font-family: var(--gl-font);
	font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
	font-weight: 300;
	letter-spacing: -0.018em;
	color: var(--gl-on-dark);
	-webkit-appearance: none;
	appearance: none;
}

.gx-find input::placeholder { color: rgba(138, 168, 154, 0.6); }
.gx-find input:focus { outline: none; }

.gx-find button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: transparent;
	border: 0;
	padding: 0 2px 0 24px;
	font-family: var(--gl-font);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gl-lime);
	cursor: pointer;
	white-space: nowrap;
}

.gx-find__arrow { transition: transform 0.2s ease; }
.gx-find button:hover .gx-find__arrow { transform: translateX(4px); }
.gx-find button:focus-visible { outline: 2px solid var(--gl-lime); outline-offset: 4px; }

/* ---------- Alphabet wall — signature ---------- */

.gx-wall {
	padding: clamp(48px, 7vw, 96px) var(--gl-gut) clamp(56px, 8vw, 104px);
	max-width: 1240px;
	margin: 0 auto;
}

.gx-wall__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px 24px;
	padding-bottom: 22px;
	border-bottom: 1px solid rgba(232, 245, 238, 0.18);
	margin-bottom: clamp(24px, 4vw, 44px);
}

.gl--index .gx-wall__head .gx-eyebrow { margin-bottom: 0; }

.gx-wall__note {
	font-size: 0.75rem;
	font-weight: 450;
	letter-spacing: 0.01em;
	color: var(--gl-muted);
	margin: 0;
}

.gx-wall__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 1px;
	background: rgba(232, 245, 238, 0.1);
	border: 1px solid rgba(232, 245, 238, 0.1);
}

.gx-glyph {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-height: clamp(104px, 11vw, 148px);
	padding: 18px 8px 14px;
	background: var(--gl-deep);
	text-decoration: none;
	color: var(--gl-on-dark);
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.gx-glyph__char {
	line-height: 0.78;
	/* --w is 0-1, computed in PHP from the term count. */
	font-size: calc(1.875rem + (var(--w, 0.5) * 3.25rem));
	font-weight: calc(200 + (var(--w, 0.5) * 600));
	letter-spacing: calc(-0.02em - (var(--w, 0.5) * 0.03em));
}

.gx-glyph__count {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	font-variant-numeric: tabular-nums;
	color: var(--gl-muted);
	transition: color 0.2s ease;
}

/* The one orchestrated moment: hovering the wall recedes every letter except
   the one under the cursor, so the whole block responds as a single object. */
.gx-wall__grid:hover .gx-glyph { opacity: 0.4; }

.gx-wall__grid .gx-glyph:hover,
.gx-wall__grid .gx-glyph:focus-visible {
	opacity: 1;
	background: var(--gl-light);
	color: var(--gl-lime);
	outline: none;
}

.gx-glyph:hover .gx-glyph__count,
.gx-glyph:focus-visible .gx-glyph__count { color: var(--gl-base); }

.gx-glyph:focus-visible { box-shadow: inset 0 0 0 2px var(--gl-lime); }

/* ---------- Cornerstone cards ---------- */

.gx-start {
	background: var(--gl-paper);
	color: var(--gl-ink);
	padding: clamp(52px, 7vw, 104px) var(--gl-gut);
}

.gx-start__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.gx-start__head { margin-bottom: clamp(28px, 4vw, 48px); }

.gx-start__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--gl-rule);
	border: 1px solid var(--gl-rule);
}

@media (max-width: 940px) {
	.gx-start__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
	.gx-start__grid { grid-template-columns: minmax(0, 1fr); }
}

.gx-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--gl-paper);
	padding: 30px 28px 26px;
	text-decoration: none;
	color: var(--gl-ink);
	transition: background 0.2s ease;
}

.gx-card:hover,
.gx-card:focus-visible {
	background: var(--gl-mid);
	color: var(--gl-on-dark);
	outline: none;
}

/* Numbered because "start here" is a reading order, not decoration. */
.gx-card__index {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	font-variant-numeric: tabular-nums;
	color: var(--gl-green);
	margin-bottom: 20px;
	transition: color 0.2s ease;
}

.gx-card:hover .gx-card__index { color: var(--gl-lime); }

.gx-card__title {
	font-size: 1.375rem;
	font-weight: 500;
	line-height: 1.16;
	letter-spacing: -0.026em;
	margin: 0 0 12px;
}

.gx-card__sense {
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--gl-ink-soft);
	margin: 0 0 26px;
	transition: color 0.2s ease;
}

.gx-card:hover .gx-card__sense { color: var(--gl-muted); }

.gx-card__go {
	margin-top: auto;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gl-green);
	transition: color 0.2s ease;
}

.gx-card:hover .gx-card__go { color: var(--gl-lime); }

/* ---------- Recently added ---------- */

.gx-recent {
	background: var(--gl-mid);
	padding: clamp(44px, 6vw, 84px) var(--gl-gut);
}

.gx-recent__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.gx-recent__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid rgba(232, 245, 238, 0.16);
}

.gx-recent__list li { border-bottom: 1px solid rgba(232, 245, 238, 0.16); }

.gx-recent__list a {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	padding: 15px 0;
	text-decoration: none;
	color: var(--gl-on-dark);
	transition: padding-left 0.18s ease, color 0.18s ease;
}

.gx-recent__list a:hover,
.gx-recent__list a:focus-visible {
	padding-left: 12px;
	color: var(--gl-lime);
	outline: none;
}

.gx-recent__tag {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--gl-base);
	border: 1px solid rgba(66, 218, 136, 0.35);
	border-radius: 2px;
	text-align: center;
	padding: 3px 0;
}

.gx-recent__word {
	font-size: 1.0625rem;
	font-weight: 450;
	letter-spacing: -0.011em;
}

.gx-recent__date {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	font-variant-numeric: tabular-nums;
	color: var(--gl-muted);
	white-space: nowrap;
}

/* ---------- Search results on the index ---------- */

.gx-results {
	background: var(--gl-paper);
	color: var(--gl-ink);
	padding: clamp(44px, 6vw, 80px) var(--gl-gut);
}

.gx-results__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.gx-results__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--gl-rule);
	margin-bottom: clamp(20px, 3vw, 32px);
}

.gl--index .gx-results__head .gx-eyebrow { margin-bottom: 0; }

.gx-results__title {
	flex: 1;
	font-size: clamp(1.375rem, 3vw, 2rem);
	font-weight: 300;
	letter-spacing: -0.03em;
	margin: 0;
}

.gx-results__clear {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gl-green);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.gx-results__clear:hover { color: var(--gl-ink); }

/* ---------- Reduced motion + narrow screens ---------- */

@media (prefers-reduced-motion: reduce) {
	.gx-wall__grid:hover .gx-glyph { opacity: 1; }
	.gx-find button:hover .gx-find__arrow { transform: none; }
}

/* ============================================================
   Thumb rail — dictionary fore-edge tabs
   ============================================================ */

.gl--sectioned {
	display: grid;
	grid-template-columns: 62px minmax(0, 1fr);
}

.gl-thumbs {
	background: var(--gl-deep);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 0px 0 40px;
	position: sticky;
	top: 0;
	align-self: start;
	max-height: 100vh;
	overflow-y: auto;
	scrollbar-width: none;
	top: 70px;
	height: 100vh;
}

.gl-thumbs::-webkit-scrollbar { display: none; }

.gl-thumbs__home {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	color: var(--gl-base);
	font-size: 1.125rem;
	text-decoration: none;
	border-bottom: 1px solid rgba(232, 245, 238, 0.14);
	margin-bottom: 8px;
}

.gl-thumbs__home:hover { color: var(--gl-lime); }

.gl-thumbs__tab {
	display: block;
	padding: 7px 0;
	text-align: center;
	font-family: var(--gl-font);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--gl-muted);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.gl-thumbs__tab:hover {
	color: var(--gl-on-dark);
	background: var(--gl-light);
}

.gl-thumbs__tab.is-current {
	color: var(--gl-deep);
	background: var(--gl-lime);
	border-left-color: var(--gl-lime);
	font-weight: 700;
}

.gl-thumbs__tab:focus-visible {
	outline: 2px solid var(--gl-lime);
	outline-offset: -2px;
}

/* ---------- Section head ---------- */

.gl-section-body {
	padding: clamp(36px, 5vw, 64px) var(--gl-gut) clamp(64px, 8vw, 104px);
	/* max-width: 1180px; */
	min-width: 0;
}

.gl-section-head {
	padding-bottom: clamp(24px, 3.5vw, 40px);
	border-bottom: 1px solid var(--gl-rule);
	margin-bottom: clamp(28px, 4vw, 48px);
}

.gl-section-head__row {
	display: flex;
	align-items: center;
	gap: clamp(18px, 3vw, 34px);
}

.gl-bigletter {
	font-family: var(--gl-font);
	font-size: clamp(4rem, 13vw, 9rem);
	line-height: 0.74;
	font-weight: 800;
	letter-spacing: -0.06em;
	color: var(--gl-base);
	flex: none;
}

.gl-section-head__title {
	font-family: var(--gl-font);
	font-size: clamp(1.5rem, 3.4vw, 2.25rem);
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	margin: 0 0 6px;
}

.gl-section-head__range {
	font-family: var(--gl-font);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--gl-ink-soft);
	margin: 0;
}

/* ============================================================
   Entry lists
   ============================================================ */

.gl-entries {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: none;
}

/* Letter sections: three cards per row, collapsing to two then one. */
.gl-entries--cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2px;
	background: var(--gl-rule-soft);
	border: 1px solid var(--gl-rule-soft);
}

@media (max-width: 1000px) {
	.gl-entries--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.gl-entries--cards { grid-template-columns: minmax(0, 1fr); }
}

/* The 2px gap over a tinted parent draws the hairlines, so the cards
   themselves need no borders and nothing doubles up at the seams. */
.gl-entries--cards .gl-entries__item {
	border-bottom: 0;
	background: var(--gl-paper);
	display: flex;
}

.gl-entries--cards .gl-entries__item a {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 22px 24px 24px;
	border-left: 2px solid transparent;
	transition: background 0.16s ease, border-color 0.16s ease;
}

/* The sliding dash belongs to the list layout, not the cards. */
.gl-entries--cards .gl-entries__item a::before { content: none; }

.gl-entries--cards .gl-entries__item a:hover,
.gl-entries--cards .gl-entries__item a:focus-visible {
	padding-left: 24px;
	background: var(--gl-paper-warm);
	border-left-color: var(--gl-lime);
}

.gl-entries--cards .gl-entries__word {
	font-size: 1.125rem;
	margin-bottom: 8px;
}

.gl-entries--cards .gl-entries__sense {
	margin-top: 0;
	/* Cap the blurb so rows stay even without fixing card heights. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gl-entries__item {
	break-inside: avoid;
	border-bottom: 1px solid var(--gl-rule-soft);
}

.gl-entries__item a {
	display: block;
	padding: 16px 12px 16px 0;
	text-decoration: none;
	color: inherit;
	position: relative;
	transition: padding-left 0.16s ease, background 0.16s ease;
}

.gl-entries__item a::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 0;
	height: 2px;
	background: var(--gl-lime);
	transform: translateY(-50%);
	transition: width 0.16s ease;
}

.gl-entries__item a:hover,
.gl-entries__item a:focus-visible {
	padding-left: 20px;
	outline: none;
}

.gl-entries__item a:hover::before,
.gl-entries__item a:focus-visible::before { width: 12px; }

.gl-entries__word {
	font-family: var(--gl-font);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.32;
	letter-spacing: -0.011em;
	margin: 0;
	transition: color 0.16s ease;
}

.gl-entries__item a:hover .gl-entries__word { color: var(--gl-green); }

.gl-entries__sense {
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--gl-ink-soft);
	margin: 5px 0 0;
}

/* ============================================================
   Single entry
   ============================================================ */

.gl--entry { padding-bottom: 0; }

.gl-entry {
	max-width: 1180px;
	margin: 0 auto;
	padding: 80px 0px;
}

.gl-entry__head {
	padding-bottom: clamp(28px, 4vw, 44px);
	border-bottom: 2px solid var(--gl-ink);
	margin-bottom: clamp(32px, 5vw, 56px);
}

.gl-headword {
	font-family: var(--gl-font);
	font-size: clamp(2.25rem, 6.5vw, 4.5rem);
	font-weight: 250;
	line-height: 1.0;
	letter-spacing: -0.045em;
	margin: 0 0 24px;
	max-width: 26ch;
	color: var(--primary-color);
}

.gl-sense {
	display: flex;
	gap: 16px;
	/* max-width: var(--gl-measure); */
}

.gl-sense__mark {
	font-family: var(--gl-font);
	font-size: 1.25rem;
	font-weight: 300;
	line-height: 1.5;
	color: var(--gl-base);
	flex: none;
}

.gl-sense__text {
	font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
	line-height: 1.6;
	color: var(--gl-ink-soft);
}

.gl-sense__text > *:first-child { margin-top: 0; }
.gl-sense__text > *:last-child { margin-bottom: 0; }

/* ---------- Entry grid ---------- */

.gl-entry__grid {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: clamp(28px, 5vw, 72px);
	align-items: start;
}

@media (max-width: 900px) {
	.gl-entry__grid { grid-template-columns: minmax(0, 1fr); }
}

.gl-apparatus {
	position: sticky;
	top: 100px;
}

@media (max-width: 900px) {
	.gl-apparatus {
		position: static;
		border-bottom: 1px solid var(--gl-rule);
		padding-bottom: 20px;
	}
}

.gl-apparatus__label {
	font-family: var(--gl-font);
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--gl-ink-soft);
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--gl-rule);
}

.gl-apparatus ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	.gl-apparatus ol {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.gl-apparatus li { margin-bottom: 0; }

	/* Inline text links are too small to hit reliably; make them chips. */
	.gl-apparatus a {
		display: block;
		padding: 8px 14px;
		border: 1px solid var(--gl-rule);
		border-radius: 999px;
		font-size: 0.8125rem;
		color: var(--gl-ink);
	}

	.gl-apparatus a:hover {
		border-color: var(--gl-base);
		background: var(--gl-paper-warm);
	}
}

.gl-apparatus li { margin-bottom: 9px; }

.gl-apparatus a {
	font-size: 0.875rem;
	line-height: 1.4;
	color: #000;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.gl-apparatus a:hover {
	color: var(--gl-green);
	border-bottom-color: var(--gl-lime);
}

/* ---------- Folds ---------- */

.gl-entry__body { min-width: 0; }

.gl-fold {
	padding-bottom: clamp(32px, 4.5vw, 52px);
	margin-bottom: clamp(32px, 4.5vw, 52px);
	border-bottom: 1px solid var(--gl-rule-soft);
	scroll-margin-top: 32px;
}

.gl-fold:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.gl-prose {
	max-width: var(--gl-measure);
	font-size: 1.0625rem;
	line-height: 1.72;
}

.gl-prose p { margin: 0 0 1.1em; }
.gl-prose p:last-child { margin-bottom: 0; }

.gl-prose a {
	color: var(--gl-green);
	text-decoration: none;
	border-bottom: 1px solid rgba(33, 165, 94, 0.35);
}

.gl-prose a:hover {
	border-bottom-color: var(--gl-lime);
	background: rgba(204, 252, 0, 0.16);
}

.gl-lede {
	font-family: var(--gl-font);
	font-size: 1.1875rem;
	font-weight: 400;
	letter-spacing: -0.014em;
	line-height: 1.5;
	max-width: var(--gl-measure);
	margin: 0 0 22px;
}

/* Webflow-extracted, kept for any residual markup. */
.gl .highlight-block {
	background: var(--gl-paper-warm);
	padding: 20px 24px;
	border-radius: 4px;
}

.gl .glossary-divider {
	display: block;
	width: 100%;
	height: 1px;
	border: 0;
	background: var(--gl-rule-soft);
	margin: 28px 0;
}

/* ---------- Use cases: ruled ledger ---------- */

.gl-cases {
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: var(--gl-measure);
	border-top: 1px solid var(--gl-rule);
}

.gl-cases li {
	position: relative;
	padding: 13px 0 13px 30px;
	border-bottom: 1px solid var(--gl-rule-soft);
	font-size: 0.9875rem;
	line-height: 1.6;
}

.gl-cases li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 21px;
	width: 8px;
	height: 8px;
	background: var(--gl-base);
}

/* ---------- Takeaways ---------- */

.gl-rules {
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: var(--gl-measure);
	display: grid;
	gap: 2px;
}

.gl-rules li {
	position: relative;
	padding: 16px 20px 16px 46px;
	background: var(--gl-paper-warm);
	font-size: 0.9875rem;
	line-height: 1.6;
}

.gl-rules li::before {
	content: "\2192";
	position: absolute;
	left: 20px;
	top: 15px;
	color: var(--gl-green);
	font-size: 1rem;
}

/* ---------- Misreads ---------- */

.gl-misreads {
	display: grid;
	gap: 2px;
	max-width: var(--gl-measure);
}

.gl-misread {
	padding: 20px 24px;
	background: var(--gl-paper-warm);
	border-left: 3px solid var(--gl-base);
}

.gl-misread__claim {
	font-family: var(--gl-font);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.011em;
	line-height: 1.4;
	margin: 0 0 8px;
	display: flex;
	gap: 10px;
	align-items: baseline;
}

.gl-misread__tag {
	font-family: var(--gl-font);
	font-size: 1rem;
	font-weight: 500;
	color: var(--gl-green);
	flex: none;
}

.gl-misread__fix {
	font-size: 0.9375rem;
	line-height: 1.65;
	color: var(--gl-ink-soft);
	padding-left: 24px;
}

.gl-misread__fix p { margin: 0; }

/* ---------- Q&A ---------- */

.gl-qa {
	max-width: var(--gl-measure);
	border-top: 1px solid var(--gl-rule);
}

.gl-q { border-bottom: 1px solid var(--gl-rule); }

.gl-q > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 18px 0;
	cursor: pointer;
	list-style: none;
}

.gl-q > summary::-webkit-details-marker { display: none; }
.gl-q > summary:focus-visible { outline: 2px solid var(--gl-lime); outline-offset: 2px; }

.gl-q__text {
	font-family: var(--gl-font);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.011em;
	line-height: 1.4;
}

.gl-q > summary:hover .gl-q__text { color: var(--gl-green); }

.gl-q__toggle {
	position: relative;
	flex: none;
	width: 14px;
	height: 14px;
}

.gl-q__toggle::before,
.gl-q__toggle::after {
	content: "";
	position: absolute;
	background: var(--gl-green);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.gl-q__toggle::before {
	left: 0; top: 6px;
	width: 14px; height: 2px;
}

.gl-q__toggle::after {
	left: 6px; top: 0;
	width: 2px; height: 14px;
}

.gl-q[open] .gl-q__toggle::after { transform: rotate(90deg); opacity: 0; }

.gl-q__a {
	padding: 0 0 20px;
	font-size: 0.9875rem;
	line-height: 1.7;
	color: var(--gl-ink-soft);
}

.gl-q__a p { margin: 0 0 0.9em; }
.gl-q__a p:last-child { margin-bottom: 0; }

/* ============================================================
   See also
   ============================================================ */

.gl-crossref {
	background: var(--gl-mid);
	color: var(--gl-on-dark);
	padding: clamp(44px, 6vw, 72px) var(--gl-gut);
}

.gl-crossref__inner {
	max-width: 1180px;
	margin: 0 auto;
}

.gl-crossref .gl-eyebrow { color: var(--gl-lime); }

.gl-crossref__list {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0;
	border-top: 1px solid rgba(232, 245, 238, 0.16);
}

.gl-crossref__list li {
	border-bottom: 1px solid rgba(232, 245, 238, 0.16);
}

.gl-crossref__list a {
	display: block;
	padding: 15px 8px 15px 0;
	font-family: var(--gl-font);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: -0.011em;
	color: var(--gl-on-dark);
	text-decoration: none;
	transition: color 0.16s ease, padding-left 0.16s ease;
}

.gl-crossref__list a:hover,
.gl-crossref__list a:focus-visible {
	color: var(--gl-lime);
	padding-left: 12px;
	outline: none;
}

.gl-crossref__more {
	font-family: var(--gl-font);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gl-base);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

.gl-crossref__more:hover { color: var(--gl-lime); }

/* ============================================================
   Pagination
   ============================================================ */

.gl-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: clamp(36px, 5vw, 56px);
	padding-top: 28px;
	border-top: 1px solid var(--gl-rule);
}

.gl-pages .page-numbers {
	font-family: var(--gl-font);
	font-size: 0.8125rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	min-width: 38px;
	padding: 9px 12px;
	text-align: center;
	text-decoration: none;
	color: var(--gl-ink-soft);
	border: 1px solid var(--gl-rule-soft);
	transition: border-color 0.14s ease, color 0.14s ease;
}

.gl-pages .page-numbers:hover {
	border-color: var(--gl-base);
	color: var(--gl-green);
}

.gl-pages .page-numbers.current {
	background: var(--gl-ink);
	border-color: var(--gl-ink);
	color: var(--gl-lime);
}

.gl-pages .page-numbers.dots { border-color: transparent; }

/* ============================================================
   MOBILE PASS
   Breakpoints follow the layouts, not device names:
     760px  thumb rail goes horizontal, grids collapse, gutters tighten
     600px  look-up field and pagination adapt to one hand
     420px  small phones — type and spacing tightened
   ============================================================ */

@media (max-width: 760px) {
	.gl--sectioned {
		grid-template-columns: minmax(0, 1fr);
	}

	.gl-thumbs {
		position: sticky;
		top: 0;
		z-index: 5;
		max-height: none;
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 0;
		align-items: center;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		/* Fade the right edge so it reads as scrollable rather than clipped. */
		mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
	}

	.gl-thumbs__tab { scroll-snap-align: center; }

	.gl-thumbs__home {
		border-bottom: 0;
		border-right: 1px solid rgba(232, 245, 238, 0.14);
		margin: 0;
		padding: 0 14px;
		flex: none;
	}

	.gl-thumbs__tab {
		padding: 14px 13px;
		border-left: 0;
		border-bottom: 2px solid transparent;
		flex: none;
	}

	.gl-thumbs__tab.is-current { border-bottom-color: var(--gl-lime); }


	/* --- Gutters --- */
	.gl,
	.gl--index { --gl-gut: 18px; }

	/* --- Index cover --- */
	.gx-cover {
		padding-top: clamp(36px, 12vw, 64px);
		padding-bottom: 40px;
	}

	.gx-title { margin-bottom: 20px; }

	.gx-standfirst {
		font-size: 1rem;
		line-height: 1.58;
		margin-bottom: 30px;
	}

	/* The two washes are sized for a wide viewport; scale back so the
	   glow does not swamp a narrow screen. */
	.gx-cover__wash { opacity: 0.38; background-size: auto, auto, 56px 100%; }

	/* --- Alphabet wall --- */
	.gx-wall {
		padding-top: 40px;
		padding-bottom: 48px;
	}

	.gx-wall__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		padding-bottom: 16px;
		margin-bottom: 20px;
	}

	.gx-wall__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

	.gx-glyph {
		min-height: 88px;
		padding: 14px 4px 10px;
		gap: 4px;
	}

	/* Rescaled for a five-column grid: clears a 360px viewport with room to
	   spare while keeping enough range for the count to stay readable as size. */
	.gx-glyph__char { font-size: calc(1.625rem + (var(--w, 0.5) * 2.25rem)); }
	.gx-glyph__count { font-size: 0.625rem; letter-spacing: 0.06em; }

	/* Dimming siblings depends on hover, which touch does not have. */
	.gx-wall__grid:hover .gx-glyph { opacity: 1; }

	/* --- Cornerstone + recent --- */
	.gx-start { padding-top: 44px; padding-bottom: 44px; }
	.gx-card { padding: 24px 20px 22px; }
	.gx-card__index { margin-bottom: 14px; }
	.gx-card__title { font-size: 1.25rem; }
	.gx-card__sense { margin-bottom: 20px; }
	.gx-recent { padding-top: 36px; padding-bottom: 40px; }

	/* --- Letter archive --- */
	.gl-section-body { padding-top: 28px; padding-bottom: 48px; }

	.gl-section-head__row { gap: 16px; }
	.gl-bigletter { font-size: clamp(3.25rem, 18vw, 5rem); }
	.gl-section-head {
		padding-bottom: 20px;
		margin-bottom: 24px;
	}

	.gl-azn { padding-bottom: 20px; margin-bottom: 24px; }

	/* --- Single entry --- */
	.gl-entry { padding-top: 24px; padding-bottom: 48px; }

	.gl-entry__head {
		padding-bottom: 22px;
		margin-bottom: 26px;
	}

	.gl-headword { margin-bottom: 18px; }

	.gl-sense { gap: 12px; }
	.gl-sense__text { font-size: 1.0625rem; line-height: 1.58; }

	.gl-fold {
		padding-bottom: 28px;
		margin-bottom: 28px;
	}

	.gl-prose { font-size: 1rem; line-height: 1.68; }

	.gl-misread { padding: 18px 18px 18px 20px; }
	.gl-misread__fix { padding-left: 0; }
	.gl-rules li { padding: 14px 16px 14px 40px; }
	.gl-rules li::before { left: 16px; }

	.gl-q > summary { padding: 16px 0; gap: 14px; }

	.gl-crossref { padding-top: 40px; padding-bottom: 44px; }
	.gl-crossref__list { grid-template-columns: minmax(0, 1fr); }
	.gl-crossref__list a { padding: 13px 0; }
}

@media (max-width: 600px) {

	/* --- Recent list: two lines rather than dropping the date --- */
	.gx-recent__list a {
		grid-template-columns: 32px minmax(0, 1fr);
		grid-template-areas: "tag word" ". date";
		gap: 4px 14px;
		padding: 13px 0;
	}

	.gx-recent__tag  { grid-area: tag; align-self: start; margin-top: 2px; }
	.gx-recent__word { grid-area: word; }
	.gx-recent__date { grid-area: date; }

	/* --- Look-up field: keep the label readable, shrink the action --- */
	.gx-find__row { gap: 4px; }

	.gx-find button {
		padding-left: 12px;
		font-size: 0.6875rem;
		letter-spacing: 0.08em;
	}

	.gx-find input[type="search"] {
		/* Must stay at or above 16px or iOS zooms the viewport on focus. */
		font-size: 1.0625rem;
		padding: 11px 2px;
	}

	.gx-results { padding-top: 36px; padding-bottom: 36px; }

	.gx-results__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding-bottom: 16px;
	}

	.gx-results__title { font-size: 1.375rem; }

	/* --- Pagination: even, tappable, wraps cleanly --- */
	.gl-pages { gap: 6px; justify-content: flex-start; }

	.gl-pages .page-numbers {
		min-width: 42px;
		padding: 11px 10px;
	}
}

@media (max-width: 420px) {

	.gl,
	.gl--index { --gl-gut: 15px; }

	.gx-title { font-size: 2.625rem; letter-spacing: -0.04em; }
	.gx-title__bold { letter-spacing: -0.045em; }

	/* Four across gives each letter a little more room to breathe. */
	.gx-wall__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

	.gx-ledger dd { font-size: 1.125rem; }

	.gl-headword { font-size: 2.0625rem; letter-spacing: -0.035em; }

	.gl-entries--cards .gl-entries__item a { padding: 18px 18px 20px; }
	.gl-entries--cards .gl-entries__word { font-size: 1.0625rem; }

	.gl-section-head__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.gl-bigletter { line-height: 0.85; }

	.gl-thumbs__tab { padding: 13px 11px; font-size: 0.875rem; }
	.gl-thumbs__home { padding: 0 12px; }
}

/* Touch devices of any width: hover states either stick or never fire, so
   the wall dimming is disabled and cards fall back to their resting style. */
@media (hover: none) {
	.gx-wall__grid:hover .gx-glyph { opacity: 1; }
	.gx-card:hover { background: var(--gl-paper); color: var(--gl-ink); }
	.gx-card:hover .gx-card__index,
	.gx-card:hover .gx-card__go { color: var(--gl-green); }
	.gx-card:hover .gx-card__sense { color: var(--gl-ink-soft); }
	.gl-entries__item a:hover { padding-left: 0; }
	.gl-entries--cards .gl-entries__item a:hover { padding-left: 24px; }
	.gx-recent__list a:hover { padding-left: 0; }
}

/* Notched phones in landscape. */
@supports (padding: max(0px)) {
	@media (max-width: 760px) {
		.gx-cover,
		.gx-wall,
		.gx-start,
		.gx-recent,
		.gx-results,
		.gl-section-body,
		.gl-entry,
		.gl-crossref {
			padding-left: max(var(--gl-gut), env(safe-area-inset-left));
			padding-right: max(var(--gl-gut), env(safe-area-inset-right));
		}
	}
}

/* ============================================================
   Accessibility
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.gl *,
	.gl *::before,
	.gl *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

.gl a:focus-visible {
	outline: 2px solid var(--gl-green);
	outline-offset: 2px;
}

.gx-cover a:focus-visible,
.gl-crossref a:focus-visible,
.gl-thumbs a:focus-visible {
	outline-color: var(--gl-lime);
	box-shadow: 0 0 0 4px var(--gl-lime-glow);
}



@media print {
	.gl-thumbs,
	.gl-apparatus,
	.gx-find,
	.gl-pages,
	.gl-crossref { display: none; }

	.gl--sectioned { grid-template-columns: 1fr; }
	.gx-cover,
	.gx-recent { background: none; color: var(--gl-ink); }
	.gl-q__a { display: block; }
}