/* -------------------------------------------------------------------------
 * Cookie consent — banner + preferences panel.
 * Uses the site's own tokens so it reads as part of the design, not a bolt-on.
 * ---------------------------------------------------------------------- */

.ltj-consent[hidden] { display: none; }

/* ------------------------------------------------------------------ banner */
.ltj-consent__bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  display: none;
  /* Grid, not flex: the copy takes whatever room is left and the buttons keep
     their natural width on the same row, so the gap between them is exactly the
     grid gap rather than a void left by justify-content. */
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(31, 53, 64, 0.16);
}
.ltj-consent.is-bar .ltj-consent__bar { display: grid; }
.ltj-consent.is-panel .ltj-consent__bar { display: none; }

.ltj-consent__copy { min-width: 0; }

/* The theme forces every heading to the sans face (style.css :1477, !important),
   so this matches that rather than fighting it — sized down to sit as a label
   above the copy rather than compete with the page's own headings. */
.ltj-consent__title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 5px;
  line-height: 1.35;
}
.ltj-consent__text {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
}
.ltj-consent__text a {
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ltj-consent__text a:hover { color: var(--sky-deep); }

.ltj-consent__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ------------------------------------------------------------------- panel */
.ltj-consent__panel {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 53, 64, 0.55);
}
.ltj-consent__panel[hidden] { display: none; }

.ltj-consent__panel-inner {
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 24px 60px rgba(31, 53, 64, 0.3);
}
.ltj-consent__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ltj-consent__panel-head .ltj-consent__title { font-size: 20px; }

.ltj-consent__close {
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 4px;
}
.ltj-consent__close:hover { color: var(--ink); }

/* --------------------------------------------------------------- category */
.ltj-consent__cat {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ltj-consent__cat:last-of-type { border-bottom: 0; }

.ltj-consent__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}
.ltj-consent__cat-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.ltj-consent__cat-text {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  margin: 8px 0 0;
  max-width: 62ch;
}

/* Switch — the checkbox stays in the DOM for keyboard and screen readers. */
.ltj-consent__switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.ltj-consent__switch input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}
.ltj-consent__switch-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink-4);
  position: relative;
  transition: background var(--t, 0.2s ease);
}
.ltj-consent__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--t, 0.2s ease);
}
.ltj-consent__switch input:checked + .ltj-consent__switch-track { background: var(--forest-deep); }
.ltj-consent__switch input:checked + .ltj-consent__switch-track::after { transform: translateX(20px); }
.ltj-consent__switch input:disabled + .ltj-consent__switch-track { background: var(--sky-20); cursor: default; }
.ltj-consent__switch input:focus-visible + .ltj-consent__switch-track {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
.ltj-consent__always {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.ltj-consent__panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 700px) {
  .ltj-consent__bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 18px;
    gap: 16px;
    grid-template-columns: 1fr;   /* stack on small screens */
  }
  .ltj-consent__actions { width: 100%; }
  .ltj-consent__actions .btn { flex: 1 1 auto; justify-content: center; }
  .ltj-consent__panel { padding: 12px; }
  .ltj-consent__panel-inner { padding: 24px 20px; }
  .ltj-consent__panel-head .ltj-consent__title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ltj-consent__switch-track,
  .ltj-consent__switch-track::after { transition: none; }
}
