/* Ebook Section - Compact Theme (Matching Pub Style) */

:root {
  --navy: #1A3320;
  --navy2: #234D2E;
  --teal: #3D9A5C;
  --teal2: #2D7A48;
  --amber: #D97941;
  --white: #FDFAF5;
  --offwhite: #F2EDE4;
  --muted: #8A9485;
  --text: #1E2D22;
  --border: #DDD8CC;
  --f-sans: 'Nunito', sans-serif;
  --f-serif: 'Playfair Display', serif;
  --radius: 16px;
  --shadow: 0 8px 40px rgba(26,51,32,0.10);
}

/* Cover Image */
.cover-img {
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Ebook Card - Compact Style */
.ebook-card-compact {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.ebook-card-compact:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.ebook-thumb-compact {
  position: relative;
  overflow: hidden;
  height: 200px;
}
.ebook-thumb-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.ebook-card-compact:hover .ebook-thumb-compact img {
  transform: scale(1.05);
}
.ebook-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,51,32,0.4) 0%, transparent 50%);
}
.ebook-badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}
.badge-active {
  background: var(--teal);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-locked {
  background: rgba(255,255,255,0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}
.ebook-body-compact {
  padding: 20px;
}
.ebook-title-compact {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ebook-desc-compact {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ebook-footer-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ebook-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.ebook-price small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 4px;
}
.btn-view-ebook {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  padding: 6px 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-view-ebook:hover {
  background: var(--teal);
  color: white;
}

/* Section styling */
.section-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}
.section-page-title {
  font-size: 32px;
  font-weight: 900;
  font-family: var(--f-serif);
  color: var(--navy);
  line-height: 1.2;
}
.section-page-title em {
  font-style: normal;
  color: var(--teal);
}

/* Author card */
.author-card {
  background: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 32px;
  color: white;
  margin: 0 auto 16px;
}
.author-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.author-username {
  font-size: 14px;
  color: var(--muted);
}

/* Subscription Plan Card */
.plan-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
  height: 100%;
}
.plan-card:hover {
  border-color: var(--teal);
}
.plan-card.featured {
  border-color: var(--teal);
  box-shadow: 0 4px 20px rgba(61,154,92,0.15);
}
.plan-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.plan-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--teal);
}
.plan-price small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.plan-cycle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.plan-features li {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-features li i {
  color: var(--teal);
}
.plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}
.plan-badge.read { background: rgba(61,154,92,0.15); color: var(--teal); }
.plan-badge.download { background: rgba(26,51,32,0.1); color: var(--navy); }

/* Chapter list */
.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.chapter-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.chapter-item:hover {
  background: var(--offwhite);
}
.chapter-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--offwhite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.chapter-title {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}
.chapter-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.chapter-badge.free { background: var(--teal); color: white; }
.chapter-badge.locked { background: var(--offwhite); color: var(--muted); }

/* Reader Content */
.reader-content {
  line-height: 1.8;
  font-size: 1.05rem;
  word-break: break-word;
  color: var(--text);
}
.reader-content h2, .reader-content h3 {
  color: var(--navy);
  font-family: var(--f-serif);
  margin-top: 32px;
  margin-bottom: 16px;
}
.reader-content p {
  margin-bottom: 16px;
}

/* Page Header */
.ebook-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.ebook-page-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

/* Table wrapper */
.ebook-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.ebook-table-wrap .table {
  min-width: 680px;
}

/* Fade-up animations */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }
.fade-up-delay-5 { transition-delay: 0.5s; }

/* Highlight */
mark.eb-highlight {
  padding: 0 2px;
  border-radius: 2px;
  background: rgba(255,203,66,0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .cover-img {
    height: 200px;
  }
  .reader-content {
    font-size: 0.98rem;
    line-height: 1.65;
  }
  .ebook-page-header h3 {
    margin-bottom: 0;
    font-size: 1.05rem;
  }
  .ebook-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .ebook-mobile-stack .btn,
  .ebook-mobile-stack .form-control,
  .ebook-mobile-stack .form-select {
    width: 100%;
  }
  .section-page-title {
    font-size: 24px;
  }
}