/* Library-card case studies. Colours come from the variables in index.html */

.shelf {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.75rem;
}

/* card height comes from its content */
.shelf-item {
  width: 100%;
  max-width: 480px;
  container-type: inline-size;
}

.lib-card {
  display: flex;
  flex-direction: column;
  min-height: 44px;
  position: relative;
  color: var(--ink);
  text-decoration: none;
  /* inner spacing scales with the card (was 2rem 1.85rem 0.75rem at 403px) */
  padding: 7.9cqi 7.3cqi 3cqi;
  /* hand-drawn card: corners sliced so they never stretch */
  border: 0 solid transparent;
  border-image: url('card-border.svg') 64 fill / 64px stretch;
  filter: drop-shadow(0 6px 12px var(--shadow));
  transition: transform 0.6s ease, filter 0.3s ease;
  will-change: transform;
}

.shelf-item:hover a.lib-card,
a.lib-card:focus-visible {
  filter: drop-shadow(0 12px 22px var(--shadow-hover));
}

a.lib-card:focus-visible { transform: translateY(-4px); }
a.lib-card:focus-visible .lib-cta { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

.lib-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  background: url('card-rule-double.svg') bottom / 100% 10px no-repeat;
}

.lib-no {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

.lib-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--accent);
  padding-bottom: 0.9rem;
  margin-bottom: 0.25rem;
  background: url('card-rule-single.svg') bottom / 100% 4px no-repeat;
}


.lib-summary {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-mid);
  margin: 0.5rem 0 0.75rem;
}

.lib-tags {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-faded);
}

.lib-cta {
  align-self: flex-start;
  margin-top: 64px;
  padding-bottom: 1rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lib-cta span { display: inline-block; transition: transform 0.2s ease; }
.shelf-item:hover .lib-cta span { transform: translateX(3px); }

@media (max-width: 480px) {
  .lib-card { padding: 1.6rem 1.4rem 0.5rem; border-image-width: 50px; }
}

