/* The Tack Board (bet 46): a corkboard of numbered brass tacks, on /board/ and as a preview on /live/.
   ops/board-page.js writes the pins at build time. Each tack is a <details>: tap shows the name and note
   on a paper card at the bottom of the board, so it never runs off a 375 px screen. */
.cork {
  position: relative;
  display: block;
  padding: 22px 14px 26px;
  border: 10px solid #6b4423;
  border-radius: 4px;
  background-color: #c99a62;
  background-image:
    radial-gradient(#a8763f 1px, transparent 1.5px),
    radial-gradient(#ddb47c 1px, transparent 1.5px),
    radial-gradient(#b6834b 1.5px, transparent 2px);
  background-size:
    9px 9px,
    13px 13px,
    23px 23px;
  background-position:
    0 0,
    4px 6px,
    11px 3px;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.35),
    0 3px 0 #4a2e16;
  color: var(--ink);
  text-decoration: none;
}
.cork-pins {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 14px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cork-pins li {
  display: grid;
  justify-items: center;
  /* margin, not transform: a transform would trap the open card inside the tack. */
  margin-top: var(--y, 0);
}
/* Undo the FAQ look that site.css gives every details and summary. */
.cork details,
.cork details:last-of-type {
  border: 0;
}
.cork summary::after {
  content: none;
}
.cork .head {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff3c4 0 8%,
    #f1c75a 22%,
    #c8952c 55%,
    #7c5614 100%
  );
  box-shadow:
    2px 4px 0 rgba(0, 0, 0, 0.28),
    inset -2px -3px 4px rgba(0, 0, 0, 0.25);
}
.cork .num {
  margin-top: 6px;
  padding: 1px 6px;
  background: #fffdf3;
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.25);
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transform: rotate(var(--r, 0deg));
}
.cork summary {
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  font-size: 1rem;
  list-style: none;
  cursor: pointer;
}
.cork summary::-webkit-details-marker {
  display: none;
}
.cork summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.cork details[open] .head {
  transform: translateY(-3px) scale(1.12);
  box-shadow:
    3px 8px 0 rgba(0, 0, 0, 0.22),
    0 0 0 4px #fffdf3;
}
.cork details[open] .num {
  background: var(--ink);
  color: #fff;
}
/* The open note: a paper card pinned along the bottom of the board. */
.cork .card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 380px;
  z-index: 2;
  padding: 14px 16px;
  background: #fffdf3;
  box-shadow: 2px 5px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(var(--t, 0deg));
}
.cork:has(details[open]) {
  padding-bottom: 150px;
}
.cork .card p {
  max-width: none;
  margin: 0;
  padding: 0;
}
.cork .card-num,
.cork .card-date {
  color: var(--muted);
  font-size: 0.875rem;
}
.cork .card-name {
  font-weight: 800;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}
.cork .card-note {
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cork-empty {
  max-width: 17em;
  margin: 40px auto;
  padding: 16px 18px;
  background: #fffdf3;
  box-shadow: 2px 5px 0 rgba(0, 0, 0, 0.3);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transform: rotate(-2deg);
}
.board-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.board-stats b {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 900;
  margin-right: 6px;
}
.board-first {
  font-weight: 800;
}
.board-buy .wrap > * {
  max-width: 34em;
}
.board-buy ul {
  padding-left: 1.2em;
}
.board-buy .btn {
  margin: 4px 0 18px;
}
.board-fine {
  color: var(--muted);
  font-size: 0.9375rem;
}
/* The /live/ preview: numbers only, the whole board is one link. */
.board-peek {
  max-width: 34em;
  margin: 32px 0 0;
}
.board-peek p {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 1.0625rem;
}
.board-peek .board-peek-h {
  margin: 0 0 12px;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
}
.cork-small {
  padding: 14px 10px 16px;
  border-width: 7px;
}
.cork-small .cork-empty {
  margin: 14px auto;
  font-size: 1.0625rem;
}
.cork-small .head {
  width: 26px;
  height: 26px;
}
.cork-small .cork-pins {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 12px 6px;
}
/* The preview sits in the /live/ calendar box: undo its day squares (.cal ol li in live.css). */
.cork-small .cork-pins li {
  place-content: normal;
  aspect-ratio: auto;
  border: 0;
  font-size: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  .cork .head {
    transition: transform 0.15s ease-out;
  }
}
