/* =========================================================================
   Technical documents: template-document-library.php.
   Scoped to .td. Mobile first, min-width queries at 640 / 768 / 900 / 1200.
   House style from the 18 Sep 2026 spec (the .sg/.wb/.su/.cr common
   denominator): navy #181d46, light blue #90cdeb, 2px buttons, 4px cards,
   Green Grey closing band.
   ========================================================================= */

.td {
	--td-navy: #181d46;      /* Billi Blue */
	--td-lightblue: #90cdeb; /* primary button on dark, accents */
	--td-grey: #eaeaea;      /* borders, rules */
	--td-band-grey: #f5f5f5;
	--td-band-tint: #f1f5f5; /* Green Grey */
	--td-text: #000;
	--td-muted: #75757b;
	--td-gutter: 20px;
	font-family: var(--font-din);
	color: var(--td-text);
	line-height: 1.5;
}

@media (min-width: 900px) {
	.td { --td-gutter: 40px; }
}

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

/* framework.css sets a global img { width: 100% }: width must be reset, not
   just max-width. */
.td img { max-width: 100%; width: auto; height: auto; display: block; }

.td-container {
	width: 100%;
	max-width: 1436px;
	margin: 0 auto;
	padding-left: var(--td-gutter);
	padding-right: var(--td-gutter);
}

/* The filter script hides rows and groups with the hidden attribute, and the
   UA rule behind it loses to any display declaration. */
.td [hidden] { display: none !important; }

.td-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.td :is(button, input) { font-family: inherit; }


/* ---- Section scaffolding ------------------------------------------------ */

.td :is(h2, h3) {
	margin-top: 0;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.td .td-section-heading {
	margin: 0 0 12px;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.18;
	color: var(--td-navy);
}

.td-section-intro {
	margin: 0;
	max-width: 66ch;
	font-size: 17px;
	line-height: 1.55;
	color: var(--td-muted);
}

@media (min-width: 900px) {
	.td .td-section-heading { font-size: 34px; }
}


/* ---- Buttons ------------------------------------------------------------
   desktop.css has a global a:hover { opacity: .7 }: every button opts out. */

/* 16px on a 1.5 line with 12px padding: 48px tall, the size the homepage,
   Why Billi, Specify Billi and the sector pages use. */
.td .td-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 28px;
	border: 0;
	border-radius: 2px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.td .td-btn:hover,
.td .td-btn:focus-visible { opacity: 1; }

.td .td-btn--navy { background: var(--td-navy); color: #fff; }
.td .td-btn--navy:hover,
.td .td-btn--navy:focus-visible { background: #fff; color: var(--td-navy); box-shadow: inset 0 0 0 1px var(--td-navy); }

.td .td-btn--light { background: var(--td-lightblue); color: var(--td-navy); }
.td .td-btn--light:hover,
.td .td-btn--light:focus-visible { background: #fff; color: var(--td-navy); }

.td .td-btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.td .td-btn--ghost:hover,
.td .td-btn--ghost:focus-visible { background: #fff; color: var(--td-navy); box-shadow: none; }

.td .td-btn--outline { background: transparent; color: var(--td-navy); box-shadow: inset 0 0 0 1px var(--td-navy); }
.td .td-btn--outline:hover,
.td .td-btn--outline:focus-visible { background: var(--td-navy); color: #fff; }

/* framework.css removes focus outlines sitewide. Navy on light grounds
   (#90cdeb on white is 1.7:1), white on the navy hero. */
.td :is(a, button, summary, input, select, textarea):focus-visible {
	outline: 2px solid var(--td-navy);
	outline-offset: 3px;
}

.td .td-hero :is(a, button):focus-visible { outline-color: #fff; }


/* ---- Hero ----------------------------------------------------------------
   Navy, no photograph: the old banner was a 1400x253 clip-art strip. The h1
   takes DM Serif Display from typography.css, so neither its weight nor its
   family is set here. */

.td-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 340px;
	background: var(--td-navy);
	color: #fff;
	overflow: hidden;
}

.td-hero__inner { width: 100%; padding-top: 48px; padding-bottom: 48px; }

.td-hero__content { max-width: 720px; }

.td-hero__eyebrow {
	margin: 0 0 12px;
	color: var(--td-lightblue);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.td .td-hero__title { margin: 0; color: #fff; font-size: 34px; line-height: 1.12; }

.td-hero__intro {
	margin: 16px 0 0;
	max-width: 62ch;
	color: rgba(255, 255, 255, .9);
	font-size: 17px;
	line-height: 1.5;
}

.td-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.td-hero__actions:empty { display: none; }

@media (min-width: 900px) {
	.td-hero__inner { padding-top: 72px; padding-bottom: 72px; }
	.td .td-hero__title { font-size: 52px; }
	.td-hero__intro { font-size: 18px; }
}


/* ---- Library ------------------------------------------------------------ */

.td-library { padding: 48px 0; }

/* "Find a document" and the range headings are jump targets: clear the fixed
   header and the trust strip under it. */
.td-library,
.td-group {
	scroll-margin-top: calc(var(--header-chrome-h, 74px) + var(--trust-bar-h, 46px) + 16px);
}

.td-library__head { margin-bottom: 24px; }

@media (min-width: 900px) {
	.td-library { padding: 80px 0; }
	.td-library__head { margin-bottom: 32px; }
}


/* ---- Filter panel ------------------------------------------------------- */

.td-filters {
	display: grid;
	gap: 18px;
	margin-bottom: 40px;
	padding: 20px;
	border-radius: 4px;
	background: var(--td-band-tint);
}

.td-filters__row { display: grid; gap: 8px; min-width: 0; }

.td .td-filters__label {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--td-navy);
}

.td-search { position: relative; max-width: 560px; }

.td-search__icon {
	position: absolute;
	top: 50%;
	left: 15px;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	color: var(--td-muted);
	pointer-events: none;
}

.td .td-search__input {
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 16px 10px 42px;
	font-size: 16px; /* 16px stops iOS zooming into the field */
	line-height: 1.3;
	color: var(--td-text);
	background: #fff;
	border: 1px solid #c9ccd6;
	border-radius: 2px;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.td .td-search__input::placeholder { color: var(--td-muted); opacity: 1; }

.td .td-search__input:focus { border-color: var(--td-navy); }

/* The chip rows scroll sideways on small screens rather than stacking six
   rows deep, and bleed to the panel's edge so the cut-off chip shows there is
   more to the right. */
.td-chips {
	display: flex;
	gap: 8px;
	margin: 0 -20px;
	padding: 2px 20px 4px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.td-chips::-webkit-scrollbar { display: none; }

.td .td-chip {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	margin: 0;
	padding: 8px 16px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--td-navy);
	white-space: nowrap;
	background: #fff;
	border: 1px solid var(--td-navy);
	border-radius: 2px;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.td .td-chip:hover { background: var(--td-lightblue); border-color: var(--td-lightblue); }

.td .td-chip.is-active,
.td .td-chip.is-active:hover {
	color: #fff;
	background: var(--td-navy);
	border-color: var(--td-navy);
}

/* Nothing behind it with the other filters as they are. Still pressable, so
   it can be combined, just quieter. */
.td .td-chip.is-empty { color: var(--td-muted); border-color: #c9ccd6; }

.td-chip__n { font-size: 13px; color: var(--td-muted); }

.td .td-chip:hover .td-chip__n { color: var(--td-navy); }
.td .td-chip.is-active .td-chip__n { color: var(--td-lightblue); }

.td-filters__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding-top: 14px;
	border-top: 1px solid #dde3e3;
}

.td .td-count {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--td-navy);
}

.td .td-clear {
	margin: 0;
	padding: 4px 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--td-navy);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	cursor: pointer;
}

.td .td-clear:hover { color: #3d4a8a; }

@media (min-width: 900px) {
	.td-filters { gap: 20px; padding: 28px 32px; }

	.td-filters__row {
		grid-template-columns: 150px minmax(0, 1fr);
		align-items: start;
		gap: 24px;
	}

	.td .td-filters__label { padding-top: 11px; }
	.td-filters__row--search .td-filters__label { padding-top: 14px; }

	.td-chips { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
}


/* ---- Groups and rows ---------------------------------------------------- */

.td-group + .td-group { margin-top: 48px; }

.td-group__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--td-navy);
}

.td .td-group__title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--td-navy);
}

.td .td-group__count {
	margin: 0;
	font-size: 15px;
	color: var(--td-muted);
}

.td-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-doc {
	min-width: 0;
	margin: 0;
	border-bottom: 1px solid var(--td-grey);
}

/* The whole row is the download link. desktop.css makes every link 600 and
   fades it on hover; neither suits a list row. */
.td .td-doc__link {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	padding: 14px 6px;
	color: var(--td-navy);
	font-weight: 400;
	text-decoration: none;
	transition: background-color .15s ease;
}

.td .td-doc__link:hover { opacity: 1; background: var(--td-band-grey); }

.td .td-doc__link:focus-visible { outline-offset: -2px; }

.td-doc__icon {
	width: 20px;
	height: 20px;
	margin-top: 1px;
	color: var(--td-navy);
}

.td-doc__body { display: block; min-width: 0; }

.td-doc__title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.td .td-doc__link:hover .td-doc__title {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.td-doc__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--td-muted);
}

.td-doc__type {
	padding: 3px 8px;
	border-radius: 2px;
	background: var(--td-band-tint);
	color: var(--td-navy);
	font-weight: 600;
}

@media (min-width: 900px) {
	.td-group + .td-group { margin-top: 64px; }
	.td .td-group__title { font-size: 30px; }

	/* Two columns of rows: a single 1356px column left the title at one edge
	   and the file details at the other. */
	.td-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}


/* ---- No results ---------------------------------------------------------- */

.td-empty {
	padding: 32px 24px;
	border: 1px solid var(--td-grey);
	border-radius: 4px;
	text-align: center;
}

.td .td-empty__title {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 600;
	color: var(--td-navy);
}

.td .td-empty__text { margin: 0 0 20px; color: var(--td-muted); }

.td-library > .td-container > .td-empty__text { margin: 0; }


/* ---- Help band ------------------------------------------------------------
   Green Grey, never navy: the footer below is navy. */

.td-help { padding: 48px 0; background: var(--td-band-tint); }

.td-help__inner {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.td-help .td-section-heading { margin-bottom: 8px; }

.td .td-help__text {
	margin: 0;
	max-width: 60ch;
	font-size: 17px;
	line-height: 1.5;
	color: var(--td-text);
}

.td-help__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 900px) {
	.td-help { padding: 72px 0; }

	.td-help__inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 48px;
	}

	.td-help__actions { flex: 0 0 auto; }
}


/* ---- Motion --------------------------------------------------------------- */

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