/*
Theme Name: Unicator
Theme URI: https://unicator.dk
Author: Rittermann
Author URI: https://rittermann.pro
Description: Blok-tema til Unicator (en del af Viborg IT). Farver, typografi og sektioner følger det godkendte layoutforslag. Sider bygges af færdige mønstre (sektioner) i editoren.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: unicator
Tags: full-site-editing, block-patterns, custom-colors, editor-style
*/

/* ---------- Reserveskrifttyper (mindsker layout shift, CLS) ----------
   Arial justeret til samme bredde og linjehøjde som webfontene, så teksten
   ikke flytter sig, når Outfit/DM Sans er hentet. Værdier udregnet fra
   fontfilerne (Outfit 700 mod Arial Bold, DM Sans 400 mod Arial). */
@font-face {
	font-family: "Outfit Fallback";
	src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial"), local("Liberation Sans Bold"), local("Liberation Sans");
	size-adjust: 95.71%;
	ascent-override: 104.48%;
	descent-override: 27.17%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "DM Sans Fallback";
	src: local("Arial"), local("ArialMT"), local("Liberation Sans");
	size-adjust: 105.84%;
	ascent-override: 93.73%;
	descent-override: 29.29%;
	line-gap-override: 0%;
}

/* ---------- Grundlæggende ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
main.wp-block-group { margin-top: 0; }
[id] { scroll-margin-top: 24px; }

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--wp--preset--color--moerkegroen);
	outline-offset: 3px;
}
.has-skov-background-color a:focus-visible,
.has-skov-lys-background-color a:focus-visible,
.unicator-footer a:focus-visible {
	outline-color: var(--wp--preset--color--lime);
}

/* Links på mørk baggrund */
.has-skov-background-color a:not(.wp-block-button__link),
.has-skov-lys-background-color a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--lime);
}
.has-skov-background-color a:not(.wp-block-button__link):hover,
.has-skov-lys-background-color a:not(.wp-block-button__link):hover {
	color: var(--wp--preset--color--hvid);
}

/* Fuldbredde-sektioner ligger kant i kant (ingen hvide striber) */
.wp-block-post-content > .alignfull + .alignfull,
.wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull:last-child { margin-block-end: 0; }

/* Links nederst i kort skubbes ned, så de flugter */
.unicator-card-link { margin-top: auto !important; }

/* ---------- Sidehoved ---------- */
.unicator-header { border-bottom: 1px solid #E3EBDB; }
.unicator-header .unicator-logo { margin: 0; }
.unicator-header .unicator-logo img { height: 60px; width: auto; max-width: none; display: block; }
.unicator-header .unicator-logo--mobile { display: none; }
.unicator-header .unicator-parent a {
	display: flex;
	align-items: center;
	gap: 20px;
	color: var(--wp--preset--color--daempet);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.unicator-header .unicator-parent a::before {
	content: "";
	width: 1px;
	height: 36px;
	background: #D3DECB;
}
.unicator-header .unicator-parent a:hover { color: var(--wp--preset--color--skov); }
.unicator-header .wp-block-navigation a:hover { color: var(--wp--preset--color--moerkegroen); }
.unicator-header .wp-block-navigation .current-menu-item > a,
.unicator-header .wp-block-navigation a[aria-current="page"] {
	color: var(--wp--preset--color--moerkegroen);
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 2px;
}
.unicator-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 32px 24px;
}
.unicator-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: 20px;
	gap: 20px;
}
.unicator-header .wp-block-navigation__responsive-container-open svg,
.unicator-header .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }

/* Menuen har mange punkter – fold den sammen under 1360px (WordPress gør det først under 600px) */
@media (min-width: 600px) and (max-width: 1359px) {
	.unicator-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.unicator-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 1359px) {
	.unicator-header .unicator-header-cta { display: none; }
}
@media (min-width: 1360px) and (max-width: 1499px) {
	.unicator-header .unicator-parent { display: none; }
}
.unicator-header .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 781px) {
	.unicator-header .unicator-logo--desktop { display: none; }
	.unicator-header .unicator-logo--mobile { display: block; }
	.unicator-header .unicator-logo--mobile img { height: 40px; }
	.unicator-header .unicator-parent { display: none; }
}

/* ---------- Knapper ---------- */
.wp-block-button__link {
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 2px solid var(--wp--preset--color--skov);
	color: var(--wp--preset--color--skov);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--skov);
	color: var(--wp--preset--color--hvid);
}
.wp-block-button.is-style-unicator-groen > .wp-block-button__link {
	background: var(--wp--preset--color--groen);
	border-color: var(--wp--preset--color--groen);
	color: var(--wp--preset--color--skov);
}
.wp-block-button.is-style-unicator-groen > .wp-block-button__link:hover {
	background: var(--wp--preset--color--lime);
	border-color: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--skov);
}
.has-skov-background-color .wp-block-button.is-style-outline > .wp-block-button__link,
.has-skov-lys-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: var(--wp--preset--color--groen);
	color: var(--wp--preset--color--hvid);
}
.has-skov-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.has-skov-lys-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--groen);
	color: var(--wp--preset--color--skov);
}
.has-skov-background-color .wp-block-button__link:focus-visible,
.has-skov-lys-background-color .wp-block-button__link:focus-visible { outline-color: var(--wp--preset--color--lime); }
.unicator-hero .wp-block-button__link { font-size: 17px; padding: 16px 32px; }
.unicator-hero .is-style-outline > .wp-block-button__link { padding: 14px 32px; }

/* ---------- Tekst-stilarter ---------- */
.is-style-unicator-eyebrow {
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	line-height: 1.4;
	color: var(--wp--preset--color--moerkegroen);
}
.has-skov-background-color .is-style-unicator-eyebrow,
.has-skov-lys-background-color .is-style-unicator-eyebrow {
	color: var(--wp--preset--color--lime);
}
.is-style-unicator-badge {
	display: inline-block;
	align-self: flex-start;
	width: auto !important;
	background: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--skov);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	padding: 6px 14px;
	border-radius: 999px;
}
.has-skov-background-color .is-style-unicator-badge {
	background: var(--wp--preset--color--groen);
}
.is-style-unicator-tag {
	display: inline-block;
	padding: 14px 22px;
	border: 2px solid var(--wp--preset--color--groen);
	border-radius: 999px;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.3;
	margin: 0;
}
/* Trin-nummer: mørkegrøn cirkel. Layoutets mellemgrønne cirkel med hvid tekst
   gav kun 2,95:1 i kontrast; mørkegrøn giver 6,5:1 (WCAG AA). */
.is-style-unicator-step {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px !important;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--moerkegroen);
	color: var(--wp--preset--color--hvid);
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 700;
	font-size: 20px;
	line-height: 1;
	margin: 0;
}

/* ---------- Lister med flueben ---------- */
:root {
	--unicator-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
ul.is-style-unicator-check {
	list-style: none;
	padding-left: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	line-height: 1.5;
}
ul.is-style-unicator-check li {
	position: relative;
	padding-left: 34px;
	margin: 0;
}
ul.is-style-unicator-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.05em;
	width: 22px;
	height: 22px;
	background-color: var(--wp--preset--color--moerkegroen);
	-webkit-mask: var(--unicator-icon-check) center / contain no-repeat;
	mask: var(--unicator-icon-check) center / contain no-repeat;
}
.has-skov-background-color ul.is-style-unicator-check li::before,
.has-skov-lys-background-color ul.is-style-unicator-check li::before {
	background-color: var(--wp--preset--color--lime);
}

/* ---------- Dekoration ---------- */
.is-style-unicator-accent-bar {
	width: 48px;
	height: 6px;
	min-height: 0 !important;
	padding: 0 !important;
	flex: none;
}
.is-style-unicator-accent-bar.unicator-accent-bar--small {
	width: 40px;
	height: 4px;
	border-radius: 2px;
}

/* Hero-grafik: tre stigende søjler (samme motiv som logoet) */
.unicator-bars {
	width: 340px;
	max-width: 100%;
	height: 380px;
	box-sizing: border-box;
	align-items: flex-end !important;
	padding: 40px 32px 48px !important;
}
.unicator-bars > .wp-block-group {
	width: 56px;
	padding: 0 !important;
	margin: 0 !important;
}
.unicator-bars > .wp-block-group:nth-child(1) { height: 140px; }
.unicator-bars > .wp-block-group:nth-child(2) { height: 210px; }
.unicator-bars > .wp-block-group:nth-child(3) { height: 290px; }
@media (max-width: 781px) {
	.unicator-bars { height: 280px; width: 260px; padding: 28px 24px 32px !important; }
	.unicator-bars > .wp-block-group { width: 44px; }
	.unicator-bars > .wp-block-group:nth-child(1) { height: 100px; }
	.unicator-bars > .wp-block-group:nth-child(2) { height: 150px; }
	.unicator-bars > .wp-block-group:nth-child(3) { height: 210px; }
}

/* ---------- Blogkort ---------- */
.unicator-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
	overflow: hidden;
	background: var(--wp--preset--color--hvid);
	border: 1px solid var(--wp--preset--color--streg);
	border-radius: 12px;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.unicator-post-card:hover {
	border-color: var(--wp--preset--color--groen);
	box-shadow: 0 12px 32px rgba(30, 58, 43, 0.08);
}
.unicator-post-card .wp-block-post-featured-image { margin: 0; }
.unicator-post-card .wp-block-post-featured-image img { height: 180px; object-fit: cover; }
/* Pladsholder, når indlægget ikke har et udvalgt billede */
.unicator-post-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	height: 180px;
	background:
		radial-gradient(circle at calc(100% + 30px) calc(100% + 30px), transparent 68px, rgba(197, 224, 99, 0.3) 69px, rgba(197, 224, 99, 0.3) 71px, transparent 72px),
		var(--wp--preset--color--skov);
}
.unicator-post-card .unicator-post-card__body { flex: 1; }
.unicator-post-card .wp-block-post-terms a {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--sektion);
	color: var(--wp--preset--color--skov);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.unicator-post-card .wp-block-post-terms__separator { display: none; }
.unicator-post-card .wp-block-post-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.unicator-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--moerkegroen); }
.unicator-meta { color: var(--wp--preset--color--daempet); font-size: 14px; }
.unicator-meta > * { margin: 0 !important; }
.unicator-meta .wp-block-post-time-to-read { white-space: nowrap; }

/* ---------- Sektioner ---------- */
.unicator-hero .has-x-large-font-size { max-width: 600px; }
.unicator-strong-white { color: var(--wp--preset--color--hvid); }
.unicator-support-note a { color: var(--wp--preset--color--skov); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Undersider ---------- */
.unicator-shadow img { box-shadow: 0 24px 60px rgba(30, 58, 43, 0.12); background: #fff; }
.is-style-unicator-step.unicator-step--groen { background: var(--wp--preset--color--groen); color: var(--wp--preset--color--skov); }
.is-style-unicator-step.unicator-step--skov { background: var(--wp--preset--color--skov); color: var(--wp--preset--color--lime); }
.is-style-unicator-step.unicator-step--letter {
	width: 56px !important;
	height: 56px;
	border-radius: 12px;
	font-size: 28px;
	flex: none;
}
.is-style-unicator-step.unicator-step--letter:not(.unicator-step--groen):not(.unicator-step--skov) {
	background: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--skov);
}
.unicator-stat {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 700;
	font-size: clamp(44px, 5vw, 56px);
	line-height: 1;
}
.unicator-tags-small .is-style-unicator-tag { padding: 8px 16px; font-size: 16px; }
.is-style-unicator-badge.unicator-badge--light { background: var(--wp--preset--color--sektion); padding: 4px 12px; }
.unicator-team-card { overflow: hidden; }
.unicator-team-card .wp-block-image { margin: 0; }
.unicator-team-card .wp-block-image img { width: 100%; display: block; background: #2A2A2A; filter: grayscale(1) contrast(1.05); }
.unicator-callout > .wp-block-group:first-child { flex: 1 1 520px; }
.unicator-check-strong li { color: var(--wp--preset--color--tekst-moerk); }
.unicator-check-strong strong { color: var(--wp--preset--color--hvid); }

/* ---------- Ikoner (fra layoutforslaget, tegnet som CSS-masker i skovgrøn) ---------- */
.unicator-icon-box {
	position: relative;
	width: 48px;
	height: 48px;
	min-height: 0 !important;
	padding: 0 !important;
	flex: none;
	box-sizing: border-box;
}
.unicator-icon-box::after {
	content: "";
	position: absolute;
	inset: 12px;
	background-color: var(--wp--preset--color--skov);
	-webkit-mask: var(--unicator-icon) center / contain no-repeat;
	mask: var(--unicator-icon) center / contain no-repeat;
}
.unicator-icon--rapport { --unicator-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h10M4 18h7'/%3E%3Cpath d='M17 15l2 2 3-4'/%3E%3C/svg%3E"); }
.unicator-icon--dokument { --unicator-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E"); }
.unicator-icon--soeg { --unicator-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5'/%3E%3C/svg%3E"); }
.unicator-icon--chat { --unicator-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H8l-4 4z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E"); }
.unicator-icon--chip { --unicator-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v3M12 18v3M3 12h3M18 12h3'/%3E%3Crect x='7' y='7' width='10' height='10' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }

/* ---------- Diagram: byggeklodser + AI (kun på store skærme) ---------- */
.unicator-diagram svg { display: block; width: 100%; max-width: 1100px; height: auto; margin: 0 auto; overflow: visible; }
@media (max-width: 899px) { .unicator-diagram { display: none; } }
.bk-anim .bk-fly { animation: bkFly 9s cubic-bezier(.45,0,.2,1) infinite both; }
.bk-anim .bk-fly rect { animation: bkFill 9s linear infinite both; animation-delay: inherit; }
.bk-anim .bk-core-ring { transform-box: fill-box; transform-origin: center; animation: bkSpin 12s linear infinite; }
.bk-anim .bk-core-pulse { transform-box: fill-box; transform-origin: center; animation: bkPulse 2.4s ease-out infinite; }
.bk-anim .bk-flow { animation: bkFlow 1.2s linear infinite; }
.bk-anim .bk-res { animation: bkRes 9s ease infinite both; }
@keyframes bkFly { 0% { transform: translate(40px, var(--y)) scale(1); opacity: 0; } 4% { transform: translate(40px, var(--y)) scale(1); opacity: 1; } 17% { transform: translate(495px, 208px) scale(.5); opacity: 1; } 21%, 100% { transform: translate(495px, 208px) scale(.5); opacity: 0; } }
@keyframes bkFill { 0%, 19% { fill: #C5E063; } 25%, 100% { fill: #8CC63F; } }
@keyframes bkSpin { to { transform: rotate(360deg); } }
@keyframes bkPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes bkFlow { to { stroke-dashoffset: -28; } }
@keyframes bkRes { 0%, 40% { opacity: 0; transform: translateX(-14px); } 46%, 86% { opacity: 1; transform: translateX(0); } 94%, 100% { opacity: 0; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .bk-anim * { animation: none !important; } }

/* ---------- Blog: emnefilter (kategorier som knapper) ---------- */
.unicator-category-filter {
	list-style: none;
	padding: 0;
	margin: 8px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.unicator-category-filter li { margin: 0; }
.unicator-category-filter a {
	display: inline-block;
	padding: 8px 18px;
	border: 2px solid var(--wp--preset--color--groen);
	border-radius: 999px;
	font-weight: 600;
	font-size: 16px;
	text-decoration: none;
}
.has-skov-background-color .unicator-category-filter a { color: var(--wp--preset--color--hvid); }
.has-skov-background-color .unicator-category-filter a:hover,
.has-skov-background-color .unicator-category-filter .current-cat > a {
	background: var(--wp--preset--color--groen);
	color: var(--wp--preset--color--skov);
}

/* ---------- Blogindlæg ---------- */
.unicator-back-link a { text-decoration: none; }
.unicator-article-header .unicator-meta { color: #B9CCAE; font-size: 15px; }
.unicator-article-header .wp-block-post-date { color: #B9CCAE; font-size: 15px; }
.unicator-article-header .wp-block-post-terms a {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--groen);
	color: var(--wp--preset--color--skov) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.unicator-article-header .wp-block-post-terms__separator { display: none; }
.unicator-article-header .wp-block-post-excerpt__more-text { display: none; }
.unicator-byline .wp-block-avatar img { display: block; }
.unicator-article-body { font-size: 19px; line-height: 1.75; color: #2E4638; }
.unicator-article-body > * + * { margin-block-start: 22px; }
.unicator-article-body h2 { font-size: clamp(24px, 2.6vw, 28px); line-height: 1.25; margin-block-start: 38px; }
.unicator-article-body h3 { font-size: 22px; margin-block-start: 30px; }
.unicator-article-body .wp-block-quote p { font-weight: 600; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.45; color: var(--wp--preset--color--skov); }

/* ---------- Søgefelt ---------- */
.wp-block-search__input {
	border: 1px solid #7E9286; /* 3,4:1 mod hvid (WCAG 1.4.11) */
	border-radius: 6px;
	padding: 12px 14px;
	font: inherit;
}
.wp-block-search__button {
	border-radius: 6px;
	margin-left: 8px;
}

/* ---------- Sidefod ---------- */
.unicator-footer a { text-decoration: none; }
.unicator-footer a:hover { color: var(--wp--preset--color--lime); }
.unicator-footer .unicator-logo { margin: 0; }
.unicator-footer .unicator-logo img { height: 64px; width: auto; max-width: none; display: block; }
.unicator-footer .unicator-parent a { color: #B9CCAE; font-size: 14px; letter-spacing: 0.01em; }
.unicator-footer .unicator-parent strong { color: var(--wp--preset--color--hvid); font-weight: 600; }
.unicator-footer .wp-block-navigation { font-size: 16px; font-weight: 400; }
.unicator-footer .wp-block-navigation a { color: var(--wp--preset--color--hvid); }
.unicator-footer .unicator-contact a { color: var(--wp--preset--color--hvid); font-weight: 600; }

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