/* Photos without a sure date on the book (guessed.js): a yellow notice above the page in view, and on each such photo a
   little yellow note with a calendar and its guessed month and year, written by hand as a note stuck on a print. Yellow
   as Je foto's' guessed days (timeline.css .tl-guess) and the badge on Foto's, and the same calendar on the notice and
   the notes, so they read as one thing. */
:root {
  --guess: #f2c94c;
  --guess-ink: #3d2f00;
  --guess-paper: #fff7da;
}

/* ---- the notice, centred above the page (guessed.js place sets its top and middle). Over the book and under its top
   bar, and under anything that lies over the book (a sheet, the agent's dock, a card over everything) */
.guessed {
  position: fixed;
  z-index: 11;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'mark words choose';
  align-items: center;
  gap: 8px 12px;
  /* as wide as its words on one line each, within the window */
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 10px 10px 12px;
  border-radius: 18px;
  background: var(--guess-paper);
  box-shadow:
    0 0 0 1px rgb(194 150 30 / 0.35),
    0 16px 36px -18px rgb(60 44 10 / 0.5);
  color: var(--text);
  font-family: var(--ui-font);
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.97);
  transition:
    opacity 0.22s var(--ease),
    transform 0.45s cubic-bezier(0.34, 1.4, 0.5, 1),
    top 0.3s var(--ease),
    left 0.3s var(--ease);
}
.guessed[hidden] {
  display: none;
}
.guessed.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* on an upright phone the notice takes the tray's band (guessed.js room): the closed stack steps aside while it's shown */
body:has(.guessed.is-in) #table.has-corner .tb-tray:not(.is-open) {
  opacity: 0;
  pointer-events: none;
}
/* the card of photos that just came in stands in the same place: this one waits under it */
body:has(.arrived.is-in) .guessed {
  opacity: 0;
  pointer-events: none;
}
.guessed-mark {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--guess);
  color: var(--guess-ink);
  rotate: -4deg;
}
.guessed-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.guessed-words {
  grid-area: words;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.guessed-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
}
.guessed-line {
  color: var(--quiet, #6b655c);
  font-size: 13.5px;
  line-height: 1.3;
}
/* Plek klopt and Aanpassen side by side, the same weight: neither is the answer we hope for */
.guessed-choose {
  grid-area: choose;
  display: flex;
  gap: 6px;
}
.guessed-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  background: #fff;
  white-space: nowrap;
}
.guessed-button svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* a narrow screen: the window's width (never off its middle), the buttons on a row of their own under the words */
@media (max-width: 620px) {
  .guessed {
    width: calc(100vw - 24px);
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'mark words'
      '. choose';
    align-items: start;
  }
  .guessed-choose {
    justify-content: flex-end;
  }
}
@media (prefers-reduced-motion: reduce) {
  .guessed {
    transition: opacity 0.2s ease-out;
  }
}

/* ---- the note on the photo: a yellow slip stuck over its top right corner (or at the fold on the page in view:
   guessed.js tag), written by hand, the size it reads on screen at any zoom (dpimark.js --tb-mark). It floats gently
   up and down over the page, so it reads as a note of ours on the book, not a part of its design, and a tap on it
   opens the date's check (tapping.js tapAt). */
.tb-guess {
  --guess-x: 8px;
  --guess-y: -12px;
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px 6px 7px;
  border-radius: 2px 2px 3px 9px / 2px 2px 3px 5px;
  background: linear-gradient(172deg, #ffe58a, var(--guess) 70%);
  color: var(--guess-ink);
  font:
    700 19px/1 'Caveat',
    var(--ui-font);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.55),
    0 1px 1.5px rgb(40 30 20 / 0.3),
    0 7px 12px -6px rgb(40 30 20 / 0.5);
  cursor: pointer;
  transform-origin: 100% 0;
  scale: var(--tb-mark, 1);
  translate: var(--guess-x) var(--guess-y);
  rotate: 4deg;
  animation: tb-guess-float 1.6s ease-in-out infinite alternate;
}
.tb-guess:hover {
  background: linear-gradient(172deg, #fff0b3, #f6d465 70%);
}
/* up by a few px on screen at any zoom (the note's own scale), from where it's stuck and back */
@keyframes tb-guess-float {
  to {
    translate: var(--guess-x) calc(var(--guess-y) - 4px * var(--tb-mark, 1));
  }
}
/* the writing sits on the middle of the slip, by its letters' own height (not the font's line box, which sits high) */
.tb-guess-when {
  text-box: trim-both cap alphabetic;
}
.tb-guess svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tb.is-overview .tb-guess {
  --guess-x: 5px;
  --guess-y: -7px;
}
/* the notice above just came to speak of this photo: its note waves once, so the eye finds it */
.tb-guess.is-called {
  animation:
    tb-guess-float 1.6s ease-in-out infinite alternate,
    tb-guess-wave 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) 0.35s;
}
@keyframes tb-guess-wave {
  30% {
    scale: calc(var(--tb-mark, 1) * 1.25);
    rotate: -6deg;
  }
  60% {
    rotate: 8deg;
  }
}
/* under the pointer it holds still, to be taken (after the wave's shorthand, which would set it running again) */
.tb-guess:hover,
.tb-guess:focus-visible {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .tb-guess,
  .tb-guess.is-called {
    animation: none;
  }
}
