/* ==========================================================
   Kroghøjgård – stylesheet
   Farver og skrifttyper styres fra :root herunder.
   ========================================================== */

:root {
  --linen: #f5f4f3;
  --paper: #ffffff;
  --forest: #3a3137;
  --moss: #4c4148;
  --straw: #7d6474;
  --straw-dark: #63495a;
  --ink: #222022;
  --muted: #69636a;
  --line: #e5e2e3;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
  --wrap: 1120px;
  --shadow: 0 10px 30px rgba(34, 32, 34, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--linen);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--straw-dark); text-underline-offset: 3px; }
a:hover { color: var(--forest); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--forest);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--straw-dark);
  margin-bottom: 0.75rem;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--forest); color: #fff; padding: 0.6rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--straw); color: #fff; }
.btn-primary:hover { background: var(--straw-dark); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,0.8); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--forest); }
.btn-outline { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-outline:hover { background: var(--forest); color: #fff; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--forest);
  color: #e7e2e5;
  font-size: 0.85rem;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  justify-content: flex-end; padding-block: 0.45rem;
}
.topbar a { color: #e7e2e5; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--forest);
}
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1; }
.brand-sub { display: block; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.3rem; }
.nav a {
  display: block; padding: 0.55rem 0.9rem;
  text-decoration: none; color: var(--ink); font-weight: 500;
  border-radius: var(--radius);
}
.nav a:hover { background: var(--linen); color: var(--forest); }
.nav a[aria-current="page"] { color: var(--straw-dark); box-shadow: inset 0 -2px 0 var(--straw); border-radius: 0; }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 0.5rem; cursor: pointer; color: var(--forest);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 820px) {
  .topbar .wrap { justify-content: center; }
  .topbar .hide-sm { display: none; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 0.5rem 1.25rem 1rem; }
  .nav a { padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: none; }
}

/* ---------- Hero (forside) ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid; align-items: end;
  color: #fff;
  background: linear-gradient(135deg, var(--moss), var(--forest));
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slides img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.6s ease;
}
.hero-slides img.active { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(25,20,23,0.15) 0%, rgba(25,20,23,0.15) 40%, rgba(25,20,23,0.72) 100%);
}
.hero-content { position: relative; z-index: 2; padding-block: 5rem 4.5rem; }
.hero-content > * { max-width: 720px; }
.hero h1 { color: #fff; margin-bottom: 0.3em; }
.hero .eyebrow { color: #dccbd5; }
.hero p.lead { font-size: 1.2rem; color: #f2eff1; margin-bottom: 1.8rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Page header (undersider) ---------- */
.page-head {
  background: var(--forest);
  color: #e7e2e5;
  padding-block: 4rem 3.5rem;
  text-align: center;
}
.page-head h1 { color: #fff; }
.page-head p { max-width: 640px; margin: 0 auto; font-size: 1.1rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--paper); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head.center { text-align: center; margin-inline: auto; }

.split {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1.05fr 1fr; align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.photo {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #e4e1e2, #cfcacd);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.card .photo { border-radius: 0; box-shadow: none; aspect-ratio: 3 / 2; }
.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-body p { color: var(--muted); }
.card-link { margin-top: auto; font-weight: 600; color: var(--straw-dark); }

/* ---------- Apartments ---------- */
.apartment {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 2rem;
}
.apartment .photo { border-radius: 0; box-shadow: none; aspect-ratio: auto; min-height: 280px; }
.apartment-body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.apartment-body ul { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.apartment-body li { margin-bottom: 0.3rem; }
.price {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem;
  border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem;
}
.price strong { font-family: var(--serif); font-size: 1.7rem; color: var(--forest); }
.price span { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 820px) { .apartment { grid-template-columns: 1fr; } .apartment .photo { aspect-ratio: 3 / 2; min-height: 0; } }

.notice {
  background: #f1edf0; border-left: 4px solid var(--straw);
  padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 2.5rem;
}

.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 820px) { .terms { grid-template-columns: 1fr; } }
.term { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.term h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.term p { margin: 0; color: var(--muted); }

/* ---------- Facilities ---------- */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature {
  display: grid; grid-template-columns: 56px 1fr; gap: 1.1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem;
}
.icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--linen); color: var(--straw-dark);
  display: grid; place-items: center;
}
.icon svg { width: 28px; height: 28px; }
.feature h3 { margin-bottom: 0.3rem; }
.feature p { margin: 0; color: var(--muted); }

.places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .places { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .places { grid-template-columns: 1fr; } }
.place { border-top: 3px solid var(--straw); background: var(--paper); padding: 1.4rem; border-radius: 0 0 var(--radius) var(--radius); }
.place .dist { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss); }
.place h3 { margin: 0.2rem 0 0.4rem; font-size: 1.2rem; }
.place p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid; gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery a {
  display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius);
  background: #e2dfe0;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; display: none; }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(20, 17, 19, 0.92); }
.lightbox-inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 3.5rem 4rem; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-btn {
  position: fixed; background: rgba(255,255,255,0.12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover { background: rgba(255,255,255,0.25); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox-inner { padding: 4rem 0.5rem; } .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; } }

/* ---------- Map (klik for at indlæse) ---------- */
.map {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #e6e4e5, #d3cfd1);
  aspect-ratio: 4 / 3; width: 100%;
  display: grid; place-items: center; text-align: center;
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(1); }
.map-placeholder { padding: 1.5rem; max-width: 420px; }
.map-placeholder p { color: var(--forest); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.contact-list li { display: grid; grid-template-columns: 28px 1fr; gap: 0.8rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.contact-list svg { width: 22px; height: 22px; color: var(--straw-dark); margin-top: 0.2rem; }
.contact-list strong { display: block; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 0.7rem 0.85rem; border: 1px solid #cdc8cb; border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--straw); outline-offset: 1px; border-color: var(--straw); }
.field textarea { min-height: 140px; resize: vertical; }
.check { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1.2rem; }
.check input { width: 18px; height: 18px; accent-color: var(--straw); }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: var(--radius); display: none; }
.form-status.ok { display: block; background: #e3ece0; color: #2d4a27; }
.form-status.err { display: block; background: #f6e0d8; color: #7a2b14; }
.small { font-size: 0.85rem; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--moss); color: #eee9ec; text-align: center; padding-block: 3.5rem; }
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 560px; margin: 0 auto 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: #cbc4c8; font-size: 0.95rem; padding-block: 3.5rem 2rem; }
.site-footer a { color: #e7e2e5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: 1.1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer .brand { color: #fff; margin-bottom: 1rem; }
.site-footer .brand-sub { color: #aaa1a6; }
.footer-bottom { border-top: 1px solid #4d4349; margin-top: 2.5rem; padding-top: 1.5rem; font-size: 0.85rem; color: #9d9398; }

/* Skjul elementer hvis et billede mangler */
.img-missing img { display: none; }
.apartment .photo.img-missing { display: none; }
.apartment:has(.img-missing) { grid-template-columns: 1fr; }
