/*
 * GDV Supplier Registry: the framework page.
 *
 * Buttons and the call-to-action panel are gdv-public-ui's, colours its tokens,
 * and the code and reference in front of a name are styled with the brand
 * page's, in public.css. The blocks take the brand profile's block card and
 * rows, so the framework and a profile read as the same document. Class rules
 * repeat a class where they must outrank neve-child, which styles ul, li and
 * headings inside the page content.
 */

/* "Contents" sits beside the blocks once the page itself is 900px wide, measured on the page rather than the window. */
.gdv-sr-brands.gdv-sr-fw {
	container: gdv-sr-fw / inline-size;
}

/*
 * The page's lists are layouts, not running text. neve-child gives every ul a
 * disc and a 1.375em bottom margin through a selector of six :not() classes and
 * an element (style.css), so this answers it with seven classes rather than
 * !important, as the brand profile does. Only the bottom margin is answered
 * here: the margin above each list stays with the rules below.
 */
.gdv-sr-fw.gdv-sr-fw.gdv-sr-fw.gdv-sr-fw.gdv-sr-fw.gdv-sr-fw :is(ul, ol):is(.gdv-sr-fw__toc-list, .gdv-sr-fw__rows, .gdv-sr-fw__chips) {
	list-style: none;
	margin-bottom: 0;
	padding-left: 0;
}

.gdv-sr-fw .gdv-sr-fw__toc-list {
	margin-top: 0;
}

.gdv-sr-fw :is(.gdv-sr-fw__toc-list, .gdv-sr-fw__rows, .gdv-sr-fw__chips) > li {
	list-style: none;
}

/* ===== The head: centred under the page's own title ===== */

.gdv-sr-fw .gdv-sr-fw__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: 0 0 2.5rem;
	text-align: center;
}

/* neve-child's h1 rule gives it the page title's face, size, yellow and centring; only the spacing is the head's. */
.gdv-sr-fw .gdv-sr-fw__head .gdv-sr-fw__title {
	margin: 0;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.gdv-sr-fw .gdv-sr-fw__edition {
	margin: 0;
	color: var(--gdv-ui-text-faint, #666666);
	font-variant-numeric: tabular-nums;
}

/* In the text colour, unlike the grey edition line above it: those who did the work are read, not skimmed. */
.gdv-sr-fw .gdv-sr-fw__credits {
	max-width: 65ch;
	margin: 0;
	color: var(--gdv-ui-text, #444444);
	text-wrap: balance;
}

/*
 * The credits and "Cite this framework" share one centred line, wrapping on a
 * narrow screen. Opened, the fold takes a line of its own under the credits,
 * since its panel needs the width.
 */
.gdv-sr-fw .gdv-sr-fw__credits-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	column-gap: 0.5em;
	width: 100%;
}

/*
 * "Cite this framework": a quiet underlined link in the meta grey, never a
 * button. Opened, the citation sits left-aligned in the page's panel, with
 * APA's hanging indent so the authors' line stands out.
 */
.gdv-sr-fw .gdv-sr-fw__cite {
	flex: 0 0 auto;
	margin: 0;
}

/*
 * Open, the fold spans the whole line, so it always drops under the credits:
 * capped at 65ch it still fitted beside a short sentence. Its panel is the
 * part held to 65ch, centred under the link.
 */
.gdv-sr-fw .gdv-sr-fw__cite[open] {
	flex-basis: 100%;
}

.gdv-sr-fw .gdv-sr-fw__cite-toggle {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--gdv-ui-text-faint, #666666);
	text-decoration: underline;
	list-style: none;
	cursor: pointer;
}

.gdv-sr-fw .gdv-sr-fw__cite-toggle::-webkit-details-marker {
	display: none;
}

.gdv-sr-fw .gdv-sr-fw__cite-toggle:focus-visible {
	outline: 2px solid var(--gdv-ui-focus, #8a6100);
	outline-offset: 2px;
	border-radius: 4px;
}

.gdv-sr-fw .gdv-sr-fw__cite-body {
	max-width: 65ch;
	margin: 8px auto 0;
	padding: 16px 20px;
	background: var(--gdv-ui-surface, #ffffff);
	border: 1px solid var(--gdv-ui-border, #d6d6d6);
	border-radius: var(--gdv-ui-radius-lg, 12px);
	color: var(--gdv-ui-text, #444444);
	text-align: left;
}

.gdv-sr-fw .gdv-sr-fw__cite-label {
	margin: 0 0 8px;
	font-weight: 700;
}

.gdv-sr-fw .gdv-sr-fw__cite-text {
	margin: 0;
	padding-left: 2em;
	text-indent: -2em;
	overflow-wrap: anywhere;
}

.gdv-sr-fw .gdv-sr-fw__cite-action {
	margin: 12px 0 0;
}

.gdv-sr-fw .gdv-sr-fw__cite-action .gdv-ui-btn.gdv-ui-btn {
	margin-inline: 0;
}

.gdv-sr-fw .gdv-sr-fw__earlier {
	margin: 0;
}

.gdv-sr-fw .gdv-sr-fw__actions {
	justify-content: center;
}

.gdv-sr-fw .gdv-sr-fw__download-icon {
	flex: 0 0 auto;
	width: 1.25em;
	height: 1.25em;
}

/* The gate notice and the terms gate are gdv-public-ui's call to action, centred on their own. */
.gdv-sr-fw .gdv-sr-fw__head > .gdv-sr-gate {
	width: 100%;
	max-width: 40rem;
}

/*
 * A lead: a size up from the body text, at the 70ch most a reading line may
 * run, so the column is wider on screen without the lines growing longer.
 * Its text is left-aligned inside the centred head.
 */
.gdv-sr-fw .gdv-sr-fw__intro {
	width: 100%;
	max-width: 70ch;
	margin-top: 16px;
	font-size: 1.125rem;
	text-align: left;
}

.gdv-sr-fw .gdv-sr-fw__intro p,
.gdv-sr-fw .gdv-sr-fw__block-note p,
.gdv-sr-fw .gdv-sr-fw__row-note p,
.gdv-sr-fw .gdv-sr-fw__licence p {
	margin: 0 0 0.75rem;
	overflow-wrap: anywhere;
}

.gdv-sr-fw .gdv-sr-fw__intro > :last-child,
.gdv-sr-fw .gdv-sr-fw__block-note > :last-child,
.gdv-sr-fw .gdv-sr-fw__row-note > :last-child {
	margin-bottom: 0;
}

/* At body size and in the text colour: a failure in small grey print reads as a footnote. */
.gdv-sr-fw .gdv-sr-fw__failed {
	margin: 0;
	padding: 12px 16px;
	border-left: 4px solid var(--gdv-ui-danger, #b42318);
	background: var(--gdv-ui-surface, #ffffff);
	color: var(--gdv-ui-text, #444444);
	text-align: left;
}

/* ===== The notice on an earlier edition ===== */

.gdv-sr-fw .gdv-sr-fw__earlier-notice {
	margin: 0 0 2rem;
	padding: 12px 16px;
	border-left: 4px solid var(--gdv-ui-border-strong, #797979);
	background: var(--gdv-ui-surface, #ffffff);
	color: var(--gdv-ui-text, #444444);
}

.gdv-sr-fw .gdv-sr-fw__earlier-notice p {
	margin: 0 0 0.75rem;
}

.gdv-sr-fw .gdv-sr-fw__earlier-notice p.gdv-sr-fw__earlier-action {
	margin: 0;
}

.gdv-sr-fw .gdv-sr-fw__earlier-action .gdv-ui-btn.gdv-ui-btn {
	margin-inline: 0;
}

/* ===== Contents beside the blocks ===== */

/*
 * Neve sets overflow: hidden on its page wrapper, which makes the wrapper the
 * box "Contents" sticks in, and that box never scrolls. clip cuts off what
 * sticks out sideways as hidden does, without making it a scrolling box. A
 * browser without clip keeps Neve's rule, and "Contents" scrolls with the page.
 */
body > .wrapper:has(.gdv-sr-fw) {
	overflow: clip;
}

.gdv-sr-fw .gdv-sr-fw__layout {
	display: grid;
	gap: 20px;
}

@container gdv-sr-fw (min-width: 900px) {
	.gdv-sr-fw .gdv-sr-fw__layout {
		grid-template-columns: minmax(0, 1fr) 17rem;
		align-items: start;
	}

	/* In view while the blocks scroll past, and scrolling on its own when it is taller than the window. */
	.gdv-sr-fw .gdv-sr-fw__toc {
		position: sticky;
		top: 24px;
		order: 2;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
	}
}

.gdv-sr-fw .gdv-sr-fw__toc {
	padding: 18px 20px;
	background: var(--gdv-ui-surface, #ffffff);
	border: 1px solid var(--gdv-ui-border, #d6d6d6);
	border-radius: var(--gdv-ui-radius-lg, 12px);
}

/*
 * The page title is the h1, so "Contents" and each block are h2. neve-child
 * draws an h2 large, green and centred, and an h3 smaller and in the yellow:
 * these keep the h3's look a brand profile's blocks have.
 */
.gdv-sr-fw .gdv-sr-fw__toc .gdv-sr-fw__toc-heading {
	margin: 0 0 8px;
	font-size: 1.1rem;
	text-align: left;
	color: var(--gdv-ui-text, #444444);
}

.gdv-sr-fw .gdv-sr-fw__block .gdv-sr-fw__block-name {
	font-size: 1.35em;
	color: var(--yellow, #e1ad4e);
}

.gdv-sr-fw .gdv-sr-fw__toc-list > li {
	margin: 0;
	border-top: 1px solid var(--gdv-ui-border, #d6d6d6);
}

.gdv-sr-fw .gdv-sr-fw__toc-list > li:first-child {
	border-top: 0;
}

.gdv-sr-fw .gdv-sr-fw__toc-entry {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Each entry a full-height press target, not a line of text. */
.gdv-sr-fw .gdv-sr-fw__toc-list a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 4px 0;
	overflow-wrap: anywhere;
}

/*
 * A block's questions under it, indented and in the faint text colour (5.74:1
 * on white). Kept out on a narrow screen, where "Contents" sits above the blocks
 * and the questions would push them a long way down.
 */
.gdv-sr-fw .gdv-sr-fw__toc-questions {
	display: none;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}

.gdv-sr-fw .gdv-sr-fw__toc-questions a {
	min-height: 32px;
	padding: 2px 0 2px 1rem;
	color: var(--gdv-ui-text-faint, #666666);
	font-size: 0.9375rem;
}

@container gdv-sr-fw (min-width: 900px) {
	.gdv-sr-fw .gdv-sr-fw__toc-questions {
		display: block;
	}
}

/*
 * The entry the reader is in, marked by framework-blocks.js: weight and a bar
 * at its left, never a colour alone.
 */
.gdv-sr-fw .gdv-sr-fw__toc-list a.is-current {
	color: var(--gdv-ui-text, #444444);
	font-weight: 700;
	box-shadow: inset 3px 0 0 var(--yellow, #e1ad4e);
}

/* Room for the bar at all times, so the name does not shift sideways when the mark arrives. */
.gdv-sr-fw .gdv-sr-fw__toc-entry a {
	padding-left: 8px;
}

.gdv-sr-fw .gdv-sr-fw__rows > .gdv-sr-fw__row {
	scroll-margin-top: 24px;
}

.gdv-sr-fw .gdv-sr-fw__toc-count {
	flex: 0 0 auto;
	color: var(--gdv-ui-text-faint, #666666);
	font-variant-numeric: tabular-nums;
}

/* ===== One block: the brand profile's card ===== */

.gdv-sr-fw .gdv-sr-fw__blocks {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.gdv-sr-fw .gdv-sr-fw__block {
	margin: 0;
	padding: 20px 22px;
	border: 1px solid var(--gdv-ui-border, #d6d6d6);
	border-radius: var(--gdv-ui-radius-lg, 12px);
	scroll-margin-top: 24px;
}

/* "Open all blocks" and "Close all blocks", shown by framework-blocks.js. */
.gdv-sr-fw .gdv-sr-fw__toggles {
	justify-content: flex-start;
	margin: 0;
}

/*
 * A block folds, in the shape of the edit screen's blocks: the summary is the
 * chevron, the block's name and its count of questions, the whole row a press
 * target.
 */
.gdv-sr-fw .gdv-sr-fw__block-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 4px 12px;
	align-items: center;
	min-height: 44px;
	list-style: none;
	cursor: pointer;
}

.gdv-sr-fw .gdv-sr-fw__block-head::-webkit-details-marker {
	display: none;
}

.gdv-sr-fw .gdv-sr-fw__block-head:focus-visible {
	outline: 2px solid var(--gdv-ui-focus, #8a6100);
	outline-offset: 4px;
	border-radius: 4px;
}

/* The chevron in the faint text colour: 5.74:1 on white, 5.72:1 on the dark page. */
.gdv-sr-fw .gdv-sr-fw__chevron {
	width: 20px;
	height: 20px;
	color: var(--gdv-ui-text-faint, #666666);
	transition: transform 0.15s ease;
}

.gdv-sr-fw .gdv-sr-fw__block[open] .gdv-sr-fw__chevron {
	transform: rotate(90deg);
}

.gdv-sr-fw .gdv-sr-fw__block[open] .gdv-sr-fw__block-head {
	padding-bottom: 16px;
	border-bottom: 1px solid var(--gdv-ui-border, #d6d6d6);
}

.gdv-sr-fw .gdv-sr-fw__block .gdv-sr-fw__block-name {
	margin: 0;
	text-align: left;
	overflow-wrap: anywhere;
}

.gdv-sr-fw .gdv-sr-fw__block-meta {
	grid-column: 2;
	margin: 0;
	color: var(--gdv-ui-text-faint, #666666);
	font-variant-numeric: tabular-nums;
}

.gdv-sr-fw .gdv-sr-fw__block-edit {
	margin: 12px 0 0;
	font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
	.gdv-sr-fw .gdv-sr-fw__chevron {
		transition: none;
	}
}

.gdv-sr-fw .gdv-sr-fw__block-note {
	max-width: 65ch;
	margin: 12px 0 0;
	color: var(--gdv-ui-text-faint, #666666);
}

.gdv-sr-fw .gdv-sr-fw__rows {
	margin-top: 8px;
}

.gdv-sr-fw .gdv-sr-fw__block-head + .gdv-sr-fw__rows,
.gdv-sr-fw .gdv-sr-fw__block-note + .gdv-sr-fw__rows {
	margin-top: 12px;
}

/*
 * One question: its name and note on the left, its kind of answer on the
 * right, the options as chips under both. On a phone the kind drops under the name.
 */
.gdv-sr-fw .gdv-sr-fw__rows > .gdv-sr-fw__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 6px 16px;
	margin: 0;
	padding: 12px 0;
	border-top: 1px solid var(--gdv-ui-border, #d6d6d6);
}

.gdv-sr-fw .gdv-sr-fw__rows > .gdv-sr-fw__row:last-child {
	padding-bottom: 0;
}

.gdv-sr-fw .gdv-sr-fw__row-text {
	min-width: 0;
}

.gdv-sr-fw .gdv-sr-fw__row-name {
	margin: 0;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.gdv-sr-fw .gdv-sr-fw__row-note {
	max-width: 65ch;
	margin: 2px 0 0;
	color: var(--gdv-ui-text-faint, #666666);
	font-size: 0.9375rem;
}

.gdv-sr-fw .gdv-sr-fw__row-kind {
	margin: 0;
	color: var(--gdv-ui-text-faint, #666666);
	font-size: 0.9375rem;
	white-space: nowrap;
}

/* The administrator's "Edit": a quiet underlined link in the meta grey, never a button. */
.gdv-sr-fw .gdv-sr-fw__row-edit {
	margin: 2px 0 0;
	font-size: 0.9375rem;
}

.gdv-sr-fw .gdv-sr-fw__edit {
	color: var(--gdv-ui-text-faint, #666666);
	text-decoration: underline;
}

.gdv-sr-fw .gdv-sr-fw__chips,
.gdv-sr-fw .gdv-sr-fw__explained {
	grid-column: 1 / -1;
}

.gdv-sr-fw.gdv-sr-fw ul.gdv-sr-fw__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.gdv-sr-fw .gdv-sr-fw__chips > .gdv-sr-fw__chip {
	margin: 0;
	padding: 2px 12px;
	color: var(--gdv-ui-text, #444444);
	font-size: 0.9375rem;
	border: 1px solid var(--gdv-ui-border-strong, #797979);
	border-radius: 999px;
	overflow-wrap: anywhere;
}

.gdv-sr-fw .gdv-sr-fw__explained {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 4px 0 0;
	font-size: 0.9375rem;
}

.gdv-sr-fw .gdv-sr-fw__explained dt {
	display: inline;
	font-weight: 700;
}

.gdv-sr-fw .gdv-sr-fw__explained dt::after {
	content: ": ";
}

.gdv-sr-fw .gdv-sr-fw__explained dd {
	display: inline;
	margin: 0;
	color: var(--gdv-ui-text-faint, #666666);
}

@container gdv-sr-fw (max-width: 480px) {
	.gdv-sr-fw .gdv-sr-fw__rows > .gdv-sr-fw__row {
		grid-template-columns: minmax(0, 1fr);
	}

	.gdv-sr-fw .gdv-sr-fw__row-kind {
		white-space: normal;
	}
}

/* ===== Licence ===== */

.gdv-sr-fw .gdv-sr-fw__licence {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px solid var(--gdv-ui-border, #d6d6d6);
}

/* ===== Print ===== */

@media print {
	.gdv-sr-fw .gdv-sr-fw__actions,
	.gdv-sr-fw .gdv-sr-fw__toc,
	.gdv-sr-fw .gdv-sr-gate,
	.gdv-sr-fw .gdv-sr-terms,
	.gdv-sr-fw .gdv-sr-fw__failed,
	.gdv-sr-fw .gdv-sr-fw__earlier,
	.gdv-sr-fw .gdv-sr-fw__earlier-action,
	.gdv-sr-fw .gdv-sr-fw__cite,
	.gdv-sr-fw .gdv-sr-fw__toggles,
	.gdv-sr-fw .gdv-sr-fw__chevron {
		display: none;
	}

	/* framework-blocks.js opens every block before printing, so the paper carries the whole framework. */
	.gdv-sr-fw .gdv-sr-fw__block[open] .gdv-sr-fw__block-head {
		padding-bottom: 0;
		border-bottom: 0;
	}

	.gdv-sr-fw .gdv-sr-fw__layout {
		display: block;
	}

	.gdv-sr-fw .gdv-sr-fw__block {
		padding: 0;
		border: 0;
	}

	.gdv-sr-fw .gdv-sr-fw__rows > .gdv-sr-fw__row {
		break-inside: avoid;
	}

	.gdv-sr-fw .gdv-sr-fw__block-name {
		break-after: avoid;
	}
}
