/* Floating theme switcher. Loaded only for admins and on the public demo, and
   styled on its own so it looks the same over every theme. */
.jn-switcher {
  --jn-ink: #15140f;
  --jn-muted: #6b6960;
  --jn-line: rgba(21, 20, 15, .12);
  --jn-surface: #fff;
  position: fixed;
  inset-block-end: 20px;
  inset-inline-start: 20px;
  z-index: 1040;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--jn-ink);
}

.dark-mode .jn-switcher {
  --jn-ink: #f4f1e8;
  --jn-muted: #a8a59a;
  --jn-line: rgba(244, 241, 232, .16);
  --jn-surface: #1c1b16;
}

.jn-switcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--jn-ink);
  color: var(--jn-surface);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.jn-switcher span {
  color: inherit;
}

.jn-switcher-toggle::-webkit-details-marker {
  display: none;
}

.jn-switcher-toggle:focus-visible,
.jn-switcher a:focus-visible,
.jn-switcher button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.jn-switcher-panel {
  position: absolute;
  inset-block-end: calc(100% + 10px);
  inset-inline-start: 0;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--jn-line);
  border-radius: 16px;
  background: var(--jn-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

.jn-switcher-title {
  margin: 2px 4px 8px;
  font-weight: 700;
  color: var(--jn-ink);
}

.jn-switcher-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jn-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px;
  border-radius: 10px;
  color: var(--jn-ink);
  text-decoration: none;
}

.jn-switcher-item:hover {
  background: var(--jn-line);
  color: var(--jn-ink);
}

.jn-switcher-item.is-active {
  box-shadow: inset 0 0 0 2px var(--jn-ink);
}

.jn-switcher-item img {
  flex: none;
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top;
  background: var(--jn-line);
}

.jn-switcher-item strong,
.jn-switcher-item small {
  display: block;
}

.jn-switcher-item small {
  color: var(--jn-muted);
  font-size: 12px;
}

.jn-switcher-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--jn-line);
  text-align: center;
}

.jn-switcher-apply {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--jn-ink);
  color: var(--jn-surface);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .jn-switcher {
    inset-block-end: 12px;
    inset-inline-start: 12px;
  }

  .jn-switcher-toggle {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .jn-switcher-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

.jn-switcher-exit {
  padding: 6px;
  color: var(--jn-muted);
  text-decoration: underline;
}

/* Customize controls */
.jn-switcher-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.jn-switcher-panel {
  width: 300px;
}

.jn-cz-group {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.jn-cz-group .jn-switcher-title {
  float: none;
  width: auto;
  margin: 2px 4px 8px;
  padding: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--jn-muted);
}

.jn-cz-seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--jn-line);
}

.jn-cz-seg label {
  flex: 1;
  margin: 0;
}

.jn-cz-seg input,
.jn-cz-fonts input,
.jn-cz-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.jn-cz-seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.jn-cz-seg input:checked + span {
  background: var(--jn-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
}

.jn-cz-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
}

.jn-cz-swatch {
  margin: 0;
}

.jn-cz-swatch > span {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  cursor: pointer;
}

.jn-cz-swatch.is-default > span {
  background: conic-gradient(var(--sw) 0 50%, var(--jn-surface) 50% 100%);
  box-shadow: inset 0 0 0 2px var(--sw);
}

.jn-cz-swatch input:checked + span {
  outline: 2px solid var(--jn-ink);
  outline-offset: 2px;
}

.jn-cz-fonts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.jn-cz-fonts label {
  margin: 0;
}

.jn-cz-fonts span {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--jn-line);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.jn-cz-fonts input:checked + span {
  border-color: var(--jn-ink);
  box-shadow: inset 0 0 0 1px var(--jn-ink);
}

:is(.jn-cz-seg, .jn-cz-fonts, .jn-cz-swatch) input:focus-visible + span {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.jn-cz-reset {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.jn-cz-note {
  margin: 6px 0 0;
  color: var(--jn-muted);
  font-size: 12px;
}

/* Text size: scales the page body, header and footer keep their size. */
main.content {
  zoom: var(--jn-zoom, 1);
}
