/* ============ PAGE FRAME (white panel wrapper) ============ */
.page-frame {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 40px 48px;
  overflow: hidden;
  min-height: calc(100vh - 110px);
  position: relative;
}

@media (max-width: 960px) {
  .page-frame {
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-4);
    min-height: 0;
  }
}

/* ============ HUBSPOT DND LAYOUT OVERRIDES ============ */
/* Fjern HubSpot's default section-baggrund inde i vores hvide frame */
.page-frame .dnd-section,
.page-frame .cell-wrapper {
  background: transparent !important;
  padding-left: 0;
  padding-right: 0;
}

/* Stretch modules i samme dnd-section row til matching højder.
   Scopet til .dnd-section så vi ikke rammer header/footer/partial-rows. */
.dnd-section > .row-fluid-wrapper > .row-fluid,
.dnd-section > .row-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 20px 28px;
}

.dnd-section > .row-fluid-wrapper > .row-fluid > [class*="span"],
.dnd-section > .row-fluid > [class*="span"] {
  display: flex;
  flex-direction: column;
  float: none;
  margin-left: 0;
  min-width: 0;
}

/* Hele kæden af inner wrappers strækker sig: column → row-fluid-wrapper →
   row-fluid → dnd-module → widget-span → hs_cos_wrapper → cell-wrapper.
   Det er nødvendigt så moduler med height:100% (videocard, updates-list osv.)
   kan strække sig til rækkens højde. */
.dnd-section .row-fluid-wrapper,
.dnd-section [class*="span"] .row-fluid,
.dnd-section .dnd-column,
.dnd-section .dnd-row,
.dnd-section .dnd-module,
.dnd-section .widget-span,
.dnd-section .cell-wrapper,
.dnd-section .hs_cos_wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* Modul-root elementer (section/aside) inde i hs_cos_wrapper skal fylde kolonnen */
.dnd-section .hs_cos_wrapper > * {
  flex: 1;
  width: 100%;
}

/* Når en dnd-column har FLERE dnd-rows (fx brancher, kontakt),
   skal hver række være content-sized i stedet for at dele kolonnens højde.
   :has() matcher kolonner med 2+ row-fluid-wrapper-børn. */
.dnd-section .dnd-column:has(> .row-fluid-wrapper + .row-fluid-wrapper) > .row-fluid-wrapper,
.dnd-section [class*="span"]:has(> .row-fluid-wrapper + .row-fluid-wrapper) > .row-fluid-wrapper {
  flex: 0 0 auto;
  min-height: 0;
}

/* Præcis 1fr / 360px grid til home-row 1 og home-row 2 (pixel-perfekt mod design) */
@media (min-width: 961px) {
  .dnd-section.home-grid > .row-fluid-wrapper > .row-fluid,
  .dnd-section.home-grid > .row-fluid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px 28px;
    align-items: stretch;
  }
  .dnd-section.home-grid > .row-fluid-wrapper > .row-fluid > [class*="span"],
  .dnd-section.home-grid > .row-fluid > [class*="span"] {
    width: 100% !important;
    margin-left: 0 !important;
    float: none;
  }
}

/* Brancher 2-col: venstre filter-nav (260px) + højre content med 40px gap */
@media (min-width: 961px) {
  .dnd-section.brancher-grid > .row-fluid-wrapper > .row-fluid,
  .dnd-section.brancher-grid > .row-fluid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    padding: 20px 8px 60px;
  }
  .dnd-section.brancher-grid > .row-fluid-wrapper > .row-fluid > [class*="span"],
  .dnd-section.brancher-grid > .row-fluid > [class*="span"] {
    width: 100% !important;
    margin-left: 0 !important;
    float: none;
  }
}

/* Kontakt 2-col: venstre info + højre form med 80px gap og align-items: start */
@media (min-width: 961px) {
  .dnd-section.kontakt-grid > .row-fluid-wrapper > .row-fluid,
  .dnd-section.kontakt-grid > .row-fluid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px 80px;
    align-items: start;
    padding: 20px 8px 40px;
  }
  .dnd-section.kontakt-grid > .row-fluid-wrapper > .row-fluid > [class*="span"],
  .dnd-section.kontakt-grid > .row-fluid > [class*="span"] {
    width: 100% !important;
    margin-left: 0 !important;
    float: none;
  }
}

@media (max-width: 960px) {
  .dnd-section > .row-fluid-wrapper > .row-fluid,
  .dnd-section > .row-fluid {
    display: block;
  }
  .dnd-section > .row-fluid-wrapper > .row-fluid > [class*="span"],
  .dnd-section > .row-fluid > [class*="span"] {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .dnd-section > .row-fluid-wrapper > .row-fluid > [class*="span"] + [class*="span"],
  .dnd-section > .row-fluid > [class*="span"] + [class*="span"] {
    margin-top: var(--space-4);
  }
}

/* Spacing mellem dnd-sections inde i page-frame */
.page-frame .dnd-section + .dnd-section {
  margin-top: var(--space-5);
}

/* ============ SIDEBAR (desktop) ============ */
.sidebar {
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 17px;
  padding-left: 4px;
  line-height: 1;
  color: var(--ink);
}
.brand__logo {
  height: 32px;
  width: auto;
  display: block;
}
.brand .dot { color: var(--sand); }

.nav {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 2px rgba(35, 35, 35, 0.04);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  text-align: center;
  background: transparent;
  border: 0;
  font-family: inherit;
}
.nav-item:hover { background: rgba(35, 35, 35, 0.04); }
.nav-item.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 35, 35, 0.06);
}
.nav-item.active .nav-icon { color: var(--sand-deep); }
.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-footer {
  margin-top: auto;
  padding-left: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.6;
}
.sidebar-footer a {
  display: block;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: rgba(35, 35, 35, 0.3);
  text-underline-offset: 2px;
}
.sidebar-footer a:hover { color: var(--ink); }
.sidebar-footer .copyright { margin-top: 14px; font-size: 11px; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  padding: 0 8px 20px 8px;
}
.pill-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-link,
.topbar a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  font-weight: 500;
}

/* ============ MOBILE HEADER + DRAWER ============ */
.app-header { display: none; }
.bottom-cta { display: none; }
.drawer { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 960px) {
  .sidebar { display: none; }

  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-mobile-height);
    padding: 0 var(--space-4);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    z-index: 50;
  }
  .app-brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
  }
  .app-brand__logo {
    height: 24px;
    width: auto;
    display: block;
  }
  .app-brand .dot { color: var(--sand); }

  .burger {
    width: 40px;
    height: 40px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 12px;
  }
  .burger span {
    display: block;
    width: 20px;
    height: 1.6px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .drawer {
    display: block;
    position: fixed;
    top: var(--header-mobile-height);
    right: 0;
    bottom: 0;
    width: min(86vw, 340px);
    background: var(--paper);
    border-left: 1px solid var(--line);
    padding: var(--space-6) var(--space-5);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 49;
    overflow-y: auto;
  }
  .drawer:not([hidden]) { transform: translateX(0); }
  .drawer[hidden] { display: block; pointer-events: none; }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-mobile-height) 0 0 0;
    background: rgba(35, 35, 35, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 48;
    pointer-events: none;
  }
  .drawer-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
  .drawer-link {
    font-family: var(--heading);
    font-size: 28px;
    color: var(--ink);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
  }
  .drawer-footer {
    margin-top: var(--space-7);
    font-size: 13px;
    color: var(--ink-mute);
  }
  .drawer-footer a {
    display: block;
    color: var(--ink-soft);
    margin-bottom: var(--space-2);
  }
  .drawer-footer .copyright { margin-top: var(--space-4); }

  .bottom-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    z-index: 40;
  }
  .bottom-cta__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--ink);
    color: var(--paper);
    border-radius: 999px;
    padding: var(--space-3) var(--space-5);
    font-weight: 500;
    font-size: 15px;
  }
  .bottom-cta__btn .pill-arrow { font-size: 18px; }

  .topbar { display: none; }
}

/* ============ SITE FOOTER ============ */
.site-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-9);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.site-footer__nav,
.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.site-footer__nav a,
.site-footer__legal a { color: var(--ink-soft); }
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  font-size: 13px;
  color: var(--ink-mute);
}
@media (max-width: 960px) {
  .site-footer { margin-bottom: var(--bottom-cta-height); }
  .site-footer__grid { grid-template-columns: 1fr; }
}
