@font-face {
  font-family: "Wattle Fanciful";
  src: url("assets/fanciful.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Wattle Bricolage";
  src: url("assets/bricolage.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Wattle Instrument";
  src: url("assets/instrument-serif.woff2") format("woff2");
  font-display: swap;
}

body {
  font-family: "Wattle Bricolage", Arial, sans-serif;
}

.hero h1 {
  font-family: "Wattle Fanciful", "Wattle Instrument", Georgia, serif;
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: .94;
}

.search-panel h2,
.library h2,
.living-note h2,
.policy-card h3 {
  font-family: "Wattle Instrument", Georgia, serif;
}

.filters,
.categories {
  flex-wrap: wrap;
  overflow: visible;
}

.mobile-topic-filter {
  display: none;
}

@media (min-width: 621px) {
  .categories {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .categories button {
    width: 100%;
  }
}

.search-box {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-height: 70px;
  margin-bottom: .35rem;
  padding: .45rem .55rem .45rem .7rem;
  border: 1px solid #cdbdab;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: inset 0 1px 0 #fff, 0 5px 16px rgba(75, 51, 40, .05);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.search-box:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(242, 201, 76, .28), 0 8px 22px rgba(75, 51, 40, .08);
  transform: translateY(-1px);
}

.search-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--brown);
}

.search-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-box label {
  display: block;
  min-width: 0;
}

.search-box label > span {
  display: block;
  margin-bottom: .05rem;
  color: var(--orange);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brown);
  font: 700 1rem "Wattle Bricolage", Arial, sans-serif;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

#clearSearchBox {
  min-width: 64px;
  min-height: 44px;
  padding: .5rem .7rem;
  border: 0;
  border-radius: 11px;
  background: var(--brown);
  color: #fff;
  font: 900 .7rem "Wattle Bricolage", Arial, sans-serif;
  cursor: pointer;
}

#clearSearchBox[hidden] {
  display: none;
}

.search-help {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .66rem;
}

.search-help span:first-child {
  margin-right: auto;
}

.search-help kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font: 800 .68rem inherit;
}

.filters button,
.categories button {
  min-height: 44px;
  white-space: normal;
}

.policy-card {
  isolation: isolate;
  overflow: hidden;
}

.policy-card h3,
.doc-category,
.card-actions a {
  overflow-wrap: anywhere;
}

.living-note aside a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: .25rem;
  padding: .55rem .8rem;
  border: 1px solid currentColor;
  border-radius: 10px;
  text-decoration: none;
}

.load-more {
  display: block;
  width: min(100%, 360px);
  min-height: 50px;
  margin: 1.2rem auto 0;
  padding: .7rem 1rem;
  border: 1px solid var(--brown);
  border-radius: 999px;
  background: var(--paper);
  color: var(--brown);
  font: 900 .8rem "Wattle Bricolage", Arial, sans-serif;
  cursor: pointer;
}

.load-more:hover {
  background: var(--brown);
  color: #fff;
}

.load-more[hidden] {
  display: none;
}

@media (max-width: 620px) {
  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.2rem);
  }

  .search-box input {
    min-width: 0;
    font-size: .9rem;
  }

  .search-box input::placeholder {
    color: #887c72;
    opacity: 1;
  }

  .search-box {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 66px;
    padding-left: .55rem;
  }

  .search-icon {
    width: 38px;
    height: 38px;
  }

  .search-box label > span {
    font-size: .56rem;
  }

  #clearSearchBox {
    min-width: 54px;
    padding-inline: .55rem;
  }

  .search-help kbd,
  .search-help span:last-child {
    display: none;
  }

  .filters button,
  .categories button {
    flex: 1 1 auto;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
  }

  .filters button {
    width: 100%;
    padding-inline: .35rem;
  }

  .categories {
    display: none;
  }

  .mobile-topic-filter {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .7rem;
    margin-top: .7rem;
    color: var(--orange);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-topic-filter select {
    width: 100%;
    min-height: 48px;
    padding: .6rem 2rem .6rem .75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--brown);
    font: 750 .8rem "Wattle Bricolage", Arial, sans-serif;
    text-transform: none;
    letter-spacing: 0;
  }

  .card-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
