/* ============================================================
   Cookie consent — the first-visit notice card injected by
   /scripts/cookie-consent.js, fixed to the bottom left.

   Relies on the page's brand tokens (--ink, --pink, --muted)
   with safe fallbacks so it also renders on a page that has not
   defined the global :root palette.
   ============================================================ */

:root {
  --cc-ink: var(--ink, #0A0A0A);
  --cc-pink: var(--pink, #FF2D2D);
  --cc-muted: var(--muted, #6B6358);
}

.cc-card {
  position: fixed;
  left: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 300; /* above the sticky site header (200) */
  width: min(384px, calc(100vw - 40px));
  background: #fff;
  border: 2.5px solid var(--cc-ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--cc-ink);
  padding: 18px 22px 20px;
  font-family: 'Inter', sans-serif;
  color: var(--cc-ink);
  /* Hidden until .cc-in: visibility keeps the invisible card out of the
     tab order and the a11y tree, and stops it swallowing clicks during
     the enter delay and the exit fade. */
  opacity: 0;
  transform: translateY(16px);
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}
.cc-card.cc-in {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
}

/* ---------- the bag mouth ----------
   The top of the bag is folded down over the front, so its pink inside
   shows as a cuff band slightly wider than the card. A pile of cookies
   sits in the opening behind it; the cuff (later in the DOM) paints over
   their lower halves, so they look like they sit inside the bag. */
.cc-bag-rim {
  position: absolute;
  top: -15px;
  left: -6px;
  right: -6px;
  height: 30px;
  pointer-events: none;
}
.cc-bag-cuff {
  position: absolute;
  inset: 0;
  background: var(--cc-pink);
  border: 2.5px solid var(--cc-ink);
  border-radius: 9px;
}
/* the fold's crease: a soft dark line along the cuff's lower lip */
.cc-bag-cuff::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 4px;
  border-radius: 99px;
  background: rgba(10, 10, 10, 0.18);
}
/* ---------- accept-all burst: cookies pop out of the bag ---------- */
.cc-burst {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.cc-pop {
  position: absolute;
  left: -20px;
  top: -26px;
  width: 40px;
  /* Pages set img { max-width: 100% }; against the 0-width .cc-burst
     that would collapse the pops to 0x0, so opt out explicitly. */
  max-width: none;
  opacity: 0;
  animation: cc-pop 0.7s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes cc-pop {
  0% { transform: translate(0, 0) rotate(0deg) scale(0.5); opacity: 1; }
  45% { transform: translate(calc(var(--dx) * 0.55), var(--peak)) rotate(var(--rot)) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--peak) * 0.25)) rotate(calc(var(--rot) * 1.6)) scale(1); opacity: 0; }
}

.cc-eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 19px;
  font-weight: 700;
  color: var(--cc-muted);
  margin: 0 0 2px;
}

.cc-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.cc-body {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.cc-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--cc-pink);
}
.cc-link:hover { text-decoration-thickness: 3px; }

.cc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-btn {
  flex: 1 1 auto;
  background: #fff;
  color: var(--cc-ink);
  border: 2px solid var(--cc-ink);
  border-radius: 11px;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--cc-ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.cc-btn--primary {
  background: var(--cc-pink);
  color: #fff;
}
.cc-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--cc-ink); }
.cc-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cc-ink); }

.cc-btn:focus-visible,
.cc-link:focus-visible {
  outline: 3px solid var(--cc-pink);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .cc-card {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Both selectors: .cc-card.cc-in declares its own transition list and
     would out-specify a bare .cc-card override, leaving the enter fade on.
     The pile is static by design; the accept burst is skipped in the script. */
  .cc-card,
  .cc-card.cc-in { transition: none; }
}

@media print {
  .cc-card { display: none; }
}
