/* The "Thank You!" guest check: visitors' notes written on its ruled lines.
   Measurements are percentages of assets/img/guest-check.webp (383 × 644). */

.gcheck {
  --row: 4.847cqh;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 383 / 644;
  container-type: size;
  color: #24357a;
  font-family: "Caveat", cursive;
  line-height: 1;
}
.gcheck__img { position: absolute; inset: 0; width: 100%; height: 100%; }

.gcheck__table,
.gcheck__waiter,
.gcheck__total {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.6cqh;
  font-weight: 700;
  white-space: nowrap;
}
.gcheck__table  { left: 0;     width: 23%;   top: 18.6%; height: 5.6%; }
.gcheck__waiter { left: 23%;   width: 23.5%; top: 18.6%; height: 5.6%; transform: rotate(-3deg); }
.gcheck__total  { left: 74.9%; width: 13.9%; top: 92.2%; height: 4.9%; color: #b8323a; }

.gcheck__notes {
  position: absolute;
  left: 0;
  right: 0;
  top: 24.38%;
  height: calc(var(--row) * 14);
  overflow: hidden;
  font-size: 3.55cqh;
  line-height: var(--row);
}
.gnote {
  position: relative;
  display: block;
  padding: 0 26.5% 0 14%;
  overflow-wrap: anywhere;
  transform: translateY(-.1em);
}
.gnote::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  top: 0;
  width: 12%;
  text-align: center;
  color: #6b7280;
}
.gnote::after {
  content: attr(data-date);
  position: absolute;
  left: 74.9%;
  top: 0;
  width: 13.9%;
  text-align: center;
  font-size: .74em;
  line-height: var(--row);
  white-space: nowrap;
  color: #c43a44;
}
.gnote__by { color: #b8323a; white-space: nowrap; }
.gnote--invite { color: #b8323a; font-weight: 700; }
.gnote--invite::before, .gnote--invite::after { content: none; }
.gnote--new { animation: gnote-in .9s ease-out; }
@keyframes gnote-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* ---------- on the corkboard ---------- */
.guestcheck { filter: drop-shadow(0 1px 1px rgba(40, 22, 8, .35)) drop-shadow(0 8px 9px rgba(40, 22, 8, .28)); }
a.item.guestcheck:hover,
a.item.guestcheck:focus-visible { box-shadow: none; filter: drop-shadow(0 3px 3px rgba(40, 22, 8, .3)) drop-shadow(0 20px 20px rgba(40, 22, 8, .35)); }
.guestcheck .pushpin { --tx: 46%; --ty: 3.2%; --pw: 14%; }
.guestcheck[hidden] { display: none; }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .guestcheck { order: 6; grid-column: 1 / -1; width: 56%; justify-self: center; }
}

/* ---------- the opened check + note slip ---------- */
.gb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 9vh 4vw 3vh;
}
.gb[hidden] { display: none; }
.gb__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 18, 6, .58);
  backdrop-filter: blur(3px);
  animation: gb-fade .3s ease-out;
}
.gb__wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  animation: gb-rise .45s cubic-bezier(.2, .9, .3, 1.15);
}
.gb.is-closing .gb__backdrop { animation: gb-fade .25s ease-in reverse forwards; }
.gb.is-closing .gb__wrap { animation: gb-rise .25s ease-in reverse forwards; }
@keyframes gb-fade { from { opacity: 0; } }
@keyframes gb-rise { from { opacity: 0; transform: translateY(4vh) scale(.94) rotate(-2deg); } }

.gb__checkcol { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gb__checkholder { position: relative; transform: rotate(-1.2deg); }
.gb .gcheck {
  width: auto;
  height: min(72vh, 800px);
  height: min(72dvh, 800px);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)) drop-shadow(0 18px 26px rgba(0, 0, 0, .4));
}
.gb__pin {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 3.4%;
  width: 9%;
  transform: translate(-8.9%, -97.6%);
  filter: drop-shadow(1px 2px 1.5px rgba(40, 22, 8, .45)) drop-shadow(3px 6px 5px rgba(40, 22, 8, .25));
}
.gb__pager {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff8ec;
  font: 700 20px/1 "Caveat", cursive;
}
.gb__pager[hidden] { display: none; }
.gb__pager button {
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 248, 236, .14);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.gb__pager button:disabled { opacity: .35; cursor: default; }
.gb__pager button:not(:disabled):hover { background: rgba(255, 248, 236, .26); }

.gb__slip {
  position: relative;
  width: min(330px, 86vw);
  padding: 34px 26px 24px;
  background: #fffaf0;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 20px 34px rgba(0, 0, 0, .35);
  transform: rotate(1.8deg);
  color: #2d2a32;
  font-family: "Nunito", system-ui, sans-serif;
}
.gb__slip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 112px;
  height: 30px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(240, 150, 160, .78);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.gb__title { margin: 0 0 4px; font: 700 34px/1 "Caveat", cursive; color: #b8323a; }
.gb__hint { margin: 0 0 16px; font-size: 14px; color: #5b5561; }
.gb__slip label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #24357a; }
.gb__slip textarea,
.gb__slip input[type="text"] {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid #9fb0d0;
  background: transparent;
  color: #24357a;
  font: 600 24px/32px "Caveat", cursive;
  outline: none;
}
.gb__slip textarea {
  height: 128px;
  resize: none;
  border: 0;
  background: repeating-linear-gradient(transparent 0 31px, #b9c6de 31px 32px);
}
.gb__slip textarea:focus { outline: 2px dashed rgba(184, 50, 58, .4); outline-offset: 4px; }
.gb__slip input[type="text"]:focus { border-bottom-color: #b8323a; }
.gb__count { margin: 2px 0 14px; text-align: right; font-size: 12px; color: #8a8490; }
.gb__count.is-full { color: #b8323a; }
.gb__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb__send {
  margin-top: 20px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: #b8323a;
  color: #fff;
  font: 700 26px/1 "Caveat", cursive;
  cursor: pointer;
  box-shadow: 0 3px 0 #87222a;
  transition: transform .15s ease, box-shadow .15s ease;
}
.gb__send:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #87222a; }
.gb__send:active { transform: translateY(2px); box-shadow: 0 1px 0 #87222a; }
.gb__send:disabled { opacity: .6; cursor: progress; }
.gb__status { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: #24357a; }
.gb__status.is-error { color: #b8323a; }

.gb__close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 248, 236, .16);
  color: #fff8ec;
  font: 400 30px/44px system-ui, sans-serif;
  cursor: pointer;
}
.gb__close:hover { background: rgba(255, 248, 236, .3); }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .gb { place-items: start center; padding: 96px 5vw 40px; }
  .gb__wrap { flex-direction: column; }
  .gb .gcheck { height: auto; width: min(86vw, 440px); }
}

@media (prefers-reduced-motion: reduce) {
  .gb__backdrop, .gb__wrap, .gnote--new { animation: none !important; }
}
