/* ==========================================================================
   specialmål.dk
   Signatur: målebånd og målestreger fra tekniske tegninger.
   Fonte: Archivo (smal, til overskrifter) + Source Serif 4 (brødtekst).
   ========================================================================== */

:root {
	--ink: #1b2430;
	--ink-soft: #4a5666;
	--blue: #24476b;
	--blue-dark: #183450;
	--tape: #f2b705;
	--tape-soft: #fff6d6;
	--paper: #ffffff;
	--mist: #eef1f4;
	--line: #d3dae1;

	--f-head: "Archivo Variable", "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
	--f-body: "Source Serif 4 Variable", "Source Serif 4", Georgia, "Times New Roman", serif;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3rem;
	--step-2: 1.6rem;
	--step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
	--step-4: clamp(2.3rem, 1.6rem + 3.2vw, 3.6rem);

	--gutter: clamp(16px, 4vw, 32px);
	--radius: 4px;
}

/* Base --------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: var(--step-0);
	line-height: 1.65;
	font-optical-sizing: auto;
}

img,
svg,
video { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

h1, h2, h3, h4 {
	font-family: var(--f-head);
	font-stretch: 82%;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
	color: var(--ink);
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: 8px; top: -60px;
	z-index: 100;
	padding: 8px 14px;
	background: var(--ink);
	color: #fff;
	font-family: var(--f-head);
}
.skip-link:focus { top: 8px; }

.wrap {
	width: 100%;
	max-width: 1160px;
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.wrap--text { max-width: calc(700px + 2 * var(--gutter)); }
.wrap--wide { max-width: calc(960px + 2 * var(--gutter)); }

/* Målebånd ------------------------------------------------------------------
   Store streger hver 10 mm, mellemstreger ved 5 mm, små streger ved hver mm. */

.ruler {
	height: 14px;
	background-color: var(--tape);
	background-image:
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 60px),
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 30px),
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 6px);
	background-size: 100% 12px, 100% 8px, 100% 4px;
	background-repeat: no-repeat;
	background-position: 0 0;
	opacity: 0.95;
}
.ruler--dark {
	background-color: var(--ink);
	background-image:
		repeating-linear-gradient(90deg, var(--tape) 0 1px, transparent 1px 60px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 30px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 6px);
}

/* Målestreg under overskrift: |←———→| som på en teknisk tegning */

.measured { display: block; width: fit-content; max-width: 100%; }
.measured__text { display: inline; }
.measured::after {
	content: "";
	display: block;
	width: 100%;
	height: 9px;
	margin-top: 0.35em;
	background:
		linear-gradient(var(--tape), var(--tape)) left center / 100% 2px no-repeat,
		linear-gradient(var(--ink), var(--ink)) left center / 2px 100% no-repeat,
		linear-gradient(var(--ink), var(--ink)) right center / 2px 100% no-repeat;
}

/* Header ------------------------------------------------------------------- */

.site-header {
	position: relative;
	border-bottom: 1px solid var(--line);
	background: var(--paper);
	z-index: 20;
}
.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 68px;
}

.brand { margin-right: auto; }
.brand__name {
	font-family: var(--f-head);
	font-stretch: 75%;
	font-weight: 800;
	font-size: 1.6rem;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-decoration: none;
	line-height: 1;
	margin: 0;
}
.brand__name span {
	background: linear-gradient(transparent 62%, var(--tape) 62% 92%, transparent 92%);
	padding: 0 1px;
}
.brand__name--light { color: #fff; }
.brand__name--light span { color: var(--ink); background: var(--tape); padding: 0 4px; }
.custom-logo { max-height: 44px; width: auto; }

.site-nav {
	display: flex;
	align-items: center;
	gap: 20px;
}
.site-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.site-nav .menu a {
	font-family: var(--f-head);
	font-stretch: 90%;
	font-weight: 600;
	font-size: 0.98rem;
	color: var(--ink);
	text-decoration: none;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
}
.site-nav .menu a:hover,
.site-nav .current-menu-item > a { border-bottom-color: var(--tape); }

.site-nav__search input {
	width: 180px;
	padding: 7px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font: inherit;
	font-size: var(--step--1);
	background: var(--mist);
}

.nav-toggle { display: none; }

@media (max-width: 900px) {
	.nav-toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 8px 10px;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		background: var(--paper);
		font-family: var(--f-head);
		font-weight: 600;
		color: var(--ink);
		cursor: pointer;
	}
	.nav-toggle__bars,
	.nav-toggle__bars::before,
	.nav-toggle__bars::after {
		display: block;
		width: 18px;
		height: 2px;
		background: var(--ink);
		position: relative;
		content: "";
	}
	.nav-toggle__bars::before { position: absolute; top: -6px; }
	.nav-toggle__bars::after { position: absolute; top: 6px; }

	.site-nav {
		display: none;
		position: absolute;
		left: 0; right: 0; top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 16px var(--gutter) 24px;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		box-shadow: 0 12px 24px rgba(27, 36, 48, 0.08);
	}
	.nav-open .site-nav { display: flex; }
	.site-nav .menu { flex-direction: column; gap: 0; }
	.site-nav .menu a { display: block; padding: 10px 0; border-bottom: 1px solid var(--mist); }
	.site-nav__search input { width: 100%; }
}

/* Hero (forside) ------------------------------------------------------------- */

.hero {
	background: var(--mist);
	border-bottom: 1px solid var(--line);
	padding-block: clamp(40px, 7vw, 88px);
}
.hero__inner { max-width: calc(820px + 2 * var(--gutter)); margin-left: 0; margin-inline: auto; }
.hero__title { font-size: var(--step-4); font-stretch: 72%; font-weight: 800; letter-spacing: -0.02em; }
.hero__title.measured::after { height: 12px; margin-top: 0.3em; }
.hero__lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; margin-top: 1em; }

.hero__search { margin-top: 28px; max-width: 560px; }
.hero__search label {
	display: block;
	margin-bottom: 8px;
	font-family: var(--f-head);
	font-weight: 600;
}
.hero__search-row { display: flex; gap: 8px; }
.hero__search input {
	flex: 1;
	min-width: 0;
	padding: 14px 16px;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	font: inherit;
	background: var(--paper);
}
.hero__search button,
.searchform button {
	padding: 0 22px;
	border: 0;
	border-radius: var(--radius);
	background: var(--ink);
	color: #fff;
	font-family: var(--f-head);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}
.hero__search button:hover,
.searchform button:hover { background: var(--blue); }

/* Sektioner ------------------------------------------------------------------ */

.section { padding-block: clamp(36px, 5vw, 64px); }
.section + .section { padding-top: 0; }
.section__title { font-size: var(--step-2); margin-bottom: 20px; }
.section__title a { color: inherit; text-decoration: none; }

.notice {
	padding: 14px 16px;
	border-left: 4px solid var(--tape);
	background: var(--tape-soft);
	font-size: var(--step--1);
}

/* Kategorier: listet som en målliste med lineal-kant -------------------------- */

.cat-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	border-top: 2px solid var(--ink);
}
.cat-grid__item { border-bottom: 1px solid var(--line); }
.cat-grid__item a {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 16px;
	padding: 18px 16px 18px 0;
	color: var(--ink);
	text-decoration: none;
}
.cat-grid__name {
	font-family: var(--f-head);
	font-stretch: 82%;
	font-weight: 700;
	font-size: var(--step-1);
	line-height: 1.2;
}
.cat-grid__desc {
	grid-column: 1;
	font-size: var(--step--1);
	color: var(--ink-soft);
	line-height: 1.45;
}
.cat-grid__count {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
	font-family: var(--f-head);
	font-size: var(--step--1);
	color: var(--ink-soft);
	white-space: nowrap;
}
.cat-grid__item a:hover .cat-grid__name { text-decoration: underline; text-decoration-color: var(--tape); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }

/* Kort ------------------------------------------------------------------------ */

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 32px 28px;
}
.card-grid--two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card { display: flex; flex-direction: column; }
.card__image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--mist);
}
.card__body { padding-top: 12px; }
.card__cat {
	margin: 0 0 4px;
	font-family: var(--f-head);
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--ink-soft);
}
.card__title { font-size: var(--step-1); margin-bottom: 6px; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-decoration-color: var(--tape); text-decoration-thickness: 3px; }
.card__excerpt { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }

/* Artikel ---------------------------------------------------------------------- */

.article__head { padding-top: clamp(28px, 5vw, 56px); }
.article__meta { font-family: var(--f-head); font-size: var(--step--1); color: var(--ink-soft); }
.article__image { margin: 8px auto 32px; }
.article__image img { width: 100%; border-radius: var(--radius); }
.article__body { padding-bottom: 24px; }
.article__foot { padding-bottom: 64px; }
.article__more { font-family: var(--f-head); font-weight: 600; margin-top: 32px; }

.crumbs {
	font-family: var(--f-head);
	font-size: var(--step--1);
	color: var(--ink-soft);
	margin-bottom: 18px;
}
.crumbs a { color: var(--ink-soft); }
.crumbs span[aria-hidden] { margin-inline: 4px; color: var(--line); }

/* Brødtekst */

.prose { line-height: 1.7; }
.prose > * + h2 { margin-top: 1.8em; }
.prose > * + h3 { margin-top: 1.5em; }
.prose ul,
.prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li + li { margin-top: 0.35em; }
.prose ol > li::marker { font-family: var(--f-head); font-weight: 700; }
.prose blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--tape);
	font-style: italic;
}
.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--step--1);
	margin: 1.5em 0;
	font-variant-numeric: tabular-nums;
}
.prose th,
.prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-family: var(--f-head); background: var(--mist); border-bottom: 2px solid var(--ink); }
.prose .wp-block-table { margin: 1.5em 0; overflow-x: auto; }
.prose .wp-block-table table { margin: 0; }
.prose .wp-block-table th,
.prose .wp-block-table td { border: 0; border-bottom: 1px solid var(--line); }
.prose .wp-block-table thead { border-bottom: 0; }
.prose .wp-block-table th { border-bottom: 2px solid var(--ink); }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 6px; }
.prose img { border-radius: var(--radius); }

/* Kategori-hub ------------------------------------------------------------------- */

.hub-head {
	background: var(--mist);
	border-bottom: 1px solid var(--line);
	padding-block: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 40px);
}
.hub-head__intro { max-width: 68ch; color: var(--ink-soft); margin-top: 12px; }
.hub-head .searchform { margin-top: 16px; }

.hub {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 48px;
	padding-block: 40px 72px;
	align-items: start;
}
.hub__side { position: sticky; top: 24px; }
.hub__side .spm-lev,
.hub__side .spm-bliv { margin-top: 0; }
@media (max-width: 900px) {
	.hub { grid-template-columns: 1fr; gap: 24px; }
	.hub__side { position: static; order: -1; }
}

.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.subcats a {
	padding: 6px 12px;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-family: var(--f-head);
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
}
.subcats a:hover { border-color: var(--ink); background: var(--tape-soft); }

.supplier-group + .supplier-group { margin-top: 40px; }

/* Leverandørbokse (shortcodes fra specialmaal-core) ------------------------------ */

.spm-lev {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px 18px;
	margin: 20px 0;
	background: var(--paper);
}
.spm-lev--anbefalet {
	border: 2px solid var(--ink);
	background: var(--paper);
	position: relative;
	padding-top: 22px;
}
.spm-lev--anbefalet::before {
	content: "";
	position: absolute;
	left: -2px; right: -2px; top: -2px;
	height: 8px;
	background-color: var(--tape);
	background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 6px);
	background-size: 100% 4px;
	background-repeat: no-repeat;
	border-radius: var(--radius) var(--radius) 0 0;
}
.spm-lev__label {
	margin: 0 0 10px;
	font-family: var(--f-head);
	font-size: var(--step--1);
	font-weight: 700;
	color: var(--ink);
}
.spm-lev__label span { font-weight: 400; color: var(--ink-soft); }
.spm-lev__body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.spm-lev__logo img { width: 88px; height: auto; }
.spm-lev__text { flex: 1 1 200px; }
.spm-lev__text p { margin: 0 0 4px; }
.spm-lev__name { font-family: var(--f-head); font-stretch: 85%; font-weight: 700; font-size: var(--step-1); line-height: 1.2; }
.spm-lev__usp { font-size: var(--step--1); color: var(--ink-soft); }
.spm-lev__kode { font-size: var(--step--1); }
.spm-lev__kode strong { font-family: var(--f-head); background: var(--tape-soft); padding: 0 6px; }

.spm-lev__btn,
.spm-bliv__btn {
	display: inline-block;
	padding: 11px 18px;
	border-radius: var(--radius);
	background: var(--blue);
	color: #fff;
	font-family: var(--f-head);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.spm-lev__btn:hover,
.spm-bliv__btn:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.hub__side .spm-lev__btn { width: 100%; text-align: center; }
@media (max-width: 600px) {
	.spm-lev__btn { width: 100%; text-align: center; }
}

.spm-bliv {
	border: 1px dashed var(--ink-soft);
	border-radius: var(--radius);
	background: var(--mist);
	padding: 20px;
	margin: 32px 0;
}
.spm-bliv__title { font-family: var(--f-head); font-stretch: 85%; font-weight: 700; font-size: var(--step-1); margin: 0 0 6px; line-height: 1.25; }
.spm-bliv p { font-size: var(--step--1); margin-bottom: 12px; }
.spm-bliv .spm-bliv__btn { background: var(--ink); }
.spm-bliv .spm-bliv__btn:hover { background: var(--blue); }

/* Annoncer --------------------------------------------------------------------- */

.ad { margin: 2em 0; min-height: 120px; }
.ad__label { font-family: var(--f-head); font-size: 0.75rem; color: var(--ink-soft); margin: 0 0 4px; }

/* Søgning, paginering ------------------------------------------------------------- */

.searchform { display: flex; gap: 8px; max-width: 520px; }
.searchform input {
	flex: 1;
	min-width: 0;
	padding: 11px 12px;
	border: 1px solid var(--ink-soft);
	border-radius: var(--radius);
	font: inherit;
	background: var(--paper);
}

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--f-head); }
.pagination .page-numbers {
	padding: 6px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
}
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Footer ------------------------------------------------------------------------- */

.site-footer { background: var(--ink); color: #d6dde5; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer__inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 32px;
	padding-block: 48px 32px;
	font-size: var(--step--1);
}
.site-footer__about p:last-child { max-width: 36ch; margin-top: 12px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--f-head); }
.site-footer__supplier p { margin-bottom: 6px; }
.site-footer__legal {
	padding-block: 18px 32px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.8rem;
	color: #9aa6b2;
}
.site-footer__legal p { margin: 0 0 4px; max-width: 80ch; }
.site-footer__legal a { color: #c9d2db; }
@media (max-width: 760px) {
	.site-footer__inner { grid-template-columns: 1fr; }
}

/* WordPress-klasser ------------------------------------------------------------------- */

.alignwide { max-width: 960px; margin-inline: calc(50% - min(480px, 50vw - var(--gutter))); }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.wp-block-button__link { background: var(--blue); border-radius: var(--radius); font-family: var(--f-head); font-weight: 700; }
.has-text-align-center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
