/*
Theme Name: Morgenstund
Theme URI: https://morgenstund.dk
Author: Morgenstund ApS
Author URI: https://morgenstund.dk
Description: Blocktema til Morgenstund.dk - specialistkonsulenter i online marketing, analyse og udvikling.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
Version: 1.6.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: morgenstund
*/

/* ---------- Basis ---------- */
body { -webkit-font-smoothing: antialiased; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: inherit; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.wp-site-blocks { padding-top: 0; padding-bottom: 0; }

.ms-section { padding-top: clamp(72px, 9vw, 112px) !important; padding-bottom: clamp(72px, 9vw, 112px) !important; }
.ms-section--tight { padding-top: 64px !important; padding-bottom: 64px !important; }

.ms-eyebrow { font-size: 15px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.ms-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.35; font-weight: 700; max-width: 640px; }
.ms-sub { font-size: 19px; font-style: italic; font-weight: 600; }
.ms-body-lg { font-size: 19px; line-height: 1.55; max-width: 620px; }
.ms-muted { color: var(--wp--preset--color--grey); }

.ms-textlink a, a.ms-textlink { font-weight: 700; font-size: 18px; text-underline-offset: 4px; }
.ms-textlink--italic a { font-style: italic; font-weight: 800; font-size: 22px; }

/* ---------- Knapper ---------- */
.ms-btn .wp-block-button__link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; box-sizing: border-box; }
.ms-btn .wp-block-button__link::after {
	content: ""; width: 18px; height: 18px; flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform .2s ease;
}
.ms-btn .wp-block-button__link:hover::after { transform: translateX(4px); }
.ms-btn--green .wp-block-button__link { background: var(--wp--preset--color--green); color: #000; }
.ms-btn--green .wp-block-button__link:hover { background: #b6d698; color: #000; }
.ms-btn--small .wp-block-button__link { padding: 12px 20px; font-size: 14px; font-weight: 700; }
.ms-btn--small .wp-block-button__link::after { display: none; }

.ms-pills { gap: 12px !important; }
.ms-pill .wp-block-button__link {
	background: transparent; color: #000; border: 1px solid #000;
	padding: 10px 18px; font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; min-height: 44px; box-sizing: border-box;
}
.ms-pill .wp-block-button__link:hover { background: #000; color: #fff; }

/* ---------- Header ---------- */
.ms-header__inner { border-bottom: 1px solid #000; padding-top: 24px; padding-bottom: 24px; }
.ms-logo { margin: 0 !important; }
.ms-logo img { height: 26px; width: auto; display: block; }
.ms-nav { font-size: 16px; font-weight: 500; }
.ms-nav a { text-decoration: none; }
.ms-nav .current-menu-item > a, .ms-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.ms-header__right { gap: 28px !important; }
.ms-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--green) !important; color: #000 !important; }
.ms-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 28px; font-weight: 800; }

@media (max-width: 600px) {
	.ms-header .ms-btn--small { display: none; }
	.ms-header__inner { flex-wrap: nowrap !important; }
}

/* ---------- Hero ---------- */
.ms-hero { padding-top: clamp(72px, 9vw, 112px) !important; padding-bottom: clamp(72px, 9vw, 104px) !important; }
.ms-hero h1 { overflow-wrap: break-word; }
/* Smalle tekstblokke venstrestilles i indholdsbredden i stedet for at blive centreret */
.is-layout-constrained > .ms-lead,
.is-layout-constrained > .ms-body-lg,
.is-layout-constrained > .ms-page-title {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}
.ms-hero__bottom { padding-top: 8px; gap: 48px !important; }
.ms-hero__bottom > .wp-block-group { max-width: 640px; gap: 14px; }
.ms-page-title { font-size: clamp(48px, 7vw, 104px) !important; line-height: 1 !important; }

/* ---------- Sorte sektioner ---------- */
.ms-dark { color: #fff; }
.ms-dark a { color: #fff; }
.ms-dark .ms-muted, .ms-dark .ms-on-dark-muted { color: var(--wp--preset--color--light-grey); }
.ms-stat__num { font-size: 80px !important; font-weight: 900; letter-spacing: -0.04em; line-height: 1 !important; margin: 0 !important; color: var(--wp--preset--color--green); }
.ms-stat__label { font-size: 18px; font-weight: 600; margin-top: 8px !important; }
.ms-stat { gap: 0 !important; }

/* ---------- Split-layout ---------- */
.ms-split { gap: clamp(40px, 5vw, 64px) !important; align-items: flex-start !important; }
.ms-split > * { flex: 1 1 380px; min-width: 0; }
.ms-split > .ms-col--wide { flex: 2 1 560px; }
.ms-split--center { align-items: center !important; }

/* ---------- Lister ---------- */
.ms-xlist, .ms-lines { list-style: none; padding: 0 !important; margin: 0; }
.ms-xlist li, .ms-lines li { border-top: 1px solid #000; margin: 0; }
.ms-xlist li:last-child, .ms-lines li:last-child { border-bottom: 1px solid #000; }
.ms-xlist li { padding: 22px 0 22px 42px; position: relative; font-size: 21px; font-weight: 600; line-height: 1.4; }
.ms-xlist li::before {
	content: ""; position: absolute; left: 0; top: 26px; width: 22px; height: 22px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 3l10 10M13 3L3 13' stroke='black' stroke-width='2.2'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 3l10 10M13 3L3 13' stroke='black' stroke-width='2.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ms-lines li { padding: 16px 0; font-size: 18px; }
.ms-dashlist { list-style: none; padding: 0 !important; margin: 0; }
.ms-dashlist li { position: relative; margin: 0; padding: 22px 0 22px 36px; border-top: 1px solid currentColor; font-size: 21px; font-weight: 600; line-height: 1.4; }
.ms-dashlist li:last-child { border-bottom: 1px solid currentColor; }
.ms-dashlist li::before { content: "-"; position: absolute; left: 4px; top: 22px; font-weight: 800; }
.ms-plus { list-style: none; padding: 16px 0 0 !important; margin: 0; border-top: 1px solid #000; font-size: 16px; font-weight: 600; }
.ms-plus li { margin: 0 0 8px; }
.ms-plus li::before { content: "+ "; }

/* ---------- Kort ---------- */
.ms-card.is-layout-flex, .ms-step.is-layout-flex, .ms-stat.is-layout-flex { align-items: stretch !important; }
.ms-card { background: #fff; border: 1px solid #000; padding: 32px !important; gap: 18px !important; }
.ms-card h3 { font-size: 28px; line-height: 1.1; letter-spacing: -0.015em; margin: 0; }
.ms-card h3 a { text-decoration: none; }
.ms-card h3 a::after { content: ""; position: absolute; inset: 0; }
.ms-card { position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.ms-card--link:hover { transform: translateY(-4px); box-shadow: 6px 6px 0 #000; }
.ms-card p { margin: 0; font-size: 17px; line-height: 1.5; }

.ms-quote__num { font-size: 48px !important; font-weight: 900; letter-spacing: -0.03em; line-height: 1 !important; margin: 0 !important; }
.ms-quote blockquote, .ms-quote .ms-quote__text { font-size: 20px; line-height: 1.45; font-weight: 700; margin: 0; }
.ms-quote__by { font-size: 16px !important; border-top: 1px solid #000; padding-top: 16px; margin-top: auto !important; }

/* ---------- Trin ---------- */
.ms-step { border-top: 2px solid currentColor; padding-top: 20px; gap: 14px !important; }
.ms-step__num { font-size: 72px !important; font-weight: 900; font-style: italic; line-height: 1 !important; letter-spacing: -0.04em; margin: 0 !important; }
.ms-step h3 { margin: 0; }
.ms-step p { margin: 0; font-size: 17px; line-height: 1.5; }
.ms-step--thin { border-top-width: 1px; }

/* ---------- Ydelser ---------- */
.ms-service__num { font-size: 16px; font-weight: 700; margin: 0; }
.ms-service h2 { font-size: var(--wp--preset--font-size--x-large); line-height: 1.05; letter-spacing: -0.02em; }
.ms-small-label { font-size: 16px; font-weight: 700; margin: 0 0 8px !important; }

/* ---------- Billeder ---------- */
.ms-portrait { margin: 0 !important; max-width: 560px; }
.ms-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }

/* ---------- Kontaktformular ---------- */
.ms-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ms-form__field { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 700; }
.ms-form__field--full, .ms-form__actions, .ms-form__notice, .ms-form__consent { grid-column: 1 / -1; }
.ms-form input[type="text"], .ms-form input[type="email"], .ms-form input[type="tel"], .ms-form textarea {
	font: inherit; font-weight: 400; font-size: 17px; padding: 14px 16px; min-height: 52px; box-sizing: border-box; width: 100%;
	border: 1px solid #000; background: #fff; color: #000; border-radius: 0;
}
.ms-form textarea { resize: vertical; min-height: 140px; }
.ms-form input:focus-visible, .ms-form textarea:focus-visible { outline: 3px solid var(--wp--preset--color--green); outline-offset: 2px; }
.ms-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ms-form__consent { font-size: 14px; font-weight: 400; line-height: 1.5; margin: 0; }
.ms-form__submit {
	justify-self: start; font: inherit; cursor: pointer; border: 0; background: #000; color: #fff;
	padding: 20px 36px; font-size: 16px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; min-height: 44px;
}
.ms-form__submit:hover { background: #222; }
.ms-form__notice { padding: 16px 20px; font-weight: 700; border: 1px solid currentColor; margin: 0; }
.ms-dark .ms-form input, .ms-dark .ms-form textarea { border-color: #fff; }
.ms-dark .ms-form__submit { background: var(--wp--preset--color--green); color: #000; }
.ms-dark .ms-form__submit:hover { background: #b6d698; }
.ms-dark .ms-form__consent a { color: #fff; }
@media (max-width: 640px) {
	.ms-form { grid-template-columns: minmax(0, 1fr); }
}

.ms-contact-lines { font-size: 22px; line-height: 1.45; gap: 4px !important; }
.ms-contact-lines p { margin: 0; }
.ms-contact-lines a { text-decoration: none; }

/* ---------- Footer ---------- */
.ms-footer { font-size: 15px; line-height: 1.6; }
.ms-footer__inner { padding-top: 48px; padding-bottom: 56px; gap: 32px !important; }
.ms-footer p { margin: 0; }
.ms-footer .ms-logo img { height: 22px; }

/* ---------- Standardside ---------- */
.ms-page-content { padding-top: clamp(64px, 8vw, 96px) !important; padding-bottom: clamp(64px, 8vw, 112px) !important; }
.ms-page-content .wp-block-post-content { max-width: 760px; }
.ms-page-content .wp-block-post-content h2 { font-size: var(--wp--preset--font-size--x-large); }

/* ---------- Cookie-samtykke ---------- */
.ms-cc {
	position: fixed; z-index: 99999; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
	width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
	background: #fff; color: #000; border: 1px solid #000; box-shadow: 8px 8px 0 #000;
	padding: 24px; display: flex; flex-direction: column; gap: 18px; font-family: var(--wp--preset--font-family--figtree);
}
.ms-cc[hidden], .ms-cc-open[hidden] { display: none !important; }
.ms-cc__main { display: flex; flex-direction: column; gap: 8px; }
.ms-cc__title { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.ms-cc__text { margin: 0; font-size: 15px; line-height: 1.5; }
.ms-cc__text a { color: #000; font-weight: 700; }
.ms-cc__prefs { display: flex; flex-direction: column; border-top: 1px solid #000; }
.ms-cc__prefs[hidden] { display: none; }
.ms-cc__opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #000; font-size: 14px; line-height: 1.45; cursor: pointer; }
.ms-cc__opt strong { display: block; font-size: 15px; }
.ms-cc__opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: #000; }
.ms-cc__actions { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.ms-cc__actions .ms-cc__link { align-self: center; margin-right: 6px; }
@media (max-width: 520px) {
	.ms-cc__actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.ms-cc__actions .ms-cc__link { grid-column: 1 / -1; justify-self: start; }
}
.ms-cc__btn {
	font: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
	background: #000; color: #fff; border: 1px solid #000; padding: 14px 12px; min-height: 48px; width: 100%;
	display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.25;
}
.ms-cc__btn:hover { background: #222; }
.ms-cc__btn--save { background: var(--wp--preset--color--green); color: #000; grid-column: 1 / -1; }
.ms-cc__btn--save:hover { background: #b6d698; }
.ms-cc__btn[hidden] { display: none; }
.ms-cc__link { font: inherit; font-size: 15px; font-weight: 700; background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; color: #000; }
.ms-cc button:focus-visible, .ms-cc-open:focus-visible { outline: 3px solid var(--wp--preset--color--green); outline-offset: 2px; }
.ms-cc-open {
	position: fixed; z-index: 99998; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
	width: 48px; height: 48px; border-radius: 50%; border: 1px solid #000; background: var(--wp--preset--color--green); color: #000;
	display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.ms-cc-open:hover { background: #b6d698; }

/* ---------- Tabeller på almindelige sider ---------- */
.ms-page-content .wp-block-table table { table-layout: auto; font-size: 15px; line-height: 1.45; }
.ms-page-content .wp-block-table th { text-align: left; font-weight: 800; }
.ms-page-content .wp-block-table th, .ms-page-content .wp-block-table td { padding: 10px 12px; vertical-align: top; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.ms-page-content .wp-block-table td:first-child { white-space: nowrap; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.ms-page-content .wp-block-post-content h2 { font-size: clamp(30px, 4vw, 40px); margin-top: 1.6em; }

/* ---------- Sticky header ---------- */
.wp-site-blocks > .wp-block-template-part:first-child,
.wp-site-blocks > header.wp-block-template-part:first-child {
	position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 1000;
}
/* Øverst ser headeren ud som sektionen (grøn på forsiden); når der scrolles, bliver den hvid */
.ms-header { transition: background-color .25s ease, box-shadow .25s ease; }
.ms-header__inner { transition: padding .25s ease, border-color .25s ease; }
.ms-logo img { transition: height .25s ease; }
.ms-header .wp-block-button__link { transition: padding .25s ease, background-color .2s ease; }

/* Når der er scrollet: hvid, lavere og centreret i højden */
.ms-scrolled .ms-header { background-color: #fff !important; color: #000; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.ms-scrolled .ms-header__inner { padding-top: 8px; padding-bottom: 8px; border-bottom-width: 0; align-items: center !important; min-height: 56px; box-sizing: border-box; }
.ms-scrolled .ms-header__inner > *, .ms-scrolled .ms-header__right { align-self: center; align-items: center !important; }
.ms-scrolled .ms-header .ms-logo img { height: 20px; }
.ms-scrolled .ms-header .ms-btn--small .wp-block-button__link { padding: 8px 14px; min-height: 38px; font-size: 13px; }

/* ---------- Mobilmenu ---------- */
.ms-menu-logo, .ms-menu-cta { display: none; }
.ms-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)) !important;
}
.ms-header .is-menu-open .wp-block-navigation__responsive-close,
.ms-header .is-menu-open .wp-block-navigation__responsive-dialog { height: 100%; }
.ms-header .is-menu-open .wp-block-navigation__responsive-container-content {
	display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 28px;
	min-height: 100%; padding-top: 0 !important; box-sizing: border-box;
}
.ms-header .is-menu-open .ms-menu-logo { display: block; margin-bottom: 24px; line-height: 0; }
.ms-header .is-menu-open .ms-menu-logo img { height: 26px; width: auto; display: block; }
.ms-header .is-menu-open .wp-block-navigation__container { gap: 18px !important; align-items: flex-start !important; }
.ms-header .is-menu-open .ms-menu-cta {
	display: flex; align-items: center; justify-content: center; margin-top: auto; width: 100%; box-sizing: border-box;
	background: #000; color: #fff !important; text-decoration: none; padding: 18px 24px; min-height: 52px;
	font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.ms-header .wp-block-navigation__responsive-container-close { top: max(20px, env(safe-area-inset-top, 0px)) !important; right: max(20px, env(safe-area-inset-right, 0px)) !important; }

@media (prefers-reduced-motion: reduce) {
	.ms-header, .ms-header__inner, .ms-logo img, .ms-header .wp-block-button__link { transition: none; }
}

/* Ankre (fx #kontakt) lander under den sticky header */
:where(.wp-site-blocks) [id] { scroll-margin-top: calc(80px + var(--wp-admin--admin-bar--height, 0px)); }
/* Skjul cookie-knappen, mens mobilmenuen er åben */
html.has-modal-open .ms-cc-open { display: none !important; }
mark.has-inline-color { background-color: transparent; }

/* Headerens højde styres kun af den indre række (ingen ekstra padding fra baggrundsfarven) */
.ms-header.has-background { padding-top: 0 !important; padding-bottom: 0 !important; }
.ms-header .ms-logo, .ms-header .ms-logo a { line-height: 0; display: block; }
