/* ========== MARQUEE ========== */
.blog-marquee-container {
  background: transparent;
  padding: 6px 0;
  overflow: visible;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: 60px;
  margin-bottom: 100px;
}

.blog-marquee-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ff1f8f;
  z-index: 2;
}

.blog-marquee-content {
  position: relative;
  z-index: 5;
  display: flex;
  animation: marquee 20s linear infinite;
  white-space: nowrap;
}

.blog-marquee-text {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  padding: 0 40px;
  display: inline-block;
}

.blog-marquee-text span {
  margin: 0 15px;
}

.blog-marquee-bg {
  width: 600px;
  padding: 0 20px;
}

.blog-marquee-bg-blg {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
}

.blog-marquee-bg-o {
  position: absolute;
  inset: 0;
  margin: auto;
  padding-bottom: 8px;
  z-index: 1;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ========== MAIN LAYOUT ========== */
.blog-main {
  display: flex;
  gap: 30px;
}

/* ========== SIDEBAR ========== */
.blog-sidebar {
  width: 300px;
  flex-shrink: 0;
  /* background: #f5f5f5; */
}

.blog-sidebar-section {
  margin-bottom: 40px;
}

.blog-sidebar-title {
  background: #000;
  color: #fff;
  padding: 12px 15px;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.blog-sidebar-title::before {
  content: "";
  width: 16px;
  height: 16px;
  background-image: url("../../template/images/asterisk-crop.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  filter: brightness(0) saturate(100%) invert(28%) sepia(96%) saturate(6539%)
    hue-rotate(320deg) brightness(100%) contrast(105%);
  animation: rotate-icon 3s linear infinite;
}

@keyframes rotate-icon {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Sửa lại border cho list - có viền đen bao quanh */
.blog-sidebar-list {
  background: #f5f5f5;
  border: 1px solid #787878;
  border-top: none;
  text-transform: uppercase;
}

.blog-sidebar-item {
  padding: 12px 15px;
  border-bottom: 1px solid #787878;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  position: relative;
}

.blog-sidebar-item:hover {
  background: #fff;
}

.blog-sidebar-item:last-child {
  border-bottom: none;
}

.blog-sidebar-item-arrow {
  font-size: 18px;
  color: #666;
  padding: 12px 15px;
  margin: -12px -15px -12px 15px;
  border-left: 1px solid #787878;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

/* Featured Posts in Sidebar */
.blog-sidebar-featured-posts {
  background: #f5f5f5;
  border: 1px solid #787878;
}

.blog-sidebar-post-item {
  padding: 15px;
  border-bottom: 1px solid #787878;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.blog-sidebar-post-item:hover {
  background: #fff;
}

.blog-sidebar-post-item:last-child {
  border-bottom: none;
}

.blog-sidebar-post-thumbnail {
  width: 60px;
  height: 60px;
  background: #ccc;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.blog-sidebar-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-sidebar-post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blog-sidebar-post-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar-post-date {
  font-size: 11px;
  color: #666;
  margin-top: auto;
  padding-top: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Hover effect */
.blog-sidebar-post-item:hover .blog-sidebar-post-date {
  color: #333;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .blog-sidebar-post-date {
    font-size: 10px;
  }
}

/* From The Lab Section */
.blog-sidebar-lab-grid {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.blog-sidebar-lab-item {
  aspect-ratio: 1;
  background: #ccc;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.blog-sidebar-lab-item:hover {
  transform: scale(1.05);
}

.blog-sidebar-lab-item:first-child {
  grid-column: 1 / -1;
}

.blog-sidebar-lab-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Listening Section */
.blog-sidebar-listening {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 20px;
  min-height: 150px;
}

/* ========== CONTENT AREA ========== */
.blog-content {
  flex: 1;
  min-width: 0;
}

.blog-content-logo {
  width: 150px;
}

.blog-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
}

.blog-content-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}

.blog-content-tabs {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 28px;
}

.blog-content-tab {
  padding: 0px 10px;
  background: #a7a9ac;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.blog-content-tab::before {
  content: "";
  width: 30px;
  height: 30px;
  background-image: url(../../template/images/asterisk-crop.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  filter: brightness(0) saturate(100%) invert(28%) sepia(96%) saturate(6539%)
    hue-rotate(320deg) brightness(100%) contrast(105%);
  animation: rotate-icon 3s linear infinite;
  position: absolute;
  top: -15px;
  left: -15px;
}

/* Hero Post */
.blog-hero-post {
  margin-bottom: 40px;
  position: relative;
}

.blog-hero-post-thumbnail {
  width: 100%;
  max-width: 100%;
  height: 400px;
  background: #ccc;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0;
}

.blog-hero-post-thumbnail::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 110px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    transparent 100%
  );
  z-index: 1;
}

.blog-hero-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.blog-hero-post-title {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  padding: 0 30px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  z-index: 2;
}

.blog-hero-post-title a {
  color: #fff !important;
  text-decoration: none;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.blog-hero-post-description {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  padding: 0 30px;
  font-size: 16px;
  line-height: 1.6;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

/* Posts Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.blog-post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.blog-post-card:hover {
  transform: translateY(-5px);
}

.blog-post-card-thumbnail {
  width: 100%;
  max-width: 100%;
  height: 220px;
  background: #ccc;
  overflow: hidden;
}

.blog-post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.blog-post-card-content {
  padding-top: 20px;
}

.blog-post-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  height: 50px;
}

.blog-post-card-description {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Posts List (dạng hàng ngang) */
.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-post-list-item {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.blog-post-list-card {
  display: flex;
  gap: 15px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.blog-post-list-card:hover {
  transform: translateX(5px);
}

.blog-post-list-thumbnail {
  width: 150px;
  height: 120px;
  background: #ccc;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-post-list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-post-list-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.blog-post-list-description {
  font-size: 13px;
  line-height: 1.4;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========== SIDEBAR RESPONSIVE COMPONENTS ========== */

/* Overlay khi mở sidebar */
.blog-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 997;
  display: none;
}

.blog-sidebar.active ~ .blog-sidebar-overlay {
  display: block;
}


.blog-sidebar-close:hover {
  background: #ff1f8f;
  transform: rotate(90deg);
}

/* Overlay */
.blog-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.blog-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Nút đóng trong sidebar */
.blog-sidebar-close {
  display: none;
  position: absolute;
  top: 15px;
  right: 20px;
  width: 40px;
  height: 40px;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s;
}

.blog-sidebar-close:hover {
  background: #333;
}

/* Floating Button (Sticky bên trái khi scroll) */
.blog-sidebar-floating-toggle {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(-100px);
  width: 50px;
  height: 50px;
  background: #ff1f8f;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 997;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: none;
  align-items: center;
  justify-content: center;
}

.blog-sidebar-floating-toggle:hover {
  background: #333;
  transform: translateY(-50%) translateX(0) scale(1.1);
}

.blog-sidebar-floating-toggle.show {
  transform: translateY(-50%) translateX(0);
}

.blog-sidebar-floating-toggle i {
  font-size: 20px;
}

/* ========== RESPONSIVE ========== */

/* TABLET: 1024px trở xuống */
@media (max-width: 1024px) {
  .blog-sidebar-floating-toggle {
    display: flex;
  }

  .blog-main {
    flex-direction: column;
  }

  /* Hiển thị breadcrumbs thay cho toggle button */
  .blog-breadcrumbs-wrapper {
    display: block;
  }

  /* Sidebar chuyển thành slide menu */
  .blog-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    z-index: 999;
    background: #f5f5f5;
    transition: left 0.3s ease;
    padding: 60px 20px 20px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: block;
  }

  .blog-sidebar.active {
    left: 0;
  }

  /* Hiển thị nút đóng */
  .blog-sidebar-close {
    display: block;
  }
}

/* MOBILE: 480px trở xuống */
@media (max-width: 480px) {
  .blog-sidebar-floating-toggle {
    left: 15px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  /* Sidebar nhỏ hơn trên mobile */
  .blog-sidebar {
    left: -100%;
    width: 100%;
  }

  /* Nút toggle full width */
  .blog-breadcrumbs-wrapper {
    width: 100%;
  }

  .blog-breadcrumbs-wrapper .rank-math-breadcrumb {
    text-align: center;
    font-size: 13px;
  }

  /* Hero post nhỏ hơn */
  .blog-hero-post-thumbnail {
    height: 250px;
  }

  .blog-hero-post-title {
    font-size: 20px;
    padding: 0 20px;
    bottom: 40px;
  }

  .blog-hero-post-description {
    font-size: 14px;
    padding: 0 20px;
    bottom: 15px;
  }

  /* Post list 1 cột */
  .blog-post-list-item {
    grid-template-columns: 1fr;
  }

  /* Post card content padding nhỏ hơn */
  .blog-post-card-content {
    padding-top: 15px;
  }

  .blog-post-card-description {
    font-size: 13px;
  }

  .blog-content-header {
    flex-wrap: wrap;
  }

  /* Content tabs nhỏ hơn */
  .blog-content-tabs {
    font-size: 20px;
  }

  /* Marquee nhỏ hơn */
  .blog-marquee-text {
    font-size: 14px;
    padding: 0 30px;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
  }
}

/* ẨN BTN SHOW SIDEBAR DEFAULT WP */
.wd-sidebar-opener.wd-action-btn.wd-style-icon.wd-burger-icon.wd-hide-lg {
  display: none;
}

/* ========== PAGINATION STYLES - FIXED VERSION ========== */

.blog-pagination {
  text-align: center;
  margin-bottom: 40px;
}

.blog-pagination ul {
  display: inline-flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.blog-pagination li {
  display: inline-block;
  margin: 0;
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.blog-pagination a:hover {
  background: #000;
  color: #fff;
  border-color: #000;
  transform: translateY(-2px);
}

.blog-pagination .current {
  background: #ff1f8f;
  color: #fff;
  border-color: #ff1f8f;
  font-weight: 700;
}

.blog-pagination .prev,
.blog-pagination .next {
  font-weight: 600;
  min-width: 80px;
}

.blog-pagination .prev:hover,
.blog-pagination .next:hover {
  background: #ff1f8f;
  border-color: #ff1f8f;
  color: #fff;
}

.blog-pagination .dots {
  border: none;
  background: transparent;
  color: #999;
  cursor: default;
  pointer-events: none;
}

/* Responsive Pagination */
@media (max-width: 480px) {
  .blog-pagination a,
  .blog-pagination span {
    min-width: 35px;
    height: 35px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .blog-pagination ul {
    gap: 5px;
  }

  .blog-pagination .prev,
  .blog-pagination .next {
    min-width: 70px;
  }
}

/* Fix grid khi không đủ 4 items */
.blog-posts-grid {
  min-height: 750px; /* Đủ cao cho 2 hàng cards (mỗi card ~360px) + gap 25px */
  align-content: start; /* Cards bắt đầu từ trên xuống */
}

.blog-posts-grid .blog-post-card:only-child,
.blog-posts-grid .blog-post-card:first-child:nth-last-child(2),
.blog-posts-grid
  .blog-post-card:first-child:nth-last-child(2)
  ~ .blog-post-card,
.blog-posts-grid .blog-post-card:first-child:nth-last-child(3),
.blog-posts-grid
  .blog-post-card:first-child:nth-last-child(3)
  ~ .blog-post-card {
  max-width: 100%;
}

/* Khi chỉ có 1 card */
.blog-posts-grid:has(.blog-post-card:only-child) {
  grid-template-columns: repeat(2, 1fr);
}

.blog-posts-grid .blog-post-card:only-child {
  grid-column: 1 / 2;
}

.blog-posts-grid
  .blog-post-card:first-child:nth-last-child(3)
  ~ .blog-post-card:last-child {
  grid-column: 1 / 2;
}

/* Responsive */
@media (max-width: 480px) {
  .blog-pagination a.page-numbers,
  .blog-pagination span.page-numbers {
    min-width: 35px;
    height: 35px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .blog-pagination .page-numbers {
    gap: 5px;
  }

  /* Mobile: 1 cột nên không cần fix grid */
  .blog-posts-grid .blog-post-card:only-child,
  .blog-posts-grid .blog-post-card:first-child:nth-last-child(2),
  .blog-posts-grid .blog-post-card:first-child:nth-last-child(3) {
    grid-column: auto;
  }
}

/* ==================== THEME OPTIONS - CUSTOM SECTIONS ==================== */
/* Thêm vào cuối file 91lab-blog.css */

/* Custom Links Hover Enhancement */
.blog-sidebar-item {
  cursor: pointer;
  transition: all 0.3s ease;
}

.blog-sidebar-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* ==================== FROM THE LAB - PINTEREST MASONRY ==================== */
/* Override old grid styles for masonry layout */

.blog-sidebar-lab-grid.lab-masonry-grid {
  /* Remove old grid */
  display: block !important;
  grid-template-columns: unset !important;
  gap: unset !important;

  /* CSS Column-based Masonry */
  column-count: 2;
  column-gap: 10px;
}

.lab-masonry-grid .blog-sidebar-lab-item {
  /* Remove old square aspect ratio */
  aspect-ratio: unset !important;
  grid-column: unset !important;

  /* Masonry styles */
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;

  margin-bottom: 10px;
  display: inline-block;
  width: 100%;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lab-masonry-grid .blog-sidebar-lab-item:hover {
  transform: translateY(-3px);
}

.lab-masonry-grid .blog-sidebar-lab-item img {
  width: 100%;
  height: auto !important; /* Keep natural aspect ratio */
  display: block;
  border-radius: 6px;
  object-fit: contain !important; /* Show full image, no crop */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.lab-masonry-grid .blog-sidebar-lab-item:hover img {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Remove first-child special styling for masonry */
.lab-masonry-grid .blog-sidebar-lab-item:first-child {
  grid-column: unset !important;
}

/* Responsive - Single Column on Mobile */
@media (max-width: 768px) {
  .blog-sidebar-lab-grid.lab-masonry-grid {
    column-count: 1;
  }
}

/* ==================== ACTIVE STATE CHO SIDEBAR CATEGORY ITEMS ==================== */

/* Active state cho sidebar item */
.blog-sidebar-item.active {
  background-color: #ff1f8f;
  color: #fff;
  font-weight: 600;
}

.blog-sidebar-item.active .blog-sidebar-item-arrow {
  color: #fff;
}

/* Hover effect với active state */
.blog-sidebar-item {
  transition: all 0.3s ease;
}

.blog-sidebar-item:hover {
  background-color: #f5f5f5;
}

.blog-sidebar-item.active:hover {
  background-color: #ff1f8f;
  opacity: 0.9;
}

/* Responsive - đảm bảo active state hoạt động trên mobile */
@media (max-width: 1024px) {
  .blog-sidebar-item.active {
    background-color: #ff1f8f;
    color: #fff;
  }
}

input.blog-sidebar-newsletter-input {
  border-radius: 0 !important;
}

button.btn-add-to-cart {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0px;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.rank-math-breadcrumb p {
  margin-bottom: 20px !important;
}

.rank-math-breadcrumb p a {
  color: #ff1f8f;
}
