/*
Theme Name: N2IT
Theme URI: https://n2it.com
Author: N2IT ApS
Description: Let, eget tema til N2IT ApS. Siderne redigeres i blok-editoren; dansk og engelsk med Polylang.
Version: 1.0.14
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: n2it
License: Proprietary. Skrifterne (Source Serif 4, Source Sans 3, Barlow Semi Condensed) er under SIL Open Font License 1.1.
*/

/* ---------- Skrifter (ligger på serveren, ikke hos Google) ---------- */
@font-face { font-family: "Source Serif 4"; src: url("assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("assets/fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Farver og mål ---------- */
:root {
	--ink: #1d1e22;
	--graphite: #27282c;
	--muted: #5d5c58;
	--line: #dcd8cf;
	--paper: #f6f4ef;
	--paper-2: #eeebe4;
	--white: #ffffff;
	--red: #c91f3a;
	--red-dark: #a91f30;
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sans: "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
	--mark: "Barlow Semi Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
	--wrap: 1180px;
	--text: 700px;
	--gutter: clamp(20px, 4vw, 40px);
	--section: clamp(64px, 9vw, 128px);
}

/* ---------- Grundlag ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: clamp(17px, 1.05vw + 12px, 19px);
	line-height: 1.62;
	font-weight: 400;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: color .15s ease, text-decoration-color .15s ease; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--graphite); color: var(--white); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -0.012em; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 4.6vw + 0.6rem, 4.6rem); line-height: 1.06; font-weight: 350; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 2.4vw + 0.8rem, 2.9rem); line-height: 1.12; }
h3 { font-size: clamp(1.3rem, 0.7vw + 1rem, 1.55rem); line-height: 1.25; font-weight: 500; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
p, ul, ol { margin: 0 0 1.1em; }
strong { font-weight: 600; }
hr, .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--graphite); color: var(--white); padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 16px; top: 12px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Logo ---------- */
.mark { font-family: var(--mark); font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: 0.035em; color: var(--ink); text-decoration: none; display: inline-flex; flex-direction: column; gap: 5px; }
.mark .mark-logo { display: block; height: 42px; width: auto; }
.site-footer .mark .mark-logo { height: 38px; }
@media (max-width: 860px) { .site-header .mark .mark-logo { height: 34px; } }
.mark:hover { color: var(--ink); }
.mark--light { color: var(--white); }
.mark--light:hover { color: var(--white); }

/* ---------- Top ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 24px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 2.4vw, 34px); }
.nav a { font-size: 16px; text-decoration: none; color: var(--ink); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav .current-menu-item > a, .nav .current-menu-ancestor > a, .nav .current-page-ancestor > a { border-bottom-color: var(--red); color: var(--ink); }
.lang { font-size: 14px; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 0; color: var(--muted); }
.lang a, .lang .is-current { font-size: 14px; line-height: 1; padding: 14px 6px; display: inline-block; min-width: 44px; min-height: 44px; box-sizing: border-box; text-align: center; }
.lang a { text-decoration: none; color: var(--muted); border: 0; }
.lang a:hover { color: var(--ink); }
.lang .is-current { color: var(--ink); font-weight: 600; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 2px; font: inherit; font-size: 15px; padding: 8px 14px; color: var(--ink); cursor: pointer; }

@media (max-width: 860px) {
	.menu-toggle { display: inline-block; }
	.nav { position: fixed; top: 76px; left: 0; right: 0; height: calc(100dvh - 76px); overflow-y: auto; z-index: 60; background: var(--paper); flex-direction: column; align-items: flex-start; padding: 32px var(--gutter); gap: 28px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s; }
	.nav ul { flex-direction: column; gap: 4px; width: 100%; }
	.nav ul a { display: block; font-family: var(--serif); font-size: 1.7rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
	.nav-open .nav { opacity: 1; visibility: visible; transform: none; }
	.nav-open { overflow: hidden; }
}

/* ---------- Sidehoved på undersider ---------- */
.page-head { padding: clamp(56px, 8vw, 112px) 0 clamp(32px, 4vw, 56px); }
.page-head .lead { font-size: clamp(1.15rem, 0.6vw + 1rem, 1.4rem); line-height: 1.5; color: var(--muted); max-width: 46ch; margin: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 28px; letter-spacing: 0.02em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { margin: 0 8px; color: var(--line); }

/* ---------- Indhold fra blok-editoren ---------- */
.content { padding-bottom: var(--section); }
/* Teksten står venstrestillet under sidens overskrift, i en læsevenlig bredde. */
.content > * { max-width: calc(var(--text) + 2 * var(--gutter)); margin-left: max(0px, calc((100% - var(--wrap)) / 2)); margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.content > .alignwide { max-width: var(--wrap); margin-left: auto; }
.content > .alignfull { max-width: none; padding-left: 0; padding-right: 0; }
.content > h2 { margin-top: 2.2em; }
.content ul { padding-left: 1.2em; }
.content li { margin-bottom: 0.45em; }
.content li::marker { color: var(--red); }
.front .content { padding-bottom: 0; }
.front .content > * { max-width: none; margin-left: 0; }

/* Afsnit (Gruppe-blok med klassen "afsnit") */
.afsnit { padding: var(--section) 0; }
/* Baggrunden går i fuld bredde, indholdet holder sig inden for sidens bredde. */
.content > .afsnit, .front .content > .afsnit { padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); }
.content > .afsnit { max-width: none; margin-left: 0; margin-right: 0; }
.afsnit > * { max-width: none; }
.afsnit .smal { max-width: var(--text); }
/* Direkte mail under knapperne i toppen. */
.hero .direkte { font-size: 15px; color: var(--muted); margin-top: 18px; }
/* Undersider bygget af afsnit (Ydelser): mindre luft under sidehovedet. */
.content > .afsnit:first-child:not(.hero) { padding-top: clamp(16px, 2vw, 32px); }
/* Tre måder at arbejde sammen på. */
.maader { margin-top: 2rem !important; gap: 48px !important; }
.maader h3 { margin-top: 0; padding-top: 18px; border-top: 2px solid var(--red); display: inline-block; }
.maader p { color: var(--muted); }
/* Rollerne på forsiden: to spalter på store skærme. */
.roller ul { columns: 2; column-gap: 48px; max-width: none; margin-top: 1.5rem; }
.roller li { break-inside: avoid; margin-bottom: 14px; }
@media (max-width: 780px) { .roller ul { columns: 1; } }
.content > .afsnit:first-child { margin-top: 0; }
.afsnit + .afsnit { border-top: 1px solid var(--line); }
/* Et afsnit efter almindelig tekst får luft over sig, og sidste afsnit går helt ned til bunden. */
.content > :not(.afsnit) + .afsnit { margin-top: var(--section) !important; }
.content:has(> .afsnit:last-child) { padding-bottom: 0; }
.afsnit--moerk { background: var(--graphite); color: #e9e7e2; border-top: 0 !important; }
.afsnit--moerk + .afsnit { border-top: 0; }
.afsnit--moerk h2, .afsnit--moerk h3 { color: var(--white); }
.afsnit--moerk a { color: var(--white); }
.afsnit--moerk .overline { color: #b9b6ae; }
.afsnit--lys { background: var(--paper-2); border-top: 0 !important; }
.afsnit--lys + .afsnit { border-top: 0; }

/* Lille overskrift over en sektion */
.overline { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.overline::before { content: ""; width: 28px; height: 1px; background: var(--red); flex: none; }

/* Forsidens åbning */
.hero { padding: clamp(72px, 11vw, 160px) 0 clamp(64px, 8vw, 112px); }
.hero h1 { max-width: 19ch; margin-bottom: 0.45em; }
.hero .lead { font-size: clamp(1.15rem, 0.7vw + 1rem, 1.45rem); line-height: 1.5; color: var(--muted); max-width: 44ch; }
.hero .wp-block-columns { align-items: flex-end; gap: clamp(32px, 5vw, 80px); }
.hero .portraet img { aspect-ratio: 4 / 5; object-fit: contain; object-position: 50% 100%; filter: grayscale(1) contrast(1.04); }
.hero .portraet figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Knapper */
.wp-block-buttons { gap: 14px; margin-top: 2rem; }
.wp-block-button__link, .knap { display: inline-block; font-family: var(--sans); font-size: 16px; font-weight: 600; letter-spacing: 0.01em; padding: 14px 26px; border-radius: 2px; background: var(--graphite); color: var(--white); text-decoration: none; border: 1px solid var(--graphite); transition: background .15s ease, border-color .15s ease; }
.wp-block-button__link:hover, .knap:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); border-color: var(--ink); }
.is-style-outline .wp-block-button__link:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.afsnit--moerk .wp-block-button__link { background: var(--white); color: var(--ink); border-color: var(--white); }
.afsnit--moerk .wp-block-button__link:hover { background: var(--red); color: var(--white); border-color: var(--red); }

/* Ydelser som liste med streger (Kolonner med klassen "ydelser") */
.ydelser { border-top: 1px solid var(--line); margin-top: 2.5rem !important; gap: 0 !important; flex-wrap: wrap !important; }
.ydelser > .wp-block-column { flex: 1 1 33.333% !important; padding: 32px 32px 36px 0; border-bottom: 1px solid var(--line); min-width: 260px; }
.ydelser h3 { margin-bottom: 0.4em; }
.ydelser h3 a { text-decoration: none; }
.ydelser h3 a:hover { color: var(--red-dark); }
.ydelser p { color: var(--muted); margin-bottom: 0.8em; }
.ydelser .mere a { font-size: 15px; font-weight: 600; text-decoration: none; }
.ydelser .mere a::after { content: "\00a0→"; color: var(--red); }

/* Resultater med tal (Kolonner med klassen "tal") */
.tal { gap: 0 !important; margin-top: 2.5rem !important; flex-wrap: wrap !important; }
.tal > .wp-block-column { flex: 1 1 30% !important; padding: 0 28px 0 0; min-width: 220px; margin-bottom: 36px; }
.tal .stort { font-family: var(--serif); font-size: clamp(2.6rem, 3.4vw + 1rem, 3.8rem); line-height: 1; font-weight: 300; letter-spacing: -0.02em; margin-bottom: 14px; color: inherit; }
.tal p { font-size: 16px; line-height: 1.5; }
.tal .kilde { font-size: 14px; color: var(--muted); }
.afsnit--moerk .tal .kilde { color: #a9a69e; }

/* Kunder som rolig tekstlinje */
.kunder { font-family: var(--serif); font-size: clamp(1.2rem, 0.9vw + 0.9rem, 1.6rem); line-height: 1.7; color: var(--muted); max-width: 52ch; }
.kunder strong { color: var(--ink); font-weight: 400; }
.brancher { font-size: 16px; color: var(--muted); margin-top: 1.2rem; max-width: 60ch; }

/* To kolonner med tekst */
.to-kol { gap: clamp(32px, 6vw, 96px) !important; }
.to-kol h2 { margin-top: 0; }

/* Citat */
.wp-block-quote, .wp-block-pullquote { border: 0; padding: 0; margin: 2.5rem auto; }
.wp-block-quote p, .wp-block-pullquote p { font-family: var(--serif); font-size: clamp(1.4rem, 1.1vw + 1rem, 1.9rem); line-height: 1.4; font-style: italic; font-weight: 350; }
.wp-block-quote cite { font-size: 15px; font-style: normal; color: var(--muted); }

/* Erfaring (Gruppe med klassen "opgave") */
.opgave { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 12px clamp(24px, 4vw, 64px); padding: 36px 0; border-top: 1px solid var(--line); }
.opgave > :first-child { grid-row: span 3; }
.opgave h3 { margin: 0; }
.opgave .rolle { color: var(--muted); font-size: 16px; margin: 6px 0 0; }
.opgave ul { margin: 0; }
@media (max-width: 700px) { .opgave { grid-template-columns: 1fr; } .opgave > :first-child { grid-row: auto; } }

/* Kontaktformular */
.formular { max-width: 640px; margin-top: 1.5rem; }
.formular label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.formular input[type=text], .formular input[type=email], .formular textarea { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid #c9c4b9; border-radius: 2px; background: var(--white); color: var(--ink); }
.formular input:focus, .formular textarea:focus { outline: 2px solid var(--graphite); outline-offset: 0; border-color: var(--graphite); }
.formular .felt { margin-bottom: 20px; }
.formular textarea { min-height: 170px; resize: vertical; }
.formular .hp { position: absolute; left: -9999px; }
.formular button { cursor: pointer; }
.formular .note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.besked { padding: 16px 20px; border-left: 3px solid var(--graphite); background: var(--white); margin-bottom: 24px; }
.besked--fejl { border-left-color: var(--red); }
.kontakt-boks .besked { max-width: 640px; box-sizing: border-box; }

/* ---------- Bund ---------- */
.site-footer { background: var(--graphite); border-top: 1px solid #3c3d42; color: #c9c6be; padding: clamp(56px, 7vw, 96px) 0 40px; font-size: 16px; }
.site-footer a { color: #e9e7e2; text-decoration-color: rgba(201, 31, 58, .8); }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-grid h2 { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #a8a59d; margin: 0 0 16px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-claim { font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; color: #e9e7e2; max-width: 30ch; margin-top: 24px; }
.footer-bottom { border-top: 1px solid #3c3d42; margin-top: 56px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #a8a59d; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Mobil ---------- */
@media (max-width: 781px) {
	.ydelser > .wp-block-column, .tal > .wp-block-column { flex-basis: 100% !important; padding-right: 0; }
	.hero .portraet { max-width: 280px; }
}

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

/* Layout uden WordPress' globale stilark */
.is-layout-flex { display: flex; flex-wrap: wrap; align-items: center; }
.wp-block-columns { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 56px); }
.wp-block-column { flex: 1 1 0; min-width: 0; }
@media (max-width: 781px) { .wp-block-columns { flex-direction: column; } .wp-block-column { flex-basis: 100% !important; } }
.wp-block-image img { max-width: 100%; height: auto; display: block; }
.wp-block-image { margin: 0; }
.pris { font-size: 16px; color: var(--muted); }
.content h3 { margin-top: 1.6em; }
.afsnit h2 { margin-top: 0; }
.ydelser h3, .tal h3 { margin-top: 0; }
/* Lister og erfaringskort flugter med sidens overskrift */
.content > ul, .content > ol { padding-left: calc(var(--gutter) + 1.2em); }
.content > .opgave { max-width: none; margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); margin-right: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); padding-left: 0; padding-right: 0; }
.opgave ul { padding-left: 1.2em; }

/* Kundeportal */
.portal-bruger { font-size: 15px; color: var(--muted); }
.portal-filer { list-style: none; padding-left: var(--gutter) !important; }
.portal-filer li { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.portal-filer li::marker { content: none; }
.portal-meta { font-size: 14px; color: var(--muted); margin-left: 8px; white-space: nowrap; }

/* Begge knapper lige høje, også når de står ved siden af hinanden */
.wp-block-button__link { line-height: 1.25; box-sizing: border-box; }
.wp-block-buttons { align-items: stretch; }
/* Portrættet er sort-hvidt og fritlagt; det toner ud forneden, så skuldrene ikke står som en kasse */
.portraet img { filter: grayscale(1) contrast(1.04); -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); }
/* Ydelseskort: hele titlen er linket */
.ydelser h3 a::after { content: "\00a0→"; color: var(--red); font-family: var(--sans); font-size: 0.8em; }

/* Kontaktformularen: beskeden og formularen lander under den faste top efter afsendelse. */
.kontakt-boks{scroll-margin-top:100px}
