/**
 * DUI Glossary
 *
 * Scoped to .glossary-index and .glossary-single so nothing leaks into the
 * rest of the site. Colours follow the existing brand palette.
 */

:root {
	--glossary-orange: #e6701a;
	--glossary-navy: #2c3448;
	--glossary-gold: #ccbd99;
	--glossary-ink: #232323;
	--glossary-muted: #5a6170;
	--glossary-fill: #f6f7f8;
	--glossary-fill-hover: #eceef1;
	--glossary-tint: #f6f3ec;
	/* Height of the fixed site header — the sticky A-Z bar parks beneath it. */
	--glossary-sticky-top: 80px;
}

/* ----------------------------------------------------------------- Hero -- */

/* The theme's header sits on top of the first section, so the hero pads itself
   past it (--glossary-sticky-top is that header's height). */
.glossary-hero {
	padding: calc(var(--glossary-sticky-top) + 46px) 0 46px;
	background: var(--glossary-navy);
	color: #fff;
}

.glossary-hero__breadcrumb {
	margin: 0 0 14px;
	color: rgba(255, 255, 255, .7);
	font-size: 14px;
}

.glossary-hero__breadcrumb a {
	color: rgba(255, 255, 255, .7);
	text-decoration: underline;
}

.glossary-hero__breadcrumb a:hover,
.glossary-hero__breadcrumb a:focus-visible {
	color: #fff;
}

.glossary-hero__breadcrumb .breadcrumb_last {
	color: var(--glossary-gold);
}

.glossary-hero__sep {
	padding: 0 6px;
	opacity: .5;
}

.glossary-hero__title {
	margin: 0;
	color: #fff;
	font-size: 44px;
	line-height: 1.15;
}

/* ---------------------------------------------------------------- Index -- */

.glossary-index {
	padding-top: 0;
}

.glossary-index .container > .glossary-group:first-of-type {
	margin-top: 8px;
}

.glossary-alpha {
	position: sticky;
	top: var(--glossary-sticky-top);
	z-index: 5;
	margin: 0 0 24px;
	padding: 12px 0;
	background: #fff;
	box-shadow: 0 1px 0 rgba(35, 35, 35, .1);
}

.glossary-alpha__inner {
	display: grid;
	grid-template-columns: repeat(26, minmax(0, 1fr));
	gap: 5px;
}

.glossary-alpha__item {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 38px;
	background: var(--glossary-fill);
	color: var(--glossary-ink);
	font-size: 15px;
	font-weight: 900;
	line-height: 1;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

a.glossary-alpha__item:hover,
a.glossary-alpha__item:focus-visible {
	background: var(--glossary-orange);
	color: #fff;
	text-decoration: none;
}

.glossary-alpha__item.is-empty {
	color: rgba(35, 35, 35, .28);
}

.glossary-group {
	scroll-margin-top: calc(var(--glossary-sticky-top) + 80px);
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	align-items: start;
	margin: 0 0 44px;
}

.glossary-group__letter {
	margin: 0;
	padding-top: 14px;
	color: var(--glossary-orange);
	font-size: 34px;
	font-weight: 900;
	line-height: 1;
}

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

.glossary-links__item {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.glossary-links__item::before {
	content: none;
}

.glossary-link {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 73px;
	padding: 24px;
	background: var(--glossary-fill);
	color: var(--glossary-ink);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.glossary-link:hover,
.glossary-link:focus-visible {
	background: var(--glossary-fill-hover);
	color: var(--glossary-orange);
	text-decoration: none;
}

/* The parent theme sets `margin: 0 160px` on content divs — reset it so the
   text block lines up with the heading and the tiles above it. */
.glossary-index .glossary-index__content {
	max-width: 820px;
	margin: 8px 0 0;
}

/* The theme gives .wraper_blog_main > .container 70px top and only 30px
   bottom; even them up so the section breathes the same at both ends. */
.glossary-single > .container,
.glossary-index > .container {
	padding-bottom: 70px;
}

/* ------------------------------------------------------------ Term page -- */

.glossary-definition {
	margin: 0 0 28px;
	padding: 30px 32px;
	border-left: 4px solid var(--glossary-orange);
	background: var(--glossary-fill);
}

.glossary-definition__title {
	margin: 0 0 14px;
	font-size: 34px;
	line-height: 1.2;
}

.glossary-definition__text {
	margin: 0;
	font-size: 19px;
	line-height: 1.6;
}

.glossary-toc {
	margin: 0 0 36px;
	padding: 22px 26px;
	background: var(--glossary-tint);
}

.glossary-toc__title {
	margin: 0 0 12px;
	color: var(--glossary-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.glossary-toc__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.glossary-toc__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.glossary-toc__item::before {
	content: none;
}

.glossary-toc__item a {
	color: var(--glossary-navy);
	font-weight: 600;
	text-decoration: underline;
}

.glossary-toc__item a:hover,
.glossary-toc__item a:focus-visible {
	color: var(--glossary-orange);
}

.glossary-body h2 {
	margin: 40px 0 16px;
	scroll-margin-top: 120px;
}

.glossary-body h3 {
	margin: 28px 0 12px;
}

.glossary-body p,
.glossary-body li {
	line-height: 1.7;
}

/* Content tables — the glossary copy uses label/description pairs. */
.glossary-table {
	margin: 28px 0;
	padding: 0;
	overflow-x: auto;
}

.glossary-body table {
	width: 100%;
	margin: 0;
	border: none;
	border-collapse: collapse;
	font-size: 16px;
}

.glossary-body table th,
.glossary-body table td {
	padding: 16px 20px;
	border: none;
	box-shadow: inset 0 -1px 0 rgba(35, 35, 35, .1);
	text-align: left;
	vertical-align: top;
	line-height: 1.6;
}

.glossary-body table tr:last-child th,
.glossary-body table tr:last-child td {
	box-shadow: none;
}

.glossary-body table th[scope="row"] {
	width: 34%;
	background: var(--glossary-fill);
	color: var(--glossary-ink);
	font-weight: 700;
}

.glossary-body table td {
	background: #fff;
	color: var(--glossary-muted);
}

/* Content lists */
.glossary-body ul {
	margin: 18px 0;
	padding: 0;
	list-style: none;
}

.glossary-body ul > li {
	position: relative;
	margin: 0 0 10px;
	padding: 0 0 0 24px;
	list-style: none;
}

.glossary-body ul > li::before {
	content: "";
	position: absolute;
	top: .6em;
	left: 0;
	width: 8px;
	height: 8px;
	background: var(--glossary-orange);
}

.glossary-body ol {
	margin: 18px 0 18px 20px;
}

.glossary-body ol > li {
	margin: 0 0 10px;
	padding-left: 6px;
}

.glossary-body a {
	color: var(--glossary-orange);
	text-decoration: underline;
}

.glossary-body strong {
	color: var(--glossary-ink);
}

/* -------------------------------------------------------------- Sidebar -- */

/* Content and sidebar start on the same line. */
.glossary-single__row {
	display: flex;
	flex-wrap: wrap;
}

.glossary-sidebar {
	margin-top: 0;
}

.glossary-single .glossary-definition,
.glossary-single .glossary-related,
.glossary-single .glossary-cta {
	margin-top: 0;
}

.glossary-related {
	margin: 0 0 24px;
	background: var(--glossary-fill);
}

.glossary-related__title {
	margin: 0;
	padding: 22px 24px 14px;
	color: var(--glossary-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.glossary-related__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.glossary-related__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.glossary-related__item + .glossary-related__item {
	box-shadow: inset 0 1px 0 rgba(35, 35, 35, .08);
}

.glossary-related__item::before {
	content: none;
}

.glossary-related__item a {
	display: block;
	padding: 15px 24px;
	color: var(--glossary-ink);
	font-weight: 600;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.glossary-related__item a:hover,
.glossary-related__item a:focus-visible {
	background: var(--glossary-fill-hover);
	color: var(--glossary-orange);
	text-decoration: underline;
}

.glossary-cta {
	padding: 28px 26px 26px;
	background: var(--glossary-navy);
	color: #fff;
}

.glossary-cta__title {
	margin: 0 0 14px;
	color: var(--glossary-gold);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.glossary-cta__text {
	margin: 0 0 22px;
	color: #fff;
	font-size: 16px;
	line-height: 1.6;
}

.glossary-cta__button {
	display: block;
	padding: 16px 20px;
	background: var(--glossary-orange);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background-color .15s ease;
}

.glossary-cta__button:hover,
.glossary-cta__button:focus-visible {
	background: #cf6115;
	color: #fff;
	text-decoration: none;
}

.glossary-cta__note {
	margin: 12px 0 0;
	color: rgba(255, 255, 255, .75);
	font-size: 13px;
	text-align: center;
}

/* --------------------------------------------------------------- Pager -- */

.glossary-pager {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	margin: 48px 0 0;
}

/* Explicit columns: with only a previous or only a next link, it stays on its
   own side instead of sliding to the middle. */
.glossary-pager__link {
	display: flex;
	align-items: center;
	justify-self: stretch;
	box-sizing: border-box;
	width: 100%;
	gap: 12px;
	margin: 0 !important;
	padding: 18px 22px;
	text-align: left;
	background: var(--glossary-fill);
	color: var(--glossary-ink);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.glossary-pager__link--prev {
	grid-column: 1;
	justify-content: flex-start;
}

.glossary-pager__link--next {
	grid-column: 2;
	justify-content: flex-end;
	text-align: right;
}

.glossary-pager__link:hover,
.glossary-pager__link:focus-visible {
	background: var(--glossary-fill-hover);
	color: var(--glossary-orange);
	text-decoration: none;
}

.glossary-pager__arrow {
	flex: none;
	color: var(--glossary-orange);
	font-size: 22px;
	line-height: 1;
}

.glossary-pager__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	min-width: 0;
}

.glossary-pager__link--next .glossary-pager__meta {
	align-items: flex-end;
}

.glossary-pager__label {
	color: var(--glossary-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.glossary-pager__title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

/* -------------------------------------------------- Term page footer -- */

/* ------------------------------------------------- Contact block (footer) -- */

/* Full-bleed: the form panel meets the left edge of the viewport, the map runs
   to the right edge, both the same height. */
.glossary-contact {
	margin-top: 64px;
}

.glossary-contact__grid {
	display: grid;
	grid-template-columns: 480fr 520fr;
	align-items: stretch;
	gap: 0;
	min-height: 520px;
}

/* The panel is full-bleed, but its contents line up with the site's container
   so the form's left edge matches the hero, tiles and body copy above it.
   Bootstrap 3 container widths: 750 / 970 / 1170, each with 15px padding. */
.glossary-contact {
	--glossary-container: 100vw;
}

@media (min-width: 768px) {
	.glossary-contact {
		--glossary-container: 750px;
	}
}

@media (min-width: 992px) {
	.glossary-contact {
		--glossary-container: 970px;
	}
}

@media (min-width: 1200px) {
	.glossary-contact {
		--glossary-container: 1170px;
	}
}

/* The parent theme puts horizontal margins on content divs, which stops these
   filling their grid tracks — hence the explicit resets. */
.glossary-contact__panel {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	justify-self: stretch;
	box-sizing: border-box;
	width: 100%;
	margin: 0 !important;
	padding: 72px 80px 72px max(24px, calc((100vw - var(--glossary-container)) / 2 + 15px));
	background: #d2dadd;
}

.glossary-contact__inner {
	width: 100%;
	max-width: 600px;
	margin: 0 !important;
}

.glossary-contact__title {
	margin: 0 0 26px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.2;
}

.glossary-contact__title + .glossary-contact__intro {
	margin: -16px 0 22px;
	color: #444b57;
	font-size: 16px;
	line-height: 1.6;
}

/* Fields stack: the panel is too narrow for the theme's side-by-side rows. */
.glossary-contact__form .row > [class*="col-"] {
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
}

.glossary-contact__form p {
	margin: 0 0 14px;
}

.glossary-contact__form input[type="text"],
.glossary-contact__form input[type="email"],
.glossary-contact__form input[type="tel"],
.glossary-contact__form input[type="url"],
.glossary-contact__form input[type="number"],
.glossary-contact__form select,
.glossary-contact__form textarea {
	width: 100%;
	margin: 0 0 12px;
	padding: 13px 16px;
	border: 1px solid #b9c4c9;
	border-radius: 0;
	background: #fff;
	color: var(--glossary-ink);
	font-size: 16px;
	line-height: 1.4;
	text-indent: 0;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.glossary-contact__form textarea {
	min-height: 0;
	height: 120px !important;
	resize: vertical;
}

.glossary-contact__form input:focus,
.glossary-contact__form select:focus,
.glossary-contact__form textarea:focus {
	border-color: var(--glossary-orange);
	box-shadow: 0 0 0 3px rgba(230, 112, 26, .18);
	outline: none;
}

.glossary-contact__form ::placeholder {
	color: #7b838f;
	opacity: 1;
}

/* The theme's own submit styling wins on specificity and paints the label
   transparent, so these rules are deliberately specific. */
.glossary-contact .glossary-contact__form input[type="submit"],
.glossary-contact .glossary-contact__form .wpcf7-submit,
.glossary-contact .glossary-contact__form .custom-btn-submit {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	margin: 6px 0 0 !important;
	padding: 16px 32px !important;
	border: none !important;
	border-radius: 0 !important;
	background: var(--glossary-orange) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	letter-spacing: .04em;
	text-indent: 0 !important;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 1 !important;
	transition: background-color .15s ease;
}

.glossary-contact .glossary-contact__form input[type="submit"]:hover,
.glossary-contact .glossary-contact__form .wpcf7-submit:hover,
.glossary-contact .glossary-contact__form input[type="submit"]:focus-visible,
.glossary-contact .glossary-contact__form .wpcf7-submit:focus-visible {
	background: #cf6115 !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

.glossary-contact__form .wpcf7-not-valid-tip {
	margin: -8px 0 10px;
	color: #a3180b;
	font-size: 14px;
}

.glossary-contact__form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 12px 16px;
	border: none;
	background: #fff;
	font-size: 15px;
}

.glossary-contact__form .wpcf7-spinner {
	display: block;
	margin: 10px auto 0;
}

.glossary-contact__map {
	position: relative;
	justify-self: stretch;
	width: 100%;
	min-height: 520px;
	overflow: hidden;
	line-height: 0;
}

.glossary-contact__map iframe,
.glossary-contact__map .wpgmza_map {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

/* ------------------------------------------------------------- Responsive */

/* --- Small desktop / large tablet ------------------------------------- */
@media (max-width: 1199px) {
	.glossary-hero__title {
		font-size: 38px;
	}

	.glossary-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* --- Tablet ------------------------------------------------------------ */
@media (max-width: 991px) {
	.glossary-hero {
		padding: calc(var(--glossary-sticky-top) + 28px) 0 32px;
	}

	.glossary-hero__title {
		font-size: 32px;
	}

	/* 26 across is unreadable here; two shorter rows instead. */
	.glossary-alpha__inner {
		grid-template-columns: repeat(13, minmax(0, 1fr));
		gap: 4px;
	}

	.glossary-alpha__item {
		height: 34px;
		font-size: 14px;
	}

	.glossary-sidebar {
		margin-top: 40px;
	}

	.glossary-definition {
		padding: 24px;
	}

	.glossary-definition__title {
		font-size: 28px;
	}

	.glossary-definition__text {
		font-size: 17px;
	}

	/* Form above, map below. */
	.glossary-contact__grid {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}

	.glossary-contact__panel {
		justify-content: center;
		padding: 48px 32px;
	}

	.glossary-contact__inner {
		max-width: 640px;
	}

	.glossary-contact__map {
		min-height: 360px;
	}

	.glossary-single > .container,
	.glossary-index > .container {
		padding-top: 50px;
		padding-bottom: 50px;
	}
}

/* --- Large phone / small tablet ---------------------------------------- */
@media (max-width: 767px) {
	.glossary-hero__title {
		font-size: 28px;
	}

	.glossary-alpha__inner {
		grid-template-columns: repeat(9, minmax(0, 1fr));
	}

	.glossary-group {
		grid-template-columns: 48px minmax(0, 1fr);
	}

	.glossary-group__letter {
		font-size: 28px;
	}

	.glossary-link {
		min-height: 64px;
		padding: 18px 20px;
		font-size: 18px;
	}

	/* Previous / next stack in reading order. */
	.glossary-pager {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.glossary-pager__link--prev,
	.glossary-pager__link--next {
		grid-column: 1;
	}

	.glossary-pager__link--next {
		justify-content: flex-start;
		text-align: left;
	}

	.glossary-pager__link--next .glossary-pager__meta {
		align-items: flex-start;
	}

	/* Arrow first on both, so the stacked pair reads consistently. */
	.glossary-pager__link--next .glossary-pager__arrow {
		order: -1;
	}
}

/* --- Phone -------------------------------------------------------------- */
@media (max-width: 575px) {
	.glossary-hero {
		padding: calc(var(--glossary-sticky-top) + 20px) 0 26px;
	}

	.glossary-hero__title {
		font-size: 25px;
	}

	.glossary-alpha {
		margin-bottom: 20px;
		padding: 10px 0;
	}

	.glossary-alpha__inner {
		grid-template-columns: repeat(7, minmax(0, 1fr));
	}

	.glossary-group {
		grid-template-columns: minmax(0, 1fr);
	}

	.glossary-group__letter {
		padding: 0 0 12px;
	}

	.glossary-links {
		grid-template-columns: minmax(0, 1fr);
	}

	.glossary-definition {
		padding: 20px;
	}

	.glossary-toc {
		padding: 18px 20px;
	}

	.glossary-contact__panel {
		padding: 36px 20px;
	}

	.glossary-contact__title {
		font-size: 25px;
		margin-bottom: 20px;
	}

	.glossary-contact__map {
		min-height: 280px;
	}

	/* Tables: label column would be unreadably narrow, so rows stack. */
	.glossary-body table,
	.glossary-body table tbody,
	.glossary-body table tr,
	.glossary-body table th,
	.glossary-body table td {
		display: block;
		width: 100%;
	}

	.glossary-body table tr {
		margin: 0 0 14px;
	}

	.glossary-body table th[scope="row"] {
		width: 100%;
		padding: 12px 16px;
		box-shadow: none;
	}

	.glossary-body table td {
		padding: 12px 16px;
		box-shadow: none;
	}

	.glossary-table {
		overflow-x: visible;
	}

	.glossary-single > .container,
	.glossary-index > .container {
		padding-top: 38px;
		padding-bottom: 38px;
	}
}
