/* 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);
}

/* Interactions State */
.js-lemh-interact-btn[data-type="like"]:hover {
  color: #eab308;
}

.js-lemh-interact-btn[data-type="like"].savelike-is-active svg {
  fill: #ef4444;
  color: #ef4444;
}

.js-lemh-interact-btn.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* 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;
}

/* Author Popup Enhancements */
.tv-popup-back {
  display: inline-flex !important;
  width: fit-content !important;
  align-items: center;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #6b7280 !important;
  padding: 0 !important;
  margin-bottom: 15px !important;
  font-size: 11px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
  font-weight: 500;
}

.tv-popup-back strong {
  margin-left: 3px;
  color: var(--tv-accent);
}

.tv-popup-back:hover {
  color: var(--tv-accent) !important;
  background: none !important;
  transform: translateX(-3px);
}

.tv-popup-back svg {
  transition: transform 0.2s;
  stroke: currentColor;
}

.tv-popup-back:hover svg {
  stroke: var(--tv-accent);
}

.tv-author-sublink {
  color: var(--tv-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 93, 35, 0.2);
  transition: all 0.2s;
}

.tv-author-sublink:hover {
  color: var(--tv-accent-hover);
  border-bottom-color: var(--tv-accent-hover);
  background: rgba(74, 93, 35, 0.05);
}

.tv-author-members-list {
  margin-top: 4px;
}

.tv-list-inline {
  display: inline;
}

.tv-list-vertical .tv-member-item {
  display: block;
  margin-bottom: 4px;
}

.tv-list-inline .tv-member-item {
  display: inline;
}

.tv-view-all-members {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 10px;
  background: #fff;
  border: 1px solid var(--tv-accent);
  color: var(--tv-accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  vertical-align: middle;
}

.tv-view-all-members:hover {
  background: var(--tv-accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(74, 93, 35, 0.2);
}

.tv-hidden-members {
  display: none;
}