:root {
  --blue: #0b5f9e;
  --dark: #1f2933;
  --light: #f4f8fb;
  --accent: #0f766e;
  --border: #d9e2ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--dark);
  background: #fff;
  line-height: 1.55;
}

.logo-header {
  text-align: center;
  padding: 30px 20px 20px;
  background: #fff;
}

.logo-header img {
  max-width: 900px;
  width: 90%;
  height: auto;
  border-radius: 0;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0 18px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.page-nav a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
}

.page-nav a:hover,
.page-nav a:focus,
.page-nav a.active {
  background: var(--light);
  border-color: var(--blue);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
  margin-bottom: 22px;
}

h1,
h2 {
  color: var(--blue);
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: .02em;
}

h2 { font-size: 1.35rem; }

h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1rem;
}

a {
  color: var(--blue);
  font-weight: 700;
}

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.btn:hover,
.btn:focus {
  background: #084f84;
}

.muted { color: #52616f; }

.book-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.book-card,
.category-card {
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fcfdff;
  padding: 16px;
}

.book-card {
  min-height: 250px;
  text-align: center;
}

.book-card img {
  width: 120px;
  height: 170px;
  object-fit: contain;
  border-radius: 0;
  background: #fff;
}

.cover-link {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.category-card h2 { font-size: 1.15rem; }
.category-card p { margin-bottom: 0; color: #52616f; }

.pager {
  margin: 18px 0;
  text-align: center;
}

.pager-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
}

.pager-item {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.pager-item.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.pager-item[aria-disabled="true"] {
  color: #8091a5;
  background: var(--light);
  font-weight: 400;
}

.detail-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.cover-stack {
  display: grid;
  gap: 16px;
}

.detail-cover-link,
.cover-placeholder {
  display: block;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
  text-align: center;
}

.detail-cover-link img {
  width: 150px;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.section-kicker,
.category-label {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 8px;
}

.byline,
.publisher {
  margin: 0 0 8px;
  color: #52616f;
}

.metadata-list {
  padding-left: 1.2rem;
  margin: 12px 0 18px;
}

.request-actions {
  margin: 18px 0 20px;
}

.detail-section {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 18px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.detail-table th,
.detail-table td {
  border: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

.detail-table th {
  width: 180px;
  background: var(--light);
  color: var(--dark);
}

.footer {
  background: #17212b;
  color: white;
  text-align: center;
  padding: 24px 15px 32px;
}

.footer a { color: #bde7ff; }

.footer-logo {
  margin: 22px auto 0;
  max-width: 300px;
  width: 40%;
  height: auto;
  border-radius: 0;
  display: block;
}

@media (max-width: 850px) {
  .detail-layout { grid-template-columns: 1fr; }
  .cover-stack {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }
  .footer-logo { width: 70%; }
}
