/*
Theme Name: Novel Solutions
Theme URI: https://www.novelsolutions.no
Author: Elemental Web
Author URI: https://www.eleweb.no
Description: Block theme for novelsolutions.no: the site's tokens, logo, header/footer, templates and patterns. Shared functionality comes from the plugin elemental-core.
Requires at least: 6.6
Requires PHP: 8.1
Version: 0.4.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: novelsolutions
*/

/* Design: «Arbeidstegning» rev. B in green (docs/decisions/0006-design-direction.md, "Accepted
   design"): a drawing sheet as the hero, ink on concrete grey, green only for the answer and the
   main action, one typeface, greyscale photos in an ink frame. Tokens live in theme.json; this file holds the layout
   classes and what theme.json can't express. Spacing comes from the layout classes, never per
   block. Vocabulary: the Elemental Web design system (font roles display/body, spacing 20–80,
   custom line-height/letter-spacing/gutter/box/control tokens), and only these breakpoints,
   always as max-width (width − 1px):
     xs  360px   small phones                            @media (max-width: 360px)
     sm  600px   phone / tablet                          @media (max-width: 599px)
     md  782px   WordPress stacks columns below this     @media (max-width: 781px)
     lg  1024px  tablet / desktop                        @media (max-width: 1023px)
     xl  1280px  fluid type and spacing stop growing (theme.json typography.fluid) */

/* Archivo's fallback: Arial resized with Archivo's metrics (computed from the font file with
   fontTools), so text keeps its size and line breaks while the font loads. */
@font-face {
	font-family: "Archivo Fallback";
	src: local("Arial");
	size-adjust: 101%;
	ascent-override: 87%;
	descent-override: 21%;
	line-gap-override: 0%;
}

/* Figures line up like a calculation, everywhere. */
body {
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}

html,
body {
	overflow-x: clip;
}

/* Headings, the name and the big figures: Archivo at 82 % width (theme.json has no
   font-stretch). */
h1,
h2,
h3,
h4,
.wp-block-site-title,
.novelsolutions-numeral,
.novelsolutions-calc {
	font-stretch: 82%;
}

/* Links: the text colour, a thin underline that thickens on hover. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 2px;
}

/* Boxes inside columns and query loops are padded by the width of that column, not the screen:
   --wp--custom--box--padding uses cqi. Outside a container cqi measures the viewport. */
.wp-block-column,
.wp-block-post-template > li {
	container-type: inline-size;
}

/* Header, main and footer sit flush: sections bring their own spacing. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

h1,
h2 {
	text-wrap: balance;
}

p,
li {
	text-wrap: pretty;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--text);
	outline-offset: 3px;
}

/* For a heading that's there for screen readers and search engines, not for the eye. */
.novelsolutions-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------------------
   Layout system. Templates and patterns use these classes instead of per-block padding.
   `.wp-block-group.` / `.wp-block-cover.` raise specificity above WordPress's layout rules.
   --------------------------------------------------------------------------------------- */

/* Full-width content section: spacing-80 top and bottom (fluid), gutter at the sides, a hairline
   above it. Its content sits in one wide group (`novelsolutions-section__inner`). */
.wp-block-group.novelsolutions-section {
	padding: var(--wp--preset--spacing--80) var(--wp--custom--gutter);
	border-top: 1px solid var(--wp--preset--color--line);
}

/* The page top: the headline row, then the drawing sheet. No hairline above it. */
.wp-block-group.novelsolutions-hero {
	padding: var(--wp--preset--spacing--50) var(--wp--custom--gutter) var(--wp--preset--spacing--80);
}

.novelsolutions-hero__inner,
.novelsolutions-section__inner {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

/* Plain pages (page.html, index, 404, the policies). */
.wp-block-group.novelsolutions-page {
	padding: var(--wp--preset--spacing--70) var(--wp--custom--gutter) var(--wp--preset--spacing--80);
}

/* Long text pages: a sub-heading is a reading-size heading, not a section title. */
.novelsolutions-page > .wp-block-post-content h2 {
	margin-top: var(--wp--preset--spacing--60);
	font-size: var(--wp--preset--font-size--x-large);
}

.novelsolutions-page > .wp-block-post-content h3 {
	font-size: var(--wp--preset--font-size--large);
}

/* CookieYes's "settings" button in the cookie policy wraps on a phone. */
.novelsolutions-page a.cky-banner-element {
	display: inline-block;
	max-width: 100%;
	box-sizing: border-box;
	white-space: normal;
}

/* A section's heading row sits above its content. */
.novelsolutions-section__head {
	margin-bottom: var(--wp--preset--spacing--60);
}

/* The theme's grids: their children carry no block gap of their own. */
.novelsolutions-hero__top,
.novelsolutions-sheet__views,
.novelsolutions-titleblock,
.novelsolutions-figures,
.novelsolutions-split,
.novelsolutions-team,
.novelsolutions-person,
.novelsolutions-panel,
.novelsolutions-logos {
	display: grid;
}

.novelsolutions-hero__top > *,
.novelsolutions-sheet__views > *,
.novelsolutions-titleblock > *,
.novelsolutions-figures > *,
.novelsolutions-split > *,
.novelsolutions-team > *,
.novelsolutions-person > *,
.novelsolutions-panel > *,
.novelsolutions-logos > * {
	margin-block: 0;
	min-width: 0;
}

/* ---------------------------------------------------------------------------------------
   Hero: headline left, lead and the one action right, bottoms aligned
   --------------------------------------------------------------------------------------- */

.novelsolutions-hero__top {
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--wp--preset--spacing--70);
	align-items: end;
}

.novelsolutions-hero__top h1 {
	margin: 0;
	hyphens: manual;
}

/* ---------------------------------------------------------------------------------------
   The drawing sheet (inc/drawings.php fills the drawings and the toggle)
   --------------------------------------------------------------------------------------- */

.novelsolutions-sheet {
	margin-top: var(--wp--preset--spacing--60);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
}

.novelsolutions-sheet > * {
	margin-block: 0;
}

.novelsolutions-sheet__views {
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.novelsolutions-view {
	display: flex;
	flex-direction: column;
	padding: var(--wp--preset--spacing--50);
}

.novelsolutions-view + .novelsolutions-view {
	border-left: 1px solid var(--wp--preset--color--border);
}

.novelsolutions-view > * {
	margin-block: 0;
}

.novelsolutions-drawing {
	margin-bottom: auto;
}

.novelsolutions-drawing svg {
	display: block;
	width: 100%;
	height: auto;
}

.novelsolutions-view h2 {
	margin-top: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: var(--wp--custom--letter-spacing--normal);
}

/* The legend under each drawing: rows between hairlines; what ESO finds as accent tags. */
.novelsolutions-legend {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--wp--preset--spacing--40);
	margin-top: var(--wp--preset--spacing--20);
	padding: 0;
	list-style: none;
}

.novelsolutions-legend li {
	padding-block: 6px;
	border-top: 1px solid var(--wp--preset--color--line);
}

.novelsolutions-legend--answer {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	padding-top: var(--wp--preset--spacing--20);
	border-top: 1px solid var(--wp--preset--color--line);
}

.novelsolutions-legend--answer li {
	padding: 2px 8px;
	border: 0;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

/* The title block: what is drawn, and the one choice. */
.novelsolutions-titleblock {
	grid-template-columns: minmax(0, 1fr) auto;
	border-top: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--caption);
	line-height: var(--wp--custom--line-height--normal);
}

.novelsolutions-titleblock > * {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.novelsolutions-titleblock > * + * {
	border-left: 1px solid var(--wp--preset--color--border);
}

.novelsolutions-titleblock p {
	margin: 0;
}

.novelsolutions-titleblock .novelsolutions-label,
.novelsolutions-titleblock .novelsolutions-note {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.novelsolutions-titleblock .novelsolutions-note {
	margin-top: var(--wp--preset--spacing--20);
}

.novelsolutions-opt {
	display: inline-flex;
	margin-top: 4px;
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
}

.novelsolutions-opt > * {
	margin: 0;
}

.novelsolutions-opt button {
	min-height: 44px;
	padding: var(--wp--custom--control--padding-small);
	border: 0;
	background: none;
	color: var(--wp--preset--color--text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.novelsolutions-opt button + button {
	border-left: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
}

.novelsolutions-opt button[aria-pressed="true"] {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

/* The drawings: ink for what is given, muted for the sections ESO doesn't choose, the accent for
   the answer. The SVG files carry the same colours as attributes (the editor shows them as
   pictures); these rules take over when the SVG is inline. */
.novelsolutions-dwg text {
	font-family: var(--wp--preset--font-family--body);
}

.novelsolutions-cand__body {
	fill: none;
	stroke: var(--wp--preset--color--muted);
	stroke-width: 1.2;
}

.novelsolutions-cand__bars {
	fill: var(--wp--preset--color--muted);
}

.novelsolutions-cand__dims {
	visibility: hidden;
}

.novelsolutions-sheet[data-pick="a"] [data-cand="a"] .novelsolutions-cand__body,
.novelsolutions-sheet[data-pick="b"] [data-cand="b"] .novelsolutions-cand__body,
.novelsolutions-sheet[data-pick="c"] [data-cand="c"] .novelsolutions-cand__body {
	fill: var(--wp--preset--color--accent);
	stroke: var(--wp--preset--color--text);
	stroke-width: 2.2;
}

.novelsolutions-sheet[data-pick="a"] [data-cand="a"] .novelsolutions-cand__bars,
.novelsolutions-sheet[data-pick="b"] [data-cand="b"] .novelsolutions-cand__bars,
.novelsolutions-sheet[data-pick="c"] [data-cand="c"] .novelsolutions-cand__bars {
	fill: var(--wp--preset--color--on-accent);
}

.novelsolutions-sheet[data-pick="a"] [data-cand="a"] .novelsolutions-cand__dims,
.novelsolutions-sheet[data-pick="b"] [data-cand="b"] .novelsolutions-cand__dims,
.novelsolutions-sheet[data-pick="c"] [data-cand="c"] .novelsolutions-cand__dims {
	visibility: visible;
}

/* In the editor the drawing groups are empty: show the SVG files as pictures there. */
.editor-styles-wrapper .novelsolutions-drawing--elevation {
	aspect-ratio: 560 / 250;
	background: url(assets/images/elevation.svg) center / contain no-repeat;
}

.editor-styles-wrapper .novelsolutions-drawing--sections {
	aspect-ratio: 400 / 250;
	background: url(assets/images/sections.svg) center / contain no-repeat;
}

.editor-styles-wrapper .novelsolutions-opt::before {
	content: "CO₂ / Kostnad";
	padding: var(--wp--custom--control--padding-small);
	font-weight: 600;
}

/* ---------------------------------------------------------------------------------------
   The numbers: a range on an axis, and the calculation itself
   --------------------------------------------------------------------------------------- */

.novelsolutions-figures {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--80);
	align-items: start;
}

.novelsolutions-figures > * > * {
	margin-block: 0;
}

.novelsolutions-numeral,
.novelsolutions-calc {
	margin: 0;
	font-size: var(--wp--custom--font-size--numeral);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

/* 6–22 % on a 0–25 % axis. The bar's ends are these two values: change them with the text. */
.novelsolutions-range {
	--novelsolutions-from: 6;
	--novelsolutions-to: 22;
	--novelsolutions-max: 25;
	position: relative;
	height: 36px;
	margin-top: var(--wp--preset--spacing--40) !important;
	margin-bottom: 0 !important;
	border-bottom: var(--wp--custom--border--ink) solid var(--wp--preset--color--text);
	background: repeating-linear-gradient(to right, var(--wp--preset--color--text) 0 1.5px, transparent 1.5px 20%) bottom left / calc(100% - 1.5px) 8px no-repeat;
}

.novelsolutions-range::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 8px;
	left: calc(var(--novelsolutions-from) / var(--novelsolutions-max) * 100%);
	width: calc((var(--novelsolutions-to) - var(--novelsolutions-from)) / var(--novelsolutions-max) * 100%);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--text);
	border-bottom: 0;
	background: var(--wp--preset--color--accent);
}

/* The axis' end labels: "0" left, the em ("25 %") right. */
.novelsolutions-ticks {
	margin: 6px 0 0 !important;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1;
}

.novelsolutions-ticks em {
	float: right;
	font-style: normal;
}

.novelsolutions-ticks + p {
	margin-top: var(--wp--preset--spacing--30);
}

/* "15 % × 17 % ≈ 2,6 %": operators (em) small and muted, the result (strong) in the accent. */
.novelsolutions-calc em {
	margin-inline: 0.12em;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--custom--font-size--operator);
	font-style: normal;
	font-weight: 400;
}

.novelsolutions-calc strong {
	padding: 0.04em 0.1em;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-weight: 600;
}

/* What each term is: the figure, then its meaning, between hairlines. */
.novelsolutions-terms {
	margin-top: var(--wp--preset--spacing--40) !important;
	padding: 0;
	list-style: none;
}

.novelsolutions-terms li {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--20);
	border-top: 1px solid var(--wp--preset--color--line);
}

.novelsolutions-terms strong {
	font-weight: 600;
}

.novelsolutions-source {
	max-width: 44rem;
	margin-top: var(--wp--preset--spacing--60);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
}

/* ---------------------------------------------------------------------------------------
   Heading left, content right (modules, the product)
   --------------------------------------------------------------------------------------- */

.novelsolutions-split {
	grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
	gap: var(--wp--preset--spacing--70);
}

.novelsolutions-split > * > :first-child {
	margin-top: 0;
}

.novelsolutions-split .novelsolutions-legend {
	grid-template-columns: minmax(0, 1fr);
}

/* The modules: a status table. A status in bold is done (filled square). */
.wp-block-table.novelsolutions-modules {
	margin: 0;
}

.novelsolutions-modules table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table.novelsolutions-modules th,
.wp-block-table.novelsolutions-modules td {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) 0;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
}

.wp-block-table.novelsolutions-modules thead {
	border: 0;
}

.wp-block-table.novelsolutions-modules th {
	border-bottom: var(--wp--custom--border--ink) solid var(--wp--preset--color--text);
	font-weight: 600;
}

.novelsolutions-modules td:nth-child(2)::before {
	content: "";
	display: inline-block;
	width: 0.65em;
	height: 0.65em;
	margin-right: 0.5em;
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--text);
}

.novelsolutions-modules td:nth-child(2):has(strong)::before {
	background: var(--wp--preset--color--accent);
}

.novelsolutions-modules td strong {
	font-weight: 400;
}

/* A fact the client must confirm (recipe client-wording). Never on a published page. */
.novelsolutions-todo {
	width: fit-content;
	padding: 2px 8px;
	outline: var(--wp--custom--border--ink) dashed var(--wp--preset--color--text);
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------------------------------------------------------------------------------------
   Team, photos, supporters
   --------------------------------------------------------------------------------------- */

.novelsolutions-team {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--60);
}

.novelsolutions-person {
	grid-template-columns: 136px minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	align-items: start;
}

/* Without a portrait (Om oss: the portraits are on the front page). */
.novelsolutions-person--text {
	grid-template-columns: minmax(0, 1fr);
}

.novelsolutions-person > * > * {
	margin-block: 0;
}

.novelsolutions-person p {
	margin-top: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--caption);
}

.novelsolutions-person ul {
	margin-top: var(--wp--preset--spacing--20);
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--caption);
}

.novelsolutions-person li {
	padding-block: 5px;
	border-top: 1px solid var(--wp--preset--color--line);
}

/* Image edges: no image sits on the page as a bare rectangle. This site has one edge, the frame:
   every photo is greyscale inside a 1.5px ink line (the sheet's edge), decision 0006.
   - `.novelsolutions-frame`: any photo (news pictures, the conference photo);
   - `.novelsolutions-portrait`: a framed 4:5 portrait;
   - `.novelsolutions-stage`: a framed wide photo, 21:9 from 782px, 3:2 on phones;
   - `.novelsolutions-logos`: supporters' logos, each whole on a framed sheet-coloured plate.
   Drawings are SVG on a sheet and need none. */
.novelsolutions-frame,
.novelsolutions-portrait,
.novelsolutions-stage {
	margin: 0;
}

.novelsolutions-frame img,
.novelsolutions-portrait img,
.novelsolutions-stage img {
	display: block;
	width: 100%;
	height: auto;
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	filter: grayscale(1) contrast(1.05);
}

.novelsolutions-portrait img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.novelsolutions-stage {
	margin-top: var(--wp--preset--spacing--60);
}

.novelsolutions-stage img {
	aspect-ratio: 21 / 9;
	object-fit: cover;
	object-position: 50% 38%;
}

.novelsolutions-frame figcaption,
.novelsolutions-stage figcaption {
	margin: var(--wp--preset--spacing--20) 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
	text-align: left;
}

.novelsolutions-backers {
	max-width: 46rem;
	margin-top: var(--wp--preset--spacing--60);
	font-size: var(--wp--preset--font-size--lead);
	line-height: var(--wp--custom--line-height--normal);
}

.novelsolutions-logos {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
}

.novelsolutions-logos .wp-block-image {
	display: grid;
	place-items: center;
	aspect-ratio: 3 / 2;
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
}

/* The whole plate is the link (a tap target, not just the logo). */
.novelsolutions-logos .wp-block-image {
	position: relative;
}

.novelsolutions-logos .wp-block-image a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.novelsolutions-logos .wp-block-image a:focus-visible {
	outline: 0;
}

.novelsolutions-logos .wp-block-image:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--text);
	outline-offset: 3px;
}

.novelsolutions-logos img {
	width: auto;
	max-width: 100%;
	max-height: 96px;
	object-fit: contain;
	filter: grayscale(1);
}

/* ---------------------------------------------------------------------------------------
   Contact: one sheet
   --------------------------------------------------------------------------------------- */

.novelsolutions-panel {
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: var(--wp--preset--spacing--60);
	padding: var(--wp--preset--spacing--60);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
}

.novelsolutions-panel > * > :first-child {
	margin-top: 0;
}

/* The contact form (JetFormBuilder "Kontaktskjema", form 755; tools/launch/build-form.py): one
   column, the label above each field, "Det gjelder" as three chips drawn over the real radio
   buttons, one send button, the answer under the field that is wrong, and the message after
   sending on the sheet itself. Recipe forms-and-feedback. */
.novelsolutions-form > * {
	margin-block: 0;
}

.novelsolutions-form form.jet-form-builder {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.novelsolutions-form .jet-form-builder-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.novelsolutions-form .jet-form-builder__label,
.novelsolutions-form .jet-form-builder__field-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.novelsolutions-form .jet-form-builder__label-text {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
}

/* Every field is needed, so no field is starred. */
.novelsolutions-form .jet-form-builder__required {
	display: none;
}

/* Fields: 48px tall, 18px text (no zoom on iPhones), the ink border. */
.novelsolutions-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
.novelsolutions-form textarea {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	min-height: var(--wp--custom--control--height);
	padding: var(--wp--custom--control--field-padding);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
}

.novelsolutions-form textarea {
	min-height: 132px;
	resize: vertical;
}

/* "Det gjelder": chips in a row that wraps. The radio button stays inside, unseen. The
   selectors start at `form.jet-form-builder` to beat JetFormBuilder's own (a column of drawn
   radio circles: `.field-type-radio-field .jet-form-builder__field-label.for-radio … + span::before`). */
.novelsolutions-form form.jet-form-builder .jet-form-builder__fields-group.checkradio-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.novelsolutions-form form.jet-form-builder .jet-form-builder__field-wrap.radio-wrap {
	flex: 0 0 auto;
	width: auto;
}

.novelsolutions-form .jet-form-builder__field-label.for-radio {
	position: relative;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-height: var(--wp--custom--control--height);
	margin: 0;
	padding: var(--wp--custom--control--padding-small);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--medium);
	line-height: var(--wp--custom--line-height--snug);
	cursor: pointer;
}

.novelsolutions-form .jet-form-builder__field-label.for-radio input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.novelsolutions-form form.jet-form-builder .field-type-radio-field .jet-form-builder__field-label.for-radio input + span::before,
.novelsolutions-form form.jet-form-builder .field-type-radio-field .jet-form-builder__field-label.for-radio input + span::after {
	display: none;
	content: none;
}

.novelsolutions-form form.jet-form-builder .field-type-radio-field .jet-form-builder__field-label.for-radio > span {
	display: inline;
	gap: 0;
	padding: 0;
}

.novelsolutions-form .jet-form-builder__field-label.for-radio:has(input:checked) {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-weight: 600;
}

.novelsolutions-form .jet-form-builder__field-label.for-radio:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--text);
	outline-offset: 3px;
}

/* JetFormBuilder's honeypot fields stay out of sight even if its own stylesheet is late. */
.novelsolutions-form .jfb-user-info {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* Wrong: the red border on the field, and what to do right under it. */
.novelsolutions-form .field-has-error input,
.novelsolutions-form .field-has-error textarea {
	border-color: var(--wp--custom--state--wrong);
	background: var(--wp--custom--state--wrong-wash);
}

.novelsolutions-form .error-message {
	color: var(--wp--custom--state--wrong);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
}

/* Send: the page's main button; dimmed while the form is being sent. Full width on phones. */
.novelsolutions-form .jet-form-builder__action-button-wrapper {
	margin: 0;
}

.novelsolutions-form .jet-form-builder__action-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--wp--custom--control--height);
	padding: var(--wp--custom--control--padding-block) var(--wp--custom--control--padding-inline);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--normal);
	cursor: pointer;
}

.novelsolutions-form .jet-form-builder__action-button:hover {
	background: var(--wp--preset--color--accent-hover);
}

.novelsolutions-form .jet-form-builder__action-button:disabled,
.novelsolutions-form form.is-loading .jet-form-builder__action-button {
	opacity: 0.6;
	cursor: progress;
}

/* After sending: the answer on the sheet, a green edge for "sent", the red one when it failed. */
.novelsolutions-form .jet-form-builder-messages-wrap:empty {
	display: none;
}

.novelsolutions-form .jet-form-builder-messages-wrap > div {
	margin: 0;
	padding: var(--wp--custom--box--padding-compact);
	border: 0;
	border-left: 4px solid var(--wp--preset--color--accent);
	border-radius: 0;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	font-weight: 600;
	text-align: start;
}

.novelsolutions-form .jet-form-builder-messages-wrap > [class*="error"] {
	border-left-color: var(--wp--custom--state--wrong);
}

.novelsolutions-form .novelsolutions-form__note {
	margin-top: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
}

@media (max-width: 599px) {
	.novelsolutions-form .jet-form-builder__action-button {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------------------
   Buttons: the filled one is the page's main action; the outline one is everything else
   --------------------------------------------------------------------------------------- */

.wp-block-button__link {
	min-height: var(--wp--custom--control--height);
	box-sizing: border-box;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	padding: var(--wp--custom--control--padding-block) var(--wp--custom--control--padding-inline);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	background: none;
	color: var(--wp--preset--color--text);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--surface);
}

/* ---------------------------------------------------------------------------------------
   News: posts as rows (date, title and excerpt, framed picture), and the single post
   --------------------------------------------------------------------------------------- */

.novelsolutions-news .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

.novelsolutions-news .wp-block-post-template > li {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr) 240px;
	gap: var(--wp--preset--spacing--50);
	align-items: start;
	margin: 0;
	padding-block: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--line);
}

.novelsolutions-news .wp-block-post-template > li > * {
	margin-block: 0;
}

.novelsolutions-news .wp-block-post-template > li > .wp-block-group > * {
	margin-block: 0;
}

.novelsolutions-news .wp-block-post-date {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
}

.novelsolutions-news .wp-block-post-title a {
	text-decoration: none;
}

.novelsolutions-news .wp-block-post-title a:hover {
	text-decoration: underline;
}

.novelsolutions-news .wp-block-post-excerpt {
	margin-top: var(--wp--preset--spacing--20) !important;
}

.novelsolutions-post__meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
}

/* A post's top: the date, the title close under it, then air around the picture. The frame
   class zeroes a figure's margins (it is made for grids), so the picture gets its own here. */
.novelsolutions-post .wp-block-post-title {
	margin-top: var(--wp--preset--spacing--20);
}

.novelsolutions-post .wp-block-post-featured-image {
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--50);
}

.novelsolutions-post__nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.novelsolutions-post__nav {
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}

/* Photos inside a post's own content get the frame too. */
.novelsolutions-post .wp-block-post-content img {
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	filter: grayscale(1) contrast(1.05);
}

/* ---------------------------------------------------------------------------------------
   Tablets and phones
   --------------------------------------------------------------------------------------- */

@media (max-width: 1023px) {
	.novelsolutions-team {
		grid-template-columns: minmax(0, 1fr);
	}

	.novelsolutions-figures {
		gap: var(--wp--preset--spacing--60);
	}
}

@media (max-width: 781px) {
	.novelsolutions-hero__top,
	.novelsolutions-sheet__views,
	.novelsolutions-titleblock,
	.novelsolutions-figures,
	.novelsolutions-split,
	.novelsolutions-panel {
		grid-template-columns: minmax(0, 1fr);
	}

	.novelsolutions-hero__top,
	.novelsolutions-split {
		gap: var(--wp--preset--spacing--40);
	}

	/* The sheet takes nearly the whole screen width. */
	.novelsolutions-sheet {
		position: relative;
		left: calc(8px - var(--wp--custom--gutter));
		width: calc(100% + 2 * var(--wp--custom--gutter) - 16px);
		max-width: none;
	}

	.novelsolutions-view {
		padding: var(--wp--preset--spacing--40);
	}

	.novelsolutions-view + .novelsolutions-view {
		border-top: 1px solid var(--wp--preset--color--border);
		border-left: 0;
	}

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

	.novelsolutions-legend--answer {
		display: flex;
	}

	.novelsolutions-titleblock > * + * {
		border-top: 1px solid var(--wp--preset--color--border);
		border-left: 0;
	}

	.novelsolutions-panel {
		padding: var(--wp--preset--spacing--40);
	}

	.novelsolutions-stage img {
		aspect-ratio: 3 / 2;
	}

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

	/* The table keeps module and status; the material column goes. */
	.novelsolutions-modules th:nth-child(3),
	.novelsolutions-modules td:nth-child(3) {
		display: none;
	}

	.novelsolutions-news .wp-block-post-template > li {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--wp--preset--spacing--20);
	}

	.novelsolutions-news .wp-block-post-featured-image {
		order: -1;
		max-width: 240px;
	}
}

@media (max-width: 599px) {
	.novelsolutions-person {
		grid-template-columns: 104px minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------------------------------
   Header and navigation
   --------------------------------------------------------------------------------------- */

.novelsolutions-header {
	position: relative;
	z-index: 10;
}

.novelsolutions-logo {
	margin: 0;
	font-weight: 700;
	line-height: var(--wp--custom--line-height--snug);
	white-space: nowrap;
}

.novelsolutions-logo a {
	text-decoration: none;
}

/* Menu and "Logg inn" on one row; the button stays outside the phone menu. */
.novelsolutions-header__tools {
	gap: var(--wp--preset--spacing--40);
}

.novelsolutions-header .wp-block-button__link {
	white-space: nowrap;
}

@media (max-width: 599px) {
	.novelsolutions-header__tools {
		gap: var(--wp--preset--spacing--20);
	}

	/* Phones: "Logg inn", then the menu button at the edge. */
	.novelsolutions-header__tools .wp-block-navigation {
		order: 2;
	}

	.novelsolutions-header .wp-block-button.is-style-outline > .wp-block-button__link {
		padding-inline: var(--wp--preset--spacing--30);
	}
}

/* Small phones: the name, "Logg inn" and the menu button fit a 320px screen. */
@media (max-width: 360px) {
	.novelsolutions-header .novelsolutions-logo {
		font-size: var(--wp--preset--font-size--large);
	}

	.novelsolutions-header .wp-block-button.is-style-outline > .wp-block-button__link {
		padding-inline: 10px;
		font-size: var(--wp--preset--font-size--caption);
	}

	.novelsolutions-header__tools {
		gap: 4px;
	}

	/* "15 % × 17 % ≈ 2,6 %" on one line. */
	.novelsolutions-calc {
		font-size: var(--wp--custom--font-size--numeral-small);
	}

	.novelsolutions-calc em {
		font-size: var(--wp--preset--font-size--large);
	}
}

.novelsolutions-header .wp-block-navigation-item__content {
	padding-block: 12px;
}

/* The phone menu buttons get a 44px tap target. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	box-sizing: content-box;
	padding: 10px;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px var(--wp--custom--gutter);
}

/* ---------------------------------------------------------------------------------------
   Footer: a brand column and two link columns; two columns on tablets, one on phones.
   --------------------------------------------------------------------------------------- */

.wp-block-group.novelsolutions-footer {
	padding: var(--wp--preset--spacing--70) var(--wp--custom--gutter) var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--line);
}

.novelsolutions-footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--50);
}

.novelsolutions-footer-grid > * {
	margin-block: 0;
}

.novelsolutions-footer__heading {
	margin: 0;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	color: var(--wp--preset--color--heading);
}

.novelsolutions-footer a {
	display: inline-block;
	padding-block: 4px;
	text-decoration: none;
}

.novelsolutions-footer a:hover,
.novelsolutions-footer a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Privacy and cookie policy: side by side, small and muted. */
.novelsolutions-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--wp--preset--spacing--30);
}

.novelsolutions-footer .novelsolutions-footer__legal a {
	color: var(--wp--preset--color--muted);
}

@media (max-width: 1023px) {
	.novelsolutions-footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.novelsolutions-footer-grid > .novelsolutions-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 599px) {
	.novelsolutions-footer-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* "To the top" (elemental-core's `to-top` module, switched on in inc/content-model.php): core
   places the button in the lower right corner; this is its look. Quiet: never the call colour or
   a filled main-action button. Recipe: elemental-site skill, recipes/to-top-button.md. */
.elemental-to-top {
	--elemental-to-top-inset: var(--wp--custom--gutter);
	border: var(--wp--custom--border--ink) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
}

.elemental-to-top:hover {
	border-color: currentColor;
}

.elemental-to-top:focus-visible {
	outline: 2px solid var(--wp--preset--color--text);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
	.elemental-to-top {
		transition: opacity 0.2s ease, visibility 0.2s;
	}
}
