/* PantherStickies: Stickies notes as shipped with Mac OS X 10.3 Panther, drawn
   straight on the desktop (each note is its own little window, no Aqua chrome).
   .stk-*  = everything this module renders.

   Measurements sampled from 512pixels "10-3-Panther-Stickies.png" (Aqua Screenshot
   Library, Stephen Hackett; 2x capture, halved here to 1x):
   - 1px edge, 11px title bar, 1px divider, then the note body.
   - Active (frontmost) note: title bar a deeper tone of the note colour, 8px close
     box at the left, 8px zoom box at the right, two-square grow box bottom-right.
   - Inactive notes: no widgets; the bar is the body colour, split off by a 1px
     line in the saturated edge colour; top/left edge pale, right/bottom saturated.
   - Text: Helvetica 12px, black, ~10px left inset (the bundled welcome notes).
   - Yellow/green/blue/pink values sampled; purple and gray are NOT in that
     screenshot and are approximations (unverified). */

.stk-layer {
  /* Pinned to the desktop: the layer is the desktop's first child with z-index 0,
     so every window (and the desktop icons) paints above the notes. */
  z-index: 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stk-layer[hidden] { display: none; }

.stk-note {
  --stk-body: #ffffb1;
  --stk-bar: #ffeb4f;
  --stk-edge: #f2c908;
  --stk-lite: #fffbe0;
  --stk-grip: #c8901a;
  position: absolute;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 60px;
  min-height: 13px;
  background: var(--stk-body);
  border: 1px solid var(--stk-edge);
  border-top-color: var(--stk-lite);
  border-left-color: var(--stk-lite);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  color: #000;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.22;
  pointer-events: auto;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.stk-note.stk-active {
  border-color: var(--stk-edge);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Colours (Stickies' Color menu order) */
.stk-yellow { --stk-body: #ffffb1; --stk-bar: #ffeb4f; --stk-edge: #f2c908; --stk-lite: #fffbe0; --stk-grip: #c8901a; }
.stk-blue   { --stk-body: #83ffff; --stk-bar: #42e8ff; --stk-edge: #00d1ff; --stk-lite: #c3ffff; --stk-grip: #1b8fb3; }
.stk-green  { --stk-body: #bfffb0; --stk-bar: #80ef72; --stk-edge: #17d717; --stk-lite: #dbffd3; --stk-grip: #2c9b25; }
.stk-pink   { --stk-body: #ffd1d1; --stk-bar: #f7a6e6; --stk-edge: #f27af5; --stk-lite: #ffe6e5; --stk-grip: #b8509c; }
/* purple + gray: approximations, not sampled from a 10.3 capture (unverified) */
.stk-purple { --stk-body: #dccbff; --stk-bar: #bc9cff; --stk-edge: #9c6cff; --stk-lite: #efe6ff; --stk-grip: #6d48b8; }
.stk-gray   { --stk-body: #e6e6e6; --stk-bar: #c4c4c4; --stk-edge: #9c9c9c; --stk-lite: #f6f6f6; --stk-grip: #6e6e6e; }

/* Title bar: 11px + 1px divider */
.stk-bar {
  position: relative;
  flex: 0 0 auto;
  height: 12px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--stk-edge);
  background: var(--stk-body);
  cursor: default;
}
.stk-active .stk-bar { background: var(--stk-bar); }

.stk-box {
  position: absolute;
  top: 1px;
  width: 9px;
  height: 9px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: rgba(80, 50, 0, 0.42);
  display: none;
  cursor: default;
}
.stk-box svg { display: block; width: 9px; height: 9px; }
.stk-box:focus-visible { outline: 1px dotted #000; outline-offset: 0; }
.stk-close { left: 3px; }
.stk-zoom  { right: 3px; }
.stk-active .stk-box { display: block; }
.stk-box:active { color: rgba(40, 20, 0, 0.75); }

/* First line of a collapsed note sits in its title bar (support.apple.com Stickies guide) */
.stk-peek {
  display: none;
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  font-size: 10px;
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.stk-note.stk-collapsed .stk-peek { display: block; }
.stk-note.stk-collapsed:not(.stk-active) .stk-peek { left: 4px; right: 4px; }
.stk-note.stk-collapsed { height: auto !important; }
.stk-note.stk-collapsed .stk-bar { height: 13px; border-bottom: 0; }
.stk-note.stk-collapsed .stk-text,
.stk-note.stk-collapsed .stk-grow { display: none; }

.stk-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 5px 9px 8px 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: default;
}
.stk-text a { color: #0000ee; }
.stk-text a:visited { color: #551a8b; }

.stk-grow {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  color: var(--stk-grip);
  cursor: nwse-resize;
  display: none;
}
.stk-grow svg { display: block; width: 10px; height: 10px; }
.stk-active .stk-grow { display: block; }

.stk-dragging, .stk-dragging * { cursor: default !important; }

/* Mobile: index.html stacks the windows in one column at <=960px. The notes
   follow the windows as ordinary cards: full width, no drag, no resize. */
@media (max-width: 960px) {
  .stk-layer {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
  }
  .stk-note {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    z-index: auto;
  }
  .stk-note .stk-text { min-height: 48px; }
  .stk-grow { display: none !important; }
}
