/* Scratch: bookshelf-style navigation buttons on the landing page, styled
   like leatherbound book spines (gold-foil bands + nameplate). Each
   .td-bookshelf__book is one field manual; width and cover color are set
   inline per item by bookshelf.html. */
.td-bookshelf-section .td-landing-section__head {
  text-align: center;
  width: 100%;
  max-width: none;
}

.td-bookshelf {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 40px 0 0;
}

.td-bookshelf__book {
  /* Muted, tarnished foil instead of fresh gold -- the cover's had decades
     of handling. */
  --gold: #c9b081;
  --gold-dim: #7c6133;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 400px;
  padding: 16px 8px;
  border-radius: 7px 7px 3px 3px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  /* Edges just slightly uneven -- not a laser-cut rectangle. Amplitude is
     small (~1% of the book's own size) on purpose. */
  clip-path: polygon(
    1% 0%,
    99% 0%,
    100% 6%,
    99.3% 16%,
    100% 27%,
    99.3% 38%,
    100% 50%,
    99.3% 62%,
    100% 73%,
    99.3% 84%,
    100% 94%,
    99% 100%,
    1% 100%,
    0% 94%,
    0.7% 84%,
    0% 73%,
    0.7% 62%,
    0% 50%,
    0.7% 38%,
    0% 27%,
    0.7% 16%,
    0% 6%
  );
  background-image:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.11) 0%,
      rgba(255, 255, 255, 0.02) 12%,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.12) 80%,
      rgba(0, 0, 0, 0.34) 100%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.08) 0px,
      rgba(0, 0, 0, 0.08) 1px,
      transparent 1px,
      transparent 3px
    );
  /* Faint desaturation plus the drop shadow -- drop-shadow (not box-shadow)
     so the shadow follows the clipped, slightly uneven outline above
     instead of the rectangular border box. */
  filter: saturate(0.85) sepia(0.06)
    drop-shadow(0 16px 22px rgba(0, 0, 0, 0.45));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 0 18px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  color: var(--gold);
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.td-bookshelf__book:hover,
.td-bookshelf__book:focus-visible {
  transform: translateY(-8px);
  filter: saturate(0.85) sepia(0.06)
    drop-shadow(0 20px 28px rgba(0, 0, 0, 0.55));
}

/* Gold-foil ridge, like the raised bands on a real bound spine --
   tarnished rather than a fresh shine. */
.td-bookshelf__band {
  height: 5px;
  flex-shrink: 0;
  margin: 7px 0;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  opacity: 0.88;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 -1px 0 rgba(255, 255, 255, 0.15) inset;
}

.td-bookshelf__band--tight {
  height: 3px;
  margin: 3px 0;
}

/* Nameplate: thin gold rule framing the title/imprint, like an embossed
   panel. */
.td-bookshelf__plate {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 2px 6px;
  padding: 8px 4px;
  border-top: 1px solid rgba(227, 197, 131, 0.65);
  border-bottom: 1px solid rgba(227, 197, 131, 0.65);
}

.td-bookshelf__plate--small {
  padding: 5px 4px;
}

.td-bookshelf__title {
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.td-bookshelf__imprint {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.td-bookshelf__spacer {
  flex: 1;
}

/* Small emblem, like the ornamental motif stamped on a leather spine. */
.td-bookshelf__emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border: 1px solid rgba(227, 197, 131, 0.65);
  border-radius: 3px;
  color: var(--gold);
  font-size: 1rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.td-bookshelf__shelf {
  height: 16px;
  margin: 0 auto;
  max-width: 900px;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    rgba(130, 96, 62, 0.95),
    rgba(82, 58, 36, 0.98)
  );
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
