/* ==========================================================================
   Cookie consent banner (built by cookie-consent.js)
   ========================================================================== */
.cc {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(440px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 20, 19, 0.18), 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.2,.8,.2,1);
}
.cc[hidden] { display: none; }
.cc.is-visible { opacity: 1; transform: none; }
.cc--prefs { width: min(520px, calc(100% - 48px)); }

.cc-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.cc-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.cc-text a { color: var(--link); text-underline-offset: 3px; }

/* ---------- Buttons: "Accept all" and "Necessary only" get equal weight ---------- */
.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cc-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.cc-btn:hover { background: var(--paper); }
.cc-btn--primary { background: var(--ink); color: var(--paper); }
.cc-btn--primary:hover { background: var(--ink-hover); }
.cc-btn--link {
  flex: 1 0 100%;
  min-height: 36px;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cc-btn--link:hover { background: none; color: var(--ink); }
.cc-btn[hidden] { display: none; }

/* ---------- Preferences ---------- */
.cc-prefs { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; }
.cc-prefs[hidden] { display: none; }
.cc-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.cc-option:last-child { border-bottom: 1px solid var(--line); }
.cc-option-body { display: flex; flex-direction: column; gap: 2px; }
.cc-option-name { font-size: 15px; font-weight: 700; }
.cc-option-text { font-size: 13px; line-height: 1.45; color: var(--ink-muted); }

/* Switch: the real checkbox is visually hidden; the track/knob show its state */
.cc-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cc-switch {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin-top: 2px;
  border-radius: var(--radius-pill);
  background: var(--line);
  transition: background-color .2s ease;
}
.cc-switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.25);
  transition: transform .2s ease;
}
.cc-option input:checked ~ .cc-switch { background: var(--ink); }
.cc-option input:checked ~ .cc-switch::after { transform: translateX(18px); background: var(--accent-light); }
.cc-option input:disabled ~ .cc-switch { opacity: .45; }
.cc-option:has(input:disabled) { cursor: default; }
.cc-option input:focus-visible ~ .cc-switch { outline: 2px solid var(--ink); outline-offset: 3px; }

.cc-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* "Cookie settings" in the footer legal links */
.cc-footer-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-muted);
  cursor: pointer;
}
.cc-footer-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Phone: full-width sheet at the bottom ---------- */
@media (max-width: 600px) {
  .cc, .cc--prefs {
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 85dvh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

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

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