/* Restaurant ticket rail on the magnet board. */
/* No z-index or containment here: slips, magnets and the rail share one stacking order, so a slip can lie over or under a magnet. */
.ticket-rail { position: absolute; inset: 0; pointer-events: none; }

/* The rail: a brushed aluminium extrusion screwed to the board, casting a short shadow. */
.ticket-rail-bar {
  position: absolute;
  z-index: 30;
  background: url("assets/home-nov19/tickets/rail.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px .5px #0000004d) drop-shadow(0 4px 5px #00000038) drop-shadow(0 10px 14px #0000001f);
}
/* End screws. */
.ticket-rail-bar::before,
.ticket-rail-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  width: .654%;   /* .62% of the board */
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle at 38% 34%, #f4f4f4 0 18%, #a9a9ab 40%, #5c5c60 78%);
  box-shadow: inset 0 0 0 .5px #0006, 0 .5px .5px #fff8;
}
.ticket-rail-bar::before { left: 1.16%; }
.ticket-rail-bar::after { right: 1.16%; }

/* A slip of paper hanging from the rail; it pivots at its top edge. */
.ticket {
  position: absolute;
  z-index: 4;   /* replaced by the shared board stacking order in ticket-rail.js */
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: grab;
  transform-origin: 50% 0;
  container-type: inline-size;
  /* Shadow on the board: tight near the rail, softer and further away where the paper lifts off. */
  filter: drop-shadow(0 .5px .6px #0000002e) drop-shadow(1px 3px 3px #0000002a) drop-shadow(3px 9px 10px #00000024);
  transition: filter .25s;
  -webkit-tap-highlight-color: transparent;
}
.ticket:hover { filter: drop-shadow(0 .5px .6px #0000002e) drop-shadow(2px 5px 5px #0000002e) drop-shadow(5px 14px 16px #00000026); }
.ticket.is-sliding { cursor: grabbing; }
.ticket:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

.tk-paper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-size: 260% auto;
  /* The bottom curls slightly toward the viewer, so the paper isn't perfectly flat. */
  transform: perspective(320px) rotateX(-4deg);
  transform-origin: 50% 0;
}
.tk-ink {
  position: absolute;
  inset: 0;
  padding: 19cqi 9cqi 6cqi;
  display: flex;
  flex-direction: column;
  gap: 1.8cqi;
  color: #2b2724;
  font: 400 6.6cqi/1.22 "Fragment Mono", ui-monospace, Menlo, monospace;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
  /* Ink sits in the paper: multiplied, a touch uneven, very slightly soft like a thermal print. */
  mix-blend-mode: multiply;
  opacity: .88;
  filter: blur(.2px);
  -webkit-mask: url("assets/home-nov19/tickets/ink-mask.png") 0 0 / 100% auto;
  mask: url("assets/home-nov19/tickets/ink-mask.png") 0 0 / 100% auto;
}
.tk-line { margin: 0; overflow-wrap: anywhere; }
.tk-h { font-size: 9.5cqi; letter-spacing: .06em; text-align: center; font-weight: 600; }
.tk-ink > .tk-line:nth-child(2), .tk-ink > .tk-line:nth-child(3) { text-align: center; }
.tk-row { display: flex; justify-content: space-between; gap: 3cqi; }
.tk-rule { width: 100%; margin: 1.2cqi 0; border: 0; border-top: .7cqi dashed #2b2724a8; }
.tk-hand {
  font: 400 12cqi/1.05 "Reenie Beanie", "Bradley Hand", cursive;
  text-transform: none;
  letter-spacing: 0;
  color: #1d2a55;
  transform: rotate(-2deg);
}
.tk-swatch { width: 100%; aspect-ratio: 1.6; margin: 2cqi 0; opacity: .92; filter: contrast(.95) saturate(.9); }
.tk-photo { position: relative; width: 100%; overflow: hidden; margin-bottom: 2cqi; }
.tk-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(.93) saturate(.85) brightness(1.03); }

/* Creases and handling marks, multiplied into the paper. */
.tk-crease { position: absolute; inset: 0; background-size: 100% 100%; mix-blend-mode: multiply; opacity: .8; pointer-events: none; }
/* Light: the rail's lip shades the top of the slip; the curled bottom catches light. */
.tk-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(#00000059 0, #00000026 3.5%, transparent 9%),
    linear-gradient(transparent 70%, #ffffff1f 88%, #00000014 100%),
    linear-gradient(90deg, #0000000f, transparent 18%, transparent 80%, #0000000d);
  mix-blend-mode: multiply;
}

/* Pulled out to read. */
.ticket.is-out {
  z-index: 40;
  cursor: zoom-out;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .3s;
  filter: drop-shadow(0 2px 3px #0003) drop-shadow(0 30px 40px #0000004d);
}
.ticket.is-out .tk-paper { transform: none; transition: transform .4s; }
.ticket:not(.is-out) { transition: filter .25s, transform .5s cubic-bezier(.2, .8, .2, 1); }
.ticket:not(.is-out).is-sliding, .ticket:not(.is-out):not(.is-settling) { transition: filter .25s; }
.ticket-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #0000;
  pointer-events: none;
  transition: background .4s;
}
.ticket-scrim.is-on { background: #0000004d; pointer-events: auto; }
.metal-panel:has(.ticket.is-out) { z-index: 31; }

@media (prefers-reduced-motion: reduce) {
  .ticket, .ticket.is-out { transition: none; }
}

/* While a note is pulled out, it sits above the magnets. */
.ticket-rail.has-open { z-index: 50; }
.ticket.is-held { cursor: default; }

/* Slips with a photo (painting of the week): the picture sits on top of the paper, not printed into it,
   so it keeps its own colour. Only the writing keeps the inky, textured look, and the creases are lighter. */
.ticket.has-photo .tk-ink { mix-blend-mode: normal; opacity: 1; filter: none; -webkit-mask: none; mask: none; }
.ticket.has-photo .tk-line { mix-blend-mode: multiply; opacity: .88; }
.ticket.has-photo .tk-photo { box-shadow: 0 .4cqi 1cqi #0002; }
.ticket.has-photo .tk-photo img { filter: brightness(1.06) saturate(1.05); }
.ticket.has-photo .tk-crease { opacity: .3; }
/* Slips with a colour chip (colour of the week): the chip sits on the paper too, so it shows its true
   colour instead of being multiplied into the yellow; the writing stays inky. */
.ticket.has-swatch .tk-ink { mix-blend-mode: normal; opacity: 1; filter: none; -webkit-mask: none; mask: none; }
.ticket.has-swatch .tk-line { mix-blend-mode: multiply; opacity: .88; }
.ticket.has-swatch .tk-swatch { opacity: 1; filter: none; box-shadow: 0 .4cqi 1cqi #0002; }

/* A slip whose content sits in the middle (the quote), with the quote a touch larger than other handwriting
   (about 2px bigger at a laptop width). */
.ticket.is-centered .tk-ink { justify-content: center; padding-top: 12cqi; text-align: center; }
.tk-quote { font-size: 13.7cqi; line-height: 1.08; text-align: center; transform: rotate(-1.5deg); }
.ticket.is-centered .tk-line { text-align: center; }

/* An empty to-do list: a printed checkbox and a dotted line to write on. */
.tk-todo { display: flex; align-items: flex-end; gap: 3cqi; min-height: 1.6em; }
.tk-box { flex: none; width: 1.05em; height: 1.05em; margin-bottom: .15em; border: .7cqi solid #2b2724c0; border-radius: .8cqi; }
.tk-todo-text { flex: 1; min-height: 1.2em; border-bottom: .7cqi dotted #2b272480; font: 400 12cqi/1 "Reenie Beanie", "Bradley Hand", cursive; text-transform: none; color: #1d2a55; }

/* Fresh paper, not worn: each slip is clean new stock in its own colour with only a very fine grain;
   creases are a faint trace, the writing is crisp, and the rail's shade is lighter. */
.tk-paper { background-color: #fbfaf6; background-size: 180px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.tk-paper[data-paper="white"]  { background-color: #fbfaf6; }
.tk-paper[data-paper="cream"]  { background-color: #f8f1df; }
.tk-paper[data-paper="yellow"] { background-color: #fbedaf; }
.tk-paper[data-paper="blue"]   { background-color: #d5e6f2; }
.tk-paper[data-paper="pink"]   { background-color: #f9dcdc; }
.tk-crease, .ticket.has-photo .tk-crease { opacity: .1; }
.tk-ink { -webkit-mask: none; mask: none; filter: none; opacity: .92; }
.tk-light {
  background:
    linear-gradient(#0000002e 0, #00000010 3%, transparent 7%),
    linear-gradient(transparent 75%, #ffffff14 90%, #0000000a 100%);
}
