:root{
  --ink: #6F4E37;
  --paper: #fbf4ee;
  --panel: #ffffff;
  --shadow: 0 12px 22px rgba(0,0,0,.10);
  --radius: 14px;
}

/* GLOBAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body{
  font-family: "Poor Richard", "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
}

/* HEADER */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 60px;
  border-bottom: 1px solid rgba(111, 78, 55, 0.2);
}

/* NAVIGATION */
.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  font-size: 20px;
  color: #6F4E37;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background-color: #6F4E37;
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* BRAND */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 110px;
  width: auto;
}

.brand-title {
  font-size: 38px;
  line-height: 1.1;
  font-weight: normal;
}

/* SEARCH SECTION */
.search-section {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.search-container {
  width: 60%;
  max-width: 700px;
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  font-family: 'Poor Richard', serif;
  color: #6F4E37;
  background: transparent;
}

.search-input::placeholder {
  color: rgba(111, 78, 55, 0.6);
}

.search-button {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #6F4E37;
}

/* Section title */
.section-title{
  text-align: center;
  font-size: 22px;
  letter-spacing: .2px;
  margin: 22px 0 12px;
}

/* Overall shell: left image + center panel + right image */
.popular-shell{
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  padding: 6px 12px 26px;
}

/* Left/right decorative images */
.popular-deco{
  width: 120px;
  height: auto;
  object-fit: contain;
  align-self: center;
  opacity: .95;
}

.popular-deco-left{
  transform: translateY(6px);
}


.popular-deco-right {
  transform: translate(-90px, 120px);
}



/* White panel in the middle */
.popular-panel{
  width: min(820px, 92vw);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 22px;
  border: 1px solid rgba(111,78,55,.12);
}

/* 5 cards across like your example */
.popular-grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 26px;
  place-items: start center;
  padding-top: 6px;
}

/* Card layout (cover + title/author) */
.book-card{
  width: 120px;
  text-align: center;
}

.book-cover{
  width: 100px;
  height: 140px;
  border-radius: 6px;
  box-shadow: 0 10px 16px rgba(0,0,0,.14);
  border: 1px solid rgba(111,78,55,.18);
  background: #d7d1cb; /* replaced by JS if you use real cover images */
  margin: 0 auto 10px;
}

/* Title/author text (JS will fill these) */
.book-meta{
  line-height: 1.1;
}

.book-title{
  font-size: 18px;
  margin-bottom: 4px;
}

.book-author{
  font-size: 14px;
  opacity: .9;
}

/* Pretty “loading” placeholders before API data */
.skeleton .book-cover{
  background: linear-gradient(90deg, #e9e3dd 25%, #f3eee9 50%, #e9e3dd 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton .book-title,
.skeleton .book-author{
  height: 12px;
  border-radius: 999px;
  background: #eee6de;
  margin: 6px auto;
  width: 70%;
}

.skeleton .book-author{
  width: 55%;
  opacity: 1;
}


@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* Responsive: shrink to 3, then 2 columns */
@media (max-width: 900px){
  .popular-grid{ grid-template-columns: repeat(3, 1fr); }
  .popular-deco{ width: 90px; }
}
@media (max-width: 560px){
  .popular-grid{ grid-template-columns: repeat(2, 1fr); }
  .popular-deco{ display: none; } /* keeps it clean on mobile */
}

