.books-hero {
  min-height: 340px;
}

.books-hero::before {
  opacity: 0.32;
  background-image:
    linear-gradient(90deg, rgba(6,21,34,.12), rgba(6,21,34,.86)),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(216,173,84,.08) 27px 28px),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(216,173,84,.06) 35px 36px);
  mask-image: linear-gradient(90deg, #000, rgba(0,0,0,.38) 42%, transparent 86%);
}

.books-catalog {
  padding-block: 38px 80px;
}

.books-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(190px, 0.72fr) minmax(190px, 0.72fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.field-group {
  min-width: 0;
}

.field-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-text-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.field-control {
  position: relative;
}

.field-control svg {
  position: absolute;
  z-index: 1;
  width: 20px;
  height: 20px;
  inset-inline-start: 16px;
  inset-block-start: 50%;
  fill: none;
  stroke: var(--color-text-500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-control input,
.field-control select {
  width: 100%;
  min-height: 48px;
  color: var(--color-text-900);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(9, 23, 37, 0.03);
}

.field-control input {
  padding: 0.7rem 48px 0.7rem 16px;
}

.field-control select {
  padding: 0.7rem 1rem;
}

.field-control input::placeholder {
  color: #8b8173;
}

.books-reset {
  min-height: 48px;
  padding-inline: 1rem;
  color: var(--color-navy-800);
  background: rgba(255, 253, 248, 0.68);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-weight: 700;
}

.books-reset:hover {
  background: var(--color-paper-200);
  border-color: var(--color-gold-600);
}

.books-results-status {
  margin-bottom: 14px;
  color: var(--color-text-500);
  font-size: 0.85rem;
}

.books-list-header {
  display: grid;
  grid-template-columns: 52px 86px minmax(230px, 0.9fr) minmax(330px, 1.5fr) minmax(170px, 0.65fr);
  gap: 20px;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  color: rgba(255, 253, 248, 0.9);
  background: linear-gradient(180deg, var(--color-wine-800), var(--color-wine-900));
  border: 1px solid rgba(113, 61, 53, 0.66);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--font-literary);
  font-size: 1.08rem;
  box-shadow: 0 6px 16px rgba(50, 19, 24, 0.12);
}

.books-list-header span:first-child,
.books-list-header span:nth-child(2) {
  grid-column: span 1;
}

.books-list-header span:nth-child(3) {
  grid-column: 3;
}

.books-list-header span:nth-child(4) {
  grid-column: 4;
}

.books-list-header span:nth-child(5) {
  grid-column: 5;
}

.books-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.book-entry {
  background: rgba(255, 253, 248, 0.66);
  border: 1px solid var(--color-border);
  border-top: 0;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.book-entry:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-entry:hover {
  position: relative;
  z-index: 1;
  background: rgba(255, 253, 248, 0.96);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-row {
  display: grid;
  grid-template-columns: 52px 86px minmax(230px, 0.9fr) minmax(330px, 1.5fr) minmax(170px, 0.65fr);
  gap: 20px;
  align-items: center;
  min-height: 138px;
  padding: 17px 22px;
}

.book-row__number {
  color: var(--color-gold-700);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.book-row__cover-link {
  display: block;
  width: 72px;
}

.book-row__cover {
  width: 72px;
  height: 104px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  box-shadow: var(--shadow-cover);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.book-row__cover-link:hover .book-row__cover {
  transform: translateY(-2px) rotate(-0.6deg);
  box-shadow: 0 18px 32px rgba(8, 20, 32, 0.28);
}

.book-row__title {
  margin-bottom: 0.35rem;
  font-family: var(--font-literary);
  font-size: clamp(1.23rem, 1.65vw, 1.62rem);
  line-height: 1.35;
}

.book-row__title a {
  color: var(--color-navy-900);
  text-decoration: none;
}

.book-row__title a:hover {
  color: var(--color-gold-700);
}

.book-row__year,
.book-row__publication {
  margin-bottom: 0;
  color: var(--color-text-500);
  font-size: 0.78rem;
  line-height: 1.75;
}

.book-row__year {
  color: var(--color-gold-700);
  font-weight: 700;
}

.book-row__summary p {
  margin: 0;
  color: var(--color-text-700);
  font-size: 0.91rem;
  line-height: 1.85;
}

.book-row__action {
  align-self: stretch;
  border-inline-start: 1px solid var(--color-border);
}

.book-row__cta {
  display: flex;
  min-height: 100%;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding-inline-start: 16px;
  color: var(--color-text-900);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
  text-decoration: none;
}

.book-row__cta svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--color-gold-600);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.book-row__cta:hover svg {
  transform: translateX(-3px);
}

.books-empty-state {
  padding: 70px 24px;
  color: var(--color-text-700);
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.books-empty-state h3 {
  margin-bottom: 0.4rem;
  color: var(--color-navy-900);
  font-family: var(--font-literary);
  font-size: 1.7rem;
}

.books-empty-state p {
  margin-bottom: 0;
}

@media (max-width: 1099px) {
  .books-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .books-list-header {
    display: none;
  }

  .books-list {
    display: grid;
    gap: 14px;
  }

  .book-entry,
  .book-entry:last-child {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .book-row {
    grid-template-columns: 42px 86px minmax(0, 1fr);
    grid-template-areas:
      "number cover identity"
      "number cover summary"
      "action action action";
    gap: 12px 18px;
  }

  .book-row__number { grid-area: number; }
  .book-row__cover-link { grid-area: cover; }
  .book-row__identity { grid-area: identity; }
  .book-row__summary { grid-area: summary; }
  .book-row__action {
    grid-area: action;
    margin-top: 4px;
    border-top: 1px solid var(--color-border);
    border-inline-start: 0;
  }

  .book-row__cta {
    min-height: 48px;
    justify-content: flex-start;
    padding: 9px 0 0;
    text-align: right;
  }
}

@media (max-width: 767px) {
  .books-hero {
    min-height: 280px;
  }

  .books-catalog {
    padding-block: 26px 60px;
  }

  .books-toolbar {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .books-reset {
    width: 100%;
  }

  .book-row {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      "cover identity"
      "summary summary"
      "action action";
    min-height: 0;
    padding: 16px;
  }

  .book-row__number {
    position: absolute;
    inset-inline-start: 10px;
    inset-block-start: 9px;
    display: grid;
    width: 31px;
    height: 31px;
    color: var(--color-navy-900);
    background: var(--color-gold-300);
    border-radius: 50%;
    font-size: 0.74rem;
    place-items: center;
  }

  .book-entry {
    position: relative;
  }

  .book-row__cover-link,
  .book-row__cover {
    width: 68px;
  }

  .book-row__cover {
    height: 99px;
  }

  .book-row__title {
    font-size: 1.3rem;
  }

  .book-row__summary p {
    font-size: 0.88rem;
  }

  .book-row__cta {
    justify-content: space-between;
  }
}
