/* UruShop Blog Filters — v1.0.0 */

/* =============================================
   Filter Bar
   ============================================= */
.urushop-blog__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

/* Category pills */
.urushop-blog__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.urushop-blog__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #00A86B;
    border-radius: 999px;
    background: #fff;
    color: #1B4332;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
}

.urushop-blog__pill:hover {
    background: rgba(0, 168, 107, 0.08);
}

.urushop-blog__pill--active {
    background: #00A86B;
    color: #fff;
    border-color: #00A86B;
}

.urushop-blog__pill--active:hover {
    background: #009060;
}

.urushop-blog__pill-count {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
}

/* Search input */
.urushop-blog__search {
    position: relative;
    width: 260px;
    flex-shrink: 0;
}

.urushop-blog__search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 999px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    min-height: 44px;
    box-sizing: border-box;
}

.urushop-blog__search-input:focus {
    border-color: #00A86B;
}

.urushop-blog__search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.urushop-blog__search-clear:hover {
    color: #333;
}

/* =============================================
   Active Chips
   ============================================= */
.urushop-blog__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.urushop-blog__chips:empty {
    display: none;
}

.urushop-blog__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f0f7f4;
    border: 1px solid #00A86B;
    border-radius: 999px;
    font-size: 13px;
    color: #1B4332;
}

.urushop-blog__chip-remove {
    background: none;
    border: none;
    font-size: 16px;
    color: #00A86B;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.urushop-blog__chip-clear {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: none;
    border: 1px solid #ccc;
    border-radius: 999px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.urushop-blog__chip-clear:hover {
    border-color: #999;
    color: #333;
}

/* =============================================
   Post Grid
   ============================================= */
.urushop-blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =============================================
   Post Cards (reuse from urushop-blog-scroll)
   ============================================= */
.urushop-blog-card {
    display: flex;
}

.urushop-blog-card__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.urushop-blog-card__image {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
    display: block;
    border-radius: 12px 12px 0 0;
}

.urushop-blog-card__image--placeholder {
    background: #f0f0f0;
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: 12px 12px 0 0;
}

.urushop-blog-card__body {
    padding: 0 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.urushop-blog-card__category {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    color: #00A86B;
    margin-top: 16px;
    margin-bottom: 0;
}

.urushop-blog-card__category a {
    color: #00A86B;
    text-decoration: none;
}

.urushop-blog-card__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #1B4332;
    margin: 8px 0 10px;
}

.urushop-blog-card__title a {
    color: #1B4332;
    text-decoration: none;
}

.urushop-blog-card__title a:hover {
    color: #00A86B;
}

.urushop-blog-card__excerpt {
    font-size: 15px;
    color: #666;
    margin-top: auto;
    line-height: 1.5;
}

/* =============================================
   Sentinel / Loading
   ============================================= */
.urushop-blog__sentinel {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    min-height: 60px;
}

.urushop-blog__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #00A86B;
    border-radius: 50%;
    animation: urushop-blog-spin 0.8s linear infinite;
}

.urushop-blog__sentinel--done {
    display: none;
}

.urushop-blog__sentinel--end {
    padding: 32px 0;
}

.urushop-blog__sentinel--end .urushop-blog__spinner {
    display: none;
}

.urushop-blog__end-message {
    color: #999;
    font-size: 14px;
}

@keyframes urushop-blog-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton loading */
.urushop-blog-card--skeleton .urushop-blog-card__inner {
    overflow: hidden;
}

.urushop-blog-card--skeleton .urushop-blog__skeleton-img,
.urushop-blog-card--skeleton .urushop-blog__skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: urushop-blog-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.urushop-blog-card--skeleton .urushop-blog__skeleton-img {
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: 12px 12px 0 0;
}

.urushop-blog-card--skeleton .urushop-blog__skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.urushop-blog-card--skeleton .urushop-blog__skeleton-line--short {
    width: 40%;
}

.urushop-blog-card--skeleton .urushop-blog__skeleton-line--title {
    height: 20px;
    width: 80%;
}

@keyframes urushop-blog-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Empty state */
.urushop-blog__empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 900px) {
    .urushop-blog__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .urushop-blog__grid {
        grid-template-columns: 1fr;
    }

    .urushop-blog__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .urushop-blog__pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .urushop-blog__pills::-webkit-scrollbar {
        display: none;
    }

    .urushop-blog__search {
        width: 100%;
    }
}

/* Hide native pagination when plugin active */
.wp-block-query .wp-block-query-pagination {
    display: none !important;
}
