/* Cookie consent banner. Matches the site palette (ink, warm paper, terracotta focus). */

.cookie-banner {
  box-sizing: border-box;
  position: fixed;
  z-index: 80;
  left: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  background: #fff;
  color: var(--ink, #0F1420);
  border: 1px solid var(--line, #E8E4DC);
  border-radius: 16px;
  box-shadow: 0 16px 40px -20px rgba(15, 20, 32, 0.45);
  font-family: var(--sans, Geist, system-ui, -apple-system, 'Segoe UI', sans-serif);
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner[hidden],
.cookie-banner__panel[hidden] {
  display: none !important;
}

/* The dialog is focused so assistive tech announces it. The ring stays on the controls. */
#cookie-banner:focus,
#cookie-banner:focus-visible {
  outline: none;
}

.cookie-banner h2.cookie-banner__title {
  margin: 0 0 8px;
  max-width: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink, #0F1420);
}

.cookie-banner__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2, #3D4250);
}

.cookie-banner__text a {
  color: var(--accent-ink, #A84E2A);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cookie-banner__btn {
  box-sizing: border-box;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--ink, #0F1420);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  cursor: pointer;
  text-align: center;
}

.cookie-banner__accept {
  background: var(--ink, #0F1420);
  color: #fff;
}

.cookie-banner__accept:hover {
  background: #262D3F;
  border-color: #262D3F;
}

.cookie-banner__reject {
  background: #fff;
  color: var(--ink, #0F1420);
}

.cookie-banner__reject:hover {
  background: var(--bg-soft, #F6F4EF);
}

.cookie-banner__manage,
.cookie-banner__save,
.cookie-banner__back {
  grid-column: 1 / -1;
}

.cookie-banner__manage,
.cookie-banner__back {
  background: #fff;
  color: var(--ink, #0F1420);
  border-color: var(--line-2, #DCD7CD);
}

.cookie-banner__manage:hover,
.cookie-banner__back:hover {
  border-color: var(--ink, #0F1420);
}

.cookie-banner__save {
  background: var(--ink, #0F1420);
  color: #fff;
}

.cookie-banner__save:hover {
  background: #262D3F;
  border-color: #262D3F;
}

.cookie-banner :focus-visible {
  outline: 2px solid var(--accent, #C86D4C);
  outline-offset: 3px;
}

.cookie-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line, #E8E4DC);
}

.cookie-pref__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #0F1420);
}

.cookie-pref__desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--body, #4A4F5C);
}

.cookie-pref__side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.cookie-switch-state {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2, #3D4250);
  min-width: 1.6em;
}

.cookie-switch {
  position: relative;
  box-sizing: border-box;
  width: 48px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  flex: none;
}

.cookie-switch::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 28px;
  border-radius: 999px;
  background: var(--line-2, #DCD7CD);
}

.cookie-switch::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 20, 32, 0.25);
}

.cookie-switch[aria-checked="true"]::before {
  background: var(--ink, #0F1420);
}

.cookie-switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

.cookie-switch.is-locked {
  cursor: default;
}

@media (max-width: 560px) {
  .cookie-banner__choices {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-switch::after {
    transition: none;
  }
}

@media (forced-colors: active) {
  .cookie-banner,
  .cookie-banner__btn,
  .cookie-switch::before {
    border: 1px solid CanvasText;
  }
}

button.cookie-settings {
  appearance: none;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.footer-links button.cookie-settings {
  font-size: 14px;
}

button.cookie-settings:hover {
  color: var(--ink, #0F1420);
}
