/* ==========================================================================
   TuTap.vn - Tab Thờ Mẫu CSS (Khánh Tiệc Tứ Phủ Slider, Quick Dock)
   File: /include/css/tab_thomau.css
   ========================================================================== */

/* ==========================================================================
   KHÁNH TIỆC TIÊN THÁNH: GIAO DIỆN CHÍNH THỐNG NHẤT (APPLE IOS & ANDROID)
   Gộp toàn bộ thành 1 Thẻ Trượt Sang Trọng Duy Nhất:
   - Thoáng đãng, tinh tế, không còn 2 mục rời lẻ
   - Vuốt ngón tay / bấm nút để chuyển sang ngày tiệc tiếp theo
   - 4 Nút tiện ích nằm thành hàng Dock độc lập bên dưới
   ========================================================================== */
.tuphu-main-fest-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(38, 26, 20, 0.94) 0%, rgba(26, 17, 13, 0.98) 100%);
  border: 1px solid rgba(240, 207, 117, 0.22);
  box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 14px 14px 12px 14px;
  margin-bottom: 12px;
  color: var(--tt-text-title, #fff4dc);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 641px) {
  .tuphu-main-fest-card {
    padding: 16px 18px 14px 18px;
  }
}

html.theme-light .tuphu-main-fest-card,
body.theme-light .tuphu-main-fest-card {
  background: linear-gradient(165deg, rgba(255, 253, 248, 0.96) 0%, rgba(247, 241, 232, 0.98) 100%);
  border: 1px solid rgba(197, 145, 42, 0.22);
  box-shadow: 0 10px 30px -4px rgba(60, 40, 20, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  color: #2b1f17;
}

/* Header Thẻ Khánh Tiệc (Tiêu đề & Bộ đếm Capsule) */
.tuphu-fest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(240, 207, 117, 0.12);
}

html.theme-light .tuphu-fest-header {
  border-bottom-color: rgba(197, 145, 42, 0.12);
}

.tuphu-fest-header-left {
  min-width: 0;
  flex: 1;
}

.tuphu-fest-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tt-gold, #f0cf75);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.2px;
}

html.theme-light .tuphu-fest-header-title {
  color: #8c5b08;
}

.tuphu-fest-header-sub {
  font-size: 11px;
  color: var(--tt-text-muted, #a69180);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

html.theme-light .tuphu-fest-header-sub {
  color: #7d6856;
}

.tuphu-fest-season-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(240, 207, 117, 0.15);
  color: var(--tt-gold, #f0cf75);
  border: 1px solid rgba(240, 207, 117, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

html.theme-light .tuphu-fest-season-pill {
  background: rgba(197, 145, 42, 0.12);
  border-color: rgba(197, 145, 42, 0.3);
  color: #7a4e06;
}

/* Cụm điều hướng viên thuốc Apple Capsule (‹ 1 / 8 ›) */
.tuphu-capsule-nav {
  display: inline-flex;
  align-items: center;
  background: rgba(240, 207, 117, 0.12);
  border: 1px solid rgba(240, 207, 117, 0.25);
  border-radius: 999px;
  padding: 2px 3px;
  gap: 2px;
  flex-shrink: 0;
  user-select: none;
}

html.theme-light .tuphu-capsule-nav {
  background: rgba(197, 145, 42, 0.1);
  border-color: rgba(197, 145, 42, 0.22);
}

.tuphu-pill-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--tt-gold, #f0cf75);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.18s ease;
}

.tuphu-pill-btn:hover {
  background: rgba(240, 207, 117, 0.22);
  transform: scale(1.1);
}

.tuphu-pill-btn:active {
  transform: scale(0.9);
}

html.theme-light .tuphu-pill-btn {
  color: #8c5b08;
}

html.theme-light .tuphu-pill-btn:hover {
  background: rgba(197, 145, 42, 0.18);
}

.tuphu-pill-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--tt-gold, #f0cf75);
  padding: 0 5px;
  letter-spacing: 0.4px;
}

html.theme-light .tuphu-pill-indicator {
  color: #8c5b08;
}

/* Khung Carousel Trượt (Swipe Stage) */
.tuphu-fest-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
  border-radius: 14px;
}

.tuphu-fest-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

.tuphu-fest-track:active,
.tuphu-fest-track.grabbing {
  cursor: grabbing;
  cursor: -webkit-grabbing;
  scroll-behavior: auto;
}

.tuphu-fest-track::-webkit-scrollbar {
  display: none;
}

.tuphu-fest-slide {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  box-sizing: border-box;
}

.tuphu-fest-item-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(240, 207, 117, 0.15);
  padding: 12px 14px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

html.theme-light .tuphu-fest-item-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(197, 145, 42, 0.16);
  box-shadow: 0 2px 8px rgba(60, 40, 20, 0.04);
}

.tuphu-slide-ambient {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  opacity: 0.16;
  filter: blur(24px);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

html.theme-light .tuphu-slide-ambient {
  opacity: 0.09;
  mix-blend-mode: multiply;
}

.tuphu-slide-inner {
  position: relative;
  z-index: 2;
}

.tuphu-slide-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* Badges trạng thái */
.tuphu-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8.5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}

.tuphu-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: tuPhuDotPulse 1.6s infinite ease-in-out;
}

@keyframes tuPhuDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.tuphu-status-badge.today {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #f87171;
}

.tuphu-status-badge.tomorrow {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.tuphu-status-badge.this-week {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--tt-gold, #f0cf75);
}

.tuphu-status-badge.upcoming {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

html.theme-light .tuphu-status-badge.today {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #b91c1c;
}

html.theme-light .tuphu-status-badge.tomorrow,
html.theme-light .tuphu-status-badge.this-week {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
}

html.theme-light .tuphu-status-badge.upcoming {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
  color: #047857;
}

.tuphu-phu-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--tt-gold, #f0cf75);
  background: rgba(240, 207, 117, 0.12);
  border: 1px solid rgba(240, 207, 117, 0.25);
  border-radius: 999px;
  padding: 2.5px 8.5px;
  display: inline-flex;
  align-items: center;
}

html.theme-light .tuphu-phu-pill {
  color: #8c5b08;
  background: rgba(197, 145, 42, 0.1);
  border-color: rgba(197, 145, 42, 0.24);
}

/* Thân nội dung Slide (Side-by-side thoáng đãng) */
.tuphu-slide-main-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tuphu-slide-avatar-box {
  width: 82px;
  height: 104px;
  border-radius: 14px;
  border: 1.5px solid rgba(240, 207, 117, 0.55);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  background: #180d0a;
}

@media (min-width: 641px) {
  .tuphu-slide-avatar-box {
    width: 96px;
    height: 122px;
    border-radius: 16px;
  }
}

html.theme-light .tuphu-slide-avatar-box {
  background: #fff8f0;
  border-color: rgba(197, 145, 42, 0.45);
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.1);
}

.tuphu-slide-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.tuphu-slide-avatar-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tt-gold, #f0cf75);
}

.tuphu-slide-text-box {
  flex: 1;
  min-width: 0;
}

.tuphu-slide-heading {
  margin: 0 0 5px 0;
  font-size: clamp(14.5px, 2.7vw, 17px);
  font-weight: 700;
  color: var(--tt-gold, #f0cf75);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

html.theme-light .tuphu-slide-heading {
  color: #8c5b08;
}

.tuphu-slide-date-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tuphu-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7.5px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.tuphu-date-chip.lunar {
  color: var(--tt-gold, #f0cf75);
  background: rgba(240, 207, 117, 0.08);
  border: 1px solid rgba(240, 207, 117, 0.18);
}

.tuphu-date-chip.solar {
  color: var(--tt-text-body, #d6c4b2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html.theme-light .tuphu-date-chip.lunar {
  color: #8c5b08;
  background: rgba(197, 145, 42, 0.08);
  border-color: rgba(197, 145, 42, 0.2);
}

html.theme-light .tuphu-date-chip.solar {
  color: #5c4737;
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.06);
}

.tuphu-slide-description {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--tt-text-body, #d6c4b2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  transition: all 0.25s ease;
}

/* Xóa bỏ hoàn toàn mọi định dạng cỡ chữ, font chữ bên trong phần mô tả */
.tuphu-slide-description,
.tuphu-slide-description * {
  font-family: inherit !important;
  font-size: 11.5px !important;
}

.tuphu-slide-description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Tối ưu hiển thị các thẻ HTML sinh ra từ Rich Editor */
.tuphu-slide-description p,
.tuphu-slide-description div {
  margin: 0 0 4px 0;
  line-height: 1.5;
}

.tuphu-slide-description p:last-child,
.tuphu-slide-description div:last-child {
  margin-bottom: 0;
}

.tuphu-slide-description ul,
.tuphu-slide-description ol {
  margin: 4px 0;
  padding-left: 18px;
}

.tuphu-slide-description li {
  margin-bottom: 2px;
}

.tuphu-slide-description strong,
.tuphu-slide-description b {
  font-weight: 700;
  color: var(--tt-gold, #f0cf75);
}

.tuphu-slide-description em,
.tuphu-slide-description i {
  font-style: italic;
}

.tuphu-slide-description u {
  text-decoration: underline;
}

.tuphu-slide-description a {
  color: var(--tt-gold, #f0cf75);
  text-decoration: underline;
}

html.theme-light .tuphu-slide-description {
  color: #554437;
}

html.theme-light .tuphu-slide-description strong,
html.theme-light .tuphu-slide-description b,
html.theme-light .tuphu-slide-description a {
  color: #8c5b08;
}

/* Nút bấm ẩn/hiện thêm nội dung bị cắt chữ */
.tuphu-desc-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  padding: 3px 0 0 0;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tt-gold, #f0cf75);
  cursor: pointer;
  line-height: 1.3;
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tuphu-desc-more-btn:hover {
  opacity: 1;
  text-decoration: underline;
}

.tuphu-desc-more-btn:active {
  transform: scale(0.96);
}

.tuphu-desc-more-btn svg {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tuphu-desc-more-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

html.theme-light .tuphu-desc-more-btn {
  color: #8c5b08;
}

.tuphu-swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--tt-text-muted, #a69180);
  opacity: 0.75;
  user-select: none;
  transition: opacity 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease;
}

html.theme-light .tuphu-swipe-hint {
  color: #7d6856;
}

html.tuphu-hint-hidden #tuphu-swipe-hint,
body.tuphu-hint-hidden #tuphu-swipe-hint {
  display: none !important;
}

/* ==========================================================================
   4 PHÍM TẮT TIỆN ÍCH DOCK (QUICK ACTIONS DOCK) NẰM ĐỘC LẬP BÊN DƯỚI
   ========================================================================== */
.tuphu-quick-actions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.tuphu-action-dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 3px 7px 3px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(240, 207, 117, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  user-select: none;
  min-width: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tuphu-action-dock-btn:hover {
  background: rgba(240, 207, 117, 0.1);
  border-color: rgba(240, 207, 117, 0.35);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tuphu-action-dock-btn:active {
  transform: scale(0.96);
  background: rgba(240, 207, 117, 0.16);
}

html.theme-light .tuphu-action-dock-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(197, 145, 42, 0.16);
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.05);
}

html.theme-light .tuphu-action-dock-btn:hover {
  background: #fff;
  border-color: rgba(197, 145, 42, 0.35);
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.08);
}

.tuphu-action-dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(240, 207, 117, 0.1);
  border: 1px solid rgba(240, 207, 117, 0.18);
  margin-bottom: 4px;
  color: var(--tt-gold, #f0cf75);
  transition: transform 0.2s ease;
}

.tuphu-action-dock-btn:hover .tuphu-action-dock-icon {
  transform: scale(1.08);
}

html.theme-light .tuphu-action-dock-icon {
  background: rgba(197, 145, 42, 0.1);
  border-color: rgba(197, 145, 42, 0.2);
  color: #8c5b08;
}

.tuphu-action-dock-svg {
  width: 14px;
  height: 14px;
  color: var(--tt-gold, #f0cf75);
  flex-shrink: 0;
  display: block;
}

html.theme-light .tuphu-action-dock-svg {
  color: #8c5b08;
}

.tuphu-action-dock-title {
  font-size: clamp(10px, 2.4vw, 11.5px);
  font-weight: 700;
  color: var(--tt-text-title, #fff4dc);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

html.theme-light .tuphu-action-dock-title {
  color: #2b1f17;
}

.tuphu-action-dock-sub {
  font-size: clamp(8px, 1.8vw, 9.5px);
  color: var(--tt-text-muted, #a69180);
  margin-top: 1px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

html.theme-light .tuphu-action-dock-sub {
  color: #7d6856;
}