/* © 2026 Sergio Santiago Bendaña Quesada. All rights reserved: no use, copy or reuse without written permission,
   and no use by AI or automated tools (training, datasets, retrieval, code generation, scraping). See LICENSE. bsketch-7f3a9c2e */
/* The sketch editor. Everything uses the sk- prefix so it can be embedded in other pages (Snowlog). */

/* Handwriting font: Caveat (SIL Open Font License, see fonts/OFL.txt), subset to Latin characters. */
@font-face {
  font-family: "Sketch Hand";
  src: url("../fonts/caveat.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
}

.sk-editor {
  --sk-bg: #ffffff;
  --sk-ui: #ffffff;
  --sk-text: #1b1b1f;
  --sk-muted: #6b6e76;
  --sk-border: #e3e4e8;
  --sk-accent: #3451b2;
  --sk-active: rgba(52, 81, 178, 0.12);
  --sk-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--sk-text);
  user-select: none;
  -webkit-user-select: none;
}

/* Dark: the system's (unless sk-light forces light) or forced with sk-dark. */
@media (prefers-color-scheme: dark) {
  .sk-editor:not(.sk-light) {
    --sk-ui: #232329;
    --sk-text: #ececf1;
    --sk-muted: #a1a1aa;
    --sk-border: #34343c;
    --sk-accent: #9db2ff;
    --sk-active: rgba(157, 178, 255, 0.18);
    --sk-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  }
}

.sk-editor.sk-dark {
  --sk-ui: #232329;
  --sk-text: #ececf1;
  --sk-muted: #a1a1aa;
  --sk-border: #34343c;
  --sk-accent: #9db2ff;
  --sk-active: rgba(157, 178, 255, 0.18);
  --sk-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.sk-stage {
  position: absolute;
  inset: 0;
}

/* In the dark theme the drawing is shown inverted (without changing its real colors or what is exported). */
@media (prefers-color-scheme: dark) {
  .sk-editor:not(.sk-light) .sk-canvas {
    filter: invert(93%) hue-rotate(180deg);
  }
}

.sk-editor.sk-dark .sk-canvas {
  filter: invert(93%) hue-rotate(180deg);
}

.sk-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.sk-toolbar,
.sk-panel,
.sk-group {
  position: absolute;
  background: var(--sk-ui);
  border: 1px solid var(--sk-border);
  border-radius: 10px;
  box-shadow: var(--sk-shadow);
}

.sk-toolbar {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 4px;
  max-width: calc(100% - 20px);
  overflow-x: auto;
}

.sk-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sk-text);
  cursor: pointer;
  font-size: 15px;
}

.sk-btn:hover {
  background: var(--sk-active);
}

.sk-btn[aria-pressed="true"] {
  background: var(--sk-accent);
  color: #ffffff;
}

/* On the dark theme's light accent, a dark icon reads better than a white one. */
@media (prefers-color-scheme: dark) {
  .sk-editor:not(.sk-light) .sk-btn[aria-pressed="true"] {
    color: #18181b;
  }
}

.sk-editor.sk-dark .sk-btn[aria-pressed="true"] {
  color: #18181b;
}

.sk-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sk-panel {
  top: 64px;
  left: 10px;
  width: 210px;
  max-height: calc(100% - 140px);
  overflow-y: auto;
  padding: 10px;
}

.sk-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sk-muted);
  margin: 10px 0 5px;
}

/* Only the panel's very first label: the ones that open a block inside it (Arrowheads, Align) keep their gap. */
.sk-panel > .sk-label:first-child {
  margin-top: 0;
}

.sk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.sk-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--sk-border);
  cursor: pointer;
  padding: 0;
}

.sk-swatch[aria-pressed="true"] {
  outline: 2px solid var(--sk-accent);
  outline-offset: 1px;
}

.sk-none {
  background: linear-gradient(45deg, transparent 45%, #e03131 45%, #e03131 55%, transparent 55%), #ffffff;
}

.sk-color {
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--sk-border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.sk-seg {
  display: flex;
  margin-top: 6px;
  border: 1px solid var(--sk-border);
  border-radius: 7px;
  overflow: hidden;
}

.sk-segbtn {
  flex: 1;
  border: 0;
  padding: 5px 2px;
  background: transparent;
  color: var(--sk-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sk-segbtn + .sk-segbtn {
  border-left: 1px solid var(--sk-border);
}

.sk-segbtn[aria-pressed="true"] {
  background: var(--sk-active);
  color: var(--sk-accent);
  font-weight: 600;
}

.sk-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.sk-bottom .sk-group {
  position: static;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  pointer-events: auto;
}

.sk-zoomlabel {
  min-width: 58px;
  min-height: 32px; /* big enough to tap (WCAG 2.5.8: at least 24 px) */
  border: 0;
  background: transparent;
  color: var(--sk-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sk-textbox {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 1px dashed var(--sk-accent);
  outline: none;
  background: transparent;
  resize: none;
  overflow: hidden;
  white-space: pre;
  font-family: "Sketch Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive;
  min-width: 40px;
}

/* Text inside a shape: centered and wrapped to the shape's width. */
.sk-textbox.sk-bound {
  white-space: pre-wrap;
  text-align: center;
}

.sk-readonly .sk-canvas {
  cursor: grab;
}

@media (max-width: 640px) {
  .sk-toolbar {
    top: auto;
    bottom: 60px;
    max-width: calc(100% - 12px);
    gap: 0;
  }

  /* 13 buttons in a phone's width (still above the 24 px a finger needs, WCAG 2.5.8). */
  .sk-toolbar .sk-btn {
    width: 28px;
  }

  .sk-panel {
    top: 10px;
    width: auto;
    right: 10px;
    max-height: 34%;
  }
}

/* For screen readers only. */
.sk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sk-editor [hidden] {
  display: none !important;
}

/* Visible keyboard focus. */
.sk-editor:focus-visible {
  box-shadow: inset 0 0 0 2px var(--sk-accent);
}

.sk-editor button:focus-visible,
.sk-editor input:focus-visible {
  outline: 2px solid var(--sk-accent);
  outline-offset: 1px;
}

/* The library: pieces kept to use again, on the right. */
.sk-library {
  left: auto;
  right: 10px;
  width: 230px;
}

.sk-libhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sk-libhead .sk-label {
  margin: 0;
}

.sk-textbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--sk-border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sk-textbtn:hover {
  background: var(--sk-active);
}

.sk-libempty {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

.sk-liblist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sk-liblist li {
  position: relative;
}

.sk-libitem {
  width: 100%;
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid var(--sk-border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.sk-libthumb {
  width: 100%;
  height: 100%;
}

.sk-libdel {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  padding: 2px;
  border: 1px solid var(--sk-border);
  border-radius: 50%;
  background: var(--sk-ui);
  color: inherit;
  cursor: pointer;
  opacity: 0;
}

.sk-liblist li:hover .sk-libdel,
.sk-libdel:focus-visible {
  opacity: 1;
}

.sk-libdel .sk-icon {
  width: 14px;
  height: 14px;
}

@media (hover: none) {
  .sk-libdel {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .sk-library {
    top: 10px;
    left: 10px;
    width: auto;
    max-height: 45%;
  }
}

/* Search: a small box at the top right. */
.sk-search {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: 64px;
  width: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.sk-searchinput {
  width: 12rem;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--sk-border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
}

.sk-searchcount {
  min-width: 4.5rem;
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sk-search {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
  }

  .sk-searchinput {
    width: 100%;
    min-width: 0;
  }
}

/* Presenting: only the slide and a small bar to move through it. */
.sk-presenting .sk-toolbar,
.sk-presenting .sk-panel,
.sk-presenting .sk-bottom,
.sk-presenting .sk-library,
.sk-presenting .sk-search {
  display: none !important;
}

.sk-present {
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.sk-present:hover,
.sk-present:focus-within {
  opacity: 1;
}

.sk-slidecount {
  min-width: 3.5rem;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sk-editor.sk-presenting:fullscreen {
  background: #ffffff;
}

/* The selected frame's name and speaker notes. */
.sk-framepanel {
  width: 230px;
}

.sk-framename,
.sk-framenotes {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--sk-border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
}

.sk-framenotes {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.4;
}

.sk-hint {
  margin: 6px 0 0;
  font-size: 11px;
  opacity: 0.7;
}

/* Presenting: the notes box and the timer. */
.sk-notesview {
  left: 14px;
  right: auto;
  top: auto;
  bottom: 64px;
  width: min(28rem, calc(100% - 28px));
  max-height: 40%;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.sk-presenting .sk-notesview:not([hidden]) {
  display: block !important;
}

.sk-timer {
  min-width: 3rem;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
