/* Cookie banner and settings (inc/consent.php, js/consent.js) on every page; the /cookie-policy/
   page parts at the end. Above the sticky sign-up bar (1500), below search (2000) and toasts (3000). */

.cc {
  position: fixed;
  z-index: 1900;
  /* Right: page heroes keep their text and sign-up buttons on the left */
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 40px));
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  animation: ccIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.cc[hidden] { display: none; }

.cc.is-leaving {
  opacity: 0;
  transform: translateY(10px);
  animation: none;
  transition: opacity 0.18s ease-in, transform 0.18s ease-in;
}

@keyframes ccIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
}

.cc__card {
  position: relative;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 14px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(212, 165, 116, 0.14), transparent 60%),
    linear-gradient(165deg, #2a1845 0%, #1a0f2e 72%);
  border: 1px solid rgba(212, 165, 116, 0.32);
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(10, 5, 22, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* A few faint stars, as in the header and footer */
.cc__card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 90% 62%, rgba(232, 201, 161, 0.5), transparent 60%),
    radial-gradient(1px 1px at 34% 88%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 62% 48%, rgba(255, 255, 255, 0.25), transparent 60%);
}

.cc__view { position: relative; }
.cc__view.is-new { animation: ccView 0.22s ease-out; }

@keyframes ccView {
  from { opacity: 0; transform: translateY(4px); }
}

.cc__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
}

.cc__title:focus { outline: none; }
.cc__title:focus-visible { outline: 2px solid #E8C9A1; outline-offset: 4px; border-radius: 4px; }

.cc__glyph {
  flex: none;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: #D4A574;
}

.cc__text {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Accept and Reject look the same: neither is the "easy" answer. Button rules start with .cc to
   win over design.css's button[type="button"] (purple, blue lift on hover). */
.cc__actions {
  display: flex;
  gap: 10px;
}

.cc .cc__btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a0f2e;
  background: #E8C9A1;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

@media (hover: hover) {
  .cc .cc__btn:hover { background: #F2DAB8; box-shadow: none; transform: none; }
}

.cc .cc__btn:active { transform: scale(0.97); }

.cc .cc__btn:focus-visible,
.cc .cc__close:focus-visible,
.cc .cc__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cc__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.cc .cc__link {
  min-height: 0;
  padding: 6px 2px;
  font: inherit;
  font-weight: 400;
  color: #E8C9A1;
  text-decoration: underline;
  text-decoration-color: rgba(232, 201, 161, 0.45);
  text-underline-offset: 3px;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.cc .cc__link:hover,
.cc .cc__link:focus { color: #fff; text-decoration-color: currentColor; background: none; box-shadow: none; transform: none; }

/* Settings */
.cc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cc .cc__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  margin: -8px -10px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cc .cc__close:hover { color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: none; transform: none; }

.cc__cats {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 0;
  list-style: none;
}

.cc__cat {
  margin: 0;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.cc__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

.cc__cat-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
}

label.cc__cat-name { cursor: pointer; }

.cc__always {
  flex: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #E8C9A1;
  background: rgba(212, 165, 116, 0.14);
  border-radius: 999px;
}

.cc__cat-text {
  margin: 6px 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}

/* Switch: a real checkbox on top of the drawn track */
.cc__switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
}

.cc__switch input {
  position: absolute;
  inset: -8px;
  z-index: 1;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc__track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.cc__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc__switch input:checked + .cc__track { background: #D4A574; }
.cc__switch input:checked + .cc__track::after { transform: translateX(20px); }
.cc__switch input:focus-visible + .cc__track { outline: 2px solid #fff; outline-offset: 2px; }

.cc__gpc {
  margin: -4px 0 14px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #E8C9A1;
  background: rgba(212, 165, 116, 0.1);
  border-radius: 10px;
}

.cc__gpc[hidden] { display: none; }

/* Announcements for screen readers */
.cc-live {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* While the banner is up: no second bar at the bottom; and it steps aside for the mobile menu */
body.cc-open .hs-stickybar { visibility: hidden; }
body:has(.sh-drawer.is-open) .cc,
body:has(.sh-search-overlay.is-open) .cc { visibility: hidden; }

@media (max-width: 600px) {
  .cc {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
  }
  .cc__card {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px 18px 10px;
    border-radius: 18px;
  }
  .cc__title { font-size: 1.35rem; }
  .cc__text { margin-bottom: 14px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cc,
  .cc__view.is-new { animation: none; }
  .cc .cc__btn,
  .cc__track,
  .cc__track::after { transition: none; }
}

@media print {
  .cc { display: none !important; }
}

/* ───────── /cookie-policy/ (cookie-policy.php, on top of blog.css and help.css) ───────── */

.ck-updated {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

.ck-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 1.1em;
  font-weight: 700;
}

.ck-status::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.62em;
  background: #A19BA8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(161, 155, 168, 0.18);
}

.ck-status[data-state="on"]::before {
  background: #12B76A;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.18);
}

.ck-status:empty { display: none; }

.rp-prose .ck-table { margin-bottom: 1.4em; font-size: 0.92rem; line-height: 1.55; }
.rp-prose .ck-table th { font-size: 0.8rem; font-weight: 700; color: #6B6670; white-space: nowrap; }
.rp-prose .ck-table td { vertical-align: top; }
.rp-prose .ck-table td:first-child { width: 32%; }
.rp-prose .ck-table td:last-child { width: 22%; color: #6B6670; }

.rp-prose .ck-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  overflow-wrap: anywhere;
  padding: 1px 6px;
  color: #3D2560;
  background: #F4EFF8;
  border-radius: 6px;
}

/* Phones: each row becomes a small card */
@media (max-width: 600px) {
  .rp-prose .ck-table thead { display: none; }
  .rp-prose .ck-table,
  .rp-prose .ck-table tbody,
  .rp-prose .ck-table tr,
  .rp-prose .ck-table td { display: block; width: auto; }
  .rp-prose .ck-table tr {
    margin: 0 0 10px;
    padding: 12px 14px;
    background: #FAF8F5;
    border: 1px solid #ECE4D8;
    border-radius: 12px;
  }
  .rp-prose .ck-table td { padding: 2px 0; border: 0; }
  .rp-prose .ck-table td:first-child { width: auto; margin-bottom: 4px; }
  .rp-prose .ck-table td:last-child { width: auto; font-size: 0.86rem; }
  .rp-prose .ck-table td:last-child::before { content: attr(data-label) ": "; font-weight: 700; }
}
