/* ==========================================================================
   EMS Byg – Stylesheet
   Farvepalette er hentet direkte fra logoet: rust/terracotta + mørk brun,
   suppleret med en dæmpet petroleumsgrøn som modvægt til terracottaen.
   ========================================================================== */

:root {
  --color-bg: #FAF7F2;
  --color-bg-alt: #F1EBE1;
  --color-ink: #3D362F;
  --color-ink-soft: #6B5544;
  --color-accent: #B2502E;
  --color-accent-dark: #954327;
  --color-accent-2: #3B6E71;
  --color-accent-2-dark: #2C5457;
  --color-border: #E4DDD1;
  --color-white: #FFFFFF;

  --font-heading: ui-serif, Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1800px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(61, 54, 47, 0.08);
  --shadow-md: 0 8px 24px rgba(61, 54, 47, 0.10);
  --logo-h: 120px;
  --header-h: calc(var(--logo-h) + 1rem + 1px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--color-ink); }
p { margin: 0 0 1em; }
button { font-family: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--color-ink);
  color: var(--color-white);
  padding: 0.6em 1em;
  border-radius: var(--radius);
  transition: top 0.2s ease;
  z-index: 200;
}
.skip-link:focus { top: 1rem; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5rem 0; }
@media (max-width: 640px) {
  .section { padding: 3.5rem 0; }
}

#om-os, #ydelser, #kontakt { scroll-margin-top: calc(var(--header-h) + 20px); }
.main-offset { padding-top: calc(var(--header-h) + 2rem); }

.section-heading { max-width: 640px; margin: 0 0 2.5rem; }
.section-heading-center { max-width: none; margin: 0 auto 1rem; text-align: center; }
.section-intro { color: var(--color-ink-soft); font-size: 1.05rem; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.6em;
}
.eyebrow-lg { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-accent-2); color: var(--color-accent-2); }
.btn-lg { padding: 0.9em 1.9em; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.logo-link { flex-shrink: 0; }
.logo-img { height: var(--logo-h); width: auto; }

.main-nav { margin-left: auto; }
.nav-list { display: flex; gap: 2rem; }
.nav-list a {
  text-decoration: none;
  font-weight: 500;
  color: var(--color-ink);
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-list a:hover { color: var(--color-accent); border-color: var(--color-accent); }

.header-cta { flex-shrink: 0; }
.phone-cta svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-left: 0.5rem;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--color-ink);
}

.mobile-nav {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.mobile-nav ul { display: flex; flex-direction: column; padding: 1rem 1.5rem; gap: 0.25rem; }
.mobile-nav a {
  display: block;
  padding: 0.75em 0.25em;
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav li:last-child a { border-bottom: none; margin-top: 0.5rem; }
.mobile-nav a.btn { color: var(--color-white); text-align: center; }

@media (max-width: 860px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  :root { --logo-h: 92px; }
}
@media (max-width: 480px) {
  :root { --logo-h: 68px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: var(--header-h);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 26, 21, 0.35), rgba(31, 26, 21, 0.15) 35%, rgba(31, 26, 21, 0.5));
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(300px, 420px);
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  padding: 3rem clamp(1.5rem, 6vw, 6rem);
  width: 100%;
}
.hero-content, .hero-cta-card {
  background: var(--color-bg);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}
.hero-content { padding: 1.25rem 1.5rem; }
.hero-intro { font-size: 1.05rem; color: var(--color-ink); font-weight: 500; max-width: 56ch; }

.hero-facts { display: flex; flex-direction: column; gap: 0.7rem; margin: 1.5rem 0 0; }
.hero-facts li {
  position: relative;
  padding-left: 1.9em;
  font-weight: 600;
  color: var(--color-ink);
}
.hero-facts li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 0.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-cta-card { padding: 1.25rem 1.5rem; text-align: left; }
.hero-cta-card h2 { text-align: center; font-size: 1.3rem; margin-bottom: 0.3em; }
.hero-cta-card > p { color: var(--color-ink-soft); text-align: center; margin-bottom: 1rem; font-size: 0.9rem; }
.hero-cta-card .form-row { margin-bottom: 0.7rem; }
.hero-cta-card .form-row-half { gap: 0.7rem; margin-bottom: 0.7rem; }
.hero-cta-card label { margin-bottom: 0.25em; font-size: 0.85rem; }
.hero-cta-card input, .hero-cta-card textarea {
  padding: 0.5em 0.7em;
  font-size: 0.95rem;
}
.hero-cta-card textarea { min-height: 56px; }
.hero-cta-card .btn { width: 100%; padding: 0.65em 1.5em; font-size: 0.95rem; }
.hero-cta-card .form-status { font-size: 0.85rem; margin-top: 0.6rem; }

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    padding-top: var(--header-h);
    padding-bottom: 0;
    display: block;
  }
  .hero-img {
    position: static;
    height: 280px;
    object-position: top center;
  }
  .hero::before { display: none; }
  .hero-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  .hero-content, .hero-cta-card { padding: 1.5rem; }
}
@media (max-width: 480px) {
  .hero-img { height: 220px; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3.5rem;
  align-items: start;
}
.about-media-photo {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.check-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.check-list li {
  position: relative;
  padding-left: 1.6em;
  color: var(--color-ink-soft);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { order: -1; }
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 2rem 2.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-alt);
}
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; max-width: 480px; }
}
.service-item h3 { margin-bottom: 0.4em; }
.service-item p { color: var(--color-ink-soft); margin: 0; font-size: 0.95rem; }

/* ---------- Kontaktformular ---------- */
.form-row { margin-bottom: 1.25rem; }
.form-row-half { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.form-row-half .form-row { margin-bottom: 0; }
label { display: block; font-weight: 600; margin-bottom: 0.4em; font-size: 0.95rem; }
input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-ink);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(178, 80, 46, 0.15);
}
textarea { resize: vertical; min-height: 140px; }
.form-row input:invalid[data-touched="true"],
.form-row textarea:invalid[data-touched="true"] {
  border-color: #b23a2e;
}
.field-error {
  color: #b23a2e;
  font-size: 0.85rem;
  margin-top: 0.35em;
  display: block;
}
.form-status {
  margin-top: 1rem;
  margin-bottom: 0;
  font-weight: 600;
  min-height: 1.2em;
}
.form-status.success { color: #3B6B3B; }
.form-status.error { color: #b23a2e; }

@media (max-width: 860px) {
  .form-row-half { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-ink);
  color: #E8E1D6;
  padding: 3rem 0 1.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(232, 225, 214, 0.15);
}
.footer-logo {
  height: 64px;
  width: auto;
  border-radius: 8px;
  background: var(--color-white);
  padding: 0.4rem;
}
.footer-details p { margin: 0 0 0.3em; color: #D8CFC1; }
.footer-details a { text-decoration: none; color: #E8E1D6; }
.footer-details a:hover { color: var(--color-accent); }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; text-align: right; }
.footer-links a { text-decoration: none; color: #D8CFC1; font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-accent); }
.footer-bottom { padding-top: 1.25rem; }
.footer-bottom p { margin: 0; font-size: 0.85rem; color: #B8AE9E; }

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; text-align: left; }
  .footer-links { text-align: left; }
}

/* ---------- Sticky mobile CTA ---------- */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  gap: 0.75rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--color-border);
}
.mobile-cta-bar .btn { display: flex; flex: 1; }
.mobile-cta-bar .btn-ghost { border-color: var(--color-ink-soft); }

@media (max-width: 640px) {
  .mobile-cta-bar { display: flex; }
  body { padding-bottom: 72px; }
}

/* ---------- Cookie-banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: var(--color-ink);
  color: var(--color-white);
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(31, 26, 21, 0.15);
}
.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; color: #D8CFC1; }
.cookie-banner a { color: var(--color-white); }
.cookie-banner .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .cookie-banner { bottom: 72px; }
}
