/* Cookie banner and footer control. Loaded by every page; custom properties
   fall back to the cream/ink values. */
#cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(480px, calc(100% - 48px));
  z-index: var(--z-banner, 9999);
  padding: 24px;
  border: 1px solid var(--line, #a4afac);
  border-radius: 16px;
  background: var(--surface, #f4f3ed);
  color: var(--ink, #293233);
  box-shadow: 0 8px 28px #0002;
}
#cookie-banner[hidden] {
  display: none;
}
.cookie-banner-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#cookie-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}
#cookie-banner p {
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.6;
}
.cookie-policy {
  display: inline-block;
  padding-block: 4px;
  color: var(--accent, #6843a8);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 14px;
}
#cookie-banner button,
.cookie-settings {
  font: inherit;
  cursor: pointer;
}
#cookie-banner button {
  min-height: 44px;
  border: 1px solid var(--line, #a4afac);
  border-radius: 8px;
  padding: 10px 16px;
  background: transparent;
  color: var(--ink, #293233);
  font-size: 14px;
  font-weight: 600;
}
#cookie-banner #cookie-close {
  flex-shrink: 0;
  width: 44px;
  padding: 0;
  border: 0;
  font-size: 26px;
}
.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.cookie-actions button {
  flex: 1;
}
#cookie-banner #cookie-accept {
  background: var(--accent, #6843a8);
  border-color: var(--accent, #6843a8);
  color: white;
}
#cookie-banner button:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}
/* Footer control: a plain footer link on every page ("Cookie choice: Essential only  Change"). */
.cookie-settings {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  text-align: left;
}
.cookie-settings:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cookie-settings:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.cookie-settings-copy {
  display: flex;
  gap: 0.375rem;
}
.cookie-settings-copy span::after {
  content: ":";
}
.cookie-choice {
  font-weight: 400;
}
.cookie-settings-action {
  margin-left: 0.375rem;
  font-weight: 700;
}
#cookie-banner {
  animation: cookie-banner-in 260ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
}
@keyframes cookie-banner-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
#cookie-banner button {
  transition:
    color var(--dur, 160ms) var(--ease, ease),
    background-color var(--dur, 160ms) var(--ease, ease),
    border-color var(--dur, 160ms) var(--ease, ease),
    box-shadow var(--dur, 160ms) var(--ease, ease),
    transform var(--dur, 160ms) var(--ease, ease);
}
#cookie-banner button:active {
  transform: scale(0.97);
}
@media (max-width: 650px) {
  /* Phones only: the full-width banner would cover the footer, so the page gets room
     below it. On wider screens it is a corner card and extra room is just blank scroll. */
  body.cookie-banner-open::after {
    content: "";
    display: block;
    height: var(--cookie-banner-space, 0px);
  }
  #cookie-banner {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 55vh;
    overflow-y: auto;
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #cookie-banner {
    animation: none;
  }
  #cookie-banner button {
    transition-property: color, background-color, border-color, box-shadow;
  }
  #cookie-banner button:active {
    transform: none;
  }
}
