/* ==========================================================================
   Theme „mitzscherling“ – Privatbibliothek
   Leitlinien: Apple Human Interface Guidelines (Klarheit, Zurückhaltung, Tiefe)
   ========================================================================== */

/* ---------- Schrift: Hoefler Text (wie Projekt „website“; Web-Lizenz liegt beim Betreiber) · Inter (SIL OFL) ---------- */
@font-face { font-family: "HoeflerText"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/hoeflertext-regular.woff2") format("woff2"); }
@font-face { font-family: "HoeflerText"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/hoeflertext-italic.woff2") format("woff2"); }
@font-face { font-family: "HoeflerText"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/hoeflertext-black.woff2") format("woff2"); }
@font-face { font-family: "HoeflerText"; font-style: italic; font-weight: 900; font-display: swap; src: url("../fonts/hoeflertext-blackitalic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --font-serif: "HoeflerText", "Hoefler Text", "Iowan Old Style", Georgia, serif;
  --serif-bold: 900;           /* Hoefler Text Black */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Papier – Hintergründe (HIG: system / secondary / grouped) */
  --bg: #FFFCF0;
  --bg-elevated: #FFFEF8;
  --bg-sunken: #F8F5EA;
  --material: rgba(255, 252, 240, .82);
  --fill: rgba(24, 24, 24, .05);
  --fill-strong: rgba(24, 24, 24, .09);
  --separator: rgba(24, 24, 24, .10);
  --separator-strong: rgba(24, 24, 24, .18);

  /* Tinte – drei Textrollen */
  --label: #000000;
  --label-2: rgba(24, 24, 24, .64);
  --label-3: rgba(24, 24, 24, .44);

  /* Hauptaktion in Tinte; einziger Farbakzent: Lampenlicht (Bernstein), selten eingesetzt */
  --ink: #000000;
  --on-ink: #FFFCF0;

  /* website-svelte: Slider-/Knopf-Fläche, Daumen, inaktiver Text, feine Linien */
  --track: #E2DFD0;

  /* Akzent: Lindgrün. 4,7 : 1 mit #FFFCF0.
     Alternative warmes Orange: --accent: #B9520F; --accent-hover: #A84A0B; (dunkel: #F0954A / #F5A866) */
  --accent: #4F7D2F;
  --accent-hover: #42692A;
  --on-accent: #FFFCF0;
  --thumb: #FFFCF0;
  --muted: #71717A;          /* zinc-500 */
  --hairline: rgba(15, 23, 42, .16);
  --focus-ring: rgb(99, 102, 241);
  --tint: #8F5410;          /* 5,9 : 1 auf #FFFCF0 */
  --tint-hover: #6E400B;
  --focus: rgba(99, 102, 241, .55);

  /* Bedeutungsfarben, gedämpft (nur als Punkt in Etiketten) */
  --red: #C4161C; --orange: #B84E00; --yellow: #8F6A00; --green: #1F7A35;
  --teal: #0F6E7A; --blue: #1D5FC2; --purple: #7B3FA6; --gray: #6B6558;

  /* Radien nach Größe (Steuerelemente 8, Karten 14, Panels 16) */
  --radius-s: 4px; --radius-m: 8px; --radius-l: 14px; --radius-xl: 16px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .05);   /* shadow-xs */
  --shadow-2: 0 2px 8px rgba(24, 24, 24, .06), 0 1px 2px rgba(24, 24, 24, .04);
  --shadow-3: 0 12px 32px rgba(24, 24, 24, .14);

  --tap: 44px;               /* HIG: minimale Trefferfläche */
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 46rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0D;
    --bg-elevated: #161618;
    --bg-sunken: #070708;
    --material: rgba(11, 11, 13, .82);
    --fill: rgba(255, 252, 240, .06);
    --fill-strong: rgba(255, 252, 240, .10);
    --separator: rgba(255, 252, 240, .10);
    --separator-strong: rgba(255, 252, 240, .18);
    --label: #FFFCF0;
    --label-2: rgba(243, 239, 228, .66);
    --label-3: rgba(243, 239, 228, .44);
    --ink: #FFFCF0;
    --on-ink: #0B0B0D;
    --track: #71717A;
    --accent: #9BCB6B;
    --accent-hover: #B0D88A;
    --on-accent: #0B0B0D;
    --thumb: #0B0B0D;
    --muted: #27272A;
    --hairline: rgba(255, 255, 255, .5);
    --tint: #E0A75A;
    --tint-hover: #EDBE7C;
    --focus: rgba(129, 140, 248, .6);
    --red: #FF6961; --orange: #FFA94D; --yellow: #FFD60A; --green: #4CD964;
    --teal: #5AD8E6; --blue: #6AA9FF; --purple: #D08CFF; --gray: #B5AE9F;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hairline); transition: border-color 160ms ease, transform 160ms ease; }
a:hover { color: inherit; text-decoration: none; border-bottom-color: currentColor; }
/* Bedienelemente und Karten sind Links ohne Unterlinie */
.toolbar a, .menu a, .shortcuts a, .card a, .tile, .title-row, .shelf__row, .back-button, .pill, .btn-primary, .btn-secondary, .logo, .pagingList a, .inline-link, .crumbs a, .tags a, .detail__author a, .home__caption a, .core-content a.btn { border-bottom: 0; }
.prose a:hover, .facts a:not(.inline-link):not(.badge):hover, .core-content a:not(.btn):hover { transform: translateY(-1px); display: inline-block; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: var(--serif-bold); color: var(--label); line-height: 1.15; margin: 0; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--separator); margin: 16px 0; }
:focus-visible { outline: 3px solid var(--focus-ring, var(--focus)); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -4rem; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 8px 16px; border-radius: var(--radius-m); }
.skip-link:focus { top: 16px; color: var(--on-ink); }
.muted { color: var(--label-2); }
.lead { font-size: 1.125rem; color: var(--label-2); }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; stroke-width: 1.5; }

/* ---------- Bedienelemente ---------- */
.btn-primary, .btn-secondary, .pill, .link-button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: var(--tap); padding: 0 16px;
  font: 500 .875rem/1 var(--font-ui);
  border-radius: var(--radius-m); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent) !important; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary, .pill { background: transparent; border-color: var(--separator-strong); color: var(--label); }
.btn-secondary:hover, .pill:hover { background: var(--fill); color: var(--label); text-decoration: none; }
.pill.is-on { border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green); }
.btn-primary:active, .btn-secondary:active, .pill:active, .icon-button:active { transform: scale(.97); }
.link-button { background: none; color: var(--label-2); padding: 0 12px; }
.link-button:hover { background: var(--fill); color: var(--label); }
.icon-button { width: var(--tap); padding: 0; background: none; color: var(--label-2); }
.icon-button:hover { background: var(--fill); color: var(--label); }

input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], select, textarea {
  font: inherit; color: var(--label);
  background: var(--bg-elevated);
  border: 1px solid var(--separator-strong); border-radius: var(--radius-m);
  min-height: var(--tap); padding: 8px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.15rem; height: 1.15rem; }

/* ---------- Badges (Standort, Status, Auszeichnung) ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  --c: var(--gray);
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px; border-radius: 6px;
  font: 500 .75rem/1 var(--font-ui); color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge--red { --c: var(--red); } .badge--orange { --c: var(--orange); } .badge--yellow { --c: var(--yellow); }
.badge--green { --c: var(--green); } .badge--teal { --c: var(--teal); } .badge--blue { --c: var(--blue); }
.badge--purple { --c: var(--purple); } .badge--gray { --c: var(--gray); }
a.badge--link { border-bottom: 1px solid color-mix(in srgb, var(--c) 45%, transparent); transition: background-color .15s var(--ease); }
a.badge--link:hover { color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }

/* Signatur-Detail: die Signatur als Rückenschild, so wie sie auf dem Buch klebt */
.callnumber {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  font: 500 .8125rem/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .01em;
  color: var(--label); background: var(--bg-elevated);
  border: 1px solid var(--separator-strong); border-radius: 4px;
  box-shadow: inset 0 -1px 0 var(--separator); white-space: nowrap;
}

/* ---------- Logo ---------- */
.logo { display: inline-block; line-height: 0; }
.logo img { width: 100%; height: auto; }
.logo--hero { width: min(480px, 88vw); }

/* ---------- Werkzeugleiste & Menüs ---------- */
.toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar__item {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 12px; border-radius: var(--radius-m);
  color: var(--label-2); font: 400 .875rem/1 var(--font-ui); cursor: pointer; list-style: none; text-decoration: none;
}
.toolbar__item::-webkit-details-marker { display: none; }
.toolbar__item:hover { background: var(--fill); color: var(--label); text-decoration: none; }
.toolbar__item.is-active { color: var(--label); background: var(--fill-strong); }
.toolbar__count {
  position: absolute; top: 4px; left: 22px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--on-accent); font: 500 .6875rem/18px var(--font-ui); text-align: center; font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) { .toolbar__item > span:not(.toolbar__count) { display: none; } .toolbar__item { padding: 0 12px; } }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 13rem; padding: 4px;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--separator); border-radius: 12px; box-shadow: var(--shadow-3);
  animation: pop .16s var(--ease);
}
.menu__panel a, .menu__panel button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--label); font: 400 .875rem/1.2 var(--font-ui); text-align: left; cursor: pointer; text-decoration: none;
}
.menu__panel a:hover, .menu__panel button:hover { background: var(--fill-strong); color: var(--label); }
.menu__panel .icon { color: var(--label-2); }
.menu__panel hr { margin: 4px 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Menü oben rechts (alle Seiten gleich, ohne Leiste) ---------- */
.topbar { display: flex; align-items: center; gap: 24px; width: 100%; padding: 20px var(--gutter) 0; padding-top: max(20px, env(safe-area-inset-top)); }
.topbar .toolbar { margin-left: auto; min-height: 44px; }   /* gleiche Zeilenhöhe wie der Suchschlitz → Menü überall auf derselben Höhe */
.topbar .topbar__back { flex: none; margin: 0; }
/* Trefferliste: Startseite · Suchschlitz · Menü in einer Zeile */
.topbar__search { flex: 1 1 auto; min-width: 0; max-width: 616px; }
.topbar__search + .toolbar { flex: none; }

/* ---------- Startseite: Maße der DuckDuckGo-Startseite ---------- */
.home {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px var(--gutter) 120px; text-align: center;
}
.home .logo--hero { margin-bottom: 40px; }
.home__caption { margin-top: 64px; font-family: var(--font-serif); font-size: 1.0625rem; color: var(--label); }
.home__caption a { color: var(--label); font-style: italic; text-decoration: none; }
.home__caption a:hover { text-decoration: underline; }

/* Kurzlinks am Seitenende (wie „KI-Einstellungen“ bei DuckDuckGo) */
.shortcuts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom));
}
.shortcuts a, .shortcuts button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--track); color: var(--label); box-shadow: var(--shadow-1);
  font: 500 .8125rem/1 var(--font-ui); cursor: pointer; text-decoration: none;
  transition: background-color .15s var(--ease);
}
.shortcuts a:hover, .shortcuts button:hover { background: var(--track); opacity: .6; color: var(--label); text-decoration: none; }
.shortcuts .icon { width: 16px; height: 16px; }

/* ---------- Suche: Umschalter über rundem Feld ---------- */
.search { display: block; width: 100%; }
.search--hero { max-width: 616px; }
/* Suchbereich als Auswahl links im Schlitz */
.search .search__scope {
  flex: none; height: 32px; min-height: 0; max-width: 10rem; margin-left: 6px; padding: 0 28px 0 10px;
  border: 0; border-radius: 6px; background-color: transparent; box-shadow: none !important;
  color: var(--label-2); font: 500 .8125rem/1 var(--font-ui); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  transition: background-color .15s ease, color .15s ease;
}
.search .search__scope:hover, .search .search__scope:focus { background-color: var(--track); color: var(--label); }
.search .search__scope + label + .search__input { border-left: 1px solid var(--separator) !important; margin-left: 4px; padding-left: 16px; }

.search__field {
  display: flex; align-items: center; width: 100%; height: 48px;
  background: var(--bg-elevated); border: 1px solid var(--separator-strong); border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.search__field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search .search__input {
  flex: 1; min-width: 0; height: 100%; border: 0 !important; box-shadow: none !important; background: transparent;
  padding: 0 8px 0 20px; color: var(--label); font: 400 1rem/1 var(--font-ui);
}
.search .search__input:focus { box-shadow: none; outline: none; }
.search .search__input::placeholder { color: var(--label-3); }
.search__submit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-right: 6px; border: 0; border-radius: 6px;
  background: none; color: var(--label-2); cursor: pointer;
}
.search__submit:hover { background: var(--fill); color: var(--label); }
.search--compact .search__field { height: 44px; }

.main { flex: 1; width: 100%; max-width: 76rem; margin: 0 auto; padding: 32px var(--gutter) 64px; }

/* ---------- Seitenkopf & Text ---------- */
.page-head { margin: 8px 0 28px; max-width: var(--measure); }
.page-head h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); display: flex; align-items: center; gap: 12px; }
.page-head h1 .icon { color: var(--accent); width: 28px; height: 28px; }
.page-head .lead { margin-top: 8px; }
.page-head--center { text-align: center; margin-left: auto; margin-right: auto; }
.page-head--center h1 { justify-content: center; }
.prose { max-width: var(--measure); font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.6; }
.prose h2, .prose h3 { margin: 1.5em 0 .5em; }
.crumbs { margin-bottom: 12px; font-size: .875rem; }
.crumbs a { color: var(--label-2); text-decoration: none; }
.crumbs a::before { content: "‹ "; }

/* ---------- Trefferliste ---------- */
.results { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .results { grid-template-columns: 1fr; gap: 16px; } }
.results__facets { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding-right: 4px; }
@media (max-width: 900px) { .results__facets { position: static; max-height: none; } }
.facets-wrap > summary {
  display: none; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--radius-m); border: 1px solid var(--separator-strong); font: 500 .875rem/1 var(--font-ui); cursor: pointer; list-style: none; width: max-content;
}
.facets-wrap > summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .facets-wrap > summary { display: inline-flex; } .facets-wrap[open] > summary { margin-bottom: 12px; } }
@media (min-width: 901px) { .facets-wrap > :not(summary) { display: block !important; } }

.facets { font-size: .9375rem; }
.facet { border-bottom: 1px solid var(--separator); }
.facet > summary {
  display: flex; justify-content: space-between; align-items: center; min-height: var(--tap);
  font: 500 .8125rem/1 var(--font-ui); color: var(--label-2);
  cursor: pointer; list-style: none;
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 1.6px solid var(--label-3); border-bottom: 1.6px solid var(--label-3); transform: rotate(-45deg); transition: transform .2s var(--ease); }
.facet[open] > summary::after { transform: rotate(45deg); }
.facet-body { padding: 0 0 12px; }
.facet-option, .facet-toggle { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; cursor: pointer; color: var(--label); font-size: .875rem; }
.facet-option span { flex: 1; }
.facet-toggle { margin-bottom: 4px; color: var(--label-2); }
.facet-more { border: 0; background: none; color: var(--label-2); padding: 4px 0; font: inherit; font-size: .875rem; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--separator-strong); cursor: pointer; }
.facet-apply { width: 100%; margin-top: 16px; }
.facet-body .irs { margin: 4px 14px 0; }   /* Platz für die Jahreszahlen an den Enden */
.results__facets .facet-body { overflow: visible; }
.irs--round .irs-bar, .irs--round .irs-from, .irs--round .irs-to, .irs--round .irs-single { background-color: var(--accent); color: var(--on-accent); }
.irs--round .irs-handle { border-color: var(--accent); border-width: 3px; width: 20px; height: 20px; top: 27px; background: var(--bg-elevated); box-shadow: none; }
.irs--round .irs-from::before, .irs--round .irs-to::before, .irs--round .irs-single::before { border-top-color: var(--accent); }
.irs--round .irs-line { background: var(--fill-strong); }
.irs--round .irs-min, .irs--round .irs-max { background: var(--fill); color: var(--label-2); }

.results__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 20px; }
.results__count { font-family: var(--font-ui); font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.results__count .muted { font-weight: 400; }
.sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .875rem; color: var(--label-2); }
.sort select { min-height: 36px; padding: 0 32px 0 12px; font-size: .875rem; border-radius: var(--radius-m); }

.biblioResult { display: flex; flex-direction: column; gap: 12px; }
.card {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 20px; align-items: start;
  padding: 20px 16px 20px 20px;
  background: var(--bg-elevated); border: 1px solid var(--separator); border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); }
.card__cover { display: block; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--bg-sunken); box-shadow: var(--shadow-1); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--label-3); }
.card__author { font-family: var(--font-serif); font-style: italic; font-size: 1rem; color: var(--label); margin: 0 0 4px; }
.card__title { font-size: 1.375rem; font-weight: var(--serif-bold); line-height: 1.2; margin: 0 0 12px; }
.card__title a { color: var(--label); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* ganze Karte klickbar */
.card__title a:hover { text-decoration: none; }
.card:has(.card__title a:hover) { border-color: var(--separator-strong); }
.card__snippet { margin: -4px 0 12px; font-size: .875rem; line-height: 1.45; color: var(--label-2); max-width: 40rem; }
.card__snippet-label { color: var(--label-3); margin-right: 4px; }
mark { padding: 0 .08em; border-radius: 2px; color: inherit; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.card__title mark { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .8125rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.card .menu { position: relative; z-index: 2; }
@media (max-width: 560px) {
  .card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 16px 12px 16px 16px; }
  .card__title { font-size: 1.1875rem; }
}

/* Seitennavigation aus dem Kern */
.biblioPaging { display: flex; justify-content: center; margin: 24px 0; }
.biblioPagingTop { display: none; }
.pagingList { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pagingList a, .pagingList b, .pagingList span {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); height: var(--tap); padding: 0 8px;
  border-radius: var(--radius-m); font: 400 .875rem/1 var(--font-ui); color: var(--label-2); text-decoration: none; font-variant-numeric: tabular-nums;
}
.pagingList a:hover { background: var(--fill); color: var(--label); text-decoration: none; }
.pagingList b { background: var(--accent); color: var(--on-accent); font-weight: 500; }

.empty { text-align: center; padding: 56px 16px; color: var(--label-2); }
.empty__icon { width: 3rem; height: 3rem; color: var(--label-3); margin-bottom: 16px; }
.empty h2 { font-size: 1.5rem; margin-bottom: 8px; }
.notice { padding: 12px 16px; border-radius: var(--radius-m); background: var(--fill); }
.notice--error { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }

/* ---------- Detailseite ---------- */
.detail-wrap { max-width: 50rem; margin: 0 auto; }
.back-button {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px 0 8px; margin-bottom: 24px;
  border-radius: var(--radius-m); background: transparent; color: var(--label-2); font: 400 .875rem/1 var(--font-ui); text-decoration: none;
}
.back-button:hover { background: var(--fill); color: var(--label); text-decoration: none; }
.detail__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; margin-bottom: 36px; }
.detail__author { font-family: var(--font-serif); font-style: italic; font-size: 1.125rem; color: var(--label); margin: 0 0 4px; }
.detail__author a { color: var(--label); text-decoration: none; }
.detail__author a:hover { color: var(--label); text-decoration: underline; }
.detail__title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: var(--serif-bold); line-height: 1.12; margin-bottom: 12px; }
.detail__cover { margin: 0; width: 10.5rem; position: sticky; top: 160px; }
.detail__cover img { border-radius: 4px; box-shadow: 0 1px 2px rgba(24,24,24,.10), 0 8px 24px rgba(24,24,24,.12); }
@media (max-width: 560px) { .detail__head { grid-template-columns: 1fr; } .detail__cover { width: 7.5rem; order: -1; } }
.detail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 32px; }

.facts { display: grid; grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr); gap: 12px 24px; margin: 0; font-size: .9375rem; align-items: start; }
.facts dt, .facts dd { line-height: 24px; min-height: 24px; }
.facts .state { display: inline-flex; align-items: center; gap: 8px; height: 24px; }
.facts dt { font-weight: 400; color: var(--label-2); }
.facts dt.facts__strong { font-weight: 500; color: var(--label); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts__prose { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.6; max-width: var(--measure); }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 12px; } }
.facts__callnumber { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.inline-link { display: inline-flex; align-items: center; gap: 6px; height: 24px; font: 400 .875rem/1 var(--font-ui); color: var(--label-2); transition: color .15s var(--ease); }
.inline-link:hover { color: var(--label); }
.inline-link .icon { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tags a:not(:last-child)::after { content: ","; color: var(--label-2); }
.state { display: inline-flex; align-items: center; gap: 8px; }
.state .icon { width: 20px; height: 20px; }
.state--yes .icon { color: var(--green); } .state--next .icon { color: var(--orange); } .state--no .icon { color: var(--red); }

.section { margin-top: 40px; border-top: 1px solid var(--separator); padding-top: 20px; }
.section h2 { font-size: 1.25rem; margin-bottom: 16px; }
.disclosure > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; min-height: var(--tap); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary h2 { margin: 0; }
.disclosure > summary .icon { transition: transform .2s var(--ease); color: var(--label-2); }
.disclosure[open] > summary .icon { transform: rotate(180deg); }
.disclosure[open] > summary { margin-bottom: 16px; }
.facts--secondary { font-size: .9375rem; }
.table-scroll { overflow-x: auto; }
.copies { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.copies th { text-align: left; font-weight: 500; color: var(--label-2); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--separator); }
.copies td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--separator); }

/* ---------- Sammlung & Listen (Plugin-Seiten) ---------- */
.focus-head { margin-bottom: 36px; }
.focus-head__text { margin-top: 12px; font-size: 1.0625rem; }
.collection-intro { margin-bottom: 8px; }
.collection-section { margin-top: 48px; max-width: 46rem; scroll-margin-top: 24px; }
.collection-section h2 { font-size: 1.5rem; }
.collection-section__lead { margin: 4px 0 16px; color: var(--label-2); font-size: .9375rem; }
.tiles {
  display: flex; flex-direction: column; max-width: 46rem;
  background: var(--bg-elevated); border: 1px solid var(--separator); border-radius: var(--radius-l); overflow: hidden;
}
.tile {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "icon title count" "icon text count";
  gap: 2px 16px; align-items: center; padding: 16px 20px; color: var(--label); text-decoration: none;
  transition: background-color .15s var(--ease);
}
.tile + .tile { border-top: 1px solid var(--separator); }
.tile:hover { background: var(--fill); color: var(--label); text-decoration: none; }
.tile__icon { grid-area: icon; color: var(--accent); align-self: center; }
.tile__icon .icon { width: 28px; height: 28px; stroke-width: 1.5; }
.tile__title { grid-area: title; font: var(--serif-bold) 1.1875rem/1.3 var(--font-serif); }
.tile__text { grid-area: text; color: var(--label-2); font-size: .875rem; }
.tile__count { grid-area: count; font: 400 .875rem/1 var(--font-ui); color: var(--label-2); font-variant-numeric: tabular-nums; }
.tile__count::after { content: "›"; margin-left: 12px; color: var(--label-3); font-size: 1.125rem; }

.title-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--separator); }
.title-list li { border-bottom: 1px solid var(--separator); }
.title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "author meta" "title meta"; gap: 2px 16px; padding: 12px 8px; color: var(--label); border-radius: var(--radius-m); text-decoration: none; }
.title-row:hover { background: var(--fill); text-decoration: none; color: var(--label); }
.title-row__author { grid-area: author; font: italic .9375rem/1.3 var(--font-serif); color: var(--label-2); }
.title-row__title { grid-area: title; font: var(--serif-bold) 1.1875rem/1.25 var(--font-serif); }
.title-row__meta { grid-area: meta; align-self: center; display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .title-row { grid-template-columns: 1fr; grid-template-areas: "author" "title" "meta"; } }

.inline-search { display: flex; gap: 8px; max-width: 30rem; margin-bottom: 32px; }
.inline-search input { flex: 1; font-family: var(--font-ui); font-size: 1rem; font-variant-numeric: tabular-nums; border-radius: var(--radius-m); padding-left: 12px; }
.shelf { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--fill-strong); }
.shelf li { margin-left: -3px; border-left: 3px solid transparent; }
.shelf li[aria-current] { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.shelf__row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); grid-template-areas: "cn title" "cn author"; gap: 2px 16px; padding: 12px 16px; color: var(--label); text-decoration: none; }
.shelf__row:hover { background: var(--fill); text-decoration: none; color: var(--label); }
.shelf__cn { grid-area: cn; align-self: start; justify-self: start; }
.shelf__title { grid-area: title; font: var(--serif-bold) 1.0625rem/1.3 var(--font-serif); }
.shelf__author { grid-area: author; font: italic .9375rem/1.3 var(--font-serif); color: var(--label-2); }
.shelf__gap { margin-left: -3px; border-left: 3px dashed var(--accent) !important; padding: 12px 16px; color: var(--accent); font-size: .875rem; }
@media (max-width: 560px) { .shelf__row { grid-template-columns: 1fr; grid-template-areas: "cn" "title" "author"; } }

/* ---------- Dialog „Erweiterte Suche“ ---------- */
.dialog {
  width: min(40rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--separator);
  border-radius: var(--radius-xl); background: var(--bg-elevated); color: var(--label); box-shadow: var(--shadow-3);
}
.dialog[open] { animation: pop .2s var(--ease); }
.dialog::backdrop { background: rgba(24, 24, 24, .28); }
.dialog__body { padding: 20px 24px 24px; }
.dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog__head h2 { font-size: 1.5rem; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .8125rem; color: var(--label-2); }
.form-grid input, .form-grid select { width: 100%; color: var(--label); font-size: 1rem; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Fuß ---------- */
.site-footer { padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom)); text-align: center; font-size: .8125rem; color: var(--label-3); }
.site-footer a { color: var(--label-2); }
.page-home .site-footer { display: none; }

/* ---------- Vom Kern erzeugte Inhalte (Mitgliederbereich, Zitieren …) an das Theme angleichen ---------- */
.core-content { font-family: var(--font-ui); font-size: 1rem; }
.member--login .core-content { max-width: 26rem; margin: 0 auto; }
.core-content .card, .core-content .card-body { background: var(--bg-elevated); border-color: var(--separator); border-radius: var(--radius-l); color: var(--label); }
.core-content .form-control, .core-content .custom-select { background: var(--bg-elevated); color: var(--label); border-color: var(--separator-strong); border-radius: var(--radius-m); min-height: var(--tap); }
.core-content .btn { min-height: 40px; border-radius: var(--radius-m); padding: 0 16px; font-weight: 500; }
.core-content .btn-primary, .core-content .btn-success, .core-content .btn-info { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.core-content .btn-outline-primary, .core-content .btn-outline-secondary, .core-content .btn-light, .core-content .btn-secondary, .core-content .btn-default { background: var(--fill); border-color: transparent; color: var(--label); }
.core-content .btn-danger, .core-content .btn-outline-danger { background: color-mix(in srgb, var(--red) 12%, transparent); border-color: transparent; color: var(--red); }
.core-content .table { color: var(--label); }
.core-content .table th, .core-content .table td { border-color: var(--separator); }
.core-content .table-striped tbody tr:nth-of-type(odd) { background: var(--fill); }
.core-content .nav-tabs, .core-content .nav-pills { border-bottom: 1px solid var(--separator); gap: 4px; }
.core-content .nav-tabs .nav-link, .core-content .nav-pills .nav-link { border: 0; border-radius: var(--radius-m); color: var(--label-2); min-height: 40px; display: inline-flex; align-items: center; }
.core-content .nav-tabs .nav-link.active, .core-content .nav-pills .nav-link.active { background: var(--fill-strong); color: var(--label); }
.core-content .alert, .core-content .infoBox, .core-content .errorBox { border-radius: var(--radius-m); border: 0; padding: 12px 16px; background: var(--fill); color: var(--label); }
.core-content .errorBox, .core-content .alert-danger { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); }
.core-content .text-muted, .core-content .text-secondary { color: var(--label-2) !important; }
.core-content .bg-white, .core-content .bg-light { background: var(--bg-elevated) !important; }
.core-content a.btn:hover { text-decoration: none; }

/* Login des Mitgliederbereichs (Markup aus lib/contents/member.inc.php) */
.core-content .tagline { font: var(--serif-bold) 1.25rem/1.3 var(--font-serif); margin-bottom: 8px; }
.core-content .loginInfo { color: var(--label-2); margin-bottom: 16px; }
.core-content .loginInfo form { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 20px; background: var(--bg-elevated); border: 1px solid var(--separator); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.core-content .fieldLabel { font-size: .875rem; color: var(--label-2); }
.core-content .fieldLabel.marginTop { margin-top: 8px; }
.core-content .login_input input { width: 100%; }
.core-content .memberButton, .core-content input[type=submit], .core-content button[type=submit] {
  min-height: 44px; margin-top: 16px; padding: 0 20px; border: 0; border-radius: var(--radius-m);
  background: var(--accent); color: var(--on-accent); font: 500 .9375rem/1 var(--font-ui); cursor: pointer;
}
.core-content .memberButton:hover, .core-content input[type=submit]:hover { background: var(--accent-hover); }
/* Mitarbeiter-Anmeldung (Markup aus lib/contents/login.inc.php) wie die Mitglieder-Anmeldung */
.core-content #loginForm form {
  display: flex; flex-direction: column; gap: 4px; padding: 20px;
  background: var(--bg-elevated); border: 1px solid var(--separator); border-radius: var(--radius-l); box-shadow: var(--shadow-1);
}
.core-content #loginForm .heading1 { font-size: .875rem; color: var(--label-2); margin-top: 8px; }
.core-content #loginForm .heading1:first-of-type { margin-top: 0; }
.core-content #loginForm .login_input input { width: 100%; }
.core-content #loginForm .remember { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .875rem; color: var(--label-2); }
.core-content #loginForm .remember label { margin: 0; }
.core-content #loginForm .loginButton { width: 100%; }
.core-content #loginForm .homeButton { display: none; }
.core-content .loginButton {
  min-height: 44px; margin-top: 16px; padding: 0 20px; border: 0; border-radius: var(--radius-m);
  background: var(--accent); color: var(--on-accent); font: 500 .9375rem/1 var(--font-ui); cursor: pointer;
}
.core-content .loginButton:hover { background: var(--accent-hover); }
.member--login .core-content .errorBox, .member--login .core-content .alert { margin-bottom: 16px; }
.staff-login { max-width: 26rem; margin: 24px auto 0; text-align: center; font-size: .875rem; color: var(--label-2); }
.staff-login a { display: inline-flex; align-items: center; gap: 6px; color: var(--label-2); }
.staff-login a:hover { color: var(--label); }
.staff-login .icon { width: 16px; height: 16px; }

/* Toastr (Kern) */
#toast-container > div { opacity: 1; border-radius: 12px; box-shadow: var(--shadow-3); font-family: var(--font-ui); font-size: .875rem; padding: 12px 16px 12px 48px; background-color: #181818; }
#toast-container > .toast-success { background-color: #181818; }
#toast-container > .toast-error { background-color: #5E1A16; }

/* Colorbox (Zitieren) */
#cboxContent, #cboxLoadedContent { background: var(--bg-elevated); color: var(--label); border-radius: var(--radius-l); }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Druck ---------- */
@media print {
  .site-header, .site-footer, .detail__actions, .back-button, .results__facets, .menu { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Kleine Bildschirme */
@media (max-width: 720px) {
  .topbar { gap: 8px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar__back { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .topbar__back > span { display: none; }   /* nur Pfeil */
  .toolbar { flex-wrap: nowrap; gap: 0; }
  .toolbar__item { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .search .search__scope { max-width: 7.5rem; }
  .home__caption { margin-top: 40px; }
}
@media (max-width: 560px) {
  /* Handy: Suchschlitz in eigener Zeile unter Startseite/Menü, sonst bleibt er zu schmal */
  .topbar:has(.topbar__search) { flex-wrap: wrap; row-gap: 12px; }
  .topbar__search { order: 3; flex-basis: 100%; max-width: none; }
}
