/* ============================================
   Thai E-Book Website Template
   Premium Literary Design System
   ============================================ */

/* --- CSS Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans Thai', 'Sarabun', 'Prompt', 'Kanit', sans-serif;
  font-size: 15px; line-height: 1.8; color: #2c2c2c;
  background: #faf8f5; overflow-x: hidden;
}
a { color: #5b4a3f; text-decoration: none; transition: color 0.3s; }
a:hover { color: #c4956a; }
img { max-width: 100%; height: auto; border: 0; }
ul, ol { list-style: none; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Color Palette --- */
:root {
  --primary: #8B6914;
  --primary-dark: #6B4F0E;
  --primary-light: #D4A84B;
  --accent: #C4956A;
  --accent-light: #E8C9A8;
  --text-dark: #2c2c2c;
  --text-medium: #5a5a5a;
  --text-light: #8a8a8a;
  --bg-cream: #faf8f5;
  --bg-warm: #f5f0e8;
  --bg-card: #ffffff;
  --border-light: #e8e2d8;
  --border-warm: #d4c9b8;
  --shadow-soft: rgba(90, 75, 55, 0.06);
  --shadow-medium: rgba(90, 75, 55, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.3s ease;
  --max-width: 1200px;
  --font-serif: 'Noto Serif Thai', 'Sarabun', serif;
  --font-sans: 'Noto Sans Thai', 'Sarabun', 'Prompt', sans-serif;
  --font-display: 'Kanit', 'Noto Sans Thai', sans-serif;
}

/* --- Container & Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col-12 { width: 100%; padding: 0 15px; }
.col-9 { width: 75%; padding: 0 15px; }
.col-8 { width: 66.666%; padding: 0 15px; }
.col-6 { width: 50%; padding: 0 15px; }
.col-4 { width: 33.333%; padding: 0 15px; }
.col-3 { width: 25%; padding: 0 15px; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display); color: var(--text-dark); line-height: 1.4;
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

/* ============================================
   HEADER
   ============================================ */
.eb-header {
  background: linear-gradient(135deg, #3d2b1f 0%, #5a3d2b 100%);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.eb-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px; height: 68px;
}
.eb-logo { display: flex; align-items: center; gap: 12px; }
.eb-logo img { height: 40px; }
.eb-logo-text {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: #f0e6d6; letter-spacing: 0.5px;
}
.eb-logo-text span { color: var(--primary-light); }

/* Navigation */
.eb-nav { display: flex; align-items: center; gap: 4px; }
.eb-nav li { position: relative; }
.eb-nav li a {
  display: flex; align-items: center; gap: 4px; padding: 8px 16px;
  color: #e8dcc8; font-size: 0.9rem; font-weight: 500;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.eb-nav li a:hover,
.eb-nav li.act a { color: var(--primary-light); background: rgba(255,255,255,0.1); }
.eb-nav li a .nav-arrow { font-size: 0.6rem; opacity: 0.6; }

/* Dropdown */
.eb-nav li ul {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 200px; background: #fff; border-radius: var(--radius-md);
  box-shadow: 0 8px 30px var(--shadow-medium); padding: 8px;
  border: 1px solid var(--border-light); z-index: 100;
}
.eb-nav li:hover ul { display: block; }
.eb-nav li ul li a {
  color: var(--text-dark); padding: 10px 14px; font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
.eb-nav li ul li a:hover { background: var(--bg-warm); color: var(--primary); }

/* Search */
.eb-search {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.1); border-radius: 50px;
  padding: 4px 4px 4px 16px; gap: 8px;
}
.eb-search input {
  background: none; border: none; color: #e8dcc8; font-size: 0.85rem;
  width: 160px; outline: none;
}
.eb-search input::placeholder { color: rgba(232,220,200,0.5); }
.eb-search button {
  background: var(--primary); color: #fff; border: none;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 0.8rem; transition: var(--transition);
}
.eb-search button:hover { background: var(--primary-dark); }

/* Mobile Header Toggle */
.eb-mobile-toggle { display: none; background: none; border: none; color: #e8dcc8; font-size: 1.5rem; cursor: pointer; padding: 8px; }

@media (max-width: 768px) {
  .eb-header-inner { height: 60px; }
  .eb-nav, .eb-search { display: none; }
  .eb-mobile-toggle { display: block; }
  .eb-nav.active {
    display: flex; flex-direction: column; position: absolute;
    top: 60px; left: 0; right: 0; background: #3d2b1f; padding: 16px; gap: 4px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  }
  .eb-nav.active li a { padding: 12px 16px; width: 100%; }
  .eb-nav.active li ul {
    position: static; box-shadow: none; border: none; margin-left: 16px;
  }
  .eb-search.active {
    display: flex; position: absolute; top: 60px; left: 0; right: 0;
    background: #3d2b1f; padding: 16px 20px;
  }
}

/* ============================================
   HERO BANNER / BREADCRUMB
   ============================================ */
.eb-hero {
  position: relative; overflow: hidden; min-height: 400px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a1f14 0%, #4a3328 50%, #3d2b1f 100%);
}
.eb-hero-overlay {
  position: absolute; inset: 0;
  background: url('img/pattern-books.png') repeat;
  opacity: 0.05;
}
.eb-hero-content {
  position: relative; text-align: center; color: #fff; padding: 60px 20px; z-index: 2;
}
.eb-hero-content h1 {
  font-family: var(--font-display); font-size: 3rem; font-weight: 700;
  color: #fff; margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.eb-hero-content p {
  font-size: 1.1rem; color: rgba(255,255,255,0.75);
  max-width: 600px; margin: 0 auto 30px; line-height: 1.8;
}
.eb-hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; background: var(--primary); color: #fff;
  border: none; border-radius: 50px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.eb-hero-btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }

/* Breadcrumb */
.eb-breadcrumb {
  background: var(--bg-warm); padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.eb-breadcrumb-inner {
  display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-light);
}
.eb-breadcrumb-inner a { color: var(--text-medium); }
.eb-breadcrumb-inner a:hover { color: var(--primary); }
.eb-breadcrumb-inner .sep { color: var(--border-warm); }
.eb-breadcrumb-inner .current { color: var(--primary); font-weight: 500; }

/* ============================================
   SECTION HEADERS
   ============================================ */
.eb-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}
.eb-section-header h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 700; color: var(--text-dark);
}
.eb-section-header h2::before {
  content: ''; display: block; width: 4px; height: 28px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}
.eb-section-header .more-link {
  font-size: 0.85rem; color: var(--primary); font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.eb-section-header .more-link:hover { color: var(--primary-dark); }

/* ============================================
   BOOK / ARTICLE CARDS
   ============================================ */
.eb-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px;
}
.eb-book-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; transition: var(--transition);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px var(--shadow-soft);
}
.eb-book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-medium);
  border-color: var(--accent-light);
}
.eb-book-card-img {
  position: relative; overflow: hidden; aspect-ratio: 3/2;
}
.eb-book-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.eb-book-card:hover .eb-book-card-img img { transform: scale(1.05); }
.eb-book-card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--primary); color: #fff; padding: 4px 12px;
  border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.eb-book-card-body { padding: 20px; }
.eb-book-card-body h3 {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.eb-book-card-body h3 a { color: var(--text-dark); }
.eb-book-card-body h3 a:hover { color: var(--primary); }
.eb-book-card-body p {
  font-size: 0.85rem; color: var(--text-medium); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 16px;
}
.eb-book-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-light);
  padding-top: 12px; border-top: 1px solid var(--border-light);
}
.eb-book-card-meta .meta-item { display: flex; align-items: center; gap: 4px; }

/* Featured / List Card */
.eb-list-card {
  display: flex; gap: 20px; padding: 20px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: var(--transition); margin-bottom: 20px;
}
.eb-list-card:hover {
  box-shadow: 0 8px 30px var(--shadow-soft); border-color: var(--accent-light);
}
.eb-list-card-img { flex-shrink: 0; width: 200px; height: 140px; border-radius: var(--radius-md); overflow: hidden; }
.eb-list-card-img img { width: 100%; height: 100%; object-fit: cover; }
.eb-list-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.eb-list-card-body h3 { margin-bottom: 8px; font-size: 1.1rem; }
.eb-list-card-body h3 a { color: var(--text-dark); }
.eb-list-card-body h3 a:hover { color: var(--primary); }
.eb-list-card-body .summary {
  font-size: 0.85rem; color: var(--text-medium); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}
.eb-list-card-body .meta { font-size: 0.78rem; color: var(--text-light); display: flex; gap: 16px; }
.eb-list-card-body .meta span { display: flex; align-items: center; gap: 4px; }

@media (max-width: 768px) {
  .eb-list-card { flex-direction: column; }
  .eb-list-card-img { width: 100%; height: 200px; }
}

/* ============================================
   SIDEBAR
   ============================================ */
.eb-sidebar { margin-top: 0; }
.eb-sidebar-widget {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 24px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px var(--shadow-soft);
}
.eb-sidebar-widget h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border-light); color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.eb-sidebar-widget h3::before {
  content: ''; width: 3px; height: 18px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* Sidebar - About */
.eb-about-widget { text-align: center; }
.eb-about-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--accent-light); margin: 0 auto 12px;
  overflow: hidden;
}
.eb-about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.eb-about-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.eb-about-desc { font-size: 0.85rem; color: var(--text-medium); line-height: 1.7; margin-bottom: 16px; }
.eb-about-stats {
  display: flex; justify-content: center; gap: 24px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.eb-about-stats .stat-item { text-align: center; }
.eb-about-stats .stat-item strong { display: block; font-size: 1.2rem; color: var(--primary); font-weight: 700; }
.eb-about-stats .stat-item span { font-size: 0.75rem; color: var(--text-light); }

/* Sidebar - Post List */
.eb-post-list { list-style: none; }
.eb-post-list li {
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 10px;
}
.eb-post-list li:last-child { border-bottom: none; }
.eb-post-list li .rank {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--border-light); color: var(--text-medium);
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.eb-post-list li:nth-child(1) .rank,
.eb-post-list li:nth-child(2) .rank,
.eb-post-list li:nth-child(3) .rank { background: var(--primary); color: #fff; }
.eb-post-list li .post-title {
  flex: 1; font-size: 0.85rem; line-height: 1.5; color: var(--text-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.eb-post-list li .post-title:hover { color: var(--primary); }
.eb-post-list li .post-views { font-size: 0.72rem; color: var(--text-light); flex-shrink: 0; }

/* Sidebar - Tags */
.eb-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.eb-tag-cloud a {
  display: inline-block; padding: 5px 14px;
  background: var(--bg-warm); color: var(--text-medium);
  border-radius: 50px; font-size: 0.8rem;
  transition: var(--transition); border: 1px solid transparent;
}
.eb-tag-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Sidebar - Random Books (image grid) */
.eb-random-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eb-random-grid a {
  display: block; border-radius: var(--radius-md); overflow: hidden;
  aspect-ratio: 3/4; position: relative;
}
.eb-random-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.eb-random-grid a:hover img { transform: scale(1.08); }
.eb-random-grid a .book-title-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff; font-size: 0.7rem; padding: 20px 6px 6px;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.eb-main-layout {
  display: flex; gap: 30px; padding: 30px 0;
}
.eb-main-content { flex: 1; min-width: 0; }
.eb-main-sidebar { width: 300px; flex-shrink: 0; }

@media (max-width: 992px) {
  .eb-main-layout { flex-direction: column; }
  .eb-main-sidebar { width: 100%; }
}

/* ============================================
   DETAIL / ARTICLE SHOW
   ============================================ */
.eb-detail {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 40px; border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px var(--shadow-soft);
}
.eb-detail h1.detail-title {
  font-size: 1.8rem; font-weight: 700; margin-bottom: 16px; line-height: 1.5;
}
.eb-detail-meta {
  display: flex; flex-wrap: wrap; gap: 20px; padding: 16px 0;
  border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px; font-size: 0.85rem; color: var(--text-light);
}
.eb-detail-meta span { display: flex; align-items: center; gap: 6px; }
.eb-detail-meta .meta-icon { color: var(--accent); }
.eb-detail-summary {
  background: var(--bg-warm); padding: 20px 24px;
  border-radius: var(--radius-md); margin-bottom: 24px;
  border-left: 4px solid var(--primary);
  font-size: 0.9rem; color: var(--text-medium); line-height: 1.8;
}
.eb-detail-summary strong { color: var(--primary); }
.eb-detail-content { font-size: 1rem; line-height: 2; color: var(--text-dark); }
.eb-detail-content p { margin-bottom: 16px; }
.eb-detail-content img { border-radius: var(--radius-md); margin: 20px 0; }
.eb-detail-copyright {
  margin-top: 30px; padding: 20px; background: var(--bg-warm);
  border-radius: var(--radius-md); font-size: 0.82rem; color: var(--text-light);
  border: 1px solid var(--border-light);
}
.eb-detail-copyright a { color: var(--primary); }

/* Prev/Next Navigation */
.eb-prev-next {
  display: flex; gap: 16px; margin-top: 30px;
}
.eb-prev-next a {
  flex: 1; padding: 16px 20px; background: var(--bg-warm);
  border-radius: var(--radius-md); font-size: 0.88rem;
  color: var(--text-medium); transition: var(--transition);
  border: 1px solid var(--border-light);
}
.eb-prev-next a:hover { background: var(--bg-card); border-color: var(--accent-light); color: var(--primary); }
.eb-prev-next a .label { font-size: 0.75rem; color: var(--text-light); margin-bottom: 4px; }

/* Tags */
.eb-detail-tags {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem;
}
.eb-detail-tags i { color: var(--accent); }
.eb-detail-tags a {
  padding: 4px 12px; background: var(--bg-warm);
  border-radius: 50px; color: var(--text-medium); font-size: 0.8rem;
}
.eb-detail-tags a:hover { background: var(--primary); color: #fff; }

/* ============================================
   COMMENTS
   ============================================ */
.eb-comments { margin-top: 40px; }
.eb-comments h3 { font-size: 1.15rem; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border-light); }
.eb-comment-item {
  display: flex; gap: 12px; padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.eb-comment-item:last-child { border-bottom: none; }
.eb-comment-avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.eb-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.eb-comment-body { flex: 1; }
.eb-comment-author { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.eb-comment-date { font-size: 0.75rem; color: var(--text-light); margin-left: 8px; }
.eb-comment-reply { font-size: 0.75rem; color: var(--primary); margin-left: 8px; cursor: pointer; }
.eb-comment-content { font-size: 0.88rem; color: var(--text-medium); line-height: 1.7; margin-top: 6px; }
.eb-comment-reply-content {
  background: var(--bg-warm); padding: 10px 14px; border-radius: var(--radius-sm);
  margin-top: 8px; font-size: 0.84rem; color: var(--text-medium);
}

/* Comment Form */
.eb-comment-form {
  margin-top: 30px; padding: 24px; background: var(--bg-warm);
  border-radius: var(--radius-lg); border: 1px solid var(--border-light);
}
.eb-comment-form h3 { margin-bottom: 20px; border-bottom: none; padding-bottom: 0; }
.eb-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.eb-form-row input[type="text"] { flex: 1; }
.eb-form-row input, .eb-comment-form textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm); font-size: 0.88rem;
  background: var(--bg-card); color: var(--text-dark);
  transition: var(--transition); outline: none;
}
.eb-form-row input:focus, .eb-comment-form textarea:focus { border-color: var(--primary); }
.eb-comment-form textarea { resize: vertical; min-height: 100px; }
.eb-form-submit {
  display: inline-flex; padding: 12px 28px; background: var(--primary);
  color: #fff; border: none; border-radius: 50px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.eb-form-submit:hover { background: var(--primary-dark); }
.eb-vcode-row { display: flex; gap: 12px; align-items: center; }
.eb-vcode-row input { flex: 1; }
.eb-vcode-row img { height: 40px; border-radius: var(--radius-sm); cursor: pointer; }

/* ============================================
   PAGINATION
   ============================================ */
.eb-pagination { margin-top: 30px; text-align: center; }
.eb-pagination a, .eb-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px; margin: 0 3px;
  border-radius: var(--radius-sm); font-size: 0.88rem;
  border: 1px solid var(--border-light); color: var(--text-medium);
  transition: var(--transition);
}
.eb-pagination a:hover { background: var(--bg-warm); border-color: var(--accent); color: var(--primary); }
.eb-pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================
   FOOTER
   ============================================ */
.eb-footer {
  background: linear-gradient(135deg, #2a1f14 0%, #3d2b1f 100%);
  color: #c4b8a6; margin-top: 60px;
}
.eb-footer-main {
  max-width: var(--max-width); margin: 0 auto;
  padding: 50px 20px 30px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.eb-footer-brand h3 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  color: #f0e6d6; margin-bottom: 12px;
}
.eb-footer-brand h3 span { color: var(--primary-light); }
.eb-footer-brand p { font-size: 0.85rem; line-height: 1.8; color: #a89880; margin-bottom: 20px; }
.eb-footer-social { display: flex; gap: 10px; }
.eb-footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #c4b8a6;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: var(--transition);
}
.eb-footer-social a:hover { background: var(--primary); color: #fff; }

.eb-footer-col h4 {
  font-size: 0.95rem; font-weight: 600; color: #f0e6d6;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.eb-footer-col ul li { margin-bottom: 10px; }
.eb-footer-col ul li a { color: #a89880; font-size: 0.85rem; transition: var(--transition); }
.eb-footer-col ul li a:hover { color: var(--primary-light); padding-left: 4px; }

.eb-footer-contact li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.85rem; color: #a89880; margin-bottom: 12px;
}
.eb-footer-contact li i { color: var(--primary-light); margin-top: 3px; }

.eb-footer-bottom {
  max-width: var(--max-width); margin: 0 auto; padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.08); text-align: center;
  font-size: 0.78rem; color: #7a6e5e;
}
.eb-footer-bottom a { color: #a89880; }
.eb-footer-bottom a:hover { color: var(--primary-light); }

@media (max-width: 768px) {
  .eb-footer-main { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 480px) {
  .eb-footer-main { grid-template-columns: 1fr; }
}

/* ============================================
   BACK TO TOP & SIDEBAR FLOAT
   ============================================ */
.eb-back-top {
  position: fixed; bottom: 30px; right: 30px; z-index: 999;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: var(--transition); opacity: 0; visibility: hidden; transform: translateY(10px);
}
.eb-back-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.eb-back-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ============================================
   SEARCH PAGE
   ============================================ */
.eb-search-panel {
  max-width: 600px; margin: 30px auto; padding: 24px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px var(--shadow-soft); border: 1px solid var(--border-light);
}
.eb-search-panel form { display: flex; gap: 10px; }
.eb-search-panel select {
  padding: 12px 16px; border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  background: var(--bg-warm); color: var(--text-dark); outline: none;
  min-width: 120px;
}
.eb-search-panel input[type="text"] {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border-warm);
  border-radius: var(--radius-sm); font-size: 0.9rem;
  background: var(--bg-warm); outline: none; color: var(--text-dark);
}
.eb-search-panel input[type="text"]:focus,
.eb-search-panel select:focus { border-color: var(--primary); }
.eb-search-panel button {
  padding: 12px 24px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.eb-search-panel button:hover { background: var(--primary-dark); }

/* ============================================
   LINKS / FRIENDLY LINKS
   ============================================ */
.eb-links-section {
  background: var(--bg-warm); padding: 30px 0;
  border-top: 1px solid var(--border-light);
}
.eb-links-list {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.eb-links-list a {
  padding: 6px 16px; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: 50px;
  font-size: 0.82rem; color: var(--text-medium); transition: var(--transition);
}
.eb-links-list a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================
   CATEGORY TABS
   ============================================ */
.eb-category-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.eb-category-tabs a {
  padding: 8px 20px; background: var(--bg-warm);
  border: 1px solid var(--border-light); border-radius: 50px;
  font-size: 0.85rem; color: var(--text-medium); transition: var(--transition);
}
.eb-category-tabs a:hover,
.eb-category-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================
   FEATURED / HOT SECTION (Homepage)
   ============================================ */
.eb-featured-section { margin: 40px 0; }
.eb-featured-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 768px) {
  .eb-featured-grid { grid-template-columns: 1fr; }
}
.eb-featured-grid .eb-book-card:first-child {
  grid-column: 1 / -1;
}
.eb-featured-grid .eb-book-card:first-child .eb-book-card-img { aspect-ratio: 21/9; }

/* ============================================
   NEW ARRIVALS / SLIDER SECTION
   ============================================ */
.eb-slider-section { margin: 40px 0; overflow: hidden; }
.eb-slider-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; scrollbar-width: none;
}
.eb-slider-track::-webkit-scrollbar { display: none; }
.eb-slider-item {
  flex-shrink: 0; width: 180px; scroll-snap-align: start;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.eb-slider-item:hover { box-shadow: 0 8px 20px var(--shadow-soft); transform: translateY(-4px); }
.eb-slider-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.eb-slider-item-title {
  padding: 10px; font-size: 0.8rem; font-weight: 500; color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================
   CATEGORY GROUP LIST (Homepage Section)
   ============================================ */
.eb-category-group { margin: 40px 0; }
.eb-category-group-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 992px) {
  .eb-category-group-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .eb-category-group-grid { grid-template-columns: 1fr; }
}
.eb-category-group-item {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); padding: 24px;
  box-shadow: 0 2px 12px var(--shadow-soft); transition: var(--transition);
}
.eb-category-group-item:hover { box-shadow: 0 8px 30px var(--shadow-medium); }
.eb-category-group-item h3 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.eb-category-group-item h3 a { color: var(--text-dark); }
.eb-category-group-item h3 a:hover { color: var(--primary); }
.eb-category-group-item h3 .more-link { font-size: 0.8rem; color: var(--primary); }

/* ============================================
   404 PAGE
   ============================================ */
.eb-404 {
  text-align: center; padding: 100px 20px;
}
.eb-404 h1 {
  font-size: 8rem; font-weight: 700; color: var(--border-warm);
  line-height: 1; margin-bottom: 20px;
}
.eb-404 h2 {
  font-size: 1.5rem; color: var(--text-medium); margin-bottom: 12px;
}
.eb-404 p { font-size: 1rem; color: var(--text-light); margin-bottom: 30px; }
.eb-404 a.eb-hero-btn { display: inline-flex; }

/* ============================================
   TAG CLOUD PAGE
   ============================================ */
.eb-tags-page { padding: 30px 0; }
.eb-tags-page .eb-tag-cloud { gap: 12px; }
.eb-tags-page .eb-tag-cloud a { padding: 8px 20px; font-size: 0.9rem; }

/* ============================================
   LOAD MORE
   ============================================ */
.eb-load-more {
  display: block; text-align: center; margin-top: 24px;
}
.eb-load-more a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 32px; background: var(--bg-warm);
  border: 1px solid var(--border-light); border-radius: 50px;
  font-size: 0.88rem; color: var(--text-medium); transition: var(--transition);
}
.eb-load-more a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================
   CLOSE WEBSITE
   ============================================ */
.eb-maintenance {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-cream); text-align: center;
}
.eb-maintenance-box {
  padding: 60px; background: var(--bg-card);
  border-radius: var(--radius-lg); box-shadow: 0 8px 40px var(--shadow-medium);
  border: 1px solid var(--border-light); max-width: 500px;
}
.eb-maintenance-box h1 { font-size: 1.8rem; margin-bottom: 12px; }
.eb-maintenance-box p { color: var(--text-medium); font-size: 0.95rem; }

/* ============================================
   SWIPER OVERRIDES (reuse existing swiper)
   ============================================ */
.swiper-container { width: 100%; }
.swiper-pagination-bullet { background: var(--text-light) !important; opacity: 0.4 !important; }
.swiper-pagination-bullet-active { background: var(--primary) !important; opacity: 1 !important; }
.swiper-button-next, .swiper-button-prev { color: var(--primary) !important; }

/* ============================================
   UTILITY
   ============================================ */
.text-center { text-align: center; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.pagebar { margin-top: 24px; }
.post_id_{$v[id]} { }

/* Legacy compatibility with LECMS blocks */
.th-img { max-width: 100%; height: auto; }