/* knusogfraes.dk - modern responsive version of the old Serif WebPlus design (same colours) */
:root {
  --green: #143f00;
  --green-light: #2f6b17;
  --text: #1d1d1d;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-light: rgba(255, 255, 255, 0.68);
  --radius: 8px;
  --font: Verdana, Geneva, "DejaVu Sans", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: #30400a;
}
/* forest photo locked to the viewport - a fixed layer, so it does not rescale when the page height changes
   (e.g. when the mobile menu opens) and works on iOS, which ignores background-attachment: fixed */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("skov.jpg") center top / cover no-repeat;
}

img { max-width: 100%; height: auto; }
a { color: var(--green-light); }
a:hover { color: var(--green); }

.kf-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

/* header: company details on the forest, title on a light panel */
.kf-header {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(0, 2fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.kf-company {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  font-weight: bold;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.kf-company p { margin: 0; }
.kf-company-name, .kf-company-owner { font-size: clamp(1.15rem, 1.9vw, 1.35rem); }
.kf-company-owner { margin-bottom: 4px !important; }
.kf-company a { color: #fff; text-decoration: none; }

.kf-title {
  display: block;
  padding: 16px 28px 20px;
  background: var(--panel-light);
  border-radius: var(--radius);
  color: var(--green);
  text-decoration: none;
  font-weight: bold;
  container-type: inline-size;  /* title text scales with the box, so it always fits */
}
.kf-title:hover { color: var(--green); }
.kf-title-name {
  display: block;
  font-size: min(4.4rem, 11cqi);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kf-title-sub {
  display: block;
  text-align: right;
  font-size: max(0.9rem, min(2rem, 5.6cqi));  /* wraps on very narrow screens instead of shrinking further */
}

/* main panel */
.kf-panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 40px 40px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* menu */
.kf-nav { border-bottom: 4px solid var(--green); margin-bottom: 28px; }
.kf-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.kf-nav li + li::before {
  content: "|";
  color: var(--text);
  font-weight: bold;
  padding: 0 4px;
}
.kf-nav li { display: flex; align-items: center; font-size: clamp(1.05rem, 1.75vw, 1.35rem); }
.kf-nav a {
  display: inline-block;
  padding: 14px 6px 8px;
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
}
.kf-nav a:hover, .kf-nav a[aria-current="page"] { color: var(--green-light); }
.kf-nav-toggle { display: none; }

/* content */
.kf-content { font-size: 1.1rem; overflow-wrap: anywhere; }
.kf-content h1, .kf-content h2, .kf-content h3 {
  color: var(--green);
  line-height: 1.25;
  margin: 0 0 0.7em;
}
.kf-content h1, .kf-content h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.kf-content h3 { font-size: 1.3rem; }
.kf-content p { margin: 0 0 1em; }
.kf-content ul { margin: 0 0 1em; padding-left: 1.4em; }
.kf-content li { margin-bottom: 0.15em; }
.kf-content img { border-radius: 4px; }

.kf-section + .kf-section.kf-space-before { margin-top: 32px; }
.kf-section.kf-space-after { margin-bottom: 32px; }
.kf-columns, .kf-sidebar {
  display: grid;
  gap: 40px;
  align-items: start;
}
.kf-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.kf-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kf-side-image { display: block; width: 100%; margin-bottom: 20px; }

.kf-note {
  border-left: 5px solid var(--green);
  background: var(--panel-light);
  padding: 12px 16px;
  font-weight: bold;
  color: var(--green);
}
.kf-logo { max-width: 140px; }
.kf-contact { border-collapse: collapse; width: 100%; }
.kf-contact th, .kf-contact td { text-align: left; vertical-align: top; padding: 10px 0; border-bottom: 1px solid rgba(20, 63, 0, 0.15); }
.kf-contact th { width: 9em; padding-right: 16px; color: var(--green); white-space: nowrap; }
.kf-contact tr:last-child th, .kf-contact tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .kf-contact th, .kf-contact td { display: block; width: auto; border: 0; padding: 0; }
  .kf-contact td { padding-bottom: 12px; }
}

/* slideshow (front page) */
.kf-slideshow {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #2b3a12;
}
.kf-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.kf-slideshow img:first-child, .kf-slideshow img.is-active { opacity: 1; }
.kf-slideshow.is-running img:first-child:not(.is-active) { opacity: 0; }

/* gallery */
.kf-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.kf-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; }
.kf-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.3s ease;
}
.kf-gallery a:hover img { transform: scale(1.05); }

.kf-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}
.kf-lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.kf-lightbox img { display: block; max-width: 92vw; max-height: 86vh; border-radius: 4px; }
.kf-lightbox button {
  position: fixed;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
}
.kf-lightbox button:hover { background: var(--green); }
.kf-lightbox .kf-lb-close { top: 16px; right: 16px; }
.kf-lightbox .kf-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.kf-lightbox .kf-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* video */
.kf-video { display: block; width: 100%; max-height: 80vh; background: #000; border-radius: 4px; }
.kf-video-wrap { position: relative; }
.kf-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border: 4px solid #fff;
  border-radius: 50%;
  background: rgba(20, 63, 0, 0.85);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, background 0.2s ease;
}
.kf-play::after {
  content: "";
  position: absolute;
  left: 36px;
  top: 26px;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent #fff;
}
.kf-play:hover { background: var(--green-light); transform: translate(-50%, -50%) scale(1.08); }
.kf-video-wrap.is-playing .kf-play { display: none; }
@media (max-width: 640px) {
  .kf-play { width: 72px; height: 72px; }
  .kf-play::after { left: 27px; top: 19px; border-width: 14px 0 14px 23px; }
}

/* footer */
.kf-footer {
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--panel);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
  font-size: 0.9rem;
}
.kf-footer span + span::before { content: "|"; padding: 0 10px; }
.kf-footer a { color: var(--text); text-decoration: none; }
.kf-footer a:hover { text-decoration: underline; }

/* tablet */
@media (max-width: 1000px) {
  .kf-header { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .kf-company { order: 2; }
  .kf-panel { padding: 8px 24px 28px; }
  .kf-columns, .kf-sidebar { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .kf-nav li { font-size: 1.15rem; }
}

/* phone */
@media (max-width: 640px) {
  .kf-wrap { padding-top: 16px; }
  .kf-title { padding: 12px 14px 14px; }
  .kf-company { font-size: 0.85rem; }
  .kf-company-name, .kf-company-owner { font-size: 1rem; }
  .kf-panel { padding: 4px 16px 24px; }
  .kf-content { font-size: 1rem; }

  .kf-nav { margin-bottom: 20px; }
  .kf-nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 0 10px;
    border: 0;
    background: none;
    font: bold 1.2rem var(--font);
    color: var(--text);
    cursor: pointer;
  }
  .kf-burger, .kf-burger::before, .kf-burger::after {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--green);
    border-radius: 2px;
    position: relative;
  }
  .kf-burger::before, .kf-burger::after { content: ""; position: absolute; left: 0; }
  .kf-burger::before { top: -7px; }
  .kf-burger::after { top: 7px; }
  .kf-nav ul { display: none; flex-direction: column; padding-bottom: 8px; }
  .kf-nav.is-open ul { display: flex; }
  .kf-nav li + li::before { content: none; }
  .kf-nav li + li { border-top: 1px solid rgba(20, 63, 0, 0.15); }
  .kf-nav a { padding: 10px 0; width: 100%; }

  .kf-footer { flex-direction: column; align-items: center; text-align: center; }
  .kf-footer span + span::before { content: none; }
  .kf-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
