/* ============================================================
   Library / Werkverzeichnis — index.html only
   ============================================================ */

.library-body {
  background: var(--c-cream);
}

/* ---------- Library Hero ---------- */
.lib-hero {
  position: relative;
  min-height: 75vh;
  min-height: 75svh;
  display: grid; place-items: center;
  text-align: center;
  color: var(--c-cream);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(6rem, 10vw, 10rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}
.lib-hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background-image: url('assets/papa-als-autor.jpg');
  background-size: cover;
  background-position: center 28%;
  background-attachment: fixed; /* parallax */
  filter: brightness(.6) contrast(1.05) sepia(.08);
}
@media (max-width: 900px), (hover: none) {
  .lib-hero-bg { background-attachment: scroll; }
}
.lib-hero-vignette {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center, transparent 25%, rgba(15, 42, 64, .55) 70%, rgba(0,0,0,.85) 100%),
    linear-gradient(180deg, rgba(15,42,64,.4) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.55) 100%);
}
.lib-hero-inner { max-width: 56rem; }
.lib-hero-eyebrow {
  font-family: var(--sans-ui);
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: clamp(.7rem, .65rem + .3vw, .85rem);
  color: var(--c-sand);
  margin: 0 0 2rem;
  opacity: 0;
  animation: fadeUp 1.1s .25s ease-out forwards;
}
.lib-hero-title {
  margin: 0;
  font-family: var(--serif-de);
  font-weight: 300;
  font-size: clamp(3rem, 1.8rem + 6vw, 6.4rem);
  letter-spacing: -.01em;
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .4em .6em;
  opacity: 0;
  animation: fadeUp 1.1s .55s ease-out forwards;
}
.lib-hero-title .lib-hero-sep,
.lib-works-h .lib-works-sep {
  color: var(--c-sand); font-style: italic; opacity: .7;
}
[data-mode="de"] .lib-hero-sep,
[data-mode="ar"] .lib-hero-sep,
[data-mode="de"] .lib-works-sep,
[data-mode="ar"] .lib-works-sep { display: none; }
.lib-hero-title [lang="ar"] {
  font-family: var(--serif-ar);
  font-weight: 700;
  color: var(--c-sand);
}
.lib-hero-sub {
  margin: 1.5rem auto 0;
  font-family: var(--sans-ui);
  font-size: clamp(.85rem, .8rem + .25vw, 1rem);
  letter-spacing: .12em;
  color: rgba(248, 244, 237, .85);
  display: flex; flex-direction: column; gap: .4rem;
  opacity: 0;
  animation: fadeUp 1.1s .85s ease-out forwards;
}
.lib-hero-sub [lang="ar"] {
  font-family: var(--serif-ar);
  letter-spacing: 0;
  font-size: 1.05rem;
  color: rgba(201, 166, 107, .9);
}
.lib-hero-meta {
  margin: 2rem 0 0;
  font-family: var(--sans-ui);
  font-size: .8rem;
  letter-spacing: .35em;
  color: rgba(248, 244, 237, .55);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 1.1s 1.1s ease-out forwards;
}

/* ---------- Library Author intro (compact) ---------- */
.lib-author {
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
  background: var(--c-paper);
}
.lib-author-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.lib-author-portrait {
  margin: 0;
}
.lib-author-portrait img {
  border-radius: 4px;
  filter: sepia(.06) saturate(.95);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 18px 48px -18px rgba(0,0,0,.18);
}
.lib-section-eyebrow {
  font-family: var(--sans-ui);
  font-size: .76rem;
  letter-spacing: .3em;
  color: var(--c-eyebrow);
  text-transform: uppercase;
  margin: 0 0 1rem;
  font-weight: 600;
}
.lib-section-eyebrow.centered { text-align: center; }
.lib-author-h {
  font-family: var(--serif-de);
  font-weight: 300;
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem);
  margin: 0 0 1.5rem;
  letter-spacing: -.01em;
  display: flex; gap: .8rem; flex-wrap: wrap; align-items: baseline;
}
.lib-author-h [lang="ar"] {
  font-family: var(--serif-ar);
  font-weight: 700;
  color: var(--c-clay);
}
.lib-author-text p {
  margin: 0 0 1rem;
  color: var(--c-ink-2);
  line-height: 1.7;
}
.lib-author-text p strong { color: var(--c-ink); font-weight: 500; }
.lib-author-text [lang="ar"] p { font-size: 1.18rem; line-height: 2.1; letter-spacing: .005em; }

/* CTA row → autor.html */
.lib-author-cta-row {
  margin: 1.6rem 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.lib-author-cta--ghost {
  background: transparent;
  color: var(--c-muted) !important;
  border-color: rgba(122, 111, 98, .35) !important;
}
.lib-author-cta--ghost:hover {
  background: rgba(139, 90, 43, .08) !important;
  color: var(--c-clay) !important;
  border-color: var(--c-clay) !important;
}
.lib-author-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--sans-ui);
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--c-clay);
  text-decoration: none;
  padding: .65rem 1.3rem;
  border: 1px solid rgba(139, 90, 43, .35);
  border-radius: 999px;
  transition: background .18s, color .18s, border-color .18s;
}
.lib-author-cta:hover,
.lib-author-cta:focus-visible {
  background: var(--c-clay);
  color: var(--c-cream);
  border-color: var(--c-clay);
}

.lib-author-inset {
  margin: 2rem 0 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 14px 38px -14px rgba(0,0,0,.18);
  max-width: 32rem;
}
.lib-author-inset img {
  width: 100%;
  display: block;
  height: auto;
  filter: sepia(.04) saturate(.98);
}
.lib-author-inset figcaption {
  font-family: var(--sans-ui);
  font-size: .82rem;
  color: var(--c-eyebrow);
  letter-spacing: .04em;
  padding: .65rem .85rem;
  background: var(--c-cream);
  border-top: 1px solid var(--c-line);
}
.lib-author-inset figcaption .t-ar {
  font-family: var(--serif-ar);
  font-size: .92rem;
  display: block;
  margin-top: .15rem;
}

@media (max-width: 700px) {
  .lib-author-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .lib-author-portrait { max-width: 220px; margin: 0 auto; }
  .lib-author-inset { max-width: 100%; }
}

/* ---------- Works grid ---------- */
.lib-works {
  padding: clamp(5rem, 10vw, 8rem) var(--gutter);
  background: var(--c-cream);
  border-top: 1px solid var(--c-line);
}
.lib-works-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.lib-works-h {
  font-family: var(--serif-de);
  font-weight: 300;
  font-size: clamp(2rem, 1.5rem + 1.8vw, 3.2rem);
  letter-spacing: -.01em;
  margin: 0 0 3rem;
  text-align: center;
  display: flex; gap: 1rem; align-items: baseline; justify-content: center;
  flex-wrap: wrap;
}
/* (sep handled in the rule above) */
.lib-works-h [lang="ar"] {
  font-family: var(--serif-ar);
  font-weight: 700;
  color: var(--c-clay);
}

.lib-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  isolation: isolate;
}
.book-card:not(.book-card--soon):hover,
.book-card:not(.book-card--soon):focus-within {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px -25px rgba(0,0,0,.25);
  border-color: var(--c-accent);
}
.book-card--soon { opacity: .85; }
.book-card-link {
  position: absolute; inset: 0; z-index: 2;
  text-indent: -9999px;
  overflow: hidden;
  background: transparent;
}
.book-card-link:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -4px; }

.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.04), transparent 60%),
    var(--c-ink-2);
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 3vw, 2.2rem);
}
.book-cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 8px 24px rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.25);
  transition: transform .6s ease;
}
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.0) 50%, color-mix(in srgb, var(--c-accent) 60%, #000) 100%);
}
.book-soon-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(34, 30, 26, .8);
  color: var(--c-sand);
  font-family: var(--sans-ui);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: .4rem .85rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.book-body {
  padding: 1.5rem 1.4rem 1.6rem;
  display: flex; flex-direction: column;
  gap: .8rem;
  flex: 1;
}
.book-title {
  margin: 0;
  font-family: var(--serif-de);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.55rem);
  line-height: 1.25;
  display: flex; flex-direction: column;
  gap: .2rem;
}
.book-title .book-title-ar {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-style: normal;
  color: var(--c-clay);
  font-size: clamp(1.2rem, 1rem + .6vw, 1.45rem);
}
.book-meta {
  margin: 0;
  font-family: var(--sans-ui);
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--c-muted);
  text-transform: uppercase;
}
.book-summary {
  margin: 0;
  color: var(--c-ink-2);
  font-size: .95rem;
  line-height: 1.6;
}
.book-summary[lang="ar"] {
  font-family: var(--serif-ar);
  font-size: 1.05rem;
  line-height: 1.85;
}
.book-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.2rem;
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  font-family: var(--sans-ui);
  font-size: .82rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-accent);
  background: transparent;
  transition: background .2s, color .2s, border-color .2s, gap .2s;
  align-self: flex-start;
  position: relative;
  z-index: 3;
}
.book-card:hover .book-cta { background: var(--c-accent); color: var(--c-cream); gap: .9rem; }
.book-cta--soon {
  border-style: dashed;
  border-color: var(--c-muted);
  color: var(--c-muted);
  cursor: default;
}
.book-cta--external {
  /* same active style as default available CTA */
}
.book-isbn {
  margin: 0;
  font-family: var(--sans-ui);
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--c-muted);
  border-top: 1px solid var(--c-line);
  padding-top: .8rem;
  margin-top: .2rem;
}
.book-card--arabic .book-soon-badge {
  background: rgba(139, 90, 43, .85);
  color: var(--c-cream);
}
.cta-arrow { transition: transform .25s; }
.book-card:hover .cta-arrow { transform: translateX(3px); }

/* ============================================================
   Foot share buttons (used on both library and book pages)
   ============================================================ */
.foot-share {
  margin: 2rem 0 0;
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
}
.foot-share-btn {
  font-family: var(--sans-ui);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: .7rem 1.3rem;
  border: 1px solid rgba(248, 244, 237, .35);
  border-radius: 999px;
  background: transparent;
  color: var(--c-cream);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.foot-share-btn:hover {
  background: rgba(248, 244, 237, .12);
  border-color: rgba(248, 244, 237, .65);
}
.foot-share-btn--ghost { color: rgba(248, 244, 237, .65); }
.foot-credits {
  margin: 1.5rem auto 0;
  max-width: 30rem;
  font-family: var(--sans-ui);
  font-size: .68rem;
  letter-spacing: .03em;
  line-height: 1.5;
  color: rgba(248, 244, 237, .35);
}
.foot-credits a {
  color: rgba(248, 244, 237, .55);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot-credits a:hover { color: var(--c-sand); }
