/* ==========================================================================
   Cookie consent banner
   Standalone: no framework, no build step. Load before </body> or in <head>.
   Retheme by overriding the custom properties on :root.
   ========================================================================== */

:root {
  --cc-surface: #ffffff;
  --cc-text: #1b2436;
  --cc-muted: #5a6478;
  --cc-border: #e2e1da;
  --cc-link: #a8741a;
  --cc-btn-bg: #ffffff;
  --cc-btn-border: #1b2436;
  --cc-btn-text: #1b2436;
  --cc-btn-bg-hover: #1b2436;
  --cc-btn-text-hover: #ffffff;
  --cc-focus: #a8741a;
  --cc-shadow: 0 -2px 24px rgba(20, 26, 40, 0.13);
  --cc-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-cc-theme="light"]) {
    --cc-surface: #161d2b;
    --cc-text: #f2f4f8;
    --cc-muted: #a6b0c3;
    --cc-border: #2b3446;
    --cc-link: #e8b75c;
    --cc-btn-bg: transparent;
    --cc-btn-border: #f2f4f8;
    --cc-btn-text: #f2f4f8;
    --cc-btn-bg-hover: #f2f4f8;
    --cc-btn-text-hover: #161d2b;
    --cc-focus: #e8b75c;
    --cc-shadow: 0 -2px 24px rgba(0, 0, 0, 0.5);
  }
}

.cc-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 2147483000; /* above app modals, below nothing */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;

  /* Stay clear of iOS home indicator / Android gesture bar. */
  padding: 16px clamp(16px, 4vw, 32px);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));

  background: var(--cc-surface);
  color: var(--cc-text);
  border-top: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow);

  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;

  transform: translateY(0);
  transition: transform 260ms ease, opacity 260ms ease;
}

/* Entry/exit. `hidden` still wins because of [hidden] below. */
.cc-banner[data-cc-state="entering"],
.cc-banner[data-cc-state="leaving"] {
  transform: translateY(100%);
  opacity: 0;
}

.cc-banner[hidden] {
  display: none !important;
}

.cc-copy {
  flex: 1 1 420px;
  min-width: 0;
  margin: 0;
  color: var(--cc-muted);
}

.cc-copy strong {
  color: var(--cc-text);
  font-weight: 600;
}

.cc-link {
  color: var(--cc-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.cc-link:hover {
  text-decoration-thickness: 2px;
}

.cc-actions {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

/* Both buttons are deliberately identical: same box, same weight, same
   contrast. Making "Reject" quieter than "Accept" is a dark pattern and
   regulators treat it as invalid consent. */
.cc-btn {
  flex: 1 1 auto;
  min-width: 132px;
  padding: 11px 22px;
  border: 1.5px solid var(--cc-btn-border);
  border-radius: var(--cc-radius);
  background: var(--cc-btn-bg);
  color: var(--cc-btn-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.cc-btn:hover {
  background: var(--cc-btn-bg-hover);
  color: var(--cc-btn-text-hover);
}

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

.cc-link:focus-visible {
  outline: 3px solid var(--cc-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Phones: stack, and let the two buttons share the row equally. */
@media (max-width: 640px) {
  .cc-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: start;
  }

  /* The desktop rule is `flex: 1 1 420px`. In a column container flex-basis
     resolves against the MAIN axis - which is now height - so the paragraph
     claimed a 420px tall box and the banner ate ~62% of a phone screen.
     Reset it to content height. */
  .cc-copy {
    flex: 0 0 auto;
  }

  .cc-actions {
    width: 100%;
  }

  .cc-btn {
    flex: 1 1 0;
    min-width: 0;
  }
}

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

/* Forced-colors (Windows high contrast): keep the buttons distinguishable. */
@media (forced-colors: active) {
  .cc-btn {
    border: 1px solid ButtonBorder;
  }
}
