/* File: assets/css/lelib-global.css */
/* PALETTE: CLASSIC LIBRARY (Rêu cổ điển & Vàng đồng) */

:root {
  /* --- MÀU CHỦ ĐẠO (Xanh rêu trầm mặc) --- */
  --tv-accent: #4A5D23;         /* Moss Green (Main Action) */
  --tv-accent-hover: #334018;   /* Dark Moss (Hover, Text đậm) */
  
  /* --- MÀU NỀN NHẤN (Màu giấy cũ/Beige xanh) --- */
  --tv-accent-bg: #F3F4E8;      
  
  /* --- MÀU BỔ SUNG (Vàng đồng - Gold/Bronze) --- */
  --tv-count-fg: #C89F5D;       /* Dùng cho số đếm, icon tim, badge */
  --tv-count-bg: #FCFBF8;       /* Nền kem rất nhạt để tôn màu vàng đồng */
  
  /* --- MÀU TRUNG TÍNH --- */
  --tv-neutral-bg: #f9fafb;
  --tv-neutral-fg: #1f2937;     /* Chữ đen xám nhẹ */
  --tv-menu-bg: #ffffff;
  --tv-menu-fg: #1f2937;
  --tv-menu-bd: #e5e7eb;
}

html { color-scheme: light; }

/* Global Utilities */
.tv-section { margin: 2rem 0; }
.tv-title { margin: 0 0 .75rem; }

/* Menu Badges */
.main-nav .menu > li > a,
#site-navigation .menu > li > a,
.menu > li > a {
  display: flex; align-items: center; gap: .5em; flex-wrap: nowrap; width: 100%;
}
.main-nav .menu :where(.tv-count--circle, .tv-count--square),
#site-navigation .menu :where(.tv-count--circle, .tv-count--square),
.menu :where(.tv-count--circle, .tv-count--square) {
  margin-left: auto; flex: 0 0 auto; line-height: 1; white-space: nowrap;
}

.tv-count--menu {
  background: var(--tv-count-bg); 
  color: var(--tv-count-fg); 
  border: 1px solid rgba(200, 159, 93, 0.3); /* Viền vàng đồng nhạt */
  font-size: 0.75em; font-weight: 700;
  padding: 0.25em 0.6em; border-radius: 99px;
  min-width: 1.5em; text-align: center;
}

/* Page & Grid Utils */
.tv-grid { list-style: none !important; margin: 0; padding: 0; }
.tv-grid li { margin: 0; }
.tv-latest-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; border-bottom: 2px solid #f3f4f6; padding-bottom: 0.5rem; }

.tv-see-all { font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--tv-accent); }
.tv-see-all:hover { text-decoration: underline; color: var(--tv-accent-hover); }

/* Chips */
.tv-chip {
  display: inline-flex; align-items: center; 
  background: #f3f4f6; color: #4b5563; 
  font-size: 0.75rem; font-weight: 500; 
  padding: 2px 8px; border-radius: 4px; 
  white-space: nowrap; transition: all 0.2s;
}
.tv-chip a { color: inherit; text-decoration: none; }
.tv-chip:hover { background: var(--tv-accent-bg); color: var(--tv-accent-hover); }

/* Badge Format (Nhãn dán trên hình) */
.tv-badge {
  position: absolute; top: 10px; right: 10px;
  color: #fff; font-size: 0.7rem; font-weight: 600;
  padding: 3px 9px; border-radius: 4px;
  backdrop-filter: blur(4px); z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tv-badge--format { 
    /* Màu rêu đậm đà (95% opacity) */
    background: rgba(74, 93, 35, 0.95); 
}

/* Like Pill */
.tv-like-pill {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(255,255,255,0.95); 
  color: var(--tv-count-fg); /* Tim màu Vàng đồng */
  font-size: 0.75rem; font-weight: 700;
  padding: 4px 8px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 2;
}
.tv-like-ic { width: 14px; height: 14px; fill: currentColor; }

/* Spinner */
.tv-spinner {
  width: 40px; height: 40px; border: 4px solid #e5e7eb;
  border-top-color: var(--tv-accent); /* Spinner màu rêu */
  border-radius: 50%;
  animation: tvSpin 0.8s linear infinite; margin: 0 auto;
}
@keyframes tvSpin { to { transform: rotate(360deg); } }

/* Pagination */
.tv-pager { 
    display: flex; align-items: center; gap: 4px; 
    /* Mặc định justify-content để flex-start hoặc center tùy ngữ cảnh */
}

.tv-page-btn {
    width: 32px; height: 32px; /* Thu nhỏ lại (cũ là 36px) */
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; /* Bo góc nhẹ hơn chút cho gọn */
    border: 1px solid #e5e7eb; background: #fff;
    color: #4b5563; font-weight: 600; font-size: 0.8rem; /* Chữ nhỏ lại */
    cursor: pointer; transition: all 0.2s;
    line-height: 1;
}

.tv-page-btn:hover:not(:disabled) { 
    border-color: var(--tv-accent); 
    color: var(--tv-accent-hover); 
    background: var(--tv-accent-bg);
}

.tv-page-btn.is-current { 
    background: var(--tv-accent); 
    color: #fff; 
    border-color: var(--tv-accent); 
}

.tv-page-btn.is-disabled { opacity: 0.5; cursor: default; }

.tv-page-ellipsis {
    color: #9ca3af; font-size: 0.8rem; padding: 0 4px;
}