/* Reserve the vertical scrollbar's gutter so filtering — which changes the
   page height as the result count changes, and swaps in shorter skeletons
   mid-load — can't make the scrollbar appear/disappear and shift the
   horizontally-centered layout (the search bar visibly slides ~7.5px). This
   stylesheet is enqueued only on pages that contain the hub block, so the
   rule is effectively scoped to those pages. */
html {
    scrollbar-gutter: stable;
}

/* The theme wraps page content in a single-child flex row
   (.max-w-7xl ... lg:flex-row). A flex item defaults to flex-basis:auto, so
   it sizes to its CONTENT — and when the AJAX filter briefly swaps the card
   grid for a few near-empty skeleton cards, the <article> collapses to fit
   them (.nc-vrh__main drops from ~956px to ~358px) and snaps back once real
   cards arrive. Pinning the article to the full line width fixes its basis
   so .nc-vrh__main holds its width across the whole load. Matches the normal
   full-width state, so it's a no-op except during loading. */
article:has(> .nc-vrh) {
    width: 100%;
}

.nc-vrh {
    font-family: 'Inter', sans-serif;
    color: #1a2327;
}

.nc-vrh a {
    text-decoration: none;
}

.nc-vrh__body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 36px;
}

.nc-vrh__filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #20323a;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.nc-vrh__filter-label--spaced {
    margin: 26px 0 14px;
}

.nc-vrh__cat-list {
    display: flex;
    flex-direction: column;
}

.nc-vrh__cat-row {
    appearance: none;
    background: none;
    border: none;
    text-align: left;
    padding: 9px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4a5b60;
    margin-bottom: 2px;
}

.nc-vrh__cat-row.is-active {
    background: #e8f3f4;
    color: #008c9a;
    font-weight: 700;
}

.nc-vrh__cat-row:hover {
    color: #008c9a;
}

.nc-vrh__type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nc-vrh__chip {
    appearance: none;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #f2f5f5;
    color: #5b6b70;
}

.nc-vrh__chip.is-active {
    background: #008c9a;
    color: #fff;
}

.nc-vrh__chip:hover {
    color: rgb(0, 140, 154);
}

.nc-vrh__chip.is-active:hover {
    color: rgb(255, 255, 255);
}

.nc-vrh__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.nc-vrh__mobile-select {
    display: none;
}

.nc-vrh__search-btn-label--short {
    display: none;
}

.nc-vrh__count {
    font-size: 14px;
    color: #5b6b70;
    flex-shrink: 0;
}

.nc-vrh__search {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 420px;
}

.nc-vrh__search input {
    flex: 1;
    padding: 9px 14px;
    border-radius: 7px;
    border: 1px solid #dde5e6;
    font-size: 13px;
    line-height: normal;
    font-family: inherit;
}

.nc-vrh__search-btn {
    appearance: none;
    border: none;
    background: #31aebe;
    color: #fff;
    padding: 0 18px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.15s ease;
}

.nc-vrh__search-btn:hover {
    background: #2a8692;
}

.nc-vrh__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    transition: opacity 0.15s ease;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nc-vrh__grid.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.nc-vrh__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgb(230, 235, 236);
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.nc-vrh__card:hover {
    box-shadow: 0 10px 28px rgba(13, 43, 52, 0.12);
    transform: translateY(-2px);
    color: inherit;
}

.nc-vrh__card[hidden] {
    display: none;
}

.nc-vrh__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #dde7e8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nc-vrh__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nc-vrh__badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #008c9a;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.nc-vrh__card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nc-vrh__card-cat {
    font-size: 11px;
    font-weight: 700;
    color: #008c9a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nc-vrh__card-title {
    font-size: 16px;
    font-weight: 900;
    color: #1a2327;
    line-height: 1.35;
}

.nc-vrh__card-date {
    font-size: 12px;
    color: #8b9a9e;
    margin-top: auto;
    padding-top: 8px;
}

.nc-vrh__card--skeleton {
    pointer-events: none;
}

.nc-vrh__card--skeleton .nc-vrh__thumb,
.nc-vrh__skel {
    background: linear-gradient(90deg, #e6ebec 25%, #f2f5f5 37%, #e6ebec 63%);
    background-size: 400% 100%;
    animation: nc-vrh-shimmer 1.4s ease infinite;
}

.nc-vrh__skel {
    border-radius: 4px;
}

.nc-vrh__skel--cat {
    width: 40%;
    height: 11px;
    margin-bottom: 2px;
}

.nc-vrh__skel--title {
    width: 92%;
    height: 16px;
}

.nc-vrh__skel--title2 {
    width: 58%;
    height: 16px;
}

.nc-vrh__skel--date {
    width: 32%;
    height: 11px;
    margin-top: auto;
}

@keyframes nc-vrh-shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nc-vrh__card--skeleton .nc-vrh__thumb,
    .nc-vrh__skel {
        animation: none;
    }
}

.nc-vrh__empty {
    text-align: center;
    padding: 60px 20px;
    color: #5b6b70;
    font-size: 14px;
}

.nc-vrh__load-more {
    appearance: none;
    display: block;
    margin: 32px auto 0;
    background: #31aebe;
    border: none;
    color: #fff;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.15s ease;
}

.nc-vrh__load-more:hover {
    background: #2a8692;
}

.nc-vrh__load-more[hidden],
.nc-vrh__empty[hidden] {
    display: none;
}

.nc-vrh__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 32px auto 0;
}

.nc-vrh__pagination[hidden] {
    display: none;
}

.nc-vrh__page-nav,
.nc-vrh__page-num {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #dde5e6;
    color: #4a5b60;
    min-width: 36px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.nc-vrh__page-nav:hover,
.nc-vrh__page-num:hover {
    border-color: #008c9a;
    color: #008c9a;
}

.nc-vrh__page-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nc-vrh__page-nav:disabled:hover {
    border-color: #dde5e6;
    color: #4a5b60;
}

.nc-vrh__page-numbers {
    display: flex;
    gap: 6px;
}

.nc-vrh__page-num.is-active {
    background: #008c9a;
    border-color: #008c9a;
    color: #fff;
}

.nc-vrh__page-num.is-active:hover {
    color: #fff;
}

@media (max-width: 1023px) {
    .nc-vrh__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 899px) {
    .nc-vrh__body {
        grid-template-columns: 1fr;
        padding: 28px 0px;
        gap: 20px;
    }

    .nc-vrh__sidebar {
        display: none;
    }

    .nc-vrh__toolbar {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "search search search"
            "count catselect typeselect";
        align-items: center;
        gap: 10px 12px;
        margin-bottom: 14px;
    }

    .nc-vrh__count {
        grid-area: count;
    }

    .nc-vrh__search {
        grid-area: search;
        max-width: none;
        width: auto;
    }

    .nc-vrh__mobile-select {
        display: block;
        min-width: 0;
        max-width: 200px;
        padding: 9px 26px 9px 10px;
        border-radius: 7px;
        border: 1px solid #dde5e6;
        font-size: 12px;
        line-height: normal;
        color: #2a3a3f;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b6b70' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
        background-size: 10px 6px;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

    .nc-vrh__mobile-select[data-role="category-select"] {
        grid-area: catselect;
    }

    .nc-vrh__mobile-select[data-role="type-select"] {
        grid-area: typeselect;
    }

    .nc-vrh__search-btn-label--full {
        display: none;
    }

    .nc-vrh__search-btn-label--short {
        display: inline;
    }

    .nc-vrh__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nc-vrh__toolbar {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "search search"
            "catselect typeselect"
            "count count";
    }

    .nc-vrh__count {
        text-align: center;
    }

    .nc-vrh__mobile-select {
        max-width: none;
        width: 100%;
    }
}
