/**
 * GVA Daily Vale — combined stylesheet
 * Filter bar, load-more button, and AJAX loading states for the
 * [gva_daily_vale] shortcode grid.
 */

/* -----------------------------------------------------------------------
   Filter bar + pills
   Baseline only — colours/spacing are a starting point, adjust to match
   the site's actual navy/accent colours once rendered against real content.
----------------------------------------------------------------------- */
.gva-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-pill {
    padding: 8px 18px;
    border: 1px solid #1e2a5e;
    border-radius: 999px;
    background: transparent;
    color: #1e2a5e;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-pill:hover:not(.active) {
    background: rgba(30, 42, 94, 0.08);
    color: #1e2a5e !important;
}

.filter-pill:focus:not(.active) {
    background: transparent !important;
    color: #1e2a5e !important;
    outline: none;
}

.filter-pill.active:hover {
    background: #1e2a5e;
    color: #fff !important;
}

.filter-pill.active {
    background: #1e2a5e;
    color: #fff;
}

.filter-pill.filter-clear {
    border-style: dashed;
    opacity: 0.75;
}

.filter-pill.filter-clear:hover {
    opacity: 1;
}

/* -----------------------------------------------------------------------
   No-results message
----------------------------------------------------------------------- */
.no-results {
    text-align: center;
    padding: 40px 0;
    color: #777;
}

/* -----------------------------------------------------------------------
   Grid loading state (filter clicks — full grid dim + centred spinner)
----------------------------------------------------------------------- */
.gva-grid-wrapper {
    position: relative;
}

.gva-grid-wrapper.gva-loading .posts-grids {
    opacity: 0.5;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.gva-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 9999;
}

.gva-grid-wrapper.gva-loading .gva-loading-overlay {
    display: flex;
}

.gva-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.15);
    border-top-color: #1e2a5e; /* adjust to match the site's accent colour */
    border-radius: 50%;
    animation: gva-spin 0.8s linear infinite;
}

.load-more-btn {
    display: block;
    margin: 40px auto 0;
    padding: 12px 36px;
    background: transparent;
    border: 2px solid #1e2a5e;
    border-radius: 4px;
    color: #1e2a5e;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.load-more-btn:hover {
    background: #1e2a5e;
    color: #fff;
}
.load-more-btn.gva-btn-loading {
    position: relative;
    background: #1e2a5e;
    border-color: #1e2a5e;
    color: transparent; /* hide button text while loading, keeps button size stable */
    pointer-events: none;
}

.load-more-btn.gva-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gva-spin 0.8s linear infinite;
}

/* -----------------------------------------------------------------------
   Shared spinner animation
----------------------------------------------------------------------- */
@keyframes gva-spin {
    to { transform: rotate(360deg); }
}
