/* Cookie consent banner + settings dialog (assets/js/consent.js). Scorpion Club dark, one gold. 2026-10-30 */

.cc,
.cc-dialog {
  --cc-bg: #221d17;
  --cc-card: #2a241c;
  --cc-text: #f4efe6;
  --cc-body: rgb(244 239 230 / 84%);
  --cc-muted: #b3a48c;
  --cc-gold: #c6a066;
  --cc-gold-hover: #e0bc7a;
  --cc-gold-press: #9e7e43;
  --cc-on-gold: #060505;
  --cc-line: rgb(198 160 102 / 30%);
  --cc-line-soft: rgb(244 239 230 / 12%);
  --cc-display: "Frank Ruhl Libre", Georgia, serif;
  --cc-body-font: "IBM Plex Sans Hebrew", system-ui, "Segoe UI", Arial, sans-serif;
  --cc-mono: "IBM Plex Mono", ui-monospace, monospace;
  --cc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.cc[hidden],
.cc-dialog:not([open]) { display: none; }

/* ---------- Banner: a quiet card docked at the bottom (start side on wide screens) ---------- */
.cc {
  position: fixed;
  z-index: 45; /* above the mobile join dock (40), below the header (50) and the mobile menu (60) */
  inset-inline: 12px;
  /* Mobile: sits above the join dock and the accessibility chip (both 56px, 10px off the edge). */
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 56px + 10px);
  color: var(--cc-text);
  font-family: var(--cc-body-font);
  direction: rtl;
  text-align: start;
}

.cc__card {
  position: relative;
  padding: 20px 20px 18px;
  border: 1px solid var(--cc-line);
  border-top: 2px solid var(--cc-gold);
  background:
    radial-gradient(420px 160px at 100% 0%, rgb(198 160 102 / 10%), transparent 70%),
    var(--cc-bg);
  box-shadow: 0 24px 60px -18px rgb(0 0 0 / 75%), 0 2px 0 rgb(0 0 0 / 30%);
}

.cc__eyebrow {
  margin: 0 0 6px;
  color: var(--cc-gold);
  font-family: var(--cc-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  line-height: 1.4;
  text-transform: uppercase;
  text-align: right;
}

.cc__title {
  margin: 0;
  color: var(--cc-text);
  font-family: var(--cc-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.cc__text {
  margin: 8px 0 0;
  color: var(--cc-body);
  font-size: 15px;
  line-height: 1.6;
}

.cc a.cc__more {
  color: var(--cc-gold-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.cc a.cc__more:hover { color: var(--cc-text); }

.cc__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.cc__actions .cc-btn--text { grid-column: 1 / -1; }

/* ---------- Buttons ---------- */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--cc-body-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

.cc-btn--primary { background: var(--cc-gold); border-color: var(--cc-gold); color: var(--cc-on-gold); }
.cc-btn--primary:hover { background: var(--cc-gold-hover); border-color: var(--cc-gold-hover); }
.cc-btn--primary:active { background: var(--cc-gold-press); border-color: var(--cc-gold-press); }

.cc-btn--line { background: transparent; border-color: rgb(244 239 230 / 38%); color: var(--cc-text); }
.cc-btn--line:hover { border-color: var(--cc-gold); color: var(--cc-gold-hover); }

.cc-btn--text {
  min-height: 40px;
  padding: 6px 8px;
  background: transparent;
  color: var(--cc-muted);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-btn--text:hover { color: var(--cc-text); }

.cc :focus-visible,
.cc-dialog :focus-visible {
  outline: 2px solid var(--cc-gold-hover);
  outline-offset: 3px;
}

/* ---------- Settings dialog ---------- */
.cc-dialog {
  width: min(100% - 24px, 34rem);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--cc-line);
  border-top: 2px solid var(--cc-gold);
  background: var(--cc-bg);
  color: var(--cc-text);
  font-family: var(--cc-body-font);
  direction: rtl;
  text-align: start;
  box-shadow: 0 40px 100px -30px rgb(0 0 0 / 85%);
}

.cc-dialog::backdrop {
  background: rgb(6 5 5 / 72%);
  backdrop-filter: blur(3px);
}

.cc-dialog__in { margin: 0; padding: 24px; }

.cc-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cc-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cc-muted);
  cursor: pointer;
}
.cc-dialog__close:hover { color: var(--cc-text); border-color: var(--cc-line-soft); }
.cc-dialog__close svg { width: 20px; height: 20px; }

.cc-opt {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--cc-line-soft);
  background: var(--cc-card);
}

.cc-opt + .cc-opt { margin-top: 8px; }

.cc-opt__text { min-width: 0; }

.cc-opt__title {
  margin: 0;
  color: var(--cc-text);
  font-family: var(--cc-body-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.cc-opt__title label { cursor: pointer; }

.cc-opt p {
  margin: 4px 0 0;
  color: var(--cc-body);
  font-size: 14px;
  line-height: 1.55;
}

.cc-opt__always {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--cc-line);
  color: var(--cc-gold-hover);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Switch: a real checkbox (role=switch) laid over a drawn track, so it keeps native focus and keyboard. */
.cc-switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  margin-top: 2px;
}

.cc-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(244 239 230 / 45%);
  border-radius: 999px;
  background: #15120f;
  transition: background-color 160ms var(--cc-ease), border-color 160ms var(--cc-ease);
}

.cc-switch__knob {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cfc3b0;
  transition: transform 160ms var(--cc-ease), background-color 160ms var(--cc-ease);
}

.cc-switch input:checked + .cc-switch__track { background: var(--cc-gold); border-color: var(--cc-gold); }
.cc-switch input:checked + .cc-switch__track .cc-switch__knob { transform: translateX(-22px); background: var(--cc-on-gold); }
.cc-switch input:focus-visible + .cc-switch__track { outline: 2px solid var(--cc-gold-hover); outline-offset: 3px; }

.cc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.cc-dialog__actions .cc-btn { flex: 1 1 10rem; }

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

/* ---------- Wider screens: a compact card on the start (right) side; the accessibility chip is bottom-left ---------- */
@media (min-width: 640px) {
  .cc {
    inset-inline: 24px auto;
    bottom: max(24px, env(safe-area-inset-bottom));
    width: 27rem;
    max-width: calc(100vw - 48px - 80px);
  }
  .cc__card { padding: 24px 24px 20px; }
  .cc__actions { grid-template-columns: auto auto 1fr; align-items: center; }
  .cc__actions .cc-btn--text { grid-column: auto; justify-self: start; }
}

/* ---------- Motion: a short rise on first show, only when the visitor allows motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .cc:not([hidden]) .cc__card { animation: cc-rise 420ms var(--cc-ease) both; }
  .cc-dialog[open] { animation: cc-fade 220ms var(--cc-ease) both; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn,
  .cc-switch__track,
  .cc-switch__knob { transition: none; }
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes cc-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .cc__card,
  .cc-dialog { border: 1px solid CanvasText; }
  .cc-switch__track { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
  .cc-switch input:checked + .cc-switch__track { background: Highlight; }
  .cc-switch__knob { background: CanvasText; }
}

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

/* Round 2 (2026-10-30): "accept all" and "necessary only" have the same size and weight (ui-copy). */
.cc-btn--choice { background: transparent; border-color: var(--cc-gold); color: var(--cc-gold-hover); }
.cc-btn--choice:hover { background: var(--cc-gold); border-color: var(--cc-gold); color: var(--cc-on-gold); }
.cc-btn--choice:active { background: var(--cc-gold-press); border-color: var(--cc-gold-press); color: var(--cc-on-gold); }

.cc-dialog__fine {
  margin: 16px 0 0;
  color: var(--cc-muted);
  font-size: 13px;
  line-height: 1.5;
}
.cc-dialog__fine a { color: var(--cc-gold-hover); text-decoration: underline; text-underline-offset: 3px; }
.cc-dialog__fine a:hover { color: var(--cc-text); }
