/* ───────────────────────────────────────────────────────────
   Deliney — Cookie consent banner + preferences
   Built on deliney-tokens.css — warm & tactile
   ─────────────────────────────────────────────────────────── */

.cc-root { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.cc-root[hidden] { display: none; }

/* ── Scrim (only for preferences modal) ── */
.cc-scrim {
  position: absolute; inset: 0; background: rgba(31,26,20,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .28s var(--ease, cubic-bezier(.4,0,.2,1));
  pointer-events: none;
}
.cc-root.cc-prefs-open .cc-scrim { opacity: 1; pointer-events: auto; }

/* ── Compact bottom banner ── */
.cc-banner {
  position: absolute; left: 24px; bottom: 24px; width: min(440px, calc(100vw - 48px));
  background: var(--surface); border: 1px solid var(--divider-strong);
  border-radius: var(--r-card-lg); box-shadow: 0 20px 50px -16px rgba(31,26,20,.4), 0 4px 14px rgba(31,26,20,.12);
  padding: 22px 22px 20px; pointer-events: auto;
  /* Statically visible whenever shown — no opacity animation that could
     leave it stuck transparent. A gentle slide-in is layered on top. */
  opacity: 1; transform: none;
}
.cc-root:not(.cc-no-anim) .cc-banner { animation: ccBannerIn .42s var(--ease, cubic-bezier(.4,0,.2,1)); }
@keyframes ccBannerIn {
  from { transform: translateY(18px); }
  to   { transform: none; }
}
.cc-root.cc-prefs-open .cc-banner { display: none; }

.cc-banner-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.cc-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--clay-soft); color: var(--clay); display: grid; place-items: center;
}
.cc-ic svg { width: 19px; height: 19px; }
.cc-banner-head h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; flex: 1 1 auto; white-space: nowrap; }
.cc-banner p { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 16px; text-wrap: pretty; }
.cc-banner p a { color: var(--clay); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--clay-soft); }
.cc-banner p a:hover { text-decoration-color: var(--clay); }

.cc-actions { display: flex; flex-direction: column; gap: 9px; }
.cc-actions .cc-row { display: flex; gap: 9px; }
.cc-actions .cc-row .cc-btn { flex: 1; }

.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease, cubic-bezier(.4,0,.2,1)), opacity .15s, background .2s, border-color .2s;
}
.cc-btn:active { transform: translateY(1px); }
.cc-btn-clay { background: var(--clay); color: #FFFBF5; box-shadow: var(--shadow-fab); }
.cc-btn-clay:hover { opacity: .92; }
.cc-btn-ghost { background: transparent; color: var(--ink); border-color: var(--divider-strong); }
.cc-btn-ghost:hover { background: var(--surface-alt); }
.cc-btn-text { background: transparent; color: var(--ink-soft); padding: 11px 12px; }
.cc-btn-text:hover { color: var(--clay); }

/* ── Preferences modal ── */
.cc-prefs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
  width: min(540px, calc(100vw - 40px)); max-height: min(86vh, 720px); overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-sheet);
  box-shadow: 0 30px 70px -18px rgba(31,26,20,.5); pointer-events: auto;
  opacity: 0; transition: transform .32s var(--ease, cubic-bezier(.4,0,.2,1)), opacity .32s var(--ease, cubic-bezier(.4,0,.2,1));
}
.cc-root.cc-prefs-open .cc-prefs { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.cc-prefs[hidden] { display: none; }

.cc-prefs-head { padding: 26px 28px 18px; border-bottom: 1px solid var(--divider); }
.cc-prefs-head .eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cc-prefs-head h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.1; }
.cc-prefs-head p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin: 8px 0 0; text-wrap: pretty; }
.cc-prefs-head p a { color: var(--clay); text-decoration: underline; text-underline-offset: 2px; }

.cc-prefs-body { padding: 8px 28px; overflow-y: auto; }

.cc-cat { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--divider); }
.cc-cat:last-child { border-bottom: none; }
.cc-cat-text { flex: 1; min-width: 0; }
.cc-cat-text h4 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.cc-cat-text p { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin: 0; text-wrap: pretty; }
.cc-cat-text .cc-locked { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--sage); display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; }
.cc-cat-text .cc-locked svg { width: 12px; height: 12px; }

/* Toggle switch */
.cc-switch { flex-shrink: 0; position: relative; width: 46px; height: 28px; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-alt);
  border: 1px solid var(--divider-strong); transition: background .22s var(--ease, cubic-bezier(.4,0,.2,1)), border-color .22s;
}
.cc-track::after {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(31,26,20,.3); transition: transform .22s var(--ease, cubic-bezier(.4,0,.2,1));
}
.cc-switch input:checked + .cc-track { background: var(--clay); border-color: var(--clay); }
.cc-switch input:checked + .cc-track::after { transform: translateY(-50%) translateX(18px); }
.cc-switch input:focus-visible + .cc-track { box-shadow: 0 0 0 3px var(--clay-soft); }
.cc-switch.cc-disabled input { cursor: not-allowed; }
.cc-switch.cc-disabled input:checked + .cc-track { background: var(--sage); border-color: var(--sage); opacity: .7; }

.cc-prefs-foot {
  padding: 18px 28px 22px; border-top: 1px solid var(--divider);
  display: flex; gap: 10px; flex-wrap: wrap;
}
.cc-prefs-foot .cc-btn { flex: 1; min-width: 130px; }
.cc-prefs-foot .cc-save { flex: 1.4 1 100%; order: -1; }

/* ── Dark mode shadow softening ── */
[data-theme="dark"] .cc-banner { box-shadow: 0 20px 50px -16px rgba(0,0,0,.6); }
[data-theme="dark"] .cc-prefs { box-shadow: 0 30px 70px -18px rgba(0,0,0,.7); }

/* ── Responsive ── */
@media (max-width: 560px) {
  .cc-banner { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .cc-prefs-foot { flex-direction: column; }
  .cc-prefs-foot .cc-btn, .cc-prefs-foot .cc-save { flex: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-prefs, .cc-scrim, .cc-track, .cc-track::after { transition: none; }
  .cc-banner { animation: none; }
}
