/* cookiefluks — banner, preferences and embed placeholders.
   Class names avoid "cookie"/"consent" so cosmetic ad-block lists
   do not hide a notice the site is legally required to show. */

#cfx-root,
#cfx-root *,
.cfx-placeholder,
.cfx-placeholder * {
  box-sizing: border-box;
}

#cfx-root {
  --cfx-radius: 14px;
  --cfx-shadow: 0 12px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  color: var(--cfx-text);
}

#cfx-root h2,
#cfx-root p,
#cfx-root ul {
  margin: 0;
  padding: 0;
}

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

/* --- Banner -------------------------------------------------------------- */

.cfx-banner {
  position: fixed;
  z-index: 2147483600;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  background: var(--cfx-bg);
  color: var(--cfx-text);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--cfx-radius);
  box-shadow: var(--cfx-shadow);
  display: grid;
  gap: 12px;
}

.cfx-banner[hidden] {
  display: none;
}

.cfx-layout-box-left .cfx-banner { left: 16px; }
.cfx-layout-box-right .cfx-banner { right: 16px; }

.cfx-layout-bar .cfx-banner {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  border-radius: 0;
  border-width: 1px 0 0;
  padding: 18px max(20px, calc((100vw - 1200px) / 2));
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title actions" "text actions";
  column-gap: 32px;
  row-gap: 4px;
  align-items: center;
}

.cfx-layout-bar .cfx-banner .cfx-title { grid-area: title; }
.cfx-layout-bar .cfx-banner .cfx-text { grid-area: text; }
.cfx-layout-bar .cfx-banner .cfx-actions { grid-area: actions; display: flex; flex-wrap: wrap; }

.cfx-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cfx-text);
}

.cfx-text {
  font-size: 14.5px;
  color: var(--cfx-text);
  opacity: 0.88;
}

.cfx-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .cfx-banner { animation: cfx-rise 220ms ease-out; }
  @keyframes cfx-rise {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* --- Buttons ------------------------------------------------------------- */

.cfx-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cfx-actions .cfx-btn-secondary { grid-column: 1 / -1; }

.cfx-btn {
  appearance: none;
  margin: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 9px;
  border: 2px solid var(--cfx-primary);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: filter 120ms ease, background-color 120ms ease;
}

/* Accept and reject share one style: equal prominence, as Datatilsynet expects. */
.cfx-btn-primary {
  background: var(--cfx-primary);
  color: var(--cfx-on-primary);
}

.cfx-btn-primary:hover { filter: brightness(1.12); }

.cfx-btn-secondary {
  background: transparent;
  color: var(--cfx-text);
  border-color: rgba(127, 127, 127, 0.45);
}

.cfx-btn-secondary:hover { border-color: var(--cfx-text); }

.cfx-btn:focus-visible,
.cfx-close:focus-visible,
.cfx-revisit:focus-visible,
.cfx-switch:focus-visible,
.cfx-link:focus-visible {
  outline: 3px solid var(--cfx-primary);
  outline-offset: 2px;
}

.cfx-btn-primary:focus-visible { outline-color: var(--cfx-text); }

/* --- Revisit button ------------------------------------------------------ */

.cfx-revisit {
  position: fixed;
  z-index: 2147483500;
  bottom: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--cfx-primary);
  color: var(--cfx-on-primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

.cfx-revisit[hidden] { display: none; }
.cfx-layout-box-right .cfx-revisit { left: auto; right: 16px; }

/* --- Preferences dialog -------------------------------------------------- */

.cfx-modal-open { overflow: hidden; }

.cfx-backdrop {
  position: fixed;
  z-index: 2147483640;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.cfx-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
  background: var(--cfx-bg);
  color: var(--cfx-text);
  border-radius: 16px;
  box-shadow: var(--cfx-shadow);
  display: grid;
  gap: 16px;
}

.cfx-modal:focus { outline: none; }

.cfx-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cfx-close {
  appearance: none;
  flex: none;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cfx-text);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.cfx-close:hover { background: rgba(127, 127, 127, 0.14); }

.cfx-cats {
  list-style: none;
  display: grid;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 12px;
}

.cfx-cat {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.cfx-cat + .cfx-cat { border-top: 1px solid rgba(127, 127, 127, 0.25); }

.cfx-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cfx-cat-name {
  font-weight: 700;
  cursor: pointer;
}

span.cfx-cat-name { cursor: default; }

.cfx-cat-desc {
  font-size: 14px;
  opacity: 0.8;
}

.cfx-always {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.cfx-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.45);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.cfx-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease;
}

.cfx-switch:checked { background: var(--cfx-primary); }
.cfx-switch:checked::before { transform: translateX(20px); }

.cfx-modal-actions { grid-template-columns: 1fr 1fr; }

.cfx-meta {
  font-size: 12px;
  opacity: 0.6;
  word-break: break-all;
}

/* --- Embed placeholder --------------------------------------------------- */

.cfx-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  background: var(--cfx-bg);
  color: var(--cfx-text);
  border: 1px dashed rgba(127, 127, 127, 0.55);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.cfx-placeholder-text {
  margin: 0;
  max-width: 44ch;
}

.cfx-placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 560px) {
  .cfx-layout-box-left .cfx-banner,
  .cfx-layout-box-right .cfx-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .cfx-layout-bar .cfx-banner {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "text" "actions";
    row-gap: 10px;
  }

  .cfx-layout-bar .cfx-banner .cfx-actions { display: grid; }

  .cfx-modal { padding: 20px; }
  .cfx-modal-actions { grid-template-columns: 1fr; }
  .cfx-placeholder { aspect-ratio: auto; }
}
