/* The Decoder — a library card catalogue (rebuilt 2026-09-29).
   The four categories are oak catalogue drawers with brass label holders and pulls; opening one
   pulls it out full width and its index cards rise out of the tray one after another. Every term is
   a lined index card (red header rule, blue lines, the punched hole at the foot). The "Find a term"
   filter rides along at the top of the cabinet so it is always one tap away; js/glossary-filter.js
   (unchanged) hides non-matching cards and opens the drawers that hold matches. Scoped to body.p-glossary. */

.p-glossary main { overflow-x: clip; }
.p-glossary .gl-open .lede { color: var(--navy); }

.p-glossary { --gl-offset: 200px; }
.p-glossary .gl-cabinet-band { background: var(--cream); padding-block: clamp(36px, 5vw, 64px) clamp(56px, 8vw, 104px); }
.p-glossary .gl-cabinet { max-width: 1120px; }

/* ---------- how to use: a pinned index card ---------- */
.p-glossary .gl-howto { position: relative; max-width: 760px; margin: 0 auto clamp(40px, 5vw, 60px); padding: 34px clamp(20px, 4vw, 40px) 26px; border: 0; border-radius: 4px; rotate: -.6deg;
  background: #fffdf8;
  box-shadow: 0 1px 1px rgba(60, 40, 10, .08), 0 24px 36px -24px rgba(60, 40, 10, .55); }
.p-glossary .gl-howto::before { content: ""; position: absolute; left: 0; right: 0; top: 66px; height: 2px; background: rgba(169, 84, 47, .55); }
.p-glossary .gl-pin { position: absolute; top: -11px; left: 50%; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--brick) 32% 100%); box-shadow: 0 5px 6px -2px rgba(0, 0, 0, .35); }
.p-glossary .gl-howto .callout-title { margin: 0 0 18px; font: 400 26px/1.1 var(--f-hand); color: var(--gold-ink); }
.p-glossary .gl-howto p { font-size: 17px; line-height: 28px; color: var(--text); margin: 0 0 12px; }
.p-glossary .gl-howto p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 16px 0 0; line-height: 1.3; }
.p-glossary .gl-howto p:last-child strong { color: var(--navy); margin-right: 2px; }
.p-glossary .gl-dot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.p-glossary .gl-howto p:last-child a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 15.5px;
  color: var(--navy); background: var(--gold-soft); border: 1.5px solid rgba(122, 91, 19, .25); transition: background .2s, translate .3s var(--spring); }
.p-glossary .gl-howto p:last-child a:hover { background: var(--gold); translate: 0 -2px; }
.p-glossary .gl-howto a:focus-visible, .p-glossary .glossary-term a:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ---------- the cabinet ---------- */
.p-glossary .gl-drawers { position: relative; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; padding: clamp(12px, 2vw, 22px); border-radius: 22px;
  background: linear-gradient(160deg, #a77640, #8d5f2e); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -4px 0 rgba(40, 24, 8, .25), var(--shadow-lift); }
@media (min-width: 760px) { .p-glossary .gl-drawers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-glossary .gl-drawers > :not(details) { grid-column: 1 / -1; }
.p-glossary .gl-drawers .disclosure-tools { margin: 0; justify-content: flex-end; }
.p-glossary .gl-drawers .disclosure-btn { background: rgba(255, 252, 245, .92); border-color: transparent; color: var(--navy); }
.p-glossary .gl-drawers .disclosure-btn:hover { background: var(--paper); color: var(--gold-dark); }

/* the filter: a brass-edged plate that stays in reach while you browse */
.p-glossary .glossary-filter { position: sticky; top: calc(var(--osv-header-h, 78px) + 8px); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 14px; margin: 0; padding: 14px clamp(14px, 2.4vw, 22px); border-radius: 16px;
  background: var(--paper); box-shadow: 0 0 0 3px #d9b56a, 0 0 0 5px #9c7440, 0 14px 22px -12px rgba(40, 24, 8, .55); }
@media (min-width: 760px) { .p-glossary .glossary-filter { grid-template-columns: auto minmax(0, 1fr); align-items: center; } }
.p-glossary .glossary-filter label { margin: 0; font: 600 18px/1.2 var(--f-display); color: var(--navy); }
.p-glossary .glossary-filter input[type="search"] { width: 100%; max-width: none; min-height: 52px; padding: 10px 16px 10px 46px; border: 2px solid rgba(29, 44, 76, .22); border-radius: 12px; background: #fff; font: inherit; font-size: 17.5px; color: var(--navy); }
.p-glossary .glossary-filter input[type="search"]:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--navy); }
.p-glossary .gl-field { position: relative; display: block; }
.p-glossary .gl-search-icon { position: absolute; left: 15px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--muted); pointer-events: none; }
.p-glossary .gl-search-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.p-glossary #glossary-count { grid-column: 1 / -1; margin: 2px 0 0; font-size: 15.5px; font-weight: 700; color: var(--navy); }
.p-glossary #glossary-count:empty { display: none; }

/* each category: an oak drawer with a brass label holder and pull */
.p-glossary details.glossary-group { margin: 0; border: 0; border-radius: 12px; overflow: visible; background: none; box-shadow: none; scroll-margin-top: var(--gl-offset); }
.p-glossary details.glossary-group[open] { grid-column: 1 / -1; }
.p-glossary details.glossary-group > summary { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 124px; padding: 18px 60px 16px; border-radius: 12px;
  background: linear-gradient(180deg, #d7a866, #c18d4c); box-shadow: inset 0 0 0 5px rgba(255, 236, 200, .18), inset 0 0 0 6px rgba(60, 36, 10, .25), 0 6px 10px -6px rgba(40, 24, 8, .6);
  cursor: pointer; transition: box-shadow .3s var(--ease), translate .35s var(--spring); }
.p-glossary details.glossary-group > summary::after { content: "+"; position: absolute; right: 16px; top: 50%; margin-top: -18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--paper); color: var(--gold-dark); font: 600 22px/1 var(--f-display); transform: none; transition: rotate .3s var(--ease); }
.p-glossary details.glossary-group[open] > summary::after { rotate: 45deg; background: var(--gold); color: var(--navy); transform: none; }
.p-glossary details.glossary-group > summary:hover { box-shadow: inset 0 0 0 5px rgba(255, 236, 200, .28), inset 0 0 0 6px rgba(60, 36, 10, .25), 0 10px 16px -8px rgba(40, 24, 8, .7); }
.p-glossary details.glossary-group > summary:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.p-glossary details.glossary-group summary h2 { display: block; margin: 0; padding: 8px 22px; min-width: 200px; text-align: center; border-radius: 4px; font-size: clamp(21px, 2.2vw, 25px); color: var(--navy); scroll-margin-top: var(--gl-offset);
  background: #fffdf5; box-shadow: 0 0 0 3px #d9b56a, 0 0 0 4px #8e6a35, 0 3px 5px 3px rgba(40, 24, 8, .25); }
.p-glossary .gl-pull { display: block; width: 92px; height: 18px; border-radius: 4px 4px 22px 22px; background: linear-gradient(180deg, #f2d48a, #c69a44 55%, #8e6a35); box-shadow: 0 4px 5px -1px rgba(40, 24, 8, .5), inset 0 1px 0 #fff3cf; }

/* the tray of index cards */
.p-glossary details.glossary-group > .accordion-body { margin: 10px 0 0; padding: clamp(16px, 2.4vw, 26px); border-radius: 12px; background: #efe2c2; box-shadow: inset 0 6px 14px -4px rgba(40, 24, 8, .4);
  columns: 2 330px; column-gap: 18px; }
.p-glossary .glossary-term { position: relative; break-inside: avoid; margin: 0 0 18px; padding: 16px 20px 30px; border-radius: 4px; background: #fffdf8;
  box-shadow: 0 1px 1px rgba(60, 40, 10, .1), 0 10px 16px -10px rgba(60, 40, 10, .45); scroll-margin-top: var(--gl-offset); rotate: -.35deg; }
.p-glossary .glossary-term:nth-child(even) { rotate: .4deg; }
.p-glossary .glossary-term[hidden] { display: none; }
.p-glossary .glossary-term::after { /* the catalogue rod hole */ content: ""; position: absolute; left: 50%; bottom: 8px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #efe2c2; box-shadow: inset 0 1px 2px rgba(40, 24, 8, .35); }
.p-glossary .glossary-term h3 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid rgba(169, 84, 47, .55); font-size: clamp(21px, 2vw, 24px); line-height: 1.2; color: var(--navy); scroll-margin-top: var(--gl-offset); }
.p-glossary .glossary-term p { margin: 0; font-size: 16.5px; line-height: 28px; color: var(--text); background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(143, 165, 198, .32) 27px 28px); }
.p-glossary .glossary-term a { font-weight: 800; color: var(--blue-ink); text-decoration: none; }
.p-glossary .glossary-term a:hover { color: var(--navy); }
.p-glossary .glossary-term :target, .p-glossary .glossary-term:target { outline: none; }
.p-glossary .glossary-term:has(:target), .p-glossary .glossary-term:target { box-shadow: 0 0 0 3px var(--gold), 0 10px 16px -10px rgba(60, 40, 10, .45); }

@media (max-width: 520px) {
  .p-glossary details.glossary-group > summary { padding-inline: 18px 58px; min-height: 112px; }
  .p-glossary details.glossary-group summary h2 { min-width: 0; padding-inline: 14px; }
  .p-glossary .gl-drawers { border-radius: 16px; }
}

/* ---------- meaningful movement ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* opening a drawer pulls it toward you and the cards rise out of the tray one after another */
  @keyframes gl-pull { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(4px) scale(1.012); } 100% { transform: none; } }
  .p-glossary details.glossary-group[open] > summary { animation: gl-pull .45s var(--ease); }
  .p-glossary details.glossary-group > summary:hover .gl-pull { translate: 0 2px; }
  .p-glossary .gl-pull { transition: translate .3s var(--spring); }
  @keyframes gl-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  .p-glossary details.glossary-group[open] .glossary-term { animation: gl-rise .5s var(--ease) both; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(2) { animation-delay: .04s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(3) { animation-delay: .08s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(4) { animation-delay: .12s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(5) { animation-delay: .16s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(6) { animation-delay: .2s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(7) { animation-delay: .24s; }
  .p-glossary details.glossary-group[open] .glossary-term:nth-child(n+8) { animation-delay: .28s; }
  /* the how-to card is pinned up first */
  @keyframes gl-pinned { 0% { transform: translateY(-14px) rotate(-3deg); opacity: 0; } 60% { transform: rotate(1deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
  .p-glossary .gl-howto { transform-origin: 50% 0; animation: gl-pinned .9s .15s var(--ease) both; }
  .p-glossary .glossary-term { transition: rotate .35s var(--spring), translate .35s var(--spring); }
  .p-glossary .glossary-term:hover { rotate: 0deg; translate: 0 -3px; }
}
@media (max-width: 759px) { .p-glossary { --gl-offset: 230px; } .p-glossary .glossary-filter label { font-size: 16px; } .p-glossary .glossary-filter { padding-block: 10px 12px; } .p-glossary .glossary-filter input[type="search"] { min-height: 48px; } }
@media print {
  .p-glossary .gl-drawers { background: none; box-shadow: none; padding: 0; }
  .p-glossary .glossary-filter, .p-glossary .gl-pull { display: none; }
  .p-glossary details.glossary-group > summary { background: none; box-shadow: none; min-height: 0; }
  .p-glossary details.glossary-group > .accordion-body { background: none; box-shadow: none; }
}
