/* Babav — cookie banner and preferences dialog.
   Paper, ink and hairlines, same as everything else. No shadows on paper; the
   banner earns its separation with an ink top rule instead.
   Accept and reject are deliberately the same size, weight and shape — only
   the fill differs. Neither is the quiet one. */

#babav-cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
#babav-cookie-banner.in { transform: translateY(0); }

#babav-cookie-banner .cb-inner {
  max-width: var(--wrap, 1280px);
  margin: 0 auto;
  padding: 22px 32px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}

#babav-cookie-banner .cb-label,
#babav-cookie-prefs .cb-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

#babav-cookie-banner p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  max-width: 78ch;
  text-wrap: pretty;
}
#babav-cookie-banner a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule-soft); }
#babav-cookie-banner a:hover { color: var(--ink); border-bottom-color: var(--ink); }

#babav-cookie-banner .cb-actions { display: flex; gap: 10px; flex-wrap: wrap; }

#babav-cookie-banner .cb-actions button,
#babav-cookie-prefs .cp-foot button {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 13px 20px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}

/* Equal weight: both primary actions are full-strength ink outlines. */
#babav-cookie-banner [data-consent="all"],
#babav-cookie-prefs [data-consent="save"] {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
}
#babav-cookie-banner [data-consent="all"]:hover,
#babav-cookie-prefs [data-consent="save"]:hover { background: var(--accent); border-color: var(--accent); }

#babav-cookie-banner [data-consent="none"],
#babav-cookie-prefs [data-consent="all"],
#babav-cookie-prefs [data-consent="none"] {
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
#babav-cookie-banner [data-consent="none"]:hover,
#babav-cookie-prefs [data-consent="all"]:hover,
#babav-cookie-prefs [data-consent="none"]:hover { background: var(--ink); color: var(--paper); }

#babav-cookie-banner [data-consent="manage"] {
  border: 1px solid var(--rule-soft); background: transparent; color: var(--ink-2);
}
#babav-cookie-banner [data-consent="manage"]:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- preferences dialog ---------- */

#babav-cookie-prefs { position: fixed; inset: 0; z-index: 140; }
#babav-cookie-prefs .cp-scrim {
  position: absolute; inset: 0;
  background: rgba(26, 22, 18, 0.46);
  opacity: 0; transition: opacity .22s ease;
}
#babav-cookie-prefs.in .cp-scrim { opacity: 1; }

#babav-cookie-prefs .cp-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%);
  width: min(560px, calc(100vw - 40px));
  max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .22s ease, transform .22s cubic-bezier(.4, 0, .2, 1);
}
#babav-cookie-prefs.in .cp-panel { opacity: 1; transform: translate(-50%, -50%); }

#babav-cookie-prefs .cp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--rule-soft);
}
#babav-cookie-prefs h2 {
  font-family: var(--display);
  font-weight: 300; font-size: 30px; line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); margin: 0;
}
#babav-cookie-prefs .cp-close {
  border: 1px solid var(--rule-soft); background: transparent;
  width: 34px; height: 34px; border-radius: 999px;
  font-size: 19px; line-height: 1; color: var(--ink-2);
  cursor: pointer; flex: 0 0 auto;
  transition: border-color .2s, color .2s;
}
#babav-cookie-prefs .cp-close:hover { border-color: var(--ink); color: var(--ink); }

#babav-cookie-prefs .cp-body { padding: 4px 28px 8px; overflow-y: auto; }
#babav-cookie-prefs .cp-row { padding: 20px 0; border-bottom: 1px solid var(--rule-soft); }
#babav-cookie-prefs .cp-row:last-child { border-bottom: 0; }
#babav-cookie-prefs .cp-row-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px;
}
#babav-cookie-prefs .cp-row h3 {
  font-family: var(--display); font-weight: 400; font-size: 20px;
  letter-spacing: -.01em; color: var(--ink); margin: 0;
}
#babav-cookie-prefs .cp-row p {
  font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; max-width: 58ch; text-wrap: pretty;
}
#babav-cookie-prefs .cp-always {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--rule-soft); border-radius: 999px; padding: 6px 12px;
}

#babav-cookie-prefs .cp-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 0; padding: 6px 0; cursor: pointer; min-height: 44px;
}
#babav-cookie-prefs .cp-track {
  width: 46px; height: 26px; border-radius: 999px;
  border: 1px solid var(--rule-soft); background: transparent;
  position: relative; display: block; transition: background .2s, border-color .2s;
}
#babav-cookie-prefs .cp-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 999px;
  background: var(--ink-3);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), background .2s;
}
#babav-cookie-prefs .cp-toggle[aria-checked="true"] .cp-track { background: var(--ink); border-color: var(--ink); }
#babav-cookie-prefs .cp-toggle[aria-checked="true"] .cp-thumb { transform: translateX(20px); background: var(--paper); }
#babav-cookie-prefs .cp-state {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); min-width: 22px; text-align: left;
}

#babav-cookie-prefs .cp-foot {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-2);
}

/* ---------- phone ---------- */

@media (max-width: 720px) {
  #babav-cookie-banner .cb-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px 20px 22px;
  }
  #babav-cookie-banner p { font-size: 14px; }
  /* Full-width stacked actions: every one is a comfortable thumb target and
     none is visually favoured by being wider than another. */
  #babav-cookie-banner .cb-actions { flex-direction: column; gap: 8px; }
  #babav-cookie-banner .cb-actions button { width: 100%; }

  #babav-cookie-prefs .cp-panel {
    top: auto; bottom: 0; left: 0;
    transform: translate(0, 100%);
    width: 100%;
    max-height: 90vh;
    border-radius: 14px 14px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  #babav-cookie-prefs.in .cp-panel { transform: translate(0, 0); }
  #babav-cookie-prefs .cp-head { padding: 22px 20px 18px; }
  #babav-cookie-prefs h2 { font-size: 26px; }
  #babav-cookie-prefs .cp-body { padding: 4px 20px 8px; }
  #babav-cookie-prefs .cp-foot { padding: 16px 20px 22px; flex-direction: column; }
  #babav-cookie-prefs .cp-foot button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #babav-cookie-banner, #babav-cookie-prefs .cp-panel, #babav-cookie-prefs .cp-scrim,
  #babav-cookie-prefs .cp-thumb { transition: none !important; }
}
