/* Search */
.searchbar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.searchbar .input { flex: 1; min-width: 0; }
.search-summary { margin: 0 0 1rem; }

.results + .results { margin-top: 1.75rem; }
.results__title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; }

mark { background: var(--amber-pale); color: inherit; border-radius: 4px; padding: 0 0.1em; }

/* Knowledge base: facts are Post-its jotted down by a teammate, policies are
   typed notices with a rubber stamp. Both pin to the same board. */
:root {
  --post-it-shade: 0%;
  --post-it-ink: #2a2a24;
  --stamp: #b8322a;
  --font-typewriter: "Special Elite", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --post-it-shade: 16%;
    --stamp: #e06a5c;
  }
}

.kb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  align-items: start;
  gap: 1.5rem 1.25rem;
  margin: 0;
  padding: 0.5rem 0.25rem;
  list-style: none;
}

.kb-list > li { display: grid; }

/* The title link covers the whole card. */
.post-it, .notice { position: relative; }
.post-it__title a::after, .notice__title a::after { content: ""; position: absolute; inset: 0; }
.post-it__title a, .notice__title a { color: inherit; text-decoration: none; }

/* Facts, in the colors Post-its come in. Dark mode dims the paper a little. */
.post-it--yellow { --post-it: #fde98b; }
.post-it--pink   { --post-it: #f9b8d0; }
.post-it--blue   { --post-it: #a9dcf0; }
.post-it--green  { --post-it: #cbe89c; }
.post-it--orange { --post-it: #fdc68a; }

.post-it {
  --tilt: -1deg;
  --paper: color-mix(in srgb, var(--post-it, #fde98b) calc(100% - var(--post-it-shade)), black);

  min-height: 190px;
  padding: 1.4rem 1.1rem 0.9rem;
  background: linear-gradient(color-mix(in srgb, var(--paper) 92%, black), var(--paper) 1.1rem);
  color: var(--post-it-ink);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.12), 0 14px 16px -14px rgb(0 0 0 / 0.55);
  transform: rotate(var(--tilt));
  transition: transform 140ms ease;
}

.kb-list > li:nth-child(3n+2) .post-it { --tilt: 1.2deg; }
.kb-list > li:nth-child(3n) .post-it { --tilt: -0.3deg; }
.post-it:hover { transform: rotate(0deg) translateY(-2px); }
.post-it:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.post-it__title { margin: 0 0 0.35rem; font: 600 1.6rem/1.1 var(--font-hand); }
.post-it__body { margin: 0; font-size: 0.95rem; }
.post-it__meta { margin: 0.75rem 0 0; color: color-mix(in srgb, var(--post-it-ink) 65%, transparent); }
.post-it mark { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.post-it--full { --tilt: -0.6deg; min-height: 260px; padding: 2.25rem 2rem 1.75rem; }
.post-it--full:hover { transform: rotate(var(--tilt)); }
.post-it--full .post-it__title { font-size: 2.6rem; }
.post-it--full .post-it__body { font-size: 1.05rem; }
.post-it--full .post-it__body + .post-it__body { margin-top: 0.75rem; }

/* Policies */
.notice {
  padding: 1rem 1.1rem 0.9rem;
  border: 1px solid var(--line);
  outline: 1px solid var(--line);
  outline-offset: -6px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line), 0 14px 18px -16px rgb(0 0 0 / 0.5);
  transition: transform 140ms ease;
}

.notice:hover { transform: translateY(-2px); }
.notice:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.notice__letterhead {
  margin: 0 0 0.6rem;
  padding: 0.15rem 4.5rem 0.4rem 0;
  border-bottom: 3px double var(--line);
  color: var(--ink-soft);
  font: 700 0.7rem/1.3 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notice__title { margin: 0 0 0.4rem; font: 400 1.15rem/1.3 var(--font-typewriter); }
.notice__body { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.notice__signature { margin: 0.85rem 0 0; color: var(--ink-soft); }
.signature { display: block; color: var(--ink); font: 600 1.3rem/1.1 var(--font-hand); }

.notice--full { padding: 1.75rem 2rem 1.5rem; }
.notice--full:hover { transform: none; }
.notice--full .notice__title { font-size: 1.9rem; margin: 0.5rem 0 1rem; }
.notice--full .notice__body { color: var(--ink); font-size: 1.05rem; }
.notice--full .notice__signature { margin-top: 1.5rem; }

/* A slightly crooked, slightly worn rubber stamp. */
.stamp {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  padding: 0.1em 0.45em;
  border: 2.5px solid currentColor;
  border-radius: 4px;
  color: var(--stamp);
  font: 800 0.85rem/1.2 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  opacity: 0.85;
  mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgb(0 0 0 / 0.65) 100%);
  pointer-events: none;
}

.notice--full .stamp { top: 1rem; right: 1.25rem; font-size: 1.15rem; }

/* Stamped once when the page opens, then still. */
.stamp--thunk { animation: thunk 360ms cubic-bezier(.3,1.4,.6,1) 200ms 1 backwards; }

@keyframes thunk {
  from { opacity: 0; transform: rotate(-16deg) scale(1.8); }
  to { opacity: 0.85; transform: rotate(-9deg) scale(1); }
}

.article__details { margin: 1.5rem 0; }

.segmented { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0 0 1rem; }
.segmented legend { font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.segmented__option input { position: absolute; opacity: 0; }
.segmented__option span {
  display: inline-block;
  padding: 0.4em 1em;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: 600 0.95rem/1.2 var(--font-display);
  cursor: pointer;
}
.segmented__option input:checked + span { border-color: var(--ink); background: var(--accent-pale); box-shadow: var(--shadow-pop); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.form-actions form { display: inline; }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; background: var(--amber-pale); }

@media (max-width: 560px) {
  .post-it--full, .notice--full { padding-inline: 1.25rem; }
  .post-it--full .post-it__title { font-size: 2.1rem; }
  .notice--full .notice__title { font-size: 1.5rem; }
}
