/* =========================
   Readletics · index.css (page specific)
   – Only styles used by the homepage dashboard
   – Relies on variables & header styles from global.css
   ========================= */

/* ---- Highlights / selections within lists ---- */
.current-reader{
  background: var(--mint-50);
  border-left: 4px solid var(--mint-500);
  border-radius: 8px;
}

#mascot-welcome{ display:flex; align-items:flex-start; gap:16px; margin-top:24px; }
#mascot-welcome{ width:220px; height:auto; border-radius:8px; }

/* ---- Page layout blocks ---- */
/*
#user-section{
  display:flex; justify-content:space-between; align-items:flex-start;
  width:100%; max-width:1100px; margin:10px auto; padding:10px; gap:20px;
}
*/
.main-content{
  display:flex; gap:5px; max-width:1100px; margin:5px auto; padding:5px;
}
.leaderboard,.books-panel{
  background:#fff; border:1px solid var(--line); border-radius:16px;
  padding:24px; box-shadow:0 2px 8px rgba(0,0,0,.04); width:100%;
  box-sizing:border-box;
}

/* ---- Reader list (left card) ---- */
.reader-list{ list-style:none; padding:0; margin:0; }
.reader-list li{ display:flex; align-items:center; margin-bottom:16px; }
.reader-list img{ width:48px; height:48px; border-radius:50%; margin-right:12px; }

.reader-item{ padding:1rem 0; border-bottom:1px solid #ccc; margin-bottom:.5rem; }
.reader-item:last-child{ border-bottom:none; }

.reader-info{ display:flex; flex-direction:column; justify-content:space-between; }
.reader-info strong{ display:block; font-size:16px; color:#333; }

.points{ font-size:14px; color:#888; }
.badges{ margin-top:4px; } /* uses .badge from global.css */

.stat-block{ text-align:center; font-size:13px; color:#222; }
.stat-block img{ width:24px; height:24px; display:block; margin:0 auto 2px; }
.stat-block strong{ display:block; font-size:14px; font-weight:600; }
.stat-block .label{ font-size:12px; color:#555; }

/* ---- Tabs above “Fresh from the Publishers” ---- */
.tabs{ display:flex; gap:20px; margin-bottom:12px; }
.tabs button{
  background:none; border:none; font-weight:500; font-size:14px; color:#888;
  cursor:pointer; padding:4px 0; border-bottom:2px solid transparent;
}
.tabs .active{ color:#000; border-color:#000; }
.tab-content[hidden]{ display:none; }

/* ---- Add book CTA (right sidebar) ---- */
/*
#add-book-btn{
  display:block; margin:20px auto 0;
  background: var(--mint-500); color:#fff; border:none; padding:14px 35px;
  font-size:22px; border-radius:8px; cursor:pointer;
  box-shadow:2px 2px 0 #2d6a2d;
  transition: background-color .2s, transform .1s;
}
#add-book-btn:hover{ background:#0ea971; }
#add-book-btn:active{ transform:translateY(1px); box-shadow:1px 1px 0 #2d6a2d; }
*/


/* ---- Books rails/cards (right column) ---- */
.books-panel.featured{
  display:grid; grid-template-columns:repeat(2,1fr); gap:20px;
  width:100%; margin:1px; padding:1px; border:none;
}
.books-panel.regular{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
  width:100%; margin:1px; padding:1px; border:none;
}

/*
.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.book-card img {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 8px;
}

.book-card img[src*="fallback-cover"] {
  background-color: #dcdee0;
  border-radius: 8px;
}
*/

/* Book card stays the same */
.book-card{
  display:flex; flex-direction:column; align-items:center;
  background:#fff; border:1px solid #e0e0e0; border-radius:12px;
  padding:6px; box-shadow:0 2px 4px rgba(0,0,0,.05);
  box-sizing:border-box; width:100%; overflow:hidden;
}

/* A fixed-size frame for the cover (2:3 is common for books) */
.book-cover-frame{
  width:100%;
  aspect-ratio: 2 / 3;           /* prevents layout shift */
  background:#dcdee0;            /* placeholder grey */
  border-radius:8px;
  position:relative;
  overflow:hidden;
}

/* The actual <img> fills the frame */
.book-cover-frame img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  border-radius:8px;
  opacity:0;                      /* fade in on load */
  transition: opacity .2s ease;
}

/* When loaded, fade image in */
.book-card.loaded .book-cover-frame img{ opacity:1; }

/* Optional: shimmer skeleton while loading */
.book-card.loading .book-cover-frame::after{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(255,255,255,0) 0%,
                                      rgba(255,255,255,.45) 50%,
                                      rgba(255,255,255,0) 100%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer{
  0%{ transform:translateX(-100%); }
  100%{ transform:translateX(100%); }
}

/* Your info area */
.book-info{ text-align:left; width:100%; }



.book-card.large h4{ font-size:14px; margin:6px 0 2px; }

.book-title{ font-size:14px; font-weight:700; margin:7px; }
.readers{ font-size:12px; color:#888; margin-bottom:4px; }
.book-rating{ margin-top:0px; font-size:15px; }

.book-cover-link{
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
}

/* IMAGE */
.book-card .book-cover-link > img.book-cover{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: none;              /* override old rule */
}
.label-new{
  position:absolute; top:8px; left:8px; z-index:10;
  background:#fff4c4; color:#333; font-weight:700; font-size:.9rem;
  padding:6px 10px; border-radius:8px; box-shadow:0 2px 4px rgba(0,0,0,.2);
}

/* star rating */
.stars{ font-size:14px; color:#f4b400; }
.star{ font-size:1.2em; color:lightgray; }
.star.full{ color:gold; }
.star.half{
  background: linear-gradient(90deg, gold 50%, lightgray 50%);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  display:inline-block;
}
.star.empty{ color:lightgray; }

/* ---- See all button under rails ---- */
.see-all-button{
  background:#0066cc; color:#fff; padding:10px 16px; border-radius:6px;
  text-decoration:none; font-weight:700; display:inline-block;
}
.see-all-button:hover{ background:#004999; }

/* ---- Reader switcher (avatar + dropdown) ---- */
.user-switcher{ position:relative; display:flex; align-items:center; gap:.4rem; }
.menu-btn{ background:none; border:none; font-size:1.5em; cursor:pointer; padding:0 .2em; }

.switch-dropdown{
  position:absolute; top:2.5rem; right:0; background:#fff; border:1px solid #ccc;
  box-shadow:0 4px 8px rgba(0,0,0,.1); border-radius:6px; width:200px;
  display:none; flex-direction:column; z-index:10;
}
.switch-dropdown.visible{ display:flex; }
.switch-dropdown .reader-item{
  padding:.6rem 1rem; display:flex; align-items:center; gap:.5rem;
  cursor:pointer; transition:background .2s;
}
.switch-dropdown .reader-item:hover{ background: var(--mint-50); }
.switch-dropdown .reader-avatar{ width:28px; height:28px; border-radius:50%; object-fit:cover; }
.switch-dropdown .add-reader{
  padding:.6rem 1rem; font-weight:700; color: var(--mint-500);
  border-top:1px solid #eee; cursor:pointer;
}

/* ---- Welcome box (centered) ---- */
.welcome-box{
  background:#eaf6f0; border:1px solid #cde7db; border-radius:12px;
  padding:1.5em; max-width:300px; margin:1em auto; text-align:center;
  box-shadow:0 4px 6px rgba(0,0,0,.05);
}
.welcome-box h3{ font-size:26px; margin-bottom:.4em; color:#2c3e50; }
.welcome-box .subtext{ margin-top:.8em; font-size:.9em; color:#555; }
.welcome-box .tagline{ font-size:18px; font-style:italic; color: var(--mint-500); margin-bottom:1.5em; }

/* ---- Utilities ---- */
.hidden{ display:none; }
.book-title-link{ color:#333; text-decoration:none; }
.book-title-link:hover{ text-decoration:underline; }
.book-cover-link{ display:inline-block; position:relative; }

/* reader-profile link (list) */
a.reader-link{ font-weight:600; color:#374151; text-decoration:none; }
a.reader-link:hover{ text-decoration:underline; }

.book-stats {
  display: flex;
  gap: 16px;
  margin: 0px 0;
  font-size: 1rem;
  color: #333;
  align-items: center;
}

.book-stats span {
  display: flex;
  align-items: center;
}

.book-stats .icon {
  width: 20px;   /* bigger for readability */
  height: 20px;
  margin-right: 6px;
}

.books-section {
  padding-bottom: 20px;
  border-bottom:1px solid #ccc;
}

.reading-banner {
  background: #f5faf5;
  border: 1px solid #e3efe3;
  border-radius: 12px;
  padding: 10px 18px;
  margin: 16px 0;
  text-align: center;
  color: #1f2a1f;
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  min-height: 50px;

}

.reading-banner .rb-emoji {
  font-size: 1.2rem;
}


#totalPages {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.rb-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 1.05rem;
}

.rb-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-right: 3px;
}

.yay-word {
  font-weight: 700;
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease;
}
