/* ==========================================================================
   Cookie consent bar + preferences dialog. Rendered by js/consent.js.
   ========================================================================== */

.cc {
  position: fixed;
  z-index: 1000;
  font-family: var(--font-body);
  color: var(--ink);
  animation: cc-in .6s var(--ease) both;
}
.cc.is-leaving { animation: cc-out .35s ease forwards; }
.cc[hidden] { display: none; } /* beats the display:flex below until it is time to show */

@keyframes cc-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes cc-out { to { opacity: 0; transform: translateY(24px); } }
@keyframes cc-wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-16deg); }
  40% { transform: rotate(11deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(3deg); }
}

.cc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cc a:hover { color: var(--red); }
.cc-cookie svg { display: block; width: 100%; height: auto; }

.cc-btn {
  height: 42px; padding: 0 18px;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
  color: #fff; background: var(--red);
  border: 1.5px solid var(--red); border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cc-btn:hover { background: var(--navy); border-color: var(--navy); }
.cc-btn--dark { background: var(--ink); border-color: var(--ink); }
.cc-btn--ghost { background: transparent; color: var(--ink); border-color: oklch(20% 0.01 40 / .25); }
.cc-btn--ghost:hover { background: transparent; color: var(--red); border-color: var(--red); }

.cc-link {
  padding: 0; border: 0; background: none;
  font: inherit; font-size: 13px; color: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.cc-link:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   The bar: slim, dark, bottom-centre.
   -------------------------------------------------------------------------- */
.cc {
  left: 16px; right: 16px; bottom: 20px;
  max-width: 900px; margin-inline: auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 12px 12px 18px;
  color: var(--cream);
  background: oklch(22% 0.02 40);
  border-radius: 14px;
  box-shadow: 0 18px 50px oklch(10% 0.02 30 / .35);
}
.cc .cc-cookie { flex: none; width: 40px; transition: transform .45s var(--ease); }
.cc:hover .cc-cookie { transform: rotate(-25deg) scale(1.1); }
.cc .cc-text { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.5; color: oklch(97% 0.012 60 / .85); }
.cc .cc-text strong {
  margin-right: 4px;
  font-family: var(--font-script); font-style: italic; font-weight: 600; font-size: 17px;
  color: var(--cream);
}
.cc a:hover { color: var(--cream); }
.cc .cc-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.cc .cc-link { margin-right: 8px; color: oklch(97% 0.012 60 / .85); }
.cc .cc-link:hover { color: var(--cream); }
.cc .cc-btn { color: var(--ink); background: var(--cream); border-color: var(--cream); }
.cc .cc-btn:hover { color: #fff; background: var(--red); border-color: var(--red); }
.cc .cc-btn--line { color: var(--cream); background: transparent; border-color: oklch(97% 0.012 60 / .6); }

@media (max-width: 780px) {
  .cc { left: 12px; right: 12px; bottom: 12px; flex-wrap: wrap; gap: 12px; padding: 16px; }
  .cc .cc-cookie { width: 36px; }
  .cc .cc-text { flex: 1 1 calc(100% - 56px); }
  .cc .cc-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .cc .cc-link { grid-column: 1 / -1; order: 3; justify-self: center; margin: 2px 0 0; }
}

/* --------------------------------------------------------------------------
   Preferences dialog (shared)
   -------------------------------------------------------------------------- */
.cc-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0; border-radius: 14px;
  color: var(--ink); background: #fff;
  font-family: var(--font-body);
  box-shadow: 0 30px 80px oklch(10% 0.02 30 / .35);
}
.cc-dialog[open] { animation: cc-in .35s var(--ease); }
.cc-dialog::backdrop { background: oklch(15% 0.02 30 / .45); backdrop-filter: blur(2px); }
.cc-dialog__inner { padding: clamp(20px, 5vw, 28px); }
.cc-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cc-dialog h2 {
  margin: 0;
  font-family: var(--font-script); font-style: italic; font-weight: 600;
  font-size: 26px; line-height: 1.2;
  color: var(--red);
}
.cc-x {
  flex: none; width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  font-size: 22px; line-height: 1;
  color: var(--ink); background: var(--cream);
  cursor: pointer;
}
.cc-x:hover { color: var(--red); }
.cc-dialog__intro { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

.cc-cats { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.cc-cat {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cc-cat__text { cursor: pointer; }
.cc-cat:first-child .cc-cat__text { cursor: default; }
.cc-cat__title { display: block; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.cc-cat__desc { display: block; margin-top: 4px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.cc-always {
  flex: none; padding-top: 2px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: oklch(45% 0.1 150);
}

.cc-switch {
  appearance: none; -webkit-appearance: none;
  flex: none; position: relative;
  width: 44px; height: 26px; margin: 0;
  border-radius: 999px;
  background: oklch(20% 0.01 40 / .2);
  cursor: pointer;
  transition: background .2s ease;
}
.cc-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25);
  transition: transform .2s var(--ease);
}
.cc-switch:checked { background: var(--red); }
.cc-switch:checked::after { transform: translateX(18px); }
.cc-switch:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.cc-dialog__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.cc-dialog__actions .cc-btn { padding: 0 8px; }
@media (max-width: 480px) { .cc-dialog__actions { grid-template-columns: 1fr; } }

/* Footer link to reopen settings */
.cookie-settings-link {
  padding: 0;
  border: 0; background: none;
  font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.cookie-settings-link:hover { color: var(--red); }
