/* ==========================================================
   1. Shortcode: [danh_sach_chuyen_muc]
========================================================== */
.cat-showcase-shortcode-container {
    margin-bottom: 30px;
}

.cat-showcase-search-wrapper {
    margin-bottom: 20px;
}

.cat-showcase-search {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
    background: #fdfdfd;
}

.cat-showcase-search:focus {
    border-color: var(--ast-global-color-0, #2ba552);
    box-shadow: 0 0 0 3px rgba(43, 165, 82, 0.15);
    background: #fff;
}

.cat-showcase-grid {
    column-count: 3;
    column-gap: 20px;
}

.cat-showcase-item {
    break-inside: avoid;
    /* Tránh bị cắt giữa cột */
    margin-bottom: 15px;
    background: #ffffff;
    border: 1px solid #efefef;
    border-left: 4px solid var(--ast-global-color-0, #2ba552);
    border-radius: 6px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.cat-showcase-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: var(--ast-global-color-0, #2ba552);
}

.cat-showcase-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
}

.cat-showcase-item .cat-name {
    font-weight: 500;
    font-size: 1em;
}

.cat-showcase-item .cat-count {
    color: var(--ast-global-color-0, #2ba552);
    background: rgba(43, 165, 82, 0.1);
    /* Nền xanh lá nhạt */
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

/* Responsive Grid */
@media (max-width: 900px) {
    .cat-showcase-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .cat-showcase-grid {
        column-count: 1;
    }
}


/* ==========================================================
   2. Horizontal Scrolling Bar (Dưới header)
========================================================== */
.cat-showcase-scrollbar-wrapper {
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
    border-top: 1px solid #eaeaea;
    width: 100%;
    overflow: hidden;
    position: relative;
    /* Có thể dùng position sticky nếu muốn luôn hiện khi cuộn */
    /* position: sticky; top: 0; z-index: 1000; */
}

.cat-showcase-scrollbar {
    display: flex;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Hỗ trợ scroll mượt trên iOS */
    padding: 8px 20px;
    /* Giảm từ 12px xuống 8px */
    gap: 12px;
    scrollbar-width: none;
    /* Ẩn thanh cuộn trên Firefox */
    cursor: grab;
}

/* Ẩn thanh cuộn trên Chrome/Safari/Edge */
.cat-showcase-scrollbar::-webkit-scrollbar {
    display: none;
}

.cat-showcase-scrollbar.active {
    cursor: grabbing;
}

.cat-scroll-item {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    font-size: 14px;
    padding: 5px 14px;
    /* Giảm từ 6px xuống 5px */
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
    user-select: none;
    /* Không bôi đen khi kéo */
}

.cat-scroll-item:hover,
.cat-scroll-item:hover,
.cat-scroll-item:active,
.cat-scroll-item.active-cat {
    background: var(--ast-global-color-0, #2ba552);
    color: #ffffff;
    border-color: var(--ast-global-color-0, #2ba552);
}

/* Các Nút Cuộn Trái/Phải (Dạng Gradient Chữ Nhật) */
.cat-scroll-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    /* Chiều rộng hiệu ứng mờ */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: none;
    outline: none;
    color: #444;
    transition: opacity 0.3s, visibility 0.3s, color 0.2s;
    opacity: 0;
    visibility: hidden;
    background: transparent;
}

.cat-scroll-nav.visible {
    opacity: 1;
    visibility: visible;
}

.cat-scroll-nav:hover,
.cat-scroll-nav:active,
.cat-scroll-nav:focus {
    color: var(--ast-global-color-0, #2ba552);
    background-color: transparent !important;
    box-shadow: none !important;
}

.cat-scroll-left {
    left: 0;
    justify-content: flex-start;
    padding-left: 5px;
    /* Khoảng cách icon tới rìa */
    background-image: linear-gradient(to right, #ffffff 40%, rgba(255, 255, 255, 0)) !important;
    background-color: transparent !important;
}

.cat-scroll-right {
    right: 0;
    justify-content: flex-end;
    padding-right: 5px;
    /* Khoảng cách icon tới rìa */
    background-image: linear-gradient(to left, #ffffff 40%, rgba(255, 255, 255, 0)) !important;
    background-color: transparent !important;
}

/* ==========================================================
   3. Shortcode: [danh_sach_ngay_thang]
========================================================== */
.cat-showcase-date-shortcode-container {
    margin: 30px 0;
    font-family: inherit;
}

.cat-showcase-date-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    background: #fdfdfd;
    padding: 15px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
}

.cat-showcase-month-select,
.cat-showcase-year-select {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    line-height: normal;
    height: auto;
    outline: none;
    background-color: #fff;
    cursor: pointer;
    min-width: 120px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.cat-showcase-month-select:focus,
.cat-showcase-year-select:focus {
    border-color: var(--ast-global-color-0, #2ba552);
}

.cat-showcase-date-results {
    transition: opacity 0.3s ease;
    min-height: 200px;
}

.cat-showcase-no-posts {
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.cat-showcase-date-group {
    margin-bottom: 30px;
    position: relative;
}

.cat-showcase-date-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 1.1em;
    color: var(--ast-global-color-0, #2ba552);
    border-bottom: 2px solid var(--ast-global-color-0, #2ba552);
    margin-bottom: 15px;
    display: inline-block;
    width: 100%;
    box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    border-radius: 10px 10px 0px 0px;
}

.cat-showcase-date-header a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cat-showcase-date-header a:hover {
    opacity: 0.8;
}

/* Thêm top bằng height header Astra nếu có */
.ast-header-sticky-active .cat-showcase-date-header {
    top: 60px;
    /* Khắc phục khi theme dùng sticky header */
}

.cat-showcase-global-date-group {
    grid-column: 1 / -1;
    width: 100%;
    clear: both;
    flex-basis: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    display: flex;
    flex-wrap: wrap;
}

.cat-showcase-global-date {
    width: 100%;
    flex: 0 0 100%;
}

.cat-showcase-date-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-showcase-date-posts ul li {
    margin-bottom: 12px;
    padding: 0 15px;
    position: relative;
    padding-left: 25px;
}

.cat-showcase-date-posts ul li::before {
    content: "•";
    color: var(--ast-global-color-0, #2ba552);
    position: absolute;
    left: 10px;
    font-weight: bold;
}

.cat-showcase-date-posts ul li a {
    text-decoration: none;
    color: #333;
    font-size: 1em;
    transition: color 0.2s ease;
    display: block;
    line-height: 1.5;
}

.cat-showcase-date-posts ul li a:hover {
    color: var(--ast-global-color-0, #2ba552);
}