/* NT Web Stories & Reels — listing pages: /web-stories/, /web-reels/, category pages, [web_stories_page], [web_reels_page]
   Colours come from the theme when it has them (NepaliTheme: --ntp-heading, --ntp-muted, --ntp-border, --ntp-surface; dark mode included). */

.ntsr-hub-page { box-sizing: border-box; width: 100%; max-width: var(--ntp-container, 1240px); margin: 0 auto; padding: 22px 20px 56px; }
.ntsr-hub { container-type: inline-size; container-name: ntsr-hub; position: relative; color: inherit; }
.ntsr-hub *, .ntsr-hub *::before, .ntsr-hub *::after { box-sizing: border-box; }

/* ───────── Heading ───────── */
.ntsr-hub__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; margin: 4px 0 18px; }
.ntsr-hub__icon {
    position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px;
    background: linear-gradient(135deg, var(--ntsr-a), var(--ntsr-b)); color: #fff;
    box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--ntsr-a) 75%, transparent), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.ntsr-hub__icon::after { content: ""; position: absolute; inset: -4px; border-radius: 21px; border: 2px solid color-mix(in srgb, var(--ntsr-a) 22%, transparent); }
.ntsr-hub .ntsr-hub__icon .ntsr-i { width: 27px; height: 27px; }
.ntsr-hub__titles { min-width: 0; }
.ntsr-hub .ntsr-hub__crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 2px; color: var(--ntsr-a); font-size: 13px; font-weight: 750; line-height: 1.3; text-decoration: none; }
.ntsr-hub .ntsr-hub__crumb::before { content: "‹"; font-size: 18px; line-height: 1; margin-top: -2px; }
.ntsr-hub .ntsr-hub__crumb:hover { text-decoration: underline; text-underline-offset: 3px; }
.ntsr-hub .ntsr-hub__title { margin: 0; padding: 0; border: 0; color: var(--ntp-heading, inherit); font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; line-height: 1.18; letter-spacing: -.012em; text-transform: none; }
.ntsr-hub .ntsr-hub__title::before, .ntsr-hub .ntsr-hub__title::after { content: none; }
.ntsr-hub .ntsr-hub__sub { margin: 5px 0 0; padding: 0; color: var(--ntp-muted, #687086); font-size: 14.5px; line-height: 1.5; }
.ntsr-hub__count {
    justify-self: end; display: inline-flex; align-items: center; height: 34px; padding: 0 15px; border-radius: 30px; white-space: nowrap;
    background: color-mix(in srgb, var(--ntsr-a) 11%, transparent); color: var(--ntsr-a); font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
html.ntp-dark .ntsr-hub__count, body.darkmode .ntsr-hub__count { background: color-mix(in srgb, var(--ntsr-a) 24%, transparent); color: color-mix(in srgb, var(--ntsr-a) 45%, #fff); }

/* ───────── Category chips ───────── */
.ntsr-hub__chips { position: relative; margin: 0 0 22px; }
.ntsr-hub__chips-track {
    display: flex; gap: 8px; margin: 0; padding: 2px 2px 8px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -ms-overflow-style: none; scroll-padding: 0 24px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
}
.ntsr-hub__chips-track::-webkit-scrollbar { display: none; }
.ntsr-hub .ntsr-hub-chip {
    flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 40px; white-space: nowrap;
    border: 1px solid var(--ntp-border, rgba(120, 125, 150, .3)); background: var(--ntp-surface, rgba(120, 125, 150, .05)); color: var(--ntp-heading, inherit);
    font-size: 14px; font-weight: 650; line-height: 1; text-decoration: none; -webkit-tap-highlight-color: transparent;
    transition: color .2s, border-color .2s, background .2s, box-shadow .3s var(--ntsr-ease), transform .3s var(--ntsr-spring);
}
.ntsr-hub .ntsr-hub-chip:hover { border-color: var(--ntsr-a); color: var(--ntsr-a); text-decoration: none; transform: translateY(-1px); }
.ntsr-hub .ntsr-hub-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--ntsr-a) 45%, transparent); outline-offset: 2px; }
.ntsr-hub .ntsr-hub-chip.is-active, .ntsr-hub .ntsr-hub-chip.is-active:hover {
    border-color: transparent; background: linear-gradient(135deg, var(--ntsr-a), var(--ntsr-b)); color: #fff; transform: none;
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--ntsr-a) 75%, transparent);
}
@container ntsr-hub (min-width: 900px) {
    .ntsr-hub__chips-track { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}

/* ───────── Grid (stories + reels share the column count) ───────── */
.ntsr-hub { --ntsr-hub-cols: 5; --ntsr-hub-gap: 18px; }
@container ntsr-hub (max-width: 1120px) { .ntsr-hub .ntsr-stories, .ntsr-hub .ntsr-rgrid-wrap { --ntsr-hub-cols: 4; } }
@container ntsr-hub (max-width: 860px) { .ntsr-hub .ntsr-stories, .ntsr-hub .ntsr-rgrid-wrap { --ntsr-hub-cols: 3; --ntsr-hub-gap: 14px; } }
@container ntsr-hub (max-width: 560px) { .ntsr-hub .ntsr-stories, .ntsr-hub .ntsr-rgrid-wrap { --ntsr-hub-cols: 2; --ntsr-hub-gap: 10px; } }

.ntsr-hub .ntsr-stories--grid .ntsr-stories__track,
.ntsr-hub .ntsr-rgrid-wrap .ntsr-rgrid {
    display: grid; grid-template-columns: repeat(var(--ntsr-hub-cols), minmax(0, 1fr)); gap: var(--ntsr-hub-gap);
    margin: 0; padding: 0; overflow: visible;
}
@container ntsr-hub (max-width: 560px) {
    .ntsr-hub .ntsr-stories .ntsr-scard, .ntsr-hub .ntsr-rgrid-wrap .ntsr-rcard { --r: 14px; border-radius: 14px; }
    .ntsr-hub .ntsr-scard__title { font-size: 14px; -webkit-line-clamp: 3; }
    .ntsr-hub .ntsr-scard__body { left: 10px; right: 10px; bottom: 10px; gap: 5px; }
}

/* Cards added by "Load more" rise in one after another. */
.ntsr-hub .is-fresh { animation: ntsrHubIn .55s var(--ntsr-ease) both; animation-delay: calc(min(var(--k, 0), 12) * 45ms); }
@keyframes ntsrHubIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ───────── Load more ───────── */
.ntsr-hub__more { display: flex; justify-content: center; margin-top: 30px; }
.ntsr-hub .ntsr-hub__more-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 210px; height: 50px; padding: 0 28px; border-radius: 50px;
    background: linear-gradient(135deg, var(--ntsr-a), var(--ntsr-b)); color: #fff; font-size: 15px; font-weight: 750; line-height: 1; text-decoration: none;
    box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--ntsr-a) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .3s var(--ntsr-spring), box-shadow .3s var(--ntsr-ease), filter .2s;
}
.ntsr-hub .ntsr-hub__more-btn:hover { color: #fff; text-decoration: none; transform: translateY(-2px); filter: brightness(1.06); }
.ntsr-hub .ntsr-hub__more-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--ntsr-a) 50%, transparent); outline-offset: 3px; }
.ntsr-hub__more-btn .ntsr-i { width: 18px; height: 18px; transition: transform .3s var(--ntsr-spring); }
.ntsr-hub__more-btn:hover .ntsr-i { transform: translateY(2px); }
.ntsr-hub__more-btn.is-loading { pointer-events: none; filter: saturate(.7); }
.ntsr-hub__more-btn.is-loading .ntsr-i { display: none; }
.ntsr-hub__more-btn.is-loading::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: ntsrSpin .8s linear infinite; }
.ntsr-hub__more-btn.is-failed { background: #b42318; }

/* ───────── Empty ───────── */
.ntsr-hub__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 20px; border: 1.5px dashed var(--ntp-border, rgba(120, 125, 150, .35)); border-radius: 22px; text-align: center; color: var(--ntp-muted, #687086); }
.ntsr-hub__empty-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: color-mix(in srgb, var(--ntsr-a) 12%, transparent); color: var(--ntsr-a); }
.ntsr-hub .ntsr-hub__empty-icon .ntsr-i { width: 28px; height: 28px; }
.ntsr-hub .ntsr-hub__empty p { margin: 0; font-size: 15px; }
.ntsr-hub .ntsr-hub__empty-link { color: var(--ntsr-a); font-weight: 750; text-decoration: none; }

/* ───────── Phones ───────── */
@container ntsr-hub (max-width: 560px) {
    .ntsr-hub__head { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; margin-bottom: 14px; }
    .ntsr-hub__icon { width: 44px; height: 44px; border-radius: 14px; }
    .ntsr-hub__icon::after { border-radius: 18px; }
    .ntsr-hub .ntsr-hub__icon .ntsr-i { width: 22px; height: 22px; }
    .ntsr-hub .ntsr-hub__sub { font-size: 13.5px; }
    .ntsr-hub__count { grid-column: 1 / -1; justify-self: start; height: 30px; padding: 0 12px; font-size: 12.5px; }
    .ntsr-hub__chips { margin: 0 -14px 16px; }
    .ntsr-hub__chips-track { padding: 2px 14px 8px; }
    .ntsr-hub .ntsr-hub-chip { height: 36px; padding: 0 15px; font-size: 13.5px; }
    .ntsr-hub__more-btn { width: 100%; }
}
@media (max-width: 600px) { .ntsr-hub-page { padding: 16px 14px 40px; } }
@media (prefers-reduced-motion: reduce) { .ntsr-hub .is-fresh { animation: none; } }
