/**
 * IAMPAQ Cookie Consent
 *
 * Self-contained, and deliberately so: every selector is prefixed `cc-` and
 * every colour falls back to a literal, so the extension works whether or not
 * the host stylesheet is present. Nothing here touches an existing class.
 *
 * It reads the site's own tokens when they exist (--ink, --paper, --gold), so
 * it inherits the palette without the site having to know about it.
 */

.cc-root {
  --cc-ink: var(--ink, #0b0c0d);
  --cc-ink-soft: var(--ink-soft, #111315);
  --cc-paper: var(--paper, #f2efe8);
  --cc-muted: var(--muted, #aaa59b);
  --cc-gold: var(--gold, #c59b5d);
  --cc-line: var(--line-dark, rgba(255, 255, 255, 0.14));

  /* Deliberately not a full-viewport layer.

     Covering the whole screen with a fixed element - even an invisible one
     with pointer-events: none - promotes a compositing layer the size of the
     window for as long as the banner is on screen, which is every page view
     until the visitor chooses. The root is now a zero-size anchor; the banner
     and the overlay each size themselves. */
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--cc-paper);
}

.cc-root[hidden] { display: none; }

/* Scrolling is only locked while the settings dialog is open, never for the
   banner: a banner that traps the page is a dark pattern. */
body.cc-locked { overflow: hidden; }

/* ---------------------------------------------------------------
   Banner
   --------------------------------------------------------------- */
.cc-banner {
  position: fixed;
  /* Below the settings dialog. Both are positioned children of the same
     stacking context, so without this they order by their place in the
     markup - which is the wrong way round the moment the panel is opened
     from somewhere other than the banner. */
  z-index: 1;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 26px;
  background: var(--cc-ink-soft);
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: cc-rise 0.28s ease-out both;
}

.cc-pos-center .cc-banner {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; }
}

.cc-pos-center .cc-banner { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .cc-banner { animation: none; }
}

.cc-banner-body { flex: 1 1 auto; min-width: 0; }

.cc-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cc-paper);
}

.cc-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--cc-muted);
}

.cc-link {
  color: var(--cc-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-link:hover { color: var(--cc-paper); }

.cc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Buttons
   Reject and Accept are the same size and weight on purpose. Making
   refusal visually quieter than agreement is the most common way a
   consent banner stops being consent.
   --------------------------------------------------------------- */
.cc-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-gold);
  outline-offset: 2px;
}

.cc-btn-primary {
  background: var(--cc-paper);
  color: var(--cc-ink);
}

.cc-btn-primary:hover { background: var(--cc-gold); }

.cc-btn-secondary {
  background: transparent;
  color: var(--cc-paper);
  border-color: var(--cc-paper);
}

.cc-btn-secondary:hover {
  background: var(--cc-paper);
  color: var(--cc-ink);
}

.cc-btn-ghost {
  background: transparent;
  color: var(--cc-muted);
  border-color: var(--cc-line);
}

.cc-btn-ghost:hover {
  color: var(--cc-paper);
  border-color: var(--cc-paper);
}

/* ---------------------------------------------------------------
   Settings panel
   --------------------------------------------------------------- */
.cc-overlay {
  position: fixed;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* No backdrop-filter. Blurring the whole page behind this panel is what made
     "Customise" crawl on the homepage, where the hero image sits underneath. */
  background: rgba(4, 5, 6, 0.88);
}

.cc-overlay[hidden] { display: none; }

.cc-panel {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--cc-ink-soft);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.cc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--cc-line);
}

.cc-panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--cc-paper);
}

.cc-close {
  background: none;
  border: 0;
  color: var(--cc-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.cc-close:hover { color: var(--cc-paper); }
.cc-close:focus-visible { outline: 2px solid var(--cc-gold); outline-offset: 2px; }

.cc-panel-body {
  padding: 8px 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cc-category {
  padding: 18px 0;
  border-bottom: 1px solid var(--cc-line);
}

.cc-category:last-of-type { border-bottom: 0; }

.cc-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cc-category-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--cc-paper);
}

.cc-category-summary {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cc-paper);
  opacity: 0.85;
}

.cc-category-examples {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--cc-muted);
}

.cc-always {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Switch
   --------------------------------------------------------------- */
.cc-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-width: 0;
}

.cc-switch.is-locked { cursor: default; }

.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cc-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--cc-line);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.cc-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cc-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.cc-switch input:checked + .cc-switch-track {
  background: var(--cc-gold);
  border-color: var(--cc-gold);
}

.cc-switch input:checked + .cc-switch-track::after {
  transform: translateX(18px);
  background: var(--cc-ink);
}

.cc-switch input:disabled + .cc-switch-track { opacity: 0.55; }

.cc-switch input:focus-visible + .cc-switch-track {
  outline: 2px solid var(--cc-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cc-switch-track,
  .cc-switch-track::after,
  .cc-btn { transition: none; }
}

.cc-panel-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--cc-line);
  font-size: 12px;
  line-height: 1.65;
  color: var(--cc-muted);
}

.cc-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--cc-line);
  background: rgba(0, 0, 0, 0.25);
}

.cc-panel-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Mobile
   The banner becomes a full-width sheet and the buttons stack, so
   every option stays reachable with one thumb.
   --------------------------------------------------------------- */
@media (max-width: 780px) {
  .cc-banner,
  .cc-pos-center .cc-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: auto;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
    border-radius: 14px;
    max-height: 80vh;
    overflow-y: auto;
  }

  @keyframes cc-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }

  .cc-actions { flex-direction: column-reverse; align-items: stretch; }
  .cc-btn { width: 100%; padding: 14px 18px; }

  .cc-overlay { padding: 0; align-items: flex-end; }

  .cc-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }

  .cc-panel-actions { flex-direction: column-reverse; align-items: stretch; }
  .cc-panel-actions-right { flex-direction: column-reverse; }
}

/* A light-background host page still gets a readable banner. */
@media (prefers-color-scheme: light) {
  .cc-root:not([data-cc-theme="dark"]) {
    --cc-ink-soft: var(--ink-soft, #111315);
  }
}

/* The footer entry point. It inherits the site's own footer link styling and
   only adds the pointer, so it sits with its neighbours rather than beside
   them. */
.cc-footer-link { cursor: pointer; }

/* ---------------------------------------------------------------
   Scrollbars inside the panel

   The category list scrolls on a short screen, and the mobile banner
   can too. Self-contained like the rest of this file: it reads the
   site's tokens where they exist and falls back to literals, so it
   matches whether or not the host stylesheet is loaded.
   --------------------------------------------------------------- */
.cc-panel-body,
.cc-banner {
  scrollbar-width: thin;
  scrollbar-color: var(--cc-line, rgba(255, 255, 255, 0.14)) var(--cc-ink-soft, #111315);
}

.cc-panel-body::-webkit-scrollbar,
.cc-banner::-webkit-scrollbar { width: 10px; }

.cc-panel-body::-webkit-scrollbar-track,
.cc-banner::-webkit-scrollbar-track { background: var(--cc-ink-soft, #111315); }

.cc-panel-body::-webkit-scrollbar-thumb,
.cc-banner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 2px solid var(--cc-ink-soft, #111315);
}

.cc-panel-body::-webkit-scrollbar-thumb:hover,
.cc-banner::-webkit-scrollbar-thumb:hover { background: var(--cc-gold, #c59b5d); }
