/* ===== Root variables & base ===== */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --ink:#0f172a;
  --muted:#6b7280;
  --accent:#27c28a;
  --accent-ink:#065f46;
  --radius:12px;
  --shadow:0 1px 2px rgba(16,24,40,.06), 0 2px 6px rgba(16,24,40,.08);
  --chip:#eef2f7;

  /* Shelf card width (responsive) */
  --book-w: clamp(110px, 18vw, 150px);
/*
  --container:1000px;
*/
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
}
.page{ max-width:1200px; margin-inline:auto; padding:24px; }

/* ===== Chips ===== */
.chips{ display:flex; gap:10px; flex-wrap:wrap; margin:8px 0 20px; }
.chip{
  padding:8px 14px; background:#fff;
  border-radius:999px; border:1px solid #e5e7eb;
  font-size:14px; font-weight:500; color:var(--ink);
  cursor:pointer; transition:background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.chip:hover{ background:#f3f4f6; }

/* Selected state (pressed) */
.chip[aria-pressed="true"]{
  background: var(--ink);
  color:#fff;
  border-color: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* Keyboard focus */
.chip:focus-visible{
  outline: 2px solid #93c5fd; /* subtle focus ring */
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #e0f2fe;
}


/* ===== Section ===== */
.section{ margin:28px 0 8px; }
.section h2{ font-size:20px; font-weight:700; margin:0 0 14px; color:var(--ink); }
.section small{ color:var(--muted); }

/* ===== Shelf (horizontal grid) ===== */
.shelf{
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--book-w);
  gap: 6px;

  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}
.shelf > *{ scroll-snap-align: start; }

/* Scrollbar cosmetics */
.shelf::-webkit-scrollbar{ height:8px; }
.shelf::-webkit-scrollbar-thumb{ background:#d7dbe3; border-radius:999px; }

/* ===== Generic card (may be used elsewhere) ===== */
.card{
  position:relative;
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  scroll-snap-align:start;
}
.thumb{ aspect-ratio:4/5; width:100%; background:#cfd8e3 center/cover no-repeat; }
.badge{
  position:absolute; top:8px; left:8px;
  background:var(--accent); color:#fff; padding:4px 8px;
  font-size:12px; border-radius:6px; font-weight:600;
}
.bookmark{
  position:absolute; top:8px; right:8px; width:26px; height:26px;
  border-radius:50%; background:#fff; border:1px solid #e5e7eb; display:grid; place-items:center;
}
.bookmark svg{ width:14px; height:14px; stroke:var(--muted); }
.meta{ padding:10px 12px 14px; }
.meta .kicker{ font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:4px; }
.title{ font-weight:600; line-height:1.25; margin:0 0 4px; font-size:15px; }
.byline{ color:var(--muted); font-size:13px; }

/* ===== Banner ===== */
.banner{
  display:grid; grid-template-columns: 1.2fr 1fr; gap:24px; align-items:center;
  background:var(--card); padding:22px; border-radius:var(--radius); box-shadow:var(--shadow);
}
.banner .copy h3{ margin:0 0 6px; font-size:20px; font-weight:700; }
.banner .copy p{ margin:0 0 10px; color:var(--muted); font-size:14px; }
.banner .cta{
  display:inline-block; background:var(--accent); color:#fff; text-decoration:none;
  padding:8px 14px; border-radius:8px; font-weight:600; font-size:14px;
}
.banner .grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.banner .mini{ background:var(--card); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.banner .mini .thumb{ aspect-ratio:4/5; }
@media (max-width:900px){ .banner{ grid-template-columns:1fr; } }

/* ===== Wide card ===== */
.card--wide{ display:grid; grid-template-columns: 4fr 6fr; align-items:stretch; }
.card--wide .thumb{ aspect-ratio:auto; height:100%; }
.card--wide .meta{ display:grid; align-content:center; }

/* ===== Genres grid ===== */
.genres{ display:grid; gap:14px; }
.genres-row{ display:grid; grid-template-columns:repeat(6,1fr); gap:14px; }
.genre{
  position:relative; border-radius:var(--radius); overflow:hidden;
  color:black; text-decoration:none; box-shadow:var(--shadow);
}



.genre .art{ aspect-ratio:16/9; background:#ecfdf5 center/cover no-repeat; }
/*.genre .overlay{ position:absolute; inset:0; background:linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.15)); }*/
.genre h4{ position:absolute; left:10px; bottom:8px; margin:0; font-size:15px; font-weight:600; }
@media (max-width:1100px){ .genres-row{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:700px){ .genres-row{ grid-template-columns:repeat(2,1fr); } }

/* ===== Book card (specific) ===== */
.book-card{
  background:#fff; border:1px solid #e0e0e0; border-radius:12px; padding:5px;
  box-shadow:0 2px 4px rgba(0,0,0,.05); box-sizing:border-box;
  position:relative;
  width:100%;
}

/* Uniform cover area */

.book-cover-link{
  display:block;
  position:relative;
  margin-bottom: 8px;   /* tweak: 6–12px */
}

.book-card .cover{
  width:100%;
  aspect-ratio: 2 / 3;                 /* fixed visual size */
  border-radius:8px;
  overflow:hidden;
  background:#f0f0f0;
  display:grid; place-items:center;
}
.book-card .cover img{
  width:100%; height:100%;
  object-fit:cover;                     /* use `contain` if you prefer letterboxing */
  display:block;
}

/* Regular cards */
.book-card.regular-card {
  width: 135px;              /* pick a size that looks good */
  flex: 0 0 auto;            /* prevent stretching */
}

/* Featured cards (slightly larger) */
.book-card.featured-card {
  width: 200px;
  flex: 0 0 auto;
}

.books-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: nowrap;   /* prevents wrapping unless you want multiple rows */
}

/* Keep the <img> rules minimal—wrapper sets size */
.book-cover{ display:block; border-radius:8px; }

/* Stats row */
.book-stats{
  display:flex; gap:16px; margin:6px 0; font-size:1rem; color:#333; align-items:center;
}
.book-stats span{ display:flex; align-items:center; }
.book-stats .icon{ width:20px; height:20px; margin-right:6px; }

/* Title link behavior */
.book-title-link{
  font-weight:600; line-height:1.25; margin:0 0 4px; font-size:15px;
  text-decoration:none; color:inherit;
}
.book-title-link:hover,
.book-title-link:focus-visible{
  text-decoration:underline;
  text-underline-offset:2px;
}

/* Section separator */
.section + .section{
  border-top: 1px solid #e5e7eb; /* light gray line */
  padding-top: 16px;              /* space after the line */
  margin-top: 24px;               /* space before the line */
}

/* container */
.editors-pick {
  margin: 28px 0;
}

.ep-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.1fr; /* copy • mascot • book */
  gap: 28px;
  align-items: center;
  background: #ecfdf5;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.08);
  padding: 28px;
}

/* left text */
.ep-eyebrow {
  margin: 0 0 6px;
  font-size: 1.2rem;
  letter-spacing: .02em;
}

.ep-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.ep-sub {
  margin: 0 0 14px;
  color: #475569;
}

.ep-cta {
  display: inline-block;
  padding: 10px 14px;
  background: var(--accent, #27c28a);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}

/* center: mascot + bubble */
.ep-mascot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  margin-left: 120px;   /* try 20–60px until it looks balanced */

}

.ep-raccoon {
  max-width: 150px;
  height: auto;
  transform: translateX(-130px); /* nudges him towards the cover */
}

/* speech bubble */
.ep-bubble {
  position: absolute;
  right: -8px;                 /* push bubble a bit towards the book */
  top: 5%;
  max-width: 200px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  border: 2px solid #11182710; /* subtle ink border */
  font-family:'Comic Neue','Comic Sans MS',cursive;
  font-size: 14px;   /* 👈 adjust this value */
  line-height: 1.4;  /* optional for readability */

}

.ep-bubble span {
  display: block;
  line-height: 1.35;
  color: #111827;
}


/* right: book card */
.ep-book {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  border-radius: 14px;
  transition: transform .15s ease, box-shadow .15s ease;

  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16,24,40,.10);
}

.ep-book:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16,24,40,.10);
}

.ep-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
}

.ep-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.ep-meta { display: grid; gap: 6px; }

.ep-badge {
  display: inline-block;
  font-size: .72rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-ink, #065f46);
  border: 1px solid rgba(16,185,129,.25);
  font-weight: 700;
}

.ep-book-title { margin: 0; font-size: 1.05rem; }
.ep-author     { margin: 0; color: #6b7280; font-size: .95rem; }

.ep-read {
  justify-self: start;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent, #27c28a);
  color: #fff; border: 0; font-weight: 700;
  cursor: pointer;
}

/* responsive */
@media (max-width: 900px) {
  .ep-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "copy book"
      "mascot book";
  }
  .ep-copy   { grid-area: copy; }
  .ep-mascot { grid-area: mascot; }
  .ep-book   { grid-area: book; }

  .ep-raccoon { max-width: 160px; }
  .ep-bubble  { right: -4px; top: 8%; max-width: 200px; }
}

@media (max-width: 640px) {
  .ep-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "book"
      "mascot";
    gap: 18px;
  }
  .ep-mascot { min-height: 140px; }
  .ep-raccoon { max-width: 140px; }
  .ep-bubble { top: 0; left: 54%; transform: translateX(-50%); }
}

.ep-month {
  margin: 4px 0 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280; /* muted gray */
}

.genre .art {
  width: 180px;
  height: 101px;
  overflow: hidden;         /* Ensures nothing spills outside */
  border-radius: 8px;       /* Optional, for rounded corners */
  position: relative;
}

.genre .art img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* Keeps aspect ratio, crops if needed */
  display: block;
}

/* Position arrow at the end of the row */
#recentBooks {
  display: flex;
  gap: 12px;
  align-items: center;
}

#newBooks {
  display: flex;
  gap: 12px;
  align-items: center;
}


#popularBooks {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* The arrow style */
.see-all-arrow {
  font-size: 2rem;
  font-weight: bold;
  color: var(--ink, #0f172a);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.see-all-arrow:hover {
  color: var(--accent, #27c28a);
}
