/* =========================================================
   Averra — Cookie consent + footer privacy links
   GDPR / ePrivacy compliant: opt-in, granular, withdrawable
   ========================================================= */

/* floating "Cookie settings" reopener — bottom-left */
.cc-reopen {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 200ms ease;
}
.cc-reopen:hover { transform: translateY(-1px); }
.cc-reopen.show { display: inline-flex; }
.cc-reopen .cc-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(0,223,146,0.6);
}

/* Banner — bottom-anchored card, frosted */
.cc-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  bottom: 18px;
  z-index: 90;
  width: min(720px, calc(100vw - 36px));
  padding: 22px 24px 20px;
  border-radius: 10px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--glass-shadow);
  color: var(--ink);
  transition: transform 460ms cubic-bezier(.22,.7,.18,1), opacity 320ms ease;
  opacity: 0;
}
.cc-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.cc-banner h6 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.cc-banner p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 64ch;
}
.cc-banner p a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(14,20,20,0.25);
}
:root[data-theme="night"] .cc-banner p a { text-decoration-color: rgba(255,255,255,0.3); }

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.cc-actions .spacer { flex: 1; }
.cc-btn {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn.ghost:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.cc-btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.cc-btn.primary:hover { background: var(--ink-2); }
.cc-btn.subtle {
  border-color: transparent;
  color: var(--muted);
  padding-left: 6px; padding-right: 6px;
  letter-spacing: 0.12em;
}
.cc-btn.subtle:hover { color: var(--ink); }

/* Detailed preferences — modal */
.cc-modal-back {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(8, 14, 14, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 280ms ease;
}
.cc-modal-back.show { display: flex; opacity: 1; }

.cc-modal {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  box-shadow: 0 20px 60px -20px rgba(14,20,20,0.45);
  transform: translateY(12px);
  transition: transform 320ms cubic-bezier(.22,.7,.18,1);
}
.cc-modal-back.show .cc-modal { transform: translateY(0); }

.cc-modal header {
  padding: 28px 30px 18px;
  border-bottom: 1px solid var(--line);
}
.cc-modal header .eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.cc-modal header h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.018em;
}
.cc-modal header p {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 12px;
  max-width: 60ch;
}

.cc-list {
  padding: 6px 30px 4px;
}
.cc-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-2);
}
.cc-cat:last-child { border-bottom: 0; }
.cc-cat .ttl {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 6px;
}
.cc-cat .meta {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.cc-cat .desc {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 50ch;
}

/* toggle switch */
.cc-switch {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 220ms ease;
  flex-shrink: 0;
  margin-top: 4px;
}
.cc-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 240ms cubic-bezier(.4,.0,.2,1), background 220ms ease;
}
.cc-switch[data-on="true"] { background: var(--ink); }
.cc-switch[data-on="true"]::after { transform: translateX(20px); }
.cc-switch[data-locked="true"] {
  background: color-mix(in oklab, var(--teal) 60%, var(--ink));
  cursor: not-allowed;
}
.cc-switch[data-locked="true"]::after { transform: translateX(20px); }

.cc-modal footer {
  padding: 20px 30px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* footer privacy rail — appended to existing .foot */
.foot-legal {
  width: 100%;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.foot-legal a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
.foot-legal a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.foot-legal .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--muted-2); opacity: 0.6;
  align-self: center;
}

@media (max-width: 540px) {
  .cc-banner { padding: 18px 18px 16px; bottom: 12px; }
  .cc-banner h6 { font-size: 19px; }
  .cc-actions { justify-content: stretch; }
  .cc-actions .cc-btn { flex: 1; text-align: center; }
  .cc-actions .cc-btn.subtle { flex-basis: 100%; }
  .cc-modal header, .cc-list, .cc-modal footer { padding-left: 22px; padding-right: 22px; }
}
