/* ============================================================================
   cookie-consent.css — shared consent banner + preferences modal.
   Loaded on every page. Relies on the design tokens (--bg-card, --gold, etc.)
   already defined in each page's :root, so it matches dark/light mode for free.
   ============================================================================ */

/* ── Bottom banner ── */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  background: color-mix(in srgb, var(--bg-card) 96%, transparent);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px -12px rgba(0,0,0,0.35);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cc-banner.in { transform: translateY(0); }
.cc-banner-text { flex: 1 1 380px; font-size: 13.5px; line-height: 1.5; color: var(--text-mute); max-width: 640px; }
.cc-banner-text strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.cc-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Shared small buttons ── */
.cc-btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 999px; white-space: nowrap;
  transition: all .2s ease;
}
.cc-btn-primary { background: var(--gold); color: #1A0F00; }
.cc-btn-primary:hover { background: var(--gold-soft); transform: translateY(-1px); }
.cc-btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.cc-btn-ghost:hover { border-color: var(--text-mute); background: color-mix(in srgb, var(--text) 4%, transparent); }

/* ── Preferences modal ── */
.cc-modal-backdrop {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(4, 8, 16, 0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.cc-modal-backdrop.in { opacity: 1; pointer-events: auto; }
.cc-modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
  transform: translateY(12px) scale(0.98); transition: transform .25s ease;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
}
.cc-modal-backdrop.in .cc-modal { transform: translateY(0) scale(1); }
.cc-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--border);
}
.cc-modal-head h3 { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.cc-close {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--text-mute); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px;
  transition: color .2s ease, background .2s ease;
}
.cc-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.cc-modal-body { padding: 8px 24px; }
.cc-row { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.cc-row:last-child { border-bottom: 0; }
.cc-row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-row-label { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; color: var(--text); font-style: italic; }
.cc-row-desc { font-size: 13px; color: var(--text-mute); line-height: 1.55; margin-top: 8px; }
.cc-modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 18px 24px 22px; border-top: 1px solid var(--border);
}

/* ── Toggle switch ── */
.cc-switch { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cc-switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--border);
  position: relative; transition: background .2s ease; display: block;
}
.cc-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-mute); transition: transform .2s ease, background .2s ease;
}
.cc-switch input:checked + .cc-switch-track { background: color-mix(in srgb, var(--gold) 35%, var(--border)); }
.cc-switch input:checked + .cc-switch-track .cc-switch-thumb { transform: translateX(18px); background: var(--gold); }
.cc-switch input:focus-visible + .cc-switch-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.cc-switch.is-locked { cursor: not-allowed; opacity: 0.7; }

/* ── Footer "Cookie preferences" reopen link ── */
.cc-manage-link {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0;
  font-family: var(--font-body); font-size: 12.5px; color: var(--text-dim);
  text-decoration: underline; text-underline-offset: 2px; transition: color .2s ease;
}
.cc-manage-link:hover { color: var(--gold); }

@media (max-width: 560px) {
  .cc-banner { padding: 18px 16px; }
  .cc-banner-actions { width: 100%; }
  .cc-banner-actions .cc-btn { flex: 1; }
}
