/* ═══════════════════════════════════════════════════════════════
   Telugu Books Plugin — Frontend Styles
   Theme: Warm editorial, inspired by traditional Telugu aesthetics
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Telugu:ital@0;1&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --tb-primary:     #C0392B;   /* Deep red — Telugu culture */
  --tb-primary-dk:  #96281B;
  --tb-accent:      #E67E22;   /* Saffron/turmeric */
  --tb-gold:        #F39C12;
  --tb-dark:        #1A1A2E;
  --tb-text:        #2C3E50;
  --tb-text-light:  #6B7280;
  --tb-bg:          #FAFAF8;
  --tb-bg-card:     #FFFFFF;
  --tb-border:      #E8E0D8;
  --tb-green:       #27AE60;
  --tb-shadow:      0 4px 20px rgba(0,0,0,.08);
  --tb-shadow-hover:0 8px 32px rgba(0,0,0,.14);
  --tb-radius:      10px;
  --tb-radius-lg:   16px;
  --font-display:   'Tiro Telugu', serif;
  --font-body:      'DM Sans', sans-serif;
}

* { box-sizing: border-box; }

/* ── BOOK CARDS GRID ─────────────────────────────────────────── */
.tb-books-grid {
  display: grid;
  gap: 20px;
}
.tb-cols-4 { grid-template-columns: repeat(4, 1fr); }
.tb-cols-6 { grid-template-columns: repeat(6, 1fr); }
.tb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tb-cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1100px) { .tb-cols-4 { grid-template-columns: repeat(3,1fr); } .tb-cols-6{grid-template-columns:repeat(4,1fr);} }
@media (max-width: 768px)  { .tb-cols-4,.tb-cols-6,.tb-cols-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px)  { .tb-cols-4,.tb-cols-6,.tb-cols-3,.tb-cols-2 { grid-template-columns: 1fr; } }

/* ── BOOK CARD ───────────────────────────────────────────────── */
.tb-book-card {
  background: var(--tb-bg-card);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
}
.tb-book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--tb-shadow-hover);
}
.tb-book-card.tb-featured {
  border-color: var(--tb-gold);
  box-shadow: 0 0 0 2px rgba(243,156,18,.25);
}

.tb-card-link { text-decoration: none; color: inherit; flex: 1; display: flex; flex-direction: column; }

/* Cover */
.tb-card-cover {
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: linear-gradient(135deg, #F5EBE0, #E8D5C0);
  position: relative;
}
.tb-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.tb-book-card:hover .tb-card-cover img { transform: scale(1.04); }

.tb-cover-placeholder, .tb-cover-placeholder-large {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #F5EBE0, #E8D5C0);
}

/* Badges */
.tb-card-discount, .tb-discount-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--tb-primary);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: .5px;
}
.tb-badge-featured {
  display: inline-block;
  background: linear-gradient(135deg, var(--tb-gold), var(--tb-accent));
  color: white;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
}

/* Card Info */
.tb-card-info { padding: 12px 14px 8px; flex: 1; }
.tb-card-title {
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  color: var(--tb-dark);
  margin: 0 0 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-card-author {
  font-size: .78rem;
  color: var(--tb-text-light);
  margin: 0 0 6px;
}
.tb-card-rating {
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--tb-gold);
}
.tb-card-rating span { color: var(--tb-text-light); }

/* Card Footer */
.tb-card-footer {
  padding: 10px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--tb-border);
  margin-top: auto;
}
.tb-card-price { display: flex; align-items: center; gap: 6px; }
.tb-price-sale {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tb-primary);
}
.tb-price-orig {
  font-size: .78rem;
  color: var(--tb-text-light);
  text-decoration: line-through;
}

/* Buy Button */
.tb-btn-buy {
  background: var(--tb-primary);
  color: white !important;
  font-size: .75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
  letter-spacing: .3px;
}
.tb-btn-buy:hover { background: var(--tb-primary-dk); color: white !important; }

/* Stars */
.tb-star.full, .tb-star.half { color: var(--tb-gold); }
.tb-star.empty { color: #DDD; }

/* ── SECTION TITLE ───────────────────────────────────────────── */
.tb-section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--tb-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--tb-primary);
  display: inline-block;
}

.tb-shortcode-wrapper { margin: 40px 0; }

/* ── ARCHIVE PAGE ────────────────────────────────────────────── */
.tb-archive-page { background: var(--tb-bg); min-height: 100vh; font-family: var(--font-body); }

.tb-archive-hero {
  background: linear-gradient(135deg, var(--tb-dark) 0%, #2C3E50 50%, var(--tb-primary-dk) 100%);
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tb-archive-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.tb-archive-hero-inner { position: relative; z-index: 1; }
.tb-archive-hero h1 {
  font-family: var(--font-display);
  color: white;
  font-size: 2.8rem;
  margin: 0 0 12px;
}
.tb-archive-hero p { color: rgba(255,255,255,.8); font-size: 1.1rem; margin: 0; }

.tb-archive-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}
@media (max-width: 900px) { .tb-archive-container { grid-template-columns: 1fr; } }

/* Sidebar */
.tb-archive-sidebar {
  background: white;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-lg);
  padding: 24px;
  position: sticky;
  top: 20px;
}
.tb-filter-section { margin-bottom: 24px; }
.tb-filter-section:last-child { margin-bottom: 0; }
.tb-filter-section h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--tb-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--tb-border);
}
.tb-filter-list { list-style: none; margin: 0; padding: 0; }
.tb-filter-list li { margin-bottom: 4px; }
.tb-filter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--tb-text);
  text-decoration: none;
  font-size: .87rem;
  transition: all .2s;
}
.tb-filter-list a:hover, .tb-filter-list a.active {
  background: var(--tb-primary);
  color: white;
}
.tb-filter-list a span {
  background: rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .75rem;
}
.tb-filter-list a.active span { background: rgba(255,255,255,.25); }

.tb-search-box { display: flex; gap: 6px; }
.tb-search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  font-size: .85rem;
  font-family: var(--font-body);
}
.tb-search-box button {
  background: var(--tb-primary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}

/* Sort Bar */
.tb-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
}
.tb-result-count { margin: 0; color: var(--tb-text-light); font-size: .9rem; }
.tb-result-count strong { color: var(--tb-dark); }
.tb-sort-options { display: flex; align-items: center; gap: 8px; font-size: .87rem; }
.tb-sort-options select {
  padding: 6px 10px;
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  font-family: var(--font-body);
  background: white;
  cursor: pointer;
}

/* Pagination */
.tb-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.tb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  color: var(--tb-text);
  text-decoration: none;
  font-size: .9rem;
  transition: all .2s;
}
.tb-pagination .current, .tb-pagination .page-numbers:hover {
  background: var(--tb-primary);
  color: white;
  border-color: var(--tb-primary);
}
.tb-pagination .prev, .tb-pagination .next { width: auto; padding: 0 14px; }

/* No Results */
.tb-no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--tb-text-light);
}
.tb-no-results span { font-size: 3rem; display: block; margin-bottom: 16px; }
.tb-no-results h3 { font-size: 1.4rem; color: var(--tb-dark); }

/* ── SINGLE BOOK PAGE ────────────────────────────────────────── */
.tb-single-page { background: var(--tb-bg); min-height: 100vh; font-family: var(--font-body); }
.tb-single-container { max-width: 1100px; margin: 0 auto; padding: 30px 20px; }

/* Breadcrumb */
.tb-breadcrumb {
  font-size: .82rem;
  color: var(--tb-text-light);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tb-breadcrumb a { color: var(--tb-primary); text-decoration: none; }
.tb-breadcrumb a:hover { text-decoration: underline; }

/* Main Layout */
.tb-single-main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}
@media (max-width: 768px) { .tb-single-main { grid-template-columns: 1fr; } }

/* Cover Column */
.tb-single-cover {
  position: sticky;
  top: 20px;
  border-radius: var(--tb-radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  position: relative;
}
.tb-single-cover img { width: 100%; display: block; }
.tb-cover-placeholder-large { height: 420px; font-size: 5rem; }

.tb-affiliate-notice {
  font-size: .72rem;
  color: var(--tb-text-light);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Details Column */
.tb-single-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--tb-dark);
  margin: 8px 0 6px;
  line-height: 1.2;
}
.tb-single-author { color: var(--tb-text-light); font-size: 1rem; margin: 0 0 16px; }
.tb-single-author strong { color: var(--tb-primary); }

.tb-single-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.tb-stars { font-size: 1.2rem; }
.tb-rating-num { color: var(--tb-text-light); font-size: .9rem; }

/* Genre Tags */
.tb-genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tb-genre-tag {
  background: rgba(192,57,43,.08);
  color: var(--tb-primary);
  border: 1px solid rgba(192,57,43,.2);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
}
.tb-genre-tag:hover { background: var(--tb-primary); color: white; }

/* Price Block */
.tb-price-block {
  background: linear-gradient(135deg, #FFF8F0, #FFF3E8);
  border: 1px solid #FFD9AA;
  border-radius: var(--tb-radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.tb-price-current {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--tb-primary);
  display: block;
}
.tb-price-original {
  font-size: 1rem;
  color: var(--tb-text-light);
  text-decoration: line-through;
  margin-right: 8px;
}
.tb-price-save {
  background: var(--tb-green);
  color: white;
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}
.tb-price-note { font-size: .78rem; color: var(--tb-text-light); margin: 8px 0 0; }

/* Buy Button Large */
.tb-buy-section { margin-bottom: 28px; }
.tb-btn-buy-large {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, var(--tb-accent), #E55B14);
  color: white !important;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: var(--tb-radius);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(230,126,34,.4);
  letter-spacing: .5px;
}
.tb-btn-buy-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230,126,34,.5);
  color: white !important;
}
.tb-buy-note { font-size: .78rem; color: var(--tb-text-light); margin: 8px 0 0; text-align: center; }

/* Details Table */
.tb-details-table { margin-top: 8px; }
.tb-details-table h3 { font-size: 1rem; font-weight: 600; color: var(--tb-dark); margin: 0 0 12px; }
.tb-details-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tb-details-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--tb-border);
}
.tb-details-table td:first-child {
  color: var(--tb-text-light);
  font-weight: 500;
  width: 35%;
  background: rgba(0,0,0,.02);
}

/* Description */
.tb-single-description {
  background: white;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-lg);
  padding: 32px;
  margin-bottom: 48px;
}
.tb-single-description h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--tb-dark);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--tb-border);
}
.tb-description-content { line-height: 1.8; color: var(--tb-text); }

/* Related Books */
.tb-related-books { margin-bottom: 48px; }
.tb-related-books h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--tb-dark);
  margin-bottom: 24px;
}
.tb-related-card .tb-card-title { font-size: .82rem; -webkit-line-clamp: 2; }

/* ── BREADCRUMB ───────────────────────────────────────────────── */
.tb-breadcrumb { font-size: .82rem; }
