/**
 * Defyne Glossary Creator — default front-end styles.
 *
 * Design intent: structure, not identity. Typography and color are pulled
 * from the active theme wherever possible (font-family: inherit, color:
 * inherit) so the glossary never looks bolted-on. The handful of custom
 * properties below give a theme an easy, single-point way to restyle the
 * accent without fighting specificity — just redeclare them on :root or
 * .defyne-glossary in the theme's own stylesheet.
 */

.defyne-glossary {
	--defyne-accent: #2c5f8a;
	--defyne-accent-soft: #eef3f7;
	--defyne-border: #e2e2e2;
	--defyne-muted: #6b6b6b;
	--defyne-radius: 6px;

	/*
	 * Deliberately no fixed pixel cap here. The theme's own template
	 * already defines the content column width (sometimes 700px,
	 * sometimes 1200px, sometimes full-bleed) — this block should fill
	 * exactly that space, not compete with it. If a site owner wants a
	 * narrower reading column on a wide theme, they can set
	 * --defyne-max-width on .defyne-glossary in their theme's own CSS;
	 * we never set an opinionated default here.
	 */
	max-width: var(--defyne-max-width, 100%);
	width: 100%;
	box-sizing: border-box;
	margin: 0 auto;
	padding: 2rem 1.25rem 4rem;
	color: inherit;
	font-family: inherit;
	line-height: 1.6;
}

.defyne-glossary a {
	color: var(--defyne-accent);
}

/* ---------- Shared header ---------- */

.defyne-index-header {
	margin-bottom: 1.5rem;
}

.defyne-index-title,
.defyne-term-title {
	font-size: 2rem;
	line-height: 1.15;
	margin: 0 0 0.5rem;
}

.defyne-index-intro {
	color: var(--defyne-muted);
	max-width: 640px;
	margin: 0;
}

.defyne-breadcrumb {
	font-size: 0.85rem;
	color: var(--defyne-muted);
	margin: 0 0 1.25rem;
}

.defyne-breadcrumb a {
	text-decoration: none;
}

.defyne-breadcrumb a:hover {
	text-decoration: underline;
}

/* ---------- Alphabet nav ---------- */

.defyne-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 1.5rem 0 2.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--defyne-border);
}

.defyne-alphabet-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.5rem;
	border-radius: var(--defyne-radius);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid var(--defyne-border);
}

a.defyne-alphabet-link.is-active {
	background: var(--defyne-accent-soft);
	color: var(--defyne-accent);
	border-color: var(--defyne-accent-soft);
}

a.defyne-alphabet-link.is-active:hover {
	background: var(--defyne-accent);
	color: #fff;
}

span.defyne-alphabet-link.is-inactive {
	color: var(--defyne-border);
	background: transparent;
}

/* ---------- Letter sections (index page) ---------- */

.defyne-letter-section {
	margin-bottom: 2.75rem;
	scroll-margin-top: 2rem;
}

.defyne-letter-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid var(--defyne-border);
	padding-bottom: 0.5rem;
	margin-bottom: 1rem;
}

.defyne-letter-heading {
	font-size: 1.5rem;
	margin: 0;
}

.defyne-view-all {
	font-size: 0.85rem;
	white-space: nowrap;
	text-decoration: none;
}

.defyne-view-all:hover {
	text-decoration: underline;
}

/* ---------- Term grid ---------- */

.defyne-term-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.defyne-term-grid--wide {
	grid-template-columns: repeat(3, 1fr);
}

.defyne-term-card {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--defyne-border);
	border-radius: var(--defyne-radius);
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.defyne-term-card:hover {
	border-color: var(--defyne-accent);
	background: var(--defyne-accent-soft);
}

.defyne-term-name {
	font-weight: 700;
	color: var(--defyne-accent);
}

.defyne-term-quick {
	font-size: 0.85rem;
	color: var(--defyne-muted);
	line-height: 1.45;
}

.defyne-empty-state {
	padding: 2rem 0;
	color: var(--defyne-muted);
}

/* ---------- Pagination ---------- */

.defyne-pagination {
	margin-top: 2.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.defyne-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	border: 1px solid var(--defyne-border);
	border-radius: var(--defyne-radius);
	text-decoration: none;
	font-size: 0.9rem;
	color: inherit;
}

.defyne-pagination .page-numbers.current {
	background: var(--defyne-accent);
	border-color: var(--defyne-accent);
	color: #fff;
}

.defyne-pagination .page-numbers:not(.current):hover {
	border-color: var(--defyne-accent);
}

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

.defyne-term-header {
	margin-bottom: 1.25rem;
}

.defyne-term-image {
	margin-bottom: 1.5rem;
}

.defyne-term-image img {
	border-radius: var(--defyne-radius);
	max-width: 100%;
	height: auto;
}

.defyne-quick-definition {
	border-left: 3px solid var(--defyne-accent);
	background: var(--defyne-accent-soft);
	border-radius: 0 var(--defyne-radius) var(--defyne-radius) 0;
	padding: 1rem 1.25rem;
	margin-bottom: 1.75rem;
}

.defyne-quick-definition p {
	margin: 0;
	font-size: 1.05rem;
}

.defyne-term-content {
	font-size: 1rem;
}

.defyne-term-content :first-child {
	margin-top: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
	.defyne-term-grid,
	.defyne-term-grid--wide {
		grid-template-columns: 1fr;
	}

	.defyne-letter-section-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.3rem;
	}
}
