/*
 * Cosmus Polering – WordPress additions on top of site.css.
 *
 * site.css keeps its rules in cascade layers (base/components/utilities).
 * Rules here are placed in the same layers where they should be overridable
 * by utility classes; only WordPress chrome fixes are un-layered.
 */

/*
 * Inter, self-hosted (variable font, weights 100–900). Registered under its own
 * family name so plugins that ship another "Inter" (e.g. WooCommerce) cannot
 * replace it; the design tokens below point at this family.
 */
@font-face {
	font-family: "Cosmus Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Cosmus Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--font-sans: "Cosmus Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--default-font-family: var(--font-sans);
}

/* ---- WordPress chrome ---------------------------------------------------- */

.skip-link:focus {
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 4px;
	background: var(--primary);
	color: var(--primary-foreground);
	font-size: 15px;
	font-weight: 500;
}

/* Keep the sticky header and mobile menu below the admin toolbar. */
.admin-bar [data-site-header].sticky { top: 32px; }
.admin-bar [data-mobile-menu] { top: 112px; }
@media (max-width: 782px) {
	.admin-bar [data-site-header].sticky { top: 46px; }
	.admin-bar [data-mobile-menu] { top: 126px; }
}
@media (max-width: 600px) {
	.admin-bar [data-site-header].sticky { top: 0; }
}

/* Visible focus for keyboard users (the design has no explicit focus styles). */
:where(a, button, [role="tab"], summary):focus-visible {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* ---- Regular WordPress content (posts, pages written with blocks) -------- */

@layer components {
	.entry-content { font-size: 17px; line-height: 1.7; color: var(--foreground); }
	.entry-content > * + * { margin-top: 1.25em; }
	.entry-content :where(p, li) { color: var(--muted-foreground); }
	.entry-content :where(h2, h3, h4) { color: var(--foreground); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
	.entry-content h2 { font-size: 30px; margin-top: 2em; }
	.entry-content h3 { font-size: 22px; margin-top: 1.75em; }
	.entry-content h4 { font-size: 19px; margin-top: 1.5em; }
	.entry-content :where(h2, h3, h4) + * { margin-top: 0.75em; }
	.entry-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
	.entry-content ul { list-style: disc; padding-left: 1.25em; }
	.entry-content ol { list-style: decimal; padding-left: 1.25em; }
	.entry-content li + li { margin-top: 0.4em; }
	.entry-content strong { color: var(--foreground); font-weight: 600; }
	.entry-content blockquote { border-left: 2px solid var(--primary); padding-left: 1.25em; color: var(--foreground); }
	.entry-content img { border-radius: 6px; height: auto; }
	.entry-content figcaption { margin-top: 0.5em; font-size: 14px; color: var(--muted-foreground); }
	.entry-content hr { border-top: 1px solid var(--border); }
	.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
	.entry-content :where(th, td) { border-bottom: 1px solid var(--border); padding: 0.6em 0.5em; text-align: left; }
	.entry-content :where(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), textarea, select) {
		width: 100%; border: 1px solid var(--input); border-radius: 4px; background: var(--background); padding: 12px 16px; font-size: 16px;
	}
	.entry-content :where(input[type="submit"], button[type="submit"]) {
		border-radius: 4px; background: var(--primary); color: var(--primary-foreground); padding: 14px 24px; font-size: 15px; font-weight: 500; cursor: pointer;
	}
	.entry-content .comment-list { list-style: none; padding: 0; }
	.entry-content .comment-list .children { list-style: none; padding-left: 1.5em; }
	.entry-content .alignwide { max-width: none; }
	.entry-content .aligncenter { margin-inline: auto; }

	.cosmus-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 500; }
	.cosmus-pagination .page-numbers { display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--input); border-radius: 4px; }
	.cosmus-pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
	.cosmus-pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary); }

	.search-form { display: flex; gap: 8px; }
	.search-form label { flex: 1; }
	.search-form .search-field { width: 100%; border: 1px solid var(--input); border-radius: 4px; background: var(--background); padding: 12px 16px; font-size: 16px; }
	.search-form .search-submit { border-radius: 4px; background: var(--primary); color: var(--primary-foreground); padding: 0 20px; font-size: 15px; font-weight: 500; cursor: pointer; }
}

/* Form busy state while a submission is being sent. */
[data-cosmus-form][aria-busy="true"] button[type="submit"] { opacity: 0.7; cursor: progress; }

/*
 * "Indhent tilbud": between 768px and 960px the design's 12-column grid with
 * 80px gaps is wider than the screen, which pushed the logo/photo column
 * off-screen. The text column keeps the design's 400px there (so the heading
 * wraps the same) and the image column takes the remaining width.
 * From 960px the design fits and is unchanged.
 */
@media (min-width: 48rem) and (max-width: 59.99rem) {
	.cosmus-quote-grid { grid-template-columns: 400px minmax(0, 1fr); column-gap: 1.5rem; }
	.cosmus-quote-grid > * { grid-column: auto; }
}

/* Utilities used by the blog templates that the page design does not include. */
@layer utilities {
	.mt-16 { margin-top: calc(var(--spacing) * 16); }
	.mb-12 { margin-bottom: calc(var(--spacing) * 12); }
	.pt-8 { padding-top: calc(var(--spacing) * 8); }
	.pt-12 { padding-top: calc(var(--spacing) * 12); }
	@media (width >= 64rem) {
		.lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	}
}

/* Image formats/positions selectable in the section editor. */
@layer utilities {
	.aspect-\[1\/1\] { aspect-ratio: 1 / 1; }
	.object-bottom { object-position: bottom; }
}

/* ---- Menu dropdowns (from parent/child items in Appearance → Menus) ------ */

.cosmus-dd { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.cosmus-dd-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; margin-right: -6px; border-radius: 4px;
	color: inherit; opacity: .7; cursor: pointer; transition: transform .15s, opacity .15s;
}
[data-site-header].bg-transparent .cosmus-dd-toggle { color: #fff; }
.cosmus-dd-toggle:hover, .cosmus-dd.is-open .cosmus-dd-toggle { opacity: 1; }
.cosmus-dd.is-open .cosmus-dd-toggle, .cosmus-dd:hover .cosmus-dd-toggle { transform: rotate(180deg); }
.cosmus-dd-panel {
	position: absolute; top: calc(100% + 14px); left: -20px; z-index: 60;
	min-width: 240px; padding: 8px;
	background: var(--background); border: 1px solid var(--border); border-radius: 6px;
	box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .28);
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
.cosmus-dd-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.cosmus-dd:hover > .cosmus-dd-panel, .cosmus-dd:focus-within > .cosmus-dd-panel, .cosmus-dd.is-open > .cosmus-dd-panel {
	opacity: 1; visibility: visible; transform: none;
}
.cosmus-dd-link {
	display: block; padding: 9px 12px; border-radius: 4px;
	font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--muted-foreground);
	transition: background-color .15s, color .15s;
}
.cosmus-dd-link:hover, .cosmus-dd-link.is-active { background: var(--secondary); color: var(--foreground); }
.cosmus-dd-sub { padding-left: 12px; border-left: 1px solid var(--border); margin: 2px 0 2px 12px; }
.cosmus-dd-sub .cosmus-dd-link { font-size: 14px; padding: 7px 10px; }

.cosmus-m-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; margin-right: -10px; color: var(--muted-foreground); transition: transform .2s;
}
.cosmus-m-item.is-open .cosmus-m-toggle { transform: rotate(180deg); }
.cosmus-m-sub { padding: 0 0 16px 4px; }
.cosmus-m-link { display: block; padding: 10px 0 10px 16px; border-left: 2px solid var(--border); font-size: 18px; font-weight: 500; color: var(--muted-foreground); }
.cosmus-m-link:hover, .cosmus-m-link[aria-current] { color: var(--foreground); border-left-color: var(--primary); }
.cosmus-m-sub .cosmus-m-sub { padding: 0 0 0 16px; }

/* Footer social icons (optional, Customizer). */
.cosmus-social a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid color-mix(in oklab, var(--ink-foreground) 20%, transparent); border-radius: 999px; color: color-mix(in oklab, var(--ink-foreground) 80%, transparent); transition: color .15s, border-color .15s; }
.cosmus-social a:hover { color: var(--ink-foreground); border-color: var(--ink-foreground); }
