/* oomoo -- the guestbook. This file is the page, same deal as css/moos/moos.css.
 *
 * Imports are the whole dependency list: tokens first so everything after can read --ink,
 * --line and --text, then the reset and faces, then the ambient chrome this page borrows
 * from home (the ruler, the theme toggle).
 *
 * Same neo-web construction as the micro-moos: one narrow column, every signature in a
 * dashed box -- ephemera, pinned up rather than built in. The form sits above the book
 * like the register desk at the door.
 *
 * Mobile-first: what's outside a media query is the phone. */

@import url('../tokens.css');
@import url('../reset.css');
@import url('../utilities.css');
@import url('../home/fonts.css');
@import url('../home/ruler.css');

/* ------------------------------------------------------------------- Page */

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'National Park', system-ui, sans-serif;
  line-height: 1.55;
}

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 24px 14px 64px;
}

@media (min-width: 480px) {
  .page {
    padding-inline: 24px;
  }
}

@media (min-width: 768px) {
  .page {
    padding-left: 72px; /* stand off the ruler, like home */
  }
}

.label {
  text-transform: uppercase;
  font-family: 'National Park', system-ui, sans-serif;
}

a {
  color: inherit;
}

.back {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
}

.back:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------- Masthead */

.masthead {
  display: grid;
  justify-items: center;
  text-align: center;
  margin: 2rem 0 2rem;
}

.masthead__title {
  font-family: 'Terminal Grotesque', 'National Park', sans-serif;
  font-size: clamp(2.6rem, 9vw, 4.5rem); /* same scale as the voicemail masthead */
  line-height: 1;
  color: var(--ink);
}

.masthead__sub {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--text);
}

.masthead__stats {
  margin-top: 0.55rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* ------------------------------------------------------------------- Sign */

/* The register desk. A hairline box rather than a dashed one: the form is furniture,
   the signatures are the ephemera. */

.sign {
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 2rem;
}

.sign__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.sign__replying {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--dim);
  margin-bottom: 0.7rem;
}

.sign__replying strong {
  color: var(--ink);
  font-style: normal;
}

.sign__cancel {
  font-size: 10px;
  color: var(--dim);
  margin-left: 6px;
}

.sign__cancel:hover {
  color: var(--accent);
}

.sign__note {
  font-size: 0.8rem;
  color: var(--readout-figure);
  margin-bottom: 0.7rem;
}

.sign__note--err {
  color: var(--accent);
}

/* The honeypot. Removed from sight and tab order, never from the DOM -- display:none
   is what half the bots check for. */
.sign__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sign__form {
  display: grid;
  gap: 12px;
}

.sign__row {
  display: grid;
  gap: 12px;
}

@media (min-width: 480px) {
  .sign__row {
    grid-template-columns: 1fr 1fr;
  }
}

.sign__field {
  display: grid;
  gap: 4px;
}

.sign__field > span {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.sign__field em {
  font-style: normal;
  text-transform: none;
  letter-spacing: normal;
}

.sign__field input,
.sign__field textarea {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'National Park', system-ui, sans-serif;
  font-size: 0.9rem;
  padding: 7px 9px;
}

.sign__field input:focus,
.sign__field textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.sign__field textarea {
  resize: vertical;
}

.sign__actions {
  display: flex;
  justify-content: flex-end;
}

.sign__submit {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 6px 16px;
  cursor: pointer;
}

.sign__submit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------------- Book */

.book {
  display: grid;
  gap: 0.9rem;
}

.entry {
  border: 1px dashed var(--line);
  padding: 0.9rem 1rem;
}

.entry__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 0.45rem;
}

.entry__name {
  color: var(--ink);
  font-weight: 500;
}

.entry__site {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.entry__site:hover {
  color: var(--accent);
}

/* Only the admin ever sees this -- to its author a pending signature looks live. */
.entry__pending {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--on-accent);
  background: var(--accent);
  padding: 1px 5px;
}

.entry__date {
  margin-left: auto;
  font: 500 10px/1 var(--chrome-face);
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* The gift a signature can carry, set apart in its own hairline sliver. */
.entry__rec {
  border: 1px solid var(--line);
  padding: 5px 9px;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
}

.entry__rec-tag {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-right: 4px;
}

.entry__body {
  font-size: 0.9rem;
}

.entry__body + .entry__body {
  margin-top: 0.5rem;
}

.entry__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 0.6rem;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.entry__reply {
  color: var(--dim);
  text-decoration: none;
}

.entry__reply:hover {
  color: var(--accent);
}

.entry__approve,
.entry__delete {
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-transform: inherit;
}

.entry__approve {
  margin-left: auto;
}

.entry__approve:hover,
.entry__delete:hover {
  color: var(--accent);
}

.entry__approve + .entry__delete {
  margin-left: 0;
}

.entry__delete:only-of-type {
  margin-left: auto;
}

/* ---------------------------------------------------------------- Threads */

/* Replies fold under their parent with <details> -- no JavaScript in the hinge. */

.thread {
  margin-left: 1.1rem;
}

.thread__toggle {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 4px 10px;
  margin-top: 0.5rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  cursor: pointer;
  list-style: none; /* no disclosure triangle; the count is the affordance */
}

.thread__toggle::-webkit-details-marker {
  display: none;
}

.thread__toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* "show" and "hide" swap with the open state -- the summary is its own label. */
.thread__hide {
  display: none;
}

.thread[open] .thread__show {
  display: none;
}

.thread[open] .thread__hide {
  display: inline;
}

.thread__list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.book__empty {
  color: var(--dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

/* ------------------------------------------------------------------- Foot */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ Admin */

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  border: 1px dashed var(--accent);
  padding: 8px 12px;
  margin-bottom: 1.5rem;
  font-size: 10px;
  color: var(--dim);
}

.admin-bar button {
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 2px 0;
}

.admin-bar button:hover {
  color: var(--accent);
}
