/* ===================== Library card catalogue =====================
   Scoped under .lsi-cat. Ported from the working reference build; the fonts
   and this file load through widgets/card-catalogue-head.html.

   Colours: layouts/base.html declares three global variables, used below. The
   rest of the palette exists only in its Tailwind config, which is not a CSS
   variable, so those stay literal here under their palette names, the way
   demo-embed.css keeps them. */
.lsi-cat{
  --cream-50:#faf5ea; --cream-200:#e8dcc0;
  --ink-900:var(--laesi-ink); --ink-800:#25211b; --ink-700:#3a342b; --ink-600:#5a5248;
  --ember-500:var(--laesi-ember); --ember-600:#bf5630; --ember-700:#9c4323;
  --rule:#c9b98f; --card-edge:rgba(22,19,15,.16);
  --stamp-reviewed:#4f3f7a; --stamp-spot:#b5482f; --stamp-pipeline:var(--ink-600);
  --face-card:'Courier Prime','Courier New',monospace;
  --face-mono:'JetBrains Mono',ui-monospace,monospace;
  --face-serif:Lora,Georgia,serif;
  --tab:44px;            /* visible strip of each card behind the front one */
  --card-h:360px;        /* a card is at least this tall */
  font-family:Inter,system-ui,sans-serif; color:var(--ink-900);
}
.lsi-cat *,.lsi-cat *::before,.lsi-cat *::after{box-sizing:border-box}
.lsi-cat .lsi-vh{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.lsi-cat :focus-visible{outline:3px solid var(--ember-600);outline-offset:3px}

/* ---- controls (shown by script only) ---- */
.lsi-cat-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:26px}
.lsi-cat-controls[hidden]{display:none}
.lsi-cat-label{font-family:var(--face-mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-600)}
.lsi-cat-q{flex:1 1 260px;min-width:0;min-height:44px;padding:0 14px;border-radius:8px;border:1px solid var(--rule);background:var(--cream-50);font-family:var(--face-card);font-size:16px;color:var(--ink-900)}
.lsi-cat-langs{display:flex;flex-wrap:wrap;gap:6px}
.lsi-cat-langs button{min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--rule);background:var(--cream-50);color:var(--ink-700);font-family:var(--face-mono);font-size:12px;cursor:pointer}
.lsi-cat-langs button[aria-pressed="true"]{background:var(--ink-900);border-color:var(--ink-900);color:var(--cream-50)}

/* ---- layout ---- */
.lsi-cat-body{display:flex;flex-wrap:wrap;align-items:flex-start;gap:40px 56px}
.lsi-cat-drawer{flex:999 1 520px;min-width:0;position:relative}

/* ---- the cards: a plain list without script ---- */
.lsi-cat-cards{list-style:none;margin:0;padding:0 8px;display:flex;flex-direction:column;gap:20px;isolation:isolate}
.lsi-cat-slot{position:relative;margin:0}
.lsi-card{position:relative;min-height:var(--card-h);padding:13px 24px 66px 20px;border-radius:4px 4px 0 0;
  background:#fbf6e8;border:1px solid var(--card-edge);box-shadow:0 -3px 8px -3px rgba(22,19,15,.22);
  font-family:var(--face-card);font-size:14px;line-height:20px;color:var(--ink-800)}
.lsi-cat-slot:nth-child(3n+1) .lsi-card{background:#f9f2df}
.lsi-cat-slot:nth-child(3n) .lsi-card{background:#f6efdc}
.lsi-card:focus{outline:none}
:where(.lsi-card) :where(p,h2,h3){margin:0;font:inherit;color:inherit}
.lsi-card-grid{display:grid;grid-template-columns:104px minmax(0,1fr);column-gap:10px}
.lsi-card-lang{font-size:12px;color:var(--stamp-spot)}
.lsi-card-text>*{text-indent:3ch}
.lsi-card-text>.lsi-card-author{text-indent:0}
.lsi-card-gap{margin-top:8px!important}
.lsi-card-credit{font-size:12px;line-height:18px;color:var(--ink-600)}
.lsi-card-callno span{display:block}
.lsi-card-foot{position:absolute;left:20px;right:24px;bottom:26px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.lsi-card-open{padding:8px 0;color:var(--ember-700);text-decoration:underline} /* Tailwind's reset strips the default */
.lsi-card-open:hover{color:var(--ink-900)}
.lsi-card-hole{position:absolute;left:50%;top:50%;width:15px;height:15px;margin:-8px 0 0 -8px;border-radius:50%;background:var(--ink-700);box-shadow:inset 0 2px 3px rgba(0,0,0,.5)}
.lsi-stamp{margin:0!important;padding:1px 10px;border:2px solid currentColor;border-radius:4px;white-space:nowrap;
  font-family:var(--face-mono);font-weight:600;font-size:12px;line-height:20px;letter-spacing:.14em;text-transform:uppercase;transform:rotate(-6deg);opacity:.85}
.lsi-stamp--reviewed{color:var(--stamp-reviewed)}
.lsi-stamp--spot{color:var(--stamp-spot)}
.lsi-stamp--pipeline{color:var(--stamp-pipeline)}
.lsi-card-pick{position:absolute;left:0;right:0;top:0;height:var(--tab);margin:0;padding:0;border:0;background:transparent;cursor:pointer;z-index:3}
.lsi-card-pick[hidden]{display:none}
.lsi-card-pick:focus-visible{outline-offset:-3px}

/* ---- with script: one stack, the picked card in front ----
   Script sets --pos and --rest so that every shown slot's margin plus padding
   comes to the same total. All the cards then take the tallest card's height,
   and the stack stays that tall whichever card is in front, so picking one
   moves nothing below the catalogue. Filtering removes cards, and the stack
   shrinks with them. */
.lsi-cat--js .lsi-cat-cards{display:grid;gap:0}
.lsi-cat--js .lsi-cat-cards::before{content:attr(data-guide);grid-area:1/1;height:var(--card-h);padding:12px 20px;border-radius:4px 4px 0 0;
  background:var(--cream-200);border:1px solid var(--card-edge);font-family:var(--face-mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-700)}
.lsi-cat--js .lsi-cat-slot{grid-area:1/1;display:flex;margin-top:calc(var(--tab) * var(--pos,1));padding-bottom:calc(var(--tab) * var(--rest,0));z-index:var(--pos,1);transition:margin-top .25s ease,padding-bottom .25s ease}
.lsi-cat--js .lsi-cat-slot.is-out{display:none}
.lsi-cat--js .lsi-card{flex:1 1 100%;min-width:0}
.lsi-cat-empty{margin:0}
.lsi-cat--js .lsi-cat-empty{position:absolute;top:var(--tab);left:8px;right:8px;z-index:2;min-height:200px;padding:20px 24px;border-radius:4px 4px 0 0;
  background:var(--cream-50);border:1px solid var(--card-edge);font-family:var(--face-card);font-size:15px;line-height:22px;color:var(--ink-700)}
.lsi-cat-empty[hidden]{display:none}

/* ---- drawer lip ---- */
.lsi-cat-lip{position:relative;z-index:1;margin-top:-24px;height:56px;border-radius:4px;background-color:var(--ink-700);
  background-image:linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,.16) 3px,rgba(0,0,0,0) 3px,rgba(0,0,0,.3) 100%);
  box-shadow:0 10px 18px -12px rgba(22,19,15,.6);display:flex;align-items:center;justify-content:center;gap:20px}
.lsi-cat-lip-label{padding:3px 12px;border-radius:3px;background:var(--cream-50);border:2px solid #a8864f;font-family:var(--face-mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-900)}
.lsi-cat-lip-pull{width:40px;height:12px;border-radius:6px;background:linear-gradient(180deg,#e0bd75,#8a6a34);box-shadow:0 2px 3px rgba(0,0,0,.45)}

/* ---- the cover beside the drawer ---- */
.lsi-cat-shelf{flex:1 1 300px;min-width:0;max-width:420px;display:flex;flex-direction:column;gap:18px}
.lsi-cat-shelf-label{margin:0;font-family:var(--face-mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-600)}
.lsi-covers{position:relative;width:100%;max-width:330px;aspect-ratio:320/440;margin:0 auto;container-type:inline-size}
.lsi-cover{position:absolute;inset:0;pointer-events:none;opacity:0;visibility:hidden;transform:translateY(14px) rotate(-1.5deg);
  transition:opacity .55s ease,transform .55s ease,visibility 0s linear .55s;filter:drop-shadow(0 18px 18px rgba(22,19,15,.32))}
.lsi-cover.is-front{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.lsi-cover svg{display:block;width:100%;height:100%}
.lsi-cover-text{position:absolute;display:flex;flex-direction:column;align-items:center;text-align:center}
.lsi-cover-text>span,.lsi-cover-title>span{display:block}

/* cloth: gilt capitals in a frame (Nils) */
.lsi-cover-text--cloth{inset:0 10% 0 12%;color:#dcb86e;font-family:var(--face-serif);text-transform:uppercase;text-shadow:0 1px 0 rgba(0,0,0,.35)}
.lsi-cover-text--cloth>span{position:absolute;left:0;right:0}
.lsi-cover-text--cloth .lsi-cover-title{top:19.5%;font-weight:600;font-size:4.6cqw;line-height:1.3;letter-spacing:.08em}
.lsi-cover-text--cloth .lsi-cover-author{top:47%;font-size:3.5cqw;letter-spacing:.22em}
.lsi-cover-text--cloth .lsi-cover-year{top:82%;font-size:3.4cqw;letter-spacing:.3em}

/* half-leather: Fraktur on the red label (Ut de Franzosentid) */
.lsi-cover-text--half-leather{left:33.75%;width:51.875%;top:27.73%;height:30%;justify-content:center;gap:1.2cqw;color:#e3c47c;
  font-family:'UnifrakturMaguntia','Old English Text MT',serif;text-shadow:0 1px 0 rgba(0,0,0,.4)}
.lsi-cover-text--half-leather .lsi-cover-author{font-size:4.4cqw}
.lsi-cover-text--half-leather .lsi-cover-title{font-size:7.2cqw;line-height:1.05}

/* woodcut boards: printed title over the vignette (Hemsöborna) */
.lsi-cover-text--woodcut{left:12%;right:4%;top:7.5%;bottom:9%;color:#1b1814;font-family:'IM Fell English',Georgia,serif}
.lsi-cover-text--woodcut .lsi-cover-author{font-size:5cqw;letter-spacing:.02em}
.lsi-cover-text--woodcut .lsi-cover-title{margin-top:.5cqw;font-size:10.5cqw;letter-spacing:.08em;line-height:1.15}
.lsi-cover-text--woodcut .lsi-cover-year{margin-top:auto;font-size:3.6cqw;letter-spacing:.3em}

/* wrapper: Fraktur printed on a plain paper wrapper (Den lille Havfrue) */
.lsi-cover-text--wrapper{left:13.5%;right:8.5%;top:9.5%;bottom:8.5%;color:#20262e;font-family:'UnifrakturMaguntia','Old English Text MT',serif}
.lsi-cover-text--wrapper .lsi-cover-author{font-size:5.4cqw}
.lsi-cover-text--wrapper .lsi-cover-title{margin-top:2cqw;font-size:13.5cqw;line-height:1.02}
.lsi-cover-text--wrapper .lsi-cover-year{margin-top:auto;font-family:'IM Fell English',Georgia,serif;font-size:3.8cqw;letter-spacing:.3em}

/* sheet: the half sheet itself, printed in two colours and written on (Ett halvt ark papper) */
.lsi-cover-text--sheet{left:12.5%;right:12.5%;top:8.4%;bottom:8.5%;color:#2a2018;font-family:'Libre Baskerville',Baskerville,'Baskerville Old Face',Georgia,serif}
.lsi-cover-text--sheet .lsi-cover-author{font-size:2.9cqw;letter-spacing:.2em;text-transform:uppercase}
.lsi-cover-text--sheet .lsi-cover-title{margin-top:2.2cqw;color:#7a2418;font-weight:700;font-size:7.8cqw;line-height:1.18;letter-spacing:.03em;text-transform:uppercase}
.lsi-cover-text--sheet .lsi-cover-year{margin-top:1.4cqw;font-size:2.9cqw;letter-spacing:.3em}

/* gilt-title: book cloth lettered like an 1820s title page, with one stamped ornament */
.lsi-cover-text--gilt-title{inset:0 8.9% 0 12%;color:#d2b05c;font-family:'Libre Baskerville',Baskerville,'Baskerville Old Face',Georgia,serif;text-transform:uppercase;text-shadow:0 1px 0 rgba(0,0,0,.35)}
.lsi-cover-text--gilt-title>span{position:absolute;left:0;right:0}
.lsi-cover-text--gilt-title .lsi-cover-title{top:12.6%;font-size:7.6cqw;line-height:1.3;letter-spacing:.14em;text-indent:.14em}
.lsi-cover-text--gilt-title .lsi-cover-author{top:30.6%;font-style:italic;font-size:3.5cqw;letter-spacing:.17em;text-indent:.17em}
.lsi-cover-text--gilt-title .lsi-cover-year{top:83.4%;font-size:3.5cqw;letter-spacing:.3em;text-indent:.3em}

/* silhouette: a paper wrapper printed in black and red, the title in Fraktur over a cut silhouette */
.lsi-cover-text--silhouette{left:12.5%;right:12.5%;top:8.8%;bottom:8.6%;color:#1f1a16;font-family:'IM Fell English',Georgia,serif}
.lsi-cover-text--silhouette .lsi-cover-author{font-size:2.9cqw;letter-spacing:.1em;text-transform:uppercase}
.lsi-cover-text--silhouette .lsi-cover-title{margin-top:.8cqw}
.lsi-cover-text--silhouette .lsi-cover-title>span:first-child{font-family:'UnifrakturMaguntia','Old English Text MT',serif;font-size:17cqw;line-height:1.04}
.lsi-cover-text--silhouette .lsi-cover-title>span:last-child{margin-top:.4cqw;color:#9b2b1c;font-size:4.5cqw;line-height:1.2;letter-spacing:.05em}
.lsi-cover-text--silhouette .lsi-cover-year{margin-top:auto;font-size:3.6cqw;letter-spacing:.3em}

/* label: red lettering on a pasted paper label (Der Prozess) */
.lsi-cover-text--label{inset:0 31.25% 0 33.75%;color:#b4382c;font-family:var(--face-serif);font-style:italic}
.lsi-cover-text--label>span{position:absolute;left:0;right:0}
.lsi-cover-text--label .lsi-cover-author{top:25.4%;font-size:5.2cqw;line-height:1.2}
.lsi-cover-text--label .lsi-cover-title{top:35.6%;font-size:9cqw;line-height:1.08}
.lsi-cover-text--label .lsi-cover-year{top:82%;font-size:3.4cqw;letter-spacing:.3em}

/* broadside: a pictured paper wrapper in black and red (Die Verwandlung, after the 1916 cover) */
.lsi-cover-text--broadside{left:10%;right:9.5%;top:9.4%;bottom:16.2%;color:#2a221b;font-family:'IM Fell English',Georgia,serif}
.lsi-cover-text--broadside .lsi-cover-author{font-size:3.8cqw;letter-spacing:.24em;text-indent:.24em;text-transform:uppercase}
.lsi-cover-text--broadside .lsi-cover-title{margin-top:3cqw;color:#a03a23;font-size:6.6cqw;line-height:1.1;letter-spacing:.03em;text-transform:uppercase}
.lsi-cover-text--broadside .lsi-cover-year{margin-top:auto;font-size:3.6cqw;letter-spacing:.5em;text-indent:.5em}

/* pictorial: a chequered frame around an illustrated panel */
.lsi-cover-text--pictorial{left:15%;right:16.25%;top:0;bottom:0;color:#1c1a16;font-family:'IM Fell English',Georgia,serif}
.lsi-cover-text--pictorial>span{position:absolute;left:0;right:0}
.lsi-cover-text--pictorial .lsi-cover-title{top:8.18%;height:21.36%;display:flex;flex-direction:column;justify-content:center;font-size:10.4cqw;line-height:1.06}
.lsi-cover-text--pictorial .lsi-cover-author{top:78%;font-size:4.2cqw}
.lsi-cover-text--pictorial .lsi-cover-year{top:83.8%;font-size:3.6cqw;letter-spacing:.3em;text-indent:.3em}

/* episodios: the 1901 wrapper of the Episodios Nacionales, red and yellow, in spaced Didone-like capitals (Zaragoza) */
.lsi-cover-text--episodios{inset:0 12.5% 0 7.5%;color:#1d1a17;font-family:'Libre Baskerville',Baskerville,'Baskerville Old Face',Georgia,serif;text-transform:uppercase}
.lsi-cover-text--episodios>span{position:absolute;left:0;right:0}
.lsi-cover-text--episodios .lsi-cover-author{top:6.6%;font-size:4.3cqw;letter-spacing:.08em;text-indent:.08em}
.lsi-cover-text--episodios .lsi-cover-title{top:21.6%;font-size:10.4cqw;line-height:1;letter-spacing:.13em;text-indent:.13em}
.lsi-cover-text--episodios .lsi-cover-year{top:89.2%;font-size:4cqw;letter-spacing:.3em;text-indent:.3em}

.lsi-cat-current-wrap{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.lsi-cat-current-wrap[hidden]{display:none}
.lsi-cat--js .lsi-cat-current-wrap[hidden]{display:flex;visibility:hidden} /* keeps its height in the empty state */
.lsi-cat-current{margin:0;min-height:3em;font-family:var(--face-serif);font-size:17px;line-height:1.5;color:var(--ink-700)} /* two lines, for the longest title */
.lsi-cat-current-title{font-style:italic}
.lsi-cat-current-call{font-family:var(--face-mono);font-size:13px;color:var(--ink-600)}
.lsi-cat-checkout{display:inline-flex;align-items:center;min-height:48px;padding:0 22px;border-radius:10px;background:var(--ember-500);color:var(--ink-900);
  font-family:var(--face-mono);font-size:14px;font-weight:600;text-decoration:none}
.lsi-cat-checkout:hover{filter:brightness(1.08)}

/* ---- the stamps and their definitions, on the /library/ page ---- */
.lsi-cat-stamps{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:28px;margin:0}
.lsi-cat-stamps .lsi-stamp{display:inline-block}
.lsi-cat-stamps dd{margin:14px 0 0;font-family:var(--face-serif);font-size:16px;line-height:1.6;color:var(--ink-700)}

/* ---- one card on its own, under the home page's demo: no stack, no drawer ---- */
.lsi-cat--single .lsi-card{min-height:0;border-radius:4px;background:#fbf7ec;box-shadow:0 1px 0 rgba(22,19,15,.05),0 18px 30px -22px rgba(22,19,15,.55);transform:rotate(-.6deg)}
.lsi-cat--single .lsi-card-hole{background:var(--cream-200);box-shadow:inset 0 2px 3px rgba(22,19,15,.35)}

/* ---- phones: call number on one line above the text, footer in flow ---- */
@media (max-width:560px){
  .lsi-cat-cards{padding:0 4px}
  .lsi-card{padding:12px 14px 34px} /* clears the lip, which overlaps the card by 24px */
  .lsi-cat--single .lsi-card{padding-bottom:18px} /* no lip to clear */
  .lsi-card-grid{grid-template-columns:1fr;row-gap:4px}
  .lsi-card-call{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px}
  .lsi-card-callno span{display:inline}
  .lsi-card-foot{position:static;margin-top:18px}
  .lsi-card-hole{display:none}
  /* A card shorter than the tallest keeps its footer at the bottom. */
  .lsi-cat--js .lsi-card{display:flex;flex-direction:column}
  .lsi-cat--js .lsi-card-foot{margin-top:auto;padding-top:18px}
  .lsi-cat-lip-label{font-size:10px;letter-spacing:.08em}
  .lsi-cat--js .lsi-cat-empty{left:4px;right:4px}
}

@media (prefers-reduced-motion:reduce){
  .lsi-cat--js .lsi-cat-slot,.lsi-cover{transition:none}
}

/* half-leather-picture: the half-leather binding with a painting for the board,
   the title over its top and the author over its foot (the Hauff books) */
.lsi-cover-text--half-leather-picture{inset:0 6.9% 0 26.9%;color:#e8cd85;font-family:'UnifrakturMaguntia','Old English Text MT',serif;text-shadow:0 1px 2px rgba(0,0,0,.75)}
.lsi-cover-text--half-leather-picture>span{position:absolute;left:0;right:0}
.lsi-cover-text--half-leather-picture .lsi-cover-title{top:6.6%;font-size:7.6cqw;line-height:1.08}
.lsi-cover-text--half-leather-picture .lsi-cover-author{bottom:6.4%;font-size:4.6cqw}
