/* Shared cookie consent — sync to all Websites projects. LL-26: wrap, never clip. */

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

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid color-mix(in srgb, CanvasText 14%, transparent);
  background: color-mix(in srgb, Canvas 94%, transparent);
  color: CanvasText;
  backdrop-filter: blur(12px);
  box-shadow: 0 -12px 40px rgb(0 0 0 / 0.18);
}

.cookie-banner__inner {
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
  max-width: 72rem;
  min-width: 0;
}

.cookie-banner__copy {
  min-width: 0;
}

.cookie-banner__title {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: none;
}

.cookie-banner__body {
  margin: 0.4rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0.88;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.cookie-banner__privacy {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.cookie-banner__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  min-width: 0;
}

.cookie-btn {
  box-sizing: border-box;
  flex: 1 1 9.5rem;
  min-height: 2.75rem;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, CanvasText 22%, transparent);
  background: transparent;
  color: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.cookie-btn:focus-visible {
  outline: 3px solid #3d6b52;
  outline-offset: 2px;
}

/* No primary/ghost split — reject and accept must be equal weight (TTDSG). */

.cookie-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgb(12 10 9 / 0.52);
  cursor: pointer;
}

.cookie-dialog {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: min(86dvh, 40rem);
  overflow: hidden;
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 1.15rem;
  border: 1px solid color-mix(in srgb, CanvasText 14%, transparent);
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.32);
}

.cookie-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cookie-dialog__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.cookie-dialog__lead {
  margin: 0.4rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0.86;
  overflow-wrap: break-word;
}

.cookie-dialog__close {
  flex-shrink: 0;
  display: inline-flex;
  min-height: 2.75rem;
  min-width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, CanvasText 15%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cookie-dialog__close:focus-visible {
  outline: 3px solid #3d6b52;
  outline-offset: 2px;
}

.cookie-dialog__options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 0;
  padding: 0;
  border: 0;
  min-height: 0;
  overflow: auto;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
  background: color-mix(in srgb, CanvasText 3.5%, Canvas);
}

.cookie-option input {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #3d6b52;
  flex-shrink: 0;
}

.cookie-option input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cookie-option__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cookie-option__label {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.cookie-option__hint {
  font-size: 0.875rem;
  line-height: 1.4;
  opacity: 0.8;
  overflow-wrap: break-word;
}

.cookie-option__badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  font-weight: 650;
  opacity: 0.7;
}

.cookie-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.35rem;
}

html[data-cookie-theme='dark'] .cookie-banner,
html[data-cookie-theme='dark'] .cookie-dialog {
  background: rgb(12 12 14 / 0.96);
  color: #f4f4f5;
  border-color: rgb(255 255 255 / 0.12);
}

html[data-cookie-theme='dark'] .cookie-option {
  background: rgb(255 255 255 / 0.07);
  border-color: rgb(255 255 255 / 0.16);
  color: #f4f4f5;
}

html[data-cookie-theme='dark'] .cookie-btn:focus-visible,
html[data-cookie-theme='dark'] .cookie-dialog__close:focus-visible {
  outline-color: #a78bfa;
}

html[data-cookie-theme='dark'] .cookie-option input {
  accent-color: #a78bfa;
}

html[data-cookie-theme='light'] .cookie-banner,
html[data-cookie-theme='light'] .cookie-dialog {
  background: rgb(250 249 246 / 0.97);
  color: #1c1917;
  border-color: rgb(28 25 23 / 0.12);
}

html[data-cookie-theme='light'] .cookie-option {
  background: rgb(28 25 23 / 0.04);
  color: #1c1917;
}

.cookie-settings-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  padding: 0;
  min-height: 2.75rem;
}

.cookie-settings-link:focus-visible {
  outline: 3px solid #3d6b52;
  outline-offset: 2px;
}

.cookie-settings-link--inline {
  min-height: 0;
  font-size: inherit;
  line-height: inherit;
}

@media (max-width: 639px) {
  .cookie-dialog {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100vw;
    max-height: min(88dvh, 40rem);
    border-radius: 1.15rem 1.15rem 0 0;
    padding-bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .cookie-banner__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .cookie-banner__actions {
    display: flex;
    flex-wrap: nowrap;
    max-width: 28rem;
  }

  .cookie-btn {
    flex: 1 1 0;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-dialog {
    backdrop-filter: none;
  }
}
