/* Cookie choices: a two-line notice in the bottom-right corner of a laptop and
 * a short strip along the bottom of a phone. It sits on the right because this
 * site sets its headlines and first calls to action on the left. There is no
 * overlay and no scroll lock, so the page stays usable while the notice is
 * open. Everything is drawn from the locked tokens in modern.css; the fallbacks
 * only matter on a page that loads this sheet without it. Both answers use the
 * site's hairline ghost button, so turning analytics off is exactly as easy to
 * find as keeping it. Only Save, in the settings the visitor opens from the
 * footer, is solid. */

.cc {
  position: fixed;
  z-index: 1000; /* above the navigation (900), beneath an open mobile menu (1100) */
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 48px));
  font-family: var(--font-sans, "Manrope", -apple-system, BlinkMacSystemFont, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.cc[hidden],
.cc [hidden] {
  display: none !important;
}

/* A short landscape phone or a zoomed page can be shorter than the open
 * settings; the card then scrolls inside itself rather than losing its top
 * edge beyond the screen. */
.cc-card {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper, #fff);
  color: var(--body, #5a5a62);
  border: 1px solid var(--stroke-01, rgba(18, 38, 48, 0.22));
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(18, 38, 48, 0.05), 0 18px 40px -26px rgba(18, 38, 48, 0.35);
}

.cc-enter .cc-card {
  animation: cc-rise 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.cc-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
}

.cc-link {
  color: var(--petrol-text, #1674a1);
  font: 600 13px/1.3 var(--font-sans, "Manrope", sans-serif);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Equal columns: the two answers are always the same width. */
.cc-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-left: auto;
}

/* The site's .btn-ghost and .btn-solid, at a compact height. */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--hairline, #d1d5db);
  border-radius: 10px;
  background: var(--paper, #fff);
  color: var(--ink-deep, #23242a);
  font: 600 13.5px/1.2 var(--font-sans, "Manrope", sans-serif);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cc-btn:hover {
  border-color: var(--ink, #3c3d42);
}

.cc-save {
  margin-left: auto;
  border-color: var(--petrol, #1779a7);
  background: var(--petrol, #1779a7);
  color: #fff;
}

.cc-save:hover {
  border-color: #126285;
  background: #126285;
}

/* ---- Cookie settings, opened from the footer ------------------------------ */

.cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cc-title {
  margin: 0;
  font-family: var(--font-serif, "Marcellus", Georgia, serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--ink-deep, #23242a);
}

.cc-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #70717b);
  cursor: pointer;
}

.cc-close:hover {
  background: var(--mist, #eff9fd);
  color: var(--ink-deep, #23242a);
}

.cc-rows {
  margin-top: 8px;
  border-top: 1px solid var(--hairline-soft, #e2e5e9);
}

.cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-soft, #e2e5e9);
}

.cc-row-copy {
  min-width: 0;
}

.cc-row-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-deep, #23242a);
}

.cc-row-text {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted, #70717b);
  text-wrap: pretty;
}

.cc-always {
  flex: none;
  font-family: var(--font-mono, "Chivo Mono", monospace);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #70717b);
}

.cc-switch {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--hairline, #d1d5db);
  border-radius: 999px;
  background: var(--hairline-soft, #e2e5e9);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.cc-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 38, 48, 0.2);
  transition: transform 0.18s ease;
}

.cc-switch[aria-checked="true"] {
  border-color: var(--petrol, #1779a7);
  background: var(--petrol, #1779a7);
}

.cc-switch[aria-checked="true"] .cc-switch-thumb {
  transform: translateX(18px);
}

.cc-btn:focus-visible,
.cc-link:focus-visible,
.cc-close:focus-visible,
.cc-switch:focus-visible {
  outline: 2px solid var(--petrol, #1779a7);
  outline-offset: 2px;
}

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

/* A phone: a short strip along the bottom, inside the safe area, with the
 * answers still side by side and large enough to tap. */
@media (max-width: 560px) {
  .cc {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
  }

  .cc-card {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 12px 14px;
  }

  .cc-actions {
    margin-top: 10px;
  }

  .cc-btn {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-enter .cc-card {
    animation: none;
  }

  .cc-btn,
  .cc-switch,
  .cc-switch-thumb {
    transition: none;
  }
}

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