/* Scoped styles for EHN Engagement */
.ehn-engagement-root, .ehn-engagement-root * { box-sizing: border-box; }

.ehn-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 999999;
  opacity: 0; pointer-events: none;
  transition: opacity 180ms ease;
}
.ehn-overlay.ehn-show { opacity: 1; pointer-events: auto; }

.ehn-popup {
  position: relative;
  background: #fff; color: #111;
  width: min(92vw, 560px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 14px;
  box-shadow: 0 15px 60px rgba(0,0,0,0.35);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}
.ehn-popup.ehn-show { transform: translateY(0); opacity: 1; }
.ehn-popup.ehn-anim-none { transition: none; transform: none; }
.ehn-popup.ehn-anim-slide { transform: translateY(18px); }

.ehn-popup-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 96vw;
  max-height: 96vh;
  pointer-events: auto;
}

/*
 * Luk-knappen nulstilles bevidst fra temaets knaptypografier (bl.a. Salient),
 * så det synlige felt og det reelle klikbare knapelement altid er det samme.
 */
.ehn-engagement-root button.ehn-close {
  all: unset;
  box-sizing: border-box !important;
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 100 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 0 3px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: rgba(0,0,0,0.08) !important;
  color: inherit !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 32px !important;
  font-style: normal !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Neutralisér eventuelle pseudo-elementer, som temaet måtte sætte på buttons. */
.ehn-engagement-root button.ehn-close::before,
.ehn-engagement-root button.ehn-close::after {
  content: none !important;
  display: none !important;
}
.ehn-engagement-root button.ehn-close:hover { background: rgba(0,0,0,0.14) !important; }
.ehn-engagement-root button.ehn-close:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
}

.ehn-dont-show-wrap {
  padding: 0 18px 16px;
  text-align: center;
  line-height: 1.4;
}
.ehn-dont-show-again,
.ehn-dont-show-again:visited {
  color: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ehn-dont-show-again:hover { text-decoration-thickness: 2px; }
.ehn-popup-shell > .ehn-dont-show-wrap {
  padding: 0;
  margin-top: 10px;
  color: #fff;
}

.ehn-popup-body { padding: 22px 18px 18px; }

.ehn-fullscreen .ehn-popup {
  width: 96vw; height: 92vh; max-height: 92vh; border-radius: 16px;
}

.ehn-slidein-wrap { position: fixed; z-index: 999999; inset: 0; pointer-events: none; }
.ehn-slidein {
  position: absolute; pointer-events: auto;
  width: min(92vw, 420px);
  max-height: 85vh; overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 15px 60px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateX(24px);
  transition: transform 220ms ease, opacity 220ms ease;
}
.ehn-slidein.ehn-show { opacity: 1; transform: translateX(0); }
.ehn-slidein.ehn-from-left { left: 14px; bottom: 14px; transform: translateX(-24px); }
.ehn-slidein.ehn-from-right { right: 14px; bottom: 14px; }
.ehn-slidein.ehn-from-bottom { left: 50%; bottom: 14px; transform: translate(-50%, 24px); }
.ehn-slidein.ehn-from-bottom.ehn-show { transform: translate(-50%, 0); }

/* Sidebar (off-canvas) */
.ehn-sidebar-wrap {
  position: fixed; inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.ehn-sidebar-wrap.ehn-show { opacity: 1; pointer-events: auto; }

.ehn-sidebar {
  position: absolute;
  top: 0; bottom: 0;
  width: min(92vw, 420px);
  max-width: 520px;
  background: #fff; color: #111;
  overflow: auto;
  box-shadow: 0 18px 70px rgba(0,0,0,0.30);
  opacity: 1;
  transform: translateX(100%);
  transition: transform 240ms ease;
}
.ehn-sidebar.ehn-from-right { right: 0; border-top-left-radius: 16px; border-bottom-left-radius: 16px; }
.ehn-sidebar.ehn-from-left { left: 0; transform: translateX(-100%); border-top-right-radius: 16px; border-bottom-right-radius: 16px; }
.ehn-sidebar.ehn-show { transform: translateX(0); }
.ehn-sidebar button.ehn-close { top: 14px !important; right: 14px !important; }

.ehn-notify {
  position: fixed; z-index: 999999;
  width: min(92vw, 360px);
  background: #111; color: #fff;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 45px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(10px);
  transition: transform 200ms ease, opacity 200ms ease;
}
.ehn-notify.ehn-show { opacity: 1; transform: translateY(0); }
.ehn-corner-br { right: 14px; bottom: 14px; }
.ehn-corner-bl { left: 14px; bottom: 14px; }
.ehn-corner-tr { right: 14px; top: 14px; }
.ehn-corner-tl { left: 14px; top: 14px; }

.ehn-bar {
  position: fixed; left: 0; right: 0;
  z-index: 999999;
  background: #111; color: #fff;
  padding: 12px 52px 12px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translate(var(--ehn-bar-x, 0), -100%);
  transition: transform 220ms ease, opacity 220ms ease;
}
.ehn-bar.ehn-bottom { bottom: 0; transform: translate(var(--ehn-bar-x, 0), 100%); }
.ehn-bar.ehn-top { top: 0; }
.ehn-bar.ehn-show { opacity: 1; transform: translate(var(--ehn-bar-x, 0), 0); }
.ehn-bar.ehn-bar-custom-width { right: auto; }
.ehn-bar button.ehn-close { top: 10px !important; right: 12px !important; background: rgba(255,255,255,0.15) !important; color: #fff !important; }

.ehn-widget {
  position: fixed; z-index: 999999;
  width: min(92vw, 360px);
  background: #fff; color: #111;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.30);
  overflow: hidden;
  opacity: 0; transform: translateY(12px);
  transition: transform 220ms ease, opacity 220ms ease;
}
.ehn-widget.ehn-show { opacity: 1; transform: translateY(0); }

.ehn-widget-handle {
  position: fixed; z-index: 999998;
  width: 56px; height: 56px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #111; color: #fff;
  box-shadow: 0 14px 45px rgba(0,0,0,0.28);
}
.ehn-widget-handle.ehn-corner-br { right: 14px; bottom: 14px; }
.ehn-widget-handle.ehn-corner-bl { left: 14px; bottom: 14px; }
.ehn-widget-handle.ehn-corner-tr { right: 14px; top: 14px; }
.ehn-widget-handle.ehn-corner-tl { left: 14px; top: 14px; }


@media (max-width: 768px) {
  .ehn-overlay,
  .ehn-slidein-wrap,
  .ehn-sidebar-wrap {
    inset: 0 !important;
    align-items: stretch;
    justify-content: stretch;
  }

  .ehn-popup,
  .ehn-fullscreen .ehn-popup,
  .ehn-slidein,
  .ehn-slidein.ehn-from-left,
  .ehn-slidein.ehn-from-right,
  .ehn-slidein.ehn-from-bottom,
  .ehn-sidebar,
  .ehn-sidebar.ehn-from-left,
  .ehn-sidebar.ehn-from-right,
  .ehn-notify,
  .ehn-bar,
  .ehn-widget {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 100vh;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: auto;
  }

  .ehn-popup.ehn-show,
  .ehn-fullscreen .ehn-popup.ehn-show,
  .ehn-slidein.ehn-show,
  .ehn-slidein.ehn-from-left.ehn-show,
  .ehn-slidein.ehn-from-right.ehn-show,
  .ehn-slidein.ehn-from-bottom.ehn-show,
  .ehn-sidebar.ehn-show,
  .ehn-notify.ehn-show,
  .ehn-bar.ehn-show,
  .ehn-widget.ehn-show {
    transform: none !important;
  }

  .ehn-popup-body {
    min-height: 100%;
    padding-top: 64px !important;
  }

  .ehn-bar {
    padding: 64px 18px 18px !important;
  }

  .ehn-notify,
  .ehn-widget {
    padding-top: 52px;
  }

  .ehn-engagement-root button.ehn-close,
  .ehn-sidebar button.ehn-close,
  .ehn-bar button.ehn-close {
    top: 14px !important;
    right: 14px !important;
  }

  .ehn-popup-shell > .ehn-dont-show-wrap {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 100001;
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.65);
    color: #fff;
  }
}

.ehn-inline-popup { border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; padding: 12px; }

/* Button helpers */
.ehn-engagement-root .ehn-btn,
.ehn-engagement-root a.ehn-btn,
.ehn-engagement-root button.ehn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: #111;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.ehn-engagement-root .ehn-btn.ehn-btn-outline { background: transparent; color: currentColor; border: 1px solid currentColor; }
.ehn-engagement-root .ehn-btn + .ehn-btn { margin-left: 8px; }

/* Dynamic CPT post content */
.ehn-engagement-root .ehn-post-card {
  display: grid;
  grid-template-columns: minmax(160px, 42%) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
  width: 100%;
  margin: 0;
}
.ehn-engagement-root .ehn-post-card--no-image {
  grid-template-columns: 1fr;
}
.ehn-engagement-root .ehn-post-card__media {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0,0,0,0.05);
}
.ehn-engagement-root .ehn-post-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
}
.ehn-engagement-root .ehn-post-card__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}
.ehn-engagement-root .ehn-post-card__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
}
.ehn-engagement-root .ehn-post-card__title {
  margin: 0 0 10px;
  padding: 0;
  color: inherit;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
}
.ehn-engagement-root .ehn-post-card__excerpt {
  margin: 0 0 18px;
  color: inherit;
  opacity: 0.82;
  font-size: 15px;
  line-height: 1.55;
}
.ehn-engagement-root .ehn-post-card__actions { margin-top: auto; }
.ehn-engagement-root .ehn-post-card__button { width: fit-content; }

.ehn-slidein .ehn-post-card,
.ehn-sidebar .ehn-post-card,
.ehn-notify .ehn-post-card,
.ehn-widget .ehn-post-card {
  grid-template-columns: 1fr;
}
.ehn-slidein .ehn-post-card__image-link,
.ehn-slidein .ehn-post-card__image,
.ehn-sidebar .ehn-post-card__image-link,
.ehn-sidebar .ehn-post-card__image,
.ehn-notify .ehn-post-card__image-link,
.ehn-notify .ehn-post-card__image,
.ehn-widget .ehn-post-card__image-link,
.ehn-widget .ehn-post-card__image {
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.ehn-notify .ehn-post-card__title,
.ehn-widget .ehn-post-card__title { font-size: 22px; }

.ehn-bar .ehn-post-card {
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.ehn-bar .ehn-post-card__image-link,
.ehn-bar .ehn-post-card__image {
  min-height: 88px;
  height: 88px;
}
.ehn-bar .ehn-post-card__title { font-size: 20px; margin-bottom: 6px; }
.ehn-bar .ehn-post-card__excerpt { margin-bottom: 10px; line-height: 1.4; }

@media (max-width: 768px) {
  .ehn-engagement-root .ehn-post-card,
  .ehn-bar .ehn-post-card {
    grid-template-columns: 1fr;
  }
  .ehn-engagement-root .ehn-post-card__image-link,
  .ehn-engagement-root .ehn-post-card__image,
  .ehn-bar .ehn-post-card__image-link,
  .ehn-bar .ehn-post-card__image {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .ehn-engagement-root .ehn-post-card__title { font-size: 26px; }
}
