/* Cookie banner + settings pop-up (js/consent.js), on every page. Dark card, gold accents, like the rest. */
/* colours per theme (js/consent.js picks one from what the banner sits over) */
.consent-banner {
  --c-bg: rgba(14, 16, 26, 0.96);
  --c-glow: rgba(244, 163, 0, 0.12);
  --c-border: rgba(244, 163, 0, 0.3);
  --c-text: rgba(245, 240, 225, 0.7);
  --c-title: #f5f0e1;
  --c-accent: #f4a300;
  --c-quiet: rgba(245, 240, 225, 0.25);
}

.consent-banner[data-theme="emerald"] {
  --c-bg: rgba(15, 42, 34, 0.96);
  --c-glow: rgba(244, 163, 0, 0.14);
  --c-border: rgba(244, 163, 0, 0.35);
}

.consent-banner[data-theme="teal"] {
  --c-bg: rgba(4, 38, 50, 0.95);
  --c-glow: rgba(0, 140, 170, 0.28);
  --c-border: rgba(244, 163, 0, 0.35);
}

.consent-banner[data-theme="darkroom"] {
  --c-bg: rgba(21, 13, 10, 0.96);
  --c-glow: rgba(214, 72, 38, 0.3);
  --c-border: rgba(244, 163, 0, 0.3);
}

.consent-banner[data-theme="wine"] {
  --c-bg: rgba(42, 11, 20, 0.96);
  --c-glow: rgba(122, 28, 52, 0.55);
  --c-border: rgba(244, 163, 0, 0.3);
}

.consent-banner[data-theme="cream"] {
  --c-bg: rgba(245, 240, 225, 0.97);
  --c-glow: rgba(244, 163, 0, 0.18);
  --c-border: rgba(26, 26, 26, 0.15);
  --c-text: rgba(26, 26, 26, 0.7);
  --c-title: #1a1a1a;
  --c-accent: #b36b00;
  --c-quiet: rgba(26, 26, 26, 0.3);
}

.consent-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 200;
  width: min(420px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, var(--c-glow), transparent),
    var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--c-text);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0;
  translate: 0 24px;
  scale: 0.96;
  transition:
    opacity 0.4s ease,
    translate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    scale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.5s ease,
    border-color 0.5s ease,
    color 0.5s ease;
}

.consent-banner.is-on {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

/* draggable into any corner (js/consent.js); the top ones sit below the nav */
.consent-banner {
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.consent-banner.is-dragging {
  cursor: grabbing;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.55);
}

.consent-banner[data-corner="br"] {
  left: auto;
  right: 24px;
}

.consent-banner[data-corner="tl"],
.consent-banner[data-corner="tr"] {
  bottom: auto;
  top: 104px;
}

.consent-banner[data-corner="tr"] {
  left: auto;
  right: 24px;
}

/* a little grip at the top edge, so it reads as movable */
.consent-grip {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  translate: -50% 0;
  background-color: var(--c-quiet);
}

/* quick close (= only essential) */
.consent-banner .consent-x,
.consent-banner .consent-x:hover {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-text);
  font-size: 12px;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.consent-banner .consent-x:hover {
  background-color: var(--c-quiet);
  color: var(--c-title);
}

.consent-banner .consent-title {
  padding-right: 28px; /* room for the close */
}

.consent-title {
  margin-bottom: 6px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--c-title, #f5f0e1);
  transition: color 0.5s ease;
}

.consent-banner .consent-title em,
.consent-banner a {
  color: var(--c-accent);
}

.consent-banner .consent-buttons .is-quiet {
  border-color: var(--c-quiet);
  color: var(--c-title);
}

/* Reject all: as easy to hit as Accept all, just the opposite colour */
.consent-banner .consent-buttons .is-reject,
.consent-banner .consent-buttons .is-reject:hover {
  background-color: var(--c-title);
  color: var(--c-solid, #1a1a1a);
}

.consent-banner .consent-buttons .is-reject:hover {
  opacity: 0.85;
}

.consent-banner[data-theme="cream"] {
  --c-solid: #f5f0e1;
}

.consent-banner .consent-buttons .is-link {
  color: var(--c-text);
}

.consent-banner[data-theme="cream"] .consent-buttons .is-quiet:hover {
  border-color: #1a1a1a;
}

.consent-title em,
.consent-card h3 em {
  color: #f4a300;
}

.consent-banner a,
.consent-intro a {
  color: var(--c-accent, #f4a300);
}

.consent-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.consent-buttons button {
  padding: 11px 18px;
  border-radius: 999px;
}

.consent-buttons .is-quiet {
  background: none;
  border: 1px solid rgba(245, 240, 225, 0.25);
  color: #f5f0e1;
}

.consent-buttons .is-quiet:hover {
  background: none;
  border-color: #f5f0e1;
}

.consent-buttons .is-link,
.consent-buttons .is-link:hover {
  margin-left: auto;
  padding: 11px 4px;
  background: none;
  color: rgba(245, 240, 225, 0.6);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.consent-buttons .is-link:hover {
  color: #f4a300;
}

/* settings pop-up */
.consent-settings {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 16px;
}

.consent-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(5, 6, 10, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.consent-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(480px, 100%);
  box-sizing: border-box;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 30px 28px 26px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(244, 163, 0, 0.12), transparent),
    rgb(14, 16, 26);
  border: 1px solid rgba(244, 163, 0, 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  color: rgba(245, 240, 225, 0.7);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0;
  translate: 0 20px;
  scale: 0.95;
  transition:
    opacity 0.35s ease,
    translate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consent-settings.is-on .consent-backdrop {
  opacity: 1;
}

.consent-settings.is-on .consent-card {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.consent-card h6 {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f4a300;
}

.consent-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.2rem;
  line-height: 1;
  color: #f5f0e1;
}

.consent-close,
.consent-close:hover {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(245, 240, 225, 0.06);
  color: rgba(245, 240, 225, 0.7);
  font-size: 9px;
}

.consent-close:hover {
  color: #f4a300;
}

/* each kind of storage, with a switch */
.consent-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(245, 240, 225, 0.08);
  cursor: pointer;
}

.consent-option b {
  font-weight: 500;
  color: #f5f0e1;
}

.consent-option i {
  margin-left: 6px;
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #f4a300;
}

.consent-option small {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(245, 240, 225, 0.62);
}

.consent-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.consent-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background-color: rgba(245, 240, 225, 0.15);
  transition: background-color 0.3s ease;
}

.consent-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #f5f0e1;
  transition: translate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consent-option input:checked + .consent-switch {
  background-color: #f4a300;
}

.consent-option input:checked + .consent-switch::after {
  translate: 18px 0;
  background-color: #1a1a1a;
}

.consent-option input:disabled + .consent-switch {
  opacity: 0.55;
}

.consent-option input:focus-visible + .consent-switch {
  outline: 2px solid #f4a300;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .consent-banner {
    left: 16px;
    bottom: 16px;
  }
}
