/* Gastenboek (/gastenboek). Uses the tokens from site.css (also for Nacht); stitched cards with copper rivets. */
.gb { width: min(760px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(24px, 5vh, 44px) 0 64px; display: grid; gap: 16px; }
.gb p { margin: 0; }
.gb-head { display: grid; gap: 6px; margin-bottom: 4px; }
.gb-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }

/* Copper rivets in the four corners, as on Nieuw op de site. */
.gb-form::after, .gb-entry::after, .gb-admin-form::after {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 3;
  pointer-events: none;
  --stud: radial-gradient(circle at 40% 35%, #f0c48c 0 0.8px, #c58a50 1.4px, #7a4a22 2.6px, rgba(0, 0, 0, 0.35) 3.1px, transparent 3.6px);
  background:
    var(--stud) top left / 8px 8px no-repeat, var(--stud) top right / 8px 8px no-repeat,
    var(--stud) bottom left / 8px 8px no-repeat, var(--stud) bottom right / 8px 8px no-repeat;
}

.gb-form, .gb-admin-form { display: grid; gap: 14px; padding: 22px clamp(20px, 4vw, 30px); }
.gb-field { display: grid; gap: 6px; }
.gb-field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.gb-count { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.gb-field input, .gb-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(var(--ink), 0.35);
  font: inherit;
  font-size: 1rem; /* 16px: iPhones do not zoom in on the field */
  line-height: 1.45;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.gb-field textarea { min-height: 112px; resize: vertical; }
.gb-field input:focus, .gb-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22); }

/* The honeypot: off screen for people, still in the form for bots. */
.gb-honey { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.gb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.gb-actions .btn[disabled] { opacity: 0.6; cursor: wait; }
.gb-status { min-height: 1.3em; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.gb-status[data-kind="ok"] { color: var(--ok); }
.gb-status[data-kind="bad"] { color: var(--bad); }

.gb-message { color: var(--muted); }
.gb-message[hidden] { display: none; }
.gb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gb-entry { padding: 18px clamp(20px, 4vw, 30px); animation: gb-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.gb-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.gb-entry-head h2 { font-size: clamp(1.2rem, 3.4vw, 1.45rem); overflow-wrap: anywhere; }
.gb-entry-head time { color: var(--faint); font-size: 0.82rem; font-weight: 650; }
.gb-entry-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.gb-tools { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
.gb-tools .gb-remove { margin-top: 0; }
.gb-remove { margin-top: 12px; min-height: 36px; padding: 0 14px; font-size: 0.85rem; color: var(--bad); }
.gb-remove:hover { border-color: var(--bad); }
.gb-tool { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }

/* Redmer's reply under a message: indented, with a copper line on the left. */
.gb-reply {
  margin: 14px 0 0 clamp(10px, 3vw, 24px); padding: 10px 14px 12px;
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(var(--accent-rgb), 0.09);
}
.gb-reply-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px; }
.gb-reply-by { color: var(--accent); font-size: 0.86rem; font-weight: 750; letter-spacing: 0.01em; }
.gb-reply-head time, .gb-reply-edited { color: var(--faint); font-size: 0.8rem; font-weight: 650; }
.gb-reply-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.gb-reply-form { display: grid; gap: 10px; }
.gb-reply-form textarea { min-height: 84px; }

.gb-admin { display: grid; justify-items: center; gap: 12px; margin-top: 18px; }
.gb-admin-form { width: 100%; }
.gb-admin-form[hidden], .gb-admin-on[hidden], .gb-admin-open[hidden] { display: none; }
.gb-admin-open {
  min-height: 36px; padding: 0 14px; border: 0; background: none; color: var(--faint);
  font-size: 0.85rem; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.gb-admin-open:hover { color: var(--muted); }
.gb-admin-on { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; color: var(--muted); font-weight: 600; text-align: center; }

/* The optional photo in the form: a quiet link, not an upload field. */
.gb-photo { display: flex; align-items: center; margin-top: -4px; }
.gb-photo-add {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 2px;
  color: var(--muted); font-size: 0.88rem; font-weight: 650; cursor: pointer; border-radius: var(--radius-sm);
}
.gb-photo-add[hidden] { display: none; }
.gb-photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gb-photo-add svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; flex: none; }
.gb-photo-add span { text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), 0.45); text-underline-offset: 3px; }
.gb-photo-add small { color: var(--faint); font-size: inherit; font-weight: 600; }
.gb-photo-add:hover { color: var(--text); }
.gb-photo-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.gb-photo-chosen { position: relative; display: inline-block; }
.gb-photo-chosen[hidden] { display: none; }
.gb-photo-chosen img {
  display: block; width: 76px; height: 76px; object-fit: cover;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.gb-photo-x {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--text); background: var(--surface-solid); font-size: 1.05rem; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.gb-photo-x:hover { color: var(--bad); border-color: var(--bad); }

/* A photo under a message: a modest rounded picture; a tap opens it bigger. */
.gb-entry-photo {
  display: block; margin-top: 12px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: rgba(var(--ink), 0.35); cursor: zoom-in; max-width: min(100%, 320px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22); transition: transform 160ms ease, box-shadow 160ms ease;
}
.gb-entry-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.gb-entry-photo:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.gb-entry-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gb-view {
  width: auto; max-width: 100vw; max-height: 100vh; margin: auto; padding: 0; border: 0; background: none; overflow: visible;
}
.gb-view[open] { display: grid; place-items: center; animation: gb-view-in 180ms ease-out; }
.gb-view::backdrop { background: rgba(10, 8, 5, 0.86); }
.gb-view img {
  display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); width: auto; height: auto;
  border-radius: var(--radius-sm); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.gb-view-close {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
  color: #fff; background: rgba(0, 0, 0, 0.45); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.gb-view-close:hover { background: rgba(0, 0, 0, 0.7); }
@keyframes gb-view-in { from { opacity: 0; transform: scale(0.97); } }

@keyframes gb-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .gb-entry, .gb-view[open] { animation: none; } .gb-entry-photo { transition: none; } }

/* Emoji reactions under a message: leather-toned pills, yours lit up in copper. */
.gb-react { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.gb-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); background: rgba(var(--ink), 0.26);
  font: inherit; font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.gb-chip:hover { border-color: var(--accent); }
.gb-chip:active { transform: scale(0.93); }
.gb-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gb-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: rgba(var(--accent-rgb), 0.24); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.gb-chip-e { font-size: 1.1rem; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.gb-chip.is-new .gb-chip-e { animation: gb-pop 300ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.gb-chip-add { gap: 1px; padding: 0 10px 0 9px; color: var(--faint); background: transparent; border-style: dashed; }
.gb-chip-add:hover { color: var(--text); border-style: solid; }
.gb-chip-add .gb-chip-e { filter: grayscale(0.7); opacity: 0.8; transition: filter 140ms ease, opacity 140ms ease; }
.gb-chip-add:hover .gb-chip-e { filter: none; opacity: 1; }
.gb-chip-plus { font-size: 1.05rem; font-weight: 800; }
.gb-react-note { flex-basis: 100%; color: var(--bad); font-size: 0.86rem; font-weight: 600; }
@keyframes gb-pop { 0% { transform: scale(0.5); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* The emoji picker: a card over the page on computers, a sheet from the bottom on phones. */
.gb-pick {
  width: min(430px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow); overflow: auto;
}
.gb-pick[open] { animation: gb-view-in 160ms ease-out; }
.gb-pick::backdrop { background: rgba(var(--ink-deep), 0.6); }
.gb-pick-in { display: grid; gap: 12px; padding: 14px 16px 16px; }
.gb-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gb-pick-title { margin: 0; font-size: 1.2rem; }
.gb-pick-close {
  width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--text); background: var(--surface-2); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.gb-pick-close:hover { border-color: var(--accent); }
.gb-pick-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.gb-pick-q {
  min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(var(--ink), 0.3); font-size: 1.55rem; line-height: 1; cursor: pointer;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.gb-pick-q:hover { border-color: var(--accent); transform: translateY(-1px) scale(1.06); }
.gb-pick-q:active { transform: scale(0.94); }
.gb-pick-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gb-pick-q[aria-pressed="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.26); }
.gb-pick-full { min-height: 120px; }
.gb-pick-wait { margin: 0; padding: 24px 6px; color: var(--muted); font-size: 0.92rem; text-align: center; }
.gb-pick-full emoji-picker {
  width: 100%; height: 340px;
  --background: var(--surface-solid);
  --border-color: var(--line-strong);
  --border-radius: var(--radius-sm);
  --button-active-background: rgba(var(--accent-rgb), 0.32);
  --button-hover-background: rgba(var(--accent-rgb), 0.2);
  --category-font-color: var(--muted);
  --category-font-size: 0.86rem;
  --indicator-color: var(--accent);
  --input-border-color: var(--line-strong);
  --input-border-radius: 999px;
  --input-font-color: var(--text);
  --input-font-size: 1rem; /* 16px: iPhones do not zoom in */
  --input-padding: 0.4rem 0.85rem;
  --input-placeholder-color: var(--faint);
  --outline-color: var(--accent);
  --emoji-size: 1.45rem;
  --emoji-padding: 0.42rem;
  --num-columns: 8;
  font-family: var(--font-body);
}
@media (max-width: 560px) {
  .gb-pick {
    width: 100%; max-height: 88dvh; margin: auto 0 0;
    border-width: 1px 0 0; border-radius: var(--radius) var(--radius) 0 0;
  }
  .gb-pick[open] { animation: gb-sheet-in 200ms ease-out; }
  .gb-pick-in { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .gb-pick-full emoji-picker { height: min(50dvh, 360px); --num-columns: 7; --emoji-padding: 0.38rem; }
}
@keyframes gb-sheet-in { from { transform: translateY(40px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .gb-chip, .gb-pick-q { transition: none; } .gb-chip.is-new .gb-chip-e, .gb-pick[open] { animation: none; } }
