/*
 * Persona — keyboard shortcuts cheatsheet styles (v0.39).
 *
 * Minimal, framework-agnostic CSS. Plays nicely with the ink-* / accent-*
 * palette from base.html in both light and dark themes by using a few
 * neutral tones with alpha. The :root.dark selector mirrors how
 * tailwind.config.darkMode = 'class' is wired.
 */

.persona-kbd-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1rem 1rem;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.persona-kbd-overlay[hidden] {
  display: none;
}

.persona-kbd-modal {
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(120, 120, 140, 0.25);
  background: #ffffff;
  color: #18181b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root.dark .persona-kbd-modal {
  background: #111114;
  color: #f4f4f5;
  border-color: rgba(80, 80, 100, 0.45);
}

.persona-kbd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(120, 120, 140, 0.18);
}

.persona-kbd-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.persona-kbd-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
}

.persona-kbd-close:hover,
.persona-kbd-close:focus-visible {
  background: rgba(120, 120, 140, 0.15);
  opacity: 1;
  outline: none;
}

.persona-kbd-section {
  padding: 0.75rem 1.25rem;
}

.persona-kbd-section + .persona-kbd-section {
  border-top: 1px solid rgba(120, 120, 140, 0.12);
}

.persona-kbd-group {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #71717a;
}

:root.dark .persona-kbd-group {
  color: #a1a1aa;
}

.persona-kbd-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.persona-kbd-row {
  display: grid;
  grid-template-columns: minmax(160px, auto) 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0;
}

.persona-kbd-keys {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.persona-kbd-key {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  border: 1px solid rgba(120, 120, 140, 0.4);
  background: #f4f4f5;
  color: #18181b;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

:root.dark .persona-kbd-key {
  background: #1a1a1f;
  color: #f4f4f5;
  border-color: rgba(120, 120, 140, 0.5);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.persona-kbd-sep {
  font-size: 0.7rem;
  color: #71717a;
  padding: 0 0.1rem;
}

.persona-kbd-label {
  margin: 0;
  font-size: 0.875rem;
  color: inherit;
  opacity: 0.85;
}

.persona-kbd-footer {
  padding: 0.75rem 1.25rem 1rem;
  font-size: 0.75rem;
  color: #71717a;
  text-align: right;
  border-top: 1px solid rgba(120, 120, 140, 0.12);
}

:root.dark .persona-kbd-footer {
  color: #a1a1aa;
}

/* Lock body scroll while the cheatsheet is open. */
html.persona-kbd-open,
html.persona-kbd-open body {
  overflow: hidden;
}

@media (max-width: 480px) {
  .persona-kbd-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}
