:root {
  --ku-green-900: #113325;
  --ku-green-800: #1b4d3e;
  --ku-green-700: #236349;
  --ku-green-600: #2d7a58;
  --tvrc-lime: #659b24;
  --tvrc-lime-light: #eef7e3;
  --tvrc-orange: #e07a24;
  --tvrc-orange-dark: #c46212;
  --tvrc-red: #dc3545;
  --surface-bg: #f6f8f5;
  --card-bg: #ffffff;
  --text-main: #18261f;
  --text-muted: #52635a;
  --border-color: #dce5de;
  --shadow-sm: 0 2px 8px rgba(17, 51, 37, 0.06);
  --shadow-md: 0 12px 30px rgba(17, 51, 37, 0.10);
  --shadow-lg: 0 24px 50px rgba(17, 51, 37, 0.16);
  --radius-md: 14px;
  --radius-lg: 22px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--surface-bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, .btn, .stat-value, .hero-badge, .cover-badge, .ebook-topbar {
  font-family: 'Prompt', 'Sarabun', sans-serif;
}

.container {
  width: min(1240px, 92%);
  margin: 0 auto;
}

/* ==========================================================================
   TOP BAR & HEADER
   ========================================================================== */
.top-bar {
  background: var(--ku-green-900);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  padding: 0.45rem 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ku-badge {
  background: var(--tvrc-lime);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.12rem 0.55rem;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.top-link {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.top-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.4rem 0.65rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 54px;
  width: auto;
  display: block;
}

.brand-kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tvrc-orange);
  letter-spacing: 0.02em;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ku-green-900);
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.95rem;
  border-radius: 14px;
}

.stat-pill-highlight {
  background: linear-gradient(135deg, #fff8f1 0%, #ffefe0 100%);
  border-color: #f6cfa9;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-book {
  background: var(--tvrc-lime-light);
  color: var(--ku-green-800);
}

.stat-icon-download {
  background: var(--tvrc-orange);
  color: #fff;
}

.stat-pill-visitors {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

.stat-icon-visitors {
  background: #0284c7;
  color: #fff;
}

.bottom-stats-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.bottom-stats-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.bottom-stats-grid .stat-pill {
  min-width: 240px;
  padding: 0.75rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.stat-value {
  font-size: 1rem;
  color: var(--ku-green-900);
}

.header-org-logos {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 0.36rem 0.7rem;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(17, 51, 37, 0.04);
}

.org-logo-item {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.org-logo-item:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--ku-green-900) 0%, var(--ku-green-800) 58%, #275e37 100%);
  color: #fff;
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(101, 155, 36, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(224, 122, 36, 0.22) 0%, transparent 45%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.hero-tag-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
}

.hero-badge-secondary {
  background: var(--tvrc-orange);
  border-color: var(--tvrc-orange);
}

.hero-heading {
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.hero-org {
  font-size: 1.1rem;
  color: #d9f2c4;
  font-weight: 500;
  margin-bottom: 1.1rem;
}

.hero-desc {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  margin-bottom: 1.8rem;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.72rem 1.35rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.22s ease;
  text-decoration: none;
}

.btn-lg {
  padding: 0.88rem 1.55rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--tvrc-orange);
  color: #fff;
  box-shadow: 0 8px 20px rgba(224, 122, 36, 0.35);
}

.btn-primary:hover {
  background: var(--tvrc-orange-dark);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.btn-outline-green {
  background: #fff;
  color: var(--ku-green-800);
  border: 1.5px solid var(--ku-green-700);
}

.btn-outline-green:hover {
  background: var(--ku-green-800);
  color: #fff;
}

/* Multi-Book Shelf Showcase in Hero */
.hero-shelf-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.shelf-cards-stack {
  position: relative;
  width: 310px;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shelf-card {
  position: absolute;
  width: 215px;
  aspect-ratio: 1 / 1.3;
  border-radius: 8px 12px 12px 8px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.shelf-card-back-left {
  transform: translateX(-52px) translateY(8px) rotate(-11deg) scale(0.9);
  background: linear-gradient(145deg, #275d43 0%, #163928 100%);
  border: 2px solid rgba(255, 255, 255, 0.18);
  z-index: 1;
}

.shelf-card-back-right {
  transform: translateX(52px) translateY(10px) rotate(11deg) scale(0.9);
  background: linear-gradient(145deg, #3c6e21 0%, #1d3f14 100%);
  border: 2px solid rgba(255, 255, 255, 0.18);
  z-index: 2;
}

.shelf-card-placeholder {
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  gap: 0.5rem;
}

.shelf-card-placeholder img {
  width: 68px;
  background: #fff;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.3rem;
}

.shelf-card-placeholder span {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}

.shelf-card-placeholder small {
  font-size: 0.72rem;
  opacity: 0.72;
}

.shelf-card-front {
  z-index: 3;
  cursor: pointer;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.32);
}

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

.shelf-front-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: var(--tvrc-orange);
  color: #fff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.shelf-cards-stack:hover .shelf-card-back-left {
  transform: translateX(-68px) translateY(4px) rotate(-15deg) scale(0.92);
}

.shelf-cards-stack:hover .shelf-card-back-right {
  transform: translateX(68px) translateY(6px) rotate(15deg) scale(0.92);
}

.shelf-cards-stack:hover .shelf-card-front {
  transform: translateY(-8px) scale(1.04);
}

.featured-caption {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.24);
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #84cc16;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(132, 204, 22, 0.3);
}

/* ==========================================================================
   MAIN IMAGE MENU SECTION
   ========================================================================== */
.main-content {
  padding: 3rem 0 4rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tvrc-lime);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.section-title {
  font-size: 1.75rem;
  color: var(--ku-green-900);
  line-height: 1.25;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  min-width: 270px;
  color: var(--text-muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--ku-green-700);
  box-shadow: 0 0 0 3px rgba(45, 122, 88, 0.14);
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
}

.view-switcher {
  display: inline-flex;
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.2rem;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.42rem 0.85rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: var(--ku-green-800);
  color: #fff;
}

/* ==========================================================================
   CATEGORY FILTER PILLS & MULTI-BOOK CATALOG GRID
   ========================================================================== */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.cat-pill {
  border: 1.5px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  font-family: 'Prompt', sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45rem 1.05rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  border-color: var(--ku-green-700);
  color: var(--ku-green-800);
}

.cat-pill.active {
  background: var(--ku-green-800);
  border-color: var(--ku-green-800);
  color: #fff;
  box-shadow: 0 4px 12px rgba(27, 77, 62, 0.22);
}

/* Multi-Book Image Menu Grid (Default: 3-column Book Cover Gallery) */
.books-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.85rem;
  margin-bottom: 2.5rem;
}

/* List / Detail View Mode */
.books-catalog-grid.list-mode {
  grid-template-columns: 1fr;
}

.menu-image-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.menu-image-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.books-catalog-grid.list-mode .menu-image-card {
  display: grid;
  grid-template-columns: 350px 1fr;
}

.books-catalog-grid.list-mode .menu-image-card:hover {
  transform: none;
}

/* Visual Image Menu Cover Frame */
.menu-cover-frame {
  position: relative;
  background: radial-gradient(circle at 50% 35%, #2f694c 0%, #153827 100%);
  padding: 2.2rem 1.75rem 1.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  min-height: 360px;
}

.menu-image-card.is-upcoming .menu-cover-frame {
  background: radial-gradient(circle at 50% 35%, #3a5246 0%, #1d2b24 100%);
  cursor: default;
}

.menu-cover-badges {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  z-index: 4;
}

.cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.68rem;
  border-radius: 99px;
  backdrop-filter: blur(8px);
}

.cover-badge-ebook {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ku-green-900);
}

.cover-badge-dl {
  background: rgba(224, 122, 36, 0.95);
  color: #fff;
}

.cover-badge-soon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cover-book-wrapper {
  position: relative;
  width: 100%;
  max-width: 225px;
  margin-top: 1rem;
  border-radius: 6px 12px 12px 6px;
  box-shadow: -14px 18px 34px rgba(0, 0, 0, 0.45);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-cover-frame:hover .cover-book-wrapper {
  transform: translateY(-7px) scale(1.03);
}

.menu-cover-img,
.menu-cover-canvas {
  width: 100%;
  aspect-ratio: 1 / 1.294;
  object-fit: cover;
  display: block;
  border-radius: 5px 10px 10px 5px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #fff;
}

.upcoming-cover-art {
  width: 100%;
  aspect-ratio: 1 / 1.294;
  border-radius: 5px 10px 10px 5px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  padding: 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.upcoming-cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upcoming-cover-top img {
  height: 28px;
  background: #fff;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
}

.upcoming-cover-tag {
  font-family: 'Prompt', sans-serif;
  font-size: 0.66rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.upcoming-cover-center {
  margin: auto 0;
  text-align: left;
}

.upcoming-cover-center span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.9;
}

.upcoming-cover-center strong {
  font-family: 'Prompt', sans-serif;
  font-size: 1.32rem;
  line-height: 1.25;
  display: block;
  margin-top: 0.15rem;
}

.upcoming-cover-footer {
  font-size: 0.68rem;
  opacity: 0.85;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 0.5rem;
}

.cover-page-stack {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: -7px;
  width: 7px;
  background: repeating-linear-gradient(
    90deg,
    #ffffff 0px,
    #ffffff 2px,
    #d0d5dd 2px,
    #d0d5dd 3px
  );
  border-radius: 0 4px 4px 0;
}

.menu-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 51, 37, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: 3;
}

.menu-cover-frame:hover .menu-cover-overlay,
.menu-cover-frame:focus-visible .menu-cover-overlay {
  opacity: 1;
}

.overlay-action-circle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--tvrc-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  box-shadow: 0 10px 24px rgba(224, 122, 36, 0.45);
  transform: scale(0.9);
  transition: transform 0.28s ease;
}

.menu-cover-frame:hover .overlay-action-circle {
  transform: scale(1);
}

.overlay-title {
  font-family: 'Prompt', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.overlay-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Card Body */
.menu-card-body {
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.books-catalog-grid.list-mode .menu-card-body {
  padding: 2rem 2.2rem;
}

.menu-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.category-tag {
  background: var(--tvrc-lime-light);
  color: var(--ku-green-800);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.24rem 0.72rem;
  border-radius: 99px;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.menu-card-title {
  font-size: 1.38rem;
  color: var(--ku-green-900);
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1.3;
}

.books-catalog-grid.list-mode .menu-card-title {
  font-size: 1.75rem;
}

.menu-card-title:hover {
  color: var(--tvrc-orange);
}

.menu-card-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.books-catalog-grid.list-mode .menu-card-desc {
  -webkit-line-clamp: unset;
  font-size: 0.96rem;
}

/* Download Stats Strip inside Card */
.download-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #f8faf8;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.dl-stat-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dl-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff3e6;
  color: var(--tvrc-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-stat-icon-pages {
  background: var(--tvrc-lime-light);
  color: var(--ku-green-800);
}

.dl-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.dl-stat-number {
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  color: var(--ku-green-900);
}

/* Primary Action Buttons in Card */
.menu-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.btn-ebook {
  background: var(--ku-green-800);
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(27, 77, 62, 0.2);
}

.btn-ebook:hover:not(:disabled) {
  background: var(--ku-green-900);
  transform: translateY(-2px);
}

.btn-download {
  background: var(--tvrc-orange);
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(224, 122, 36, 0.24);
}

.btn-download:hover:not(:disabled) {
  background: var(--tvrc-orange-dark);
  transform: translateY(-2px);
}

.btn-disabled {
  background: #e5ebe7;
  color: #718279;
  cursor: not-allowed;
  box-shadow: none;
}

/* Quick Chapter Chips (Shown in Detail List Mode) */
.card-chapters-box {
  display: none;
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
  margin-top: 1.15rem;
}

.books-catalog-grid.list-mode .card-chapters-box {
  display: block;
}

.card-chapters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.card-chapters-header h4 {
  font-size: 0.9rem;
  color: var(--ku-green-900);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-text-toggle {
  border: none;
  background: none;
  color: var(--tvrc-orange-dark);
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-toggle:hover {
  text-decoration: underline;
}

.chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.chapter-chip {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  font-family: 'Sarabun', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chapter-chip span.chip-page {
  font-size: 0.75rem;
  color: var(--tvrc-orange-dark);
  font-weight: 700;
}

.chapter-chip:hover {
  background: var(--ku-green-800);
  color: #fff;
  border-color: var(--ku-green-800);
}

.chapter-chip:hover span.chip-page {
  color: #ffd8a8;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ku-green-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem 0;
  border-top: 4px solid var(--tvrc-lime);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  height: 44px;
  background: #fff;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
}

.footer-brand p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-right {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   INTERACTIVE E-BOOK MODAL VIEWER
   ========================================================================== */
.ebook-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #101c16;
  color: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.ebook-modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* Top Bar */
.ebook-topbar {
  height: 62px;
  background: #162920;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.ebook-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.ebook-topbar-logo {
  height: 36px;
  background: #fff;
  padding: 0.2rem 0.35rem;
  border-radius: 7px;
}

.ebook-topbar-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ebook-topbar-titles strong {
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ebook-topbar-titles span {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ebook-topbar-center {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ebook-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.18s;
}

.ebook-tool-btn:hover,
.ebook-tool-btn.active {
  background: var(--tvrc-lime);
  border-color: var(--tvrc-lime);
}

.ebook-zoom-readout {
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  min-width: 48px;
  cursor: pointer;
}

.ebook-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 0.25rem;
}

.ebook-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ebook-dl-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.38rem 0.8rem;
  border-radius: 99px;
  font-size: 0.8rem;
  color: #e2f2d5;
}

.ebook-dl-counter strong {
  color: #ffb74d;
  font-size: 0.92rem;
}

.btn-ebook-dl {
  background: var(--tvrc-orange);
  color: #fff;
  padding: 0.46rem 0.95rem;
  font-size: 0.84rem;
  border-radius: 9px;
}

.btn-ebook-dl:hover {
  background: var(--tvrc-orange-dark);
}

.ebook-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.ebook-close-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Reader Body & Sidebar */
.ebook-body {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #223b2e 0%, #0d1712 100%);
}

.ebook-sidebar {
  width: 310px;
  background: #15251d;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: margin-left 0.28s ease;
}

.ebook-sidebar.closed {
  margin-left: -310px;
}

.sidebar-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  gap: 0.4rem;
}

.sidebar-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  padding: 0.45rem;
  border-radius: 7px;
  cursor: pointer;
}

.sidebar-tab.active {
  background: var(--ku-green-700);
  color: #fff;
  font-weight: 600;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  width: 30px;
  height: 30px;
  cursor: pointer;
  border-radius: 6px;
}

.sidebar-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.sidebar-panel.hidden {
  display: none;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-item-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.18s;
}

.toc-item-btn:hover,
.toc-item-btn.active {
  background: var(--ku-green-700);
  border-color: var(--tvrc-lime);
  color: #fff;
}

.toc-page-num {
  font-family: 'Prompt', sans-serif;
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.thumb-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.4rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}

.thumb-item:hover,
.thumb-item.active {
  border-color: var(--tvrc-orange);
  background: rgba(224, 122, 36, 0.16);
}

.thumb-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.3rem;
}

.thumb-item span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Main Flipbook Stage */
.ebook-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.75rem 1.5rem 2rem;
}

.stage-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: all 0.2s;
}

.stage-nav-btn:hover:not(:disabled) {
  background: var(--tvrc-orange);
  border-color: var(--tvrc-orange);
  transform: translateY(-50%) scale(1.08);
}

.stage-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.stage-nav-prev {
  left: 1.25rem;
}

.stage-nav-next {
  right: 1.25rem;
}

.ebook-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1800px;
  transition: transform 0.22s ease;
}

.flipbook-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.65);
  transform-style: preserve-3d;
}

.ebook-page {
  position: relative;
  background: #fff;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.ebook-page-left {
  border-radius: 6px 0 0 6px;
  transform-origin: right center;
}

.ebook-page-right {
  border-radius: 0 6px 6px 0;
  transform-origin: left center;
}

.flipbook-container.single-mode .ebook-page-left,
.flipbook-container.single-mode .ebook-center-crease {
  display: none;
}

.flipbook-container.single-mode .ebook-page-right {
  border-radius: 6px;
}

.page-inner {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: #fff;
}

.page-inner img {
  height: calc(100vh - 195px);
  max-height: 760px;
  width: auto;
  max-width: 38vw;
  display: block;
  object-fit: contain;
}

.flipbook-container.single-mode .page-inner img {
  max-width: 86vw;
}

/* Spine shadows for realistic open book depth */
.page-spine-shadow-left {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 38px;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.05) 55%, transparent 100%);
  pointer-events: none;
}

.page-spine-shadow-right {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.05) 55%, transparent 100%);
  pointer-events: none;
}

.flipbook-container.single-mode .page-spine-shadow-right {
  display: none;
}

.ebook-center-crease {
  width: 3px;
  align-self: stretch;
  background: linear-gradient(180deg, #1b1b1b, #4a4a4a 50%, #1b1b1b);
  z-index: 5;
}

/* Page corner fold hint */
.page-corner-hint {
  position: absolute;
  bottom: 0;
  width: 36px;
  height: 36px;
  pointer-events: none;
  transition: all 0.25s ease;
}

.page-corner-right {
  right: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.08) 50%, rgba(224, 122, 36, 0.35) 100%);
}

.ebook-page-right:hover .page-corner-right {
  width: 52px;
  height: 52px;
}

.page-footer-num {
  position: absolute;
  bottom: -26px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.72);
}

/* Flip Animations */
.flipbook-container.turning-next .ebook-page-right {
  animation: pageFlipNext 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.flipbook-container.turning-prev .ebook-page-left,
.flipbook-container.turning-prev .ebook-page-right {
  animation: pageFlipPrev 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pageFlipNext {
  0% { transform: rotateY(22deg) scale(0.98); opacity: 0.75; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

@keyframes pageFlipPrev {
  0% { transform: rotateY(-22deg) scale(0.98); opacity: 0.75; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* Bottom Bar */
.ebook-bottombar {
  height: 54px;
  background: #162920;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.chapter-indicator {
  font-size: 0.82rem;
  color: #cbe7b4;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  white-space: nowrap;
}

.bottombar-center {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 0.34rem 0.7rem;
  border-radius: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.18s;
}

.nav-pill-btn:hover:not(:disabled) {
  background: var(--tvrc-orange);
  border-color: var(--tvrc-orange);
}

.nav-pill-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-Input-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  padding: 0 0.4rem;
}

.page-Input-group select {
  background: #0d1913;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  padding: 0.24rem 0.5rem;
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.bottombar-right {
  width: 150px;
}

.ebook-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.ebook-progress-fill {
  height: 100%;
  width: 3.33%;
  background: linear-gradient(90deg, var(--tvrc-lime), var(--tvrc-orange));
  transition: width 0.25s ease;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  background: var(--ku-green-900);
  color: #fff;
  border-left: 5px solid var(--tvrc-orange);
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tvrc-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-content strong {
  font-family: 'Prompt', sans-serif;
  font-size: 0.92rem;
}

.toast-content span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-tag-row,
  .hero-actions {
    justify-content: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .menu-image-card {
    grid-template-columns: 1fr;
  }
  .credits-card {
    grid-template-columns: 1fr;
  }
  .ebook-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
  }
}

@media (max-width: 680px) {
  .hide-sm {
    display: none;
  }
  .menu-card-actions {
    grid-template-columns: 1fr;
  }
  .ebook-dl-counter {
    display: none;
  }
  .bottombar-left,
  .bottombar-right {
    display: none;
  }
  .ebook-bottombar {
    justify-content: center;
  }
  .ebook-stage {
    padding: 0.5rem;
  }
  .page-inner img {
    max-width: 92vw;
    height: auto;
    max-height: calc(100vh - 150px);
  }
}
