:root {
  --paper: #fbfaf5;
  --ink: #173e35;
  --green: #173e35;
  --muted: #4c6058;
  --line: #cbd3c8;
  --orange: #994226;
  background: var(--paper);
}

main.wrap {padding-bottom: 4rem}
.directory-intro {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding-block: clamp(1.8rem, 3vw, 2.6rem);
}
.directory-intro h1 {
  font: 400 clamp(3.1rem, 5.15vw, 4.6rem)/.95 Georgia, serif;
  letter-spacing: -.058em;
}
.directory-intro h1 em {display: block; color: var(--orange)}
.directory-intro p {
  max-width: 43ch;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.55;
}
.notebook {display: grid; place-items: center}
.notebook-art {
  position: relative;
  width: min(100%, clamp(16.46rem, 25.44vw, 20.95rem));
  transform-origin: 48% 85%;
}
.notebook img {display: block; width: 100%; height: auto}
.notebook svg {position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible}
.notebook svg > path {stroke-dasharray: 1 1.4; stroke-dashoffset: 1.2}
.notebook g {opacity: 0; transform-origin: 800px 76px; transform: scale(.55)}

.lookup:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr) auto;
  align-items: end;
  gap: 1rem 1.35rem;
  padding: clamp(1.1rem, 2.2vw, 1.65rem);
  background: var(--green);
  color: white;
  border-radius: .7rem;
}
.lookup label {min-width: 0; font-size: .9375rem; font-weight: 650}
.lookup input[type=search], .lookup select {
  display: block;
  width: 100%;
  height: 3.15rem;
  margin-top: .4rem;
  padding: .65rem .85rem;
  border: 1px solid transparent;
  border-radius: .3rem;
  background: white;
  color: var(--ink);
  font: 400 1rem/1.4 system-ui, sans-serif;
}
.lookup input[type=search] {
  padding-left: 2.75rem;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c6058' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6.7'/%3E%3Cpath d='m15 15 6 6'/%3E%3C/svg%3E") no-repeat .95rem center / 1.2rem;
}
.lookup input::placeholder {color: #586861; opacity: 1}
.lookup .language {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 3.15rem;
  cursor: pointer;
  font-weight: 550;
}
.language input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  accent-color: #f3cf8e;
  cursor: pointer;
  flex: none;
}
.lookup :focus-visible {outline: 3px solid #ffdc9b; outline-offset: 3px}

.results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  min-height: 4rem;
  padding-block: .75rem;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 600;
}
.results button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .22em;
  white-space: nowrap;
  cursor: pointer;
}
#organizations {list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line)}
#organizations li:not([hidden]) {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem 2rem;
  padding: 1.35rem .25rem;
  border-bottom: 1px solid var(--line);
}
#organizations h2 {
  font: 400 clamp(1.45rem, 2.5vw, 1.9rem)/1.16 Georgia, serif;
  letter-spacing: -.028em;
  overflow-wrap: anywhere;
}
#organizations h2 a {color: var(--green); text-decoration: none}
#organizations h2 a::after {content: ""; position: absolute; inset: 0}
#organizations p {color: var(--muted); margin-top: .38rem; line-height: 1.45}
#organizations li:focus-within {background: #f0f3ea}
#organizations h2 a:focus-visible {text-decoration: underline; text-underline-offset: .13em}
.downloads {display: flex; justify-content: end; gap: .5rem; flex-wrap: wrap}
.downloads a {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  min-width: 4.5rem;
  padding: .45rem .85rem;
  border: 1px solid #9eafa4;
  border-radius: .35rem;
  color: var(--green);
  background: var(--paper);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.downloads a:active {background: var(--green); color: white}
@media (hover:hover) {
  #organizations li:hover {background: #f0f3ea; box-shadow: -.7rem 0 #f0f3ea, .7rem 0 #f0f3ea}
  #organizations h2 a:hover {text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em}
  .downloads a:hover {background: var(--green); color: white; border-color: var(--green)}
  .results button:hover {text-decoration-thickness: 2px}
}
@media screen {
  .lookup:not([hidden]) {box-shadow: 0 6px 15px -10px #102f2680}
  #organizations h2::after, .downloads a[href$=".pdf"]::before {
    content: "";
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    background: currentColor;
    pointer-events: none;
  }
  #organizations h2::after {
    margin-left: .5rem;
    color: var(--orange);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h17m-7-7 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .downloads a[href$=".pdf"]::before {
    margin-right: .4rem;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .downloads a:focus-visible {background: var(--green); color: white}
  #organizations li:focus-within {box-shadow: -.7rem 0 #f0f3ea, .7rem 0 #f0f3ea}
  #directory:has(.lookup :focus-visible) .notebook svg > path {stroke-dashoffset: 0}
  #directory:has(.lookup :focus-visible) .notebook g {opacity: 1; transform: none}
}
@media (hover:hover) {
  .notebook:hover svg > path {stroke-dashoffset: 0}
  .notebook:hover g {opacity: 1; transform: none}
}
@media screen and (prefers-reduced-motion:no-preference) {
  #organizations li, .downloads a {transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s}
  #organizations h2::after, .downloads a::before {transition: transform .23s ease-out}
  #organizations h2:has(a:focus-visible)::after {transform: translateX(.28rem)}
  .downloads a:focus-visible::before {transform: translateY(2px)}
  .notebook-art {transition: transform .45s cubic-bezier(.2,.8,.25,1.2), filter .4s}
  .notebook svg > path {transition: stroke-dashoffset .25s ease-out}
  .notebook svg > path:nth-child(2) {transition-delay: .12s}
  .notebook svg > path:nth-child(3) {transition-delay: .24s}
  .notebook g {transition: opacity .22s .32s, transform .28s .32s}
  #directory:has(.lookup :focus-visible) .notebook-art {transform: translateY(-4px) rotate(-2deg)}
}
@media screen and (hover:hover) and (prefers-reduced-motion:no-preference) {
  .notebook:hover .notebook-art {
    transform: translateY(-5px) rotate(-3deg) scale(1.025);
    filter: drop-shadow(0 10px 6px #492b101f);
  }
  #organizations h2:hover::after {transform: translateX(.28rem)}
  .downloads a:hover::before {transform: translateY(2px)}
}
@media (max-width: 55rem) {
  .lookup:not([hidden]) {grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: .65rem}
  .lookup .language {grid-column: 1/-1; min-height: 44px}
}
@media (max-width: 43rem) {
  .directory-intro {display: block; padding-block: 1.8rem 1.5rem}
  .directory-intro h1 {font-size: clamp(2.8rem, 10vw, 4rem); line-height: 1}
  .directory-intro h1 em {display: inline}
  .directory-intro p {margin-top: .8rem; max-width: 50ch}
  .notebook {display: none}
  .lookup:not([hidden]) {grid-template-columns: minmax(0, 1fr); padding: 1.1rem 1rem .65rem}
  .results {min-height: 4rem}
  #organizations li:not([hidden]) {display: block; padding: 1.15rem 0}
  .downloads {justify-content: start; margin-top: .85rem}
}
@media print {
  .lookup:not([hidden]), .results button, .notebook {display: none}
  .directory-intro {display: block; padding: 0}
  .directory-intro h1 {font-size: 24pt}
  .directory-intro h1 em {display: inline}
  #organizations li:not([hidden]) {break-inside: avoid; padding: .5rem 0}
  #organizations h2 {font-size: 14pt}
  .downloads a {min-height: 0; border: 0; padding: 0}
}
