/* Colours, type and base styles shared by every sketchbook page. */

:root {
  --background: #2b2230;
  --surface: #3a2e40; /* cards and panels */
  --surface-raised: #45384c; /* buttons and inputs on a surface */
  --surface-hover: #554660;
  --surface-sunken: #241c29;
  --text: #f3e8f0;
  --text-placeholder: #b9a9bd;
  --text-on-accent: #3d2836;
  --accent: #ff9fc6;
  --accent-light: #ffb8d6;
  --highlight: #ffe28a; /* the main action, and keyboard focus */
  --lavender: #cdb6ff;
  /* behind pixel art, so white pixels stand out from transparent ones */
  --checkerboard: #ffe9f3 repeating-conic-gradient(#ffd9ea 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  background: var(--background);
  color: var(--text);
  font: 14px/1.5 system-ui, sans-serif;
}

h1 { margin: 0 0 4px; font-size: 20px; }
p { margin: 0; }
a { color: var(--accent-light); }

/* the napping kitty (shared/js/page-header.js) beside the title and intro; the intro drops below on narrow screens */
.page-header { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; }
.page-header h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 26px; line-height: 1.2; }
.page-header h1::after { content: "✦"; color: var(--highlight); font-size: .6em; line-height: 1; }
.header-kitty { grid-row: span 2; }
.header-kitty img { display: block; image-rendering: pixelated; }

.muted { opacity: .75; }

button {
  font: inherit;
  border: 0;
  background: var(--accent);
  color: var(--text-on-accent);
  cursor: pointer;
}

/* /lib/ui/confirm-dialog.js */
.confirm-dialog {
  width: min(400px, 100vw - 32px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--surface-raised), 0 20px 60px rgba(0, 0, 0, .5);
}
.confirm-dialog::backdrop { background: rgba(20, 14, 24, .7); }
.confirm-body { padding: 20px 20px 18px; }
.confirm-message { margin: 0 0 18px; font-size: 15px; line-height: 1.5; }
.confirm-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirm-buttons button { padding: 8px 14px; border-radius: 6px; font-weight: 600; }
.confirm-buttons button:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.confirm-no { background: var(--surface-raised); color: var(--text); }
.confirm-no:hover { background: var(--surface-hover); }
.confirm-yes:hover { background: var(--accent-light); }

/* /lib/ui/tooltips.js */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(280px, 100vw - 12px);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface-sunken);
  box-shadow: 0 0 0 1px var(--lavender), 0 6px 18px rgba(0, 0, 0, .4);
  pointer-events: none;
}

@media (max-width: 600px) {
  body { padding: 16px; }
  .page-header { column-gap: 12px; }
  .page-header h1 { font-size: 22px; }
  .header-kitty { grid-row: auto; }
  .page-header p { grid-column: 1 / -1; margin-top: 10px; }
}
