/* ===== OK-Jazz – Consent Management ===== */

:root {
  --okj-consent-text: rgb(55, 67, 81);
  --okj-consent-muted: #5a6570;
  --okj-consent-bg: #ffffff;
  --okj-consent-surface: #f6f6f6;
  --okj-consent-accent: rgb(55, 67, 81);
  --okj-consent-accent-hover: #2a3340;
  --okj-consent-border: rgba(55, 67, 81, 0.12);
  --okj-consent-overlay: rgba(55, 67, 81, 0.45);
  --okj-consent-focus: #5b6b7c;
  --okj-consent-font: 'Source Sans Pro', Arial, sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.okj-consent-open {
  overflow: hidden;
}

.okj-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: var(--okj-consent-font);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  text-align: center;
  width: 100%;
}

.okj-consent-btn:focus-visible {
  outline: 3px solid var(--okj-consent-focus);
  outline-offset: 2px;
}

.okj-consent-btn--primary {
  background: var(--okj-consent-accent);
  color: #fff;
  border: 2px solid var(--okj-consent-accent);
}

.okj-consent-btn--primary:hover {
  background: var(--okj-consent-accent-hover);
  border-color: var(--okj-consent-accent-hover);
}

.okj-consent-btn--secondary {
  background: transparent;
  color: var(--okj-consent-accent);
  border: 2px solid var(--okj-consent-accent);
}

.okj-consent-btn--secondary:hover {
  background: rgba(55, 67, 81, 0.06);
}

.okj-consent-btn--ghost {
  background: transparent;
  color: var(--okj-consent-accent);
  border: 2px solid transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 40px;
  font-weight: 500;
}

.okj-consent-btn--ghost:hover {
  color: var(--okj-consent-accent-hover);
}

/* Banner */
.okj-consent-banner {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.okj-consent-banner[hidden],
.okj-consent-center[hidden] {
  display: none !important;
}

.okj-consent-banner__overlay {
  position: absolute;
  inset: 0;
  background: var(--okj-consent-overlay);
}

.okj-consent-banner__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  background: var(--okj-consent-bg);
  border: 1px solid var(--okj-consent-border);
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(55, 67, 81, 0.18);
  padding: clamp(24px, 4vw, 36px);
}

.okj-consent-banner__brand {
  margin-bottom: 20px;
}

.okj-consent-banner__logo {
  height: 48px;
  width: auto;
  max-width: 200px;
  display: block;
}

.okj-consent-banner__title {
  font-family: 'Book Antiqua', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  color: var(--okj-consent-text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.okj-consent-banner__desc,
.okj-consent-banner__brand-msg {
  font-family: var(--okj-consent-font);
  font-size: 0.92rem;
  color: var(--okj-consent-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

.okj-consent-banner__brand-msg {
  padding: 12px 14px;
  background: var(--okj-consent-surface);
  border-left: 3px solid var(--okj-consent-accent);
  border-radius: 0 8px 8px 0;
  color: var(--okj-consent-text);
  font-size: 0.88rem;
}

.okj-consent-banner__actions {
  display: grid;
  gap: 10px;
  margin: 22px 0 16px;
}

.okj-consent-banner__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--okj-consent-font);
  font-size: 0.88rem;
  color: var(--okj-consent-muted);
  margin: 0;
}

.okj-consent-banner__links a {
  color: var(--okj-consent-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.okj-consent-banner__links a:hover,
.okj-consent-banner__links a:focus-visible {
  color: var(--okj-consent-accent-hover);
}

/* Privacy Center */
.okj-consent-center {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.okj-consent-center__overlay {
  position: absolute;
  inset: 0;
  background: var(--okj-consent-overlay);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.okj-consent-center__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  height: 100%;
  background: var(--okj-consent-bg);
  box-shadow: -12px 0 40px rgba(55, 67, 81, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.okj-consent-center__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--okj-consent-border);
  flex-shrink: 0;
}

.okj-consent-center__title {
  font-family: 'Book Antiqua', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--okj-consent-text);
}

.okj-consent-center__close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--okj-consent-text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.okj-consent-center__close:hover {
  background: rgba(55, 67, 81, 0.06);
}

.okj-consent-center__close:focus-visible {
  outline: 3px solid var(--okj-consent-focus);
  outline-offset: 2px;
}

.okj-consent-center__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 24px;
}

.okj-consent-center__intro {
  font-family: var(--okj-consent-font);
  font-size: 0.9rem;
  color: var(--okj-consent-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

.okj-consent-center__footer {
  display: grid;
  gap: 10px;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--okj-consent-border);
  flex-shrink: 0;
  background: var(--okj-consent-surface);
}

/* Status */
.okj-consent-status {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--okj-consent-surface);
  border: 1px solid var(--okj-consent-border);
  border-radius: 8px;
}

.okj-consent-status p {
  font-family: var(--okj-consent-font);
  font-size: 0.9rem;
  color: var(--okj-consent-text);
  margin-bottom: 8px;
}

.okj-consent-status ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.okj-consent-status li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--okj-consent-font);
  font-size: 0.85rem;
  color: var(--okj-consent-muted);
  padding: 6px 0;
  border-top: 1px solid var(--okj-consent-border);
}

.okj-consent-status li:first-child {
  border-top: 0;
}

.okj-consent-status__meta {
  font-size: 0.78rem !important;
  color: var(--okj-consent-muted) !important;
  margin-bottom: 0 !important;
}

/* Categories */
.okj-consent-category {
  padding: 16px 0;
  border-top: 1px solid var(--okj-consent-border);
}

.okj-consent-category:first-child {
  border-top: 0;
  padding-top: 0;
}

.okj-consent-category__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.okj-consent-category__title {
  font-family: var(--okj-consent-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--okj-consent-text);
  margin-bottom: 6px;
}

.okj-consent-category__desc {
  font-family: var(--okj-consent-font);
  font-size: 0.85rem;
  color: var(--okj-consent-muted);
  line-height: 1.55;
  max-width: 34ch;
}

.okj-consent-category__services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.okj-consent-category__services li {
  font-family: var(--okj-consent-font);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--okj-consent-text);
  background: rgba(55, 67, 81, 0.07);
  padding: 4px 8px;
  border-radius: 999px;
}

.okj-consent-badge {
  flex-shrink: 0;
  font-family: var(--okj-consent-font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--okj-consent-muted);
  background: rgba(55, 67, 81, 0.06);
  padding: 6px 10px;
  white-space: nowrap;
  border-radius: 999px;
}

/* Switch */
.okj-consent-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.okj-consent-switch:focus-visible {
  outline: 3px solid var(--okj-consent-focus);
  outline-offset: 2px;
}

.okj-consent-switch__track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #c5ccd8;
  position: relative;
  transition: background-color 0.2s ease;
}

.okj-consent-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.okj-consent-switch.is-on .okj-consent-switch__track,
.okj-consent-switch[aria-checked='true'] .okj-consent-switch__track {
  background: var(--okj-consent-accent);
}

.okj-consent-switch.is-on .okj-consent-switch__track::after,
.okj-consent-switch[aria-checked='true'] .okj-consent-switch__track::after {
  transform: translateX(20px);
}

/* History */
.okj-consent-history {
  margin-top: 18px;
  border-top: 1px solid var(--okj-consent-border);
  padding-top: 12px;
}

.okj-consent-history summary {
  cursor: pointer;
  font-family: var(--okj-consent-font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--okj-consent-text);
  list-style: none;
}

.okj-consent-history summary::-webkit-details-marker {
  display: none;
}

.okj-consent-history summary::before {
  content: '+ ';
  color: var(--okj-consent-accent);
}

.okj-consent-history[open] summary::before {
  content: '− ';
}

.okj-consent-history__list {
  margin-top: 12px;
}

.okj-consent-history__list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.okj-consent-history__list li {
  display: grid;
  gap: 2px;
  font-family: var(--okj-consent-font);
  font-size: 0.8rem;
  color: var(--okj-consent-muted);
  padding: 8px 0;
  border-top: 1px solid var(--okj-consent-border);
}

.okj-consent-history__list time {
  font-weight: 600;
  color: var(--okj-consent-text);
}

/* Desktop: banner centered card */
@media (min-width: 720px) {
  .okj-consent-banner {
    align-items: center;
    padding: 24px;
  }

  .okj-consent-banner__actions {
    grid-template-columns: 1fr 1fr;
  }

  .okj-consent-banner__actions .okj-consent-btn--ghost {
    grid-column: 1 / -1;
  }
}

@media (max-width: 719px) {
  .okj-consent-banner {
    padding: 0;
  }

  .okj-consent-banner__dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px 28px;
  }

  .okj-consent-center__panel {
    width: 100%;
  }

  .okj-consent-category__desc {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .okj-consent-btn,
  .okj-consent-switch__track,
  .okj-consent-switch__track::after {
    transition: none;
  }
}
