/* "More innovations" on the project page (innovation-details.php).
   Desktop: sticky side card with pages of 5. Phones/tablets: swipeable cards with arrows. */
.ndx { --x-ink: #1a1a1c; --x-mute: rgba(26, 26, 28, .58); --x-line: #ece8f3; --x-soft: #f6f4fb; --x-grad: linear-gradient(135deg, #864ffe, #e248aa);
  position: relative; display: grid; gap: 14px; padding: 20px; border: 1px solid var(--x-line); border-radius: 26px; background: #fff; color: var(--x-ink);
  font-family: var(--font-inter-tight, 'Inter Tight', system-ui, sans-serif); box-shadow: 0 24px 60px -40px rgba(60, 30, 140, .35); overflow: hidden;
  grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
.ndx > * { min-width: 0; }
.blog-sidebar-wrapper { min-width: 0; max-width: 100%; }
.ndx::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--x-grad); }
@media (min-width: 1024px) { .blog-sidebar-wrapper { position: sticky; top: 110px; } }

.ndx__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ndx__kick { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: var(--x-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ndx__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 21px; font-weight: 600; line-height: 1.2; color: var(--x-ink) !important; letter-spacing: -.01em; }
.ndx__count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(134, 79, 254, .1); color: #6d3ae0; font-size: 12.5px; font-weight: 600; }
.ndx__all { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 8px 12px; border-radius: 999px; background: var(--x-soft); color: var(--x-ink); font-size: 13px; font-weight: 500; text-decoration: none; transition: background .2s, gap .2s; }
.ndx__all:hover { background: #efeafd; gap: 8px; }
.ndx__all svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ndx__search { position: relative; display: flex; align-items: center; height: 46px; padding: 0 12px 0 14px; border: 1px solid var(--x-line); border-radius: 999px; background: var(--x-soft); transition: border-color .2s, background .2s, box-shadow .2s; }
.ndx__search:focus-within { border-color: #864ffe; background: #fff; box-shadow: 0 0 0 4px rgba(134, 79, 254, .12); }
.ndx__search svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--x-mute); stroke-width: 2; stroke-linecap: round; }
.ndx__search input { flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 10px; border: 0; background: transparent; color: var(--x-ink); font: inherit; font-size: 14.5px; outline: none; -webkit-appearance: none; appearance: none; }
.ndx__search input::-webkit-search-cancel-button { display: none; }
.ndx__clear { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(26, 26, 28, .08); color: var(--x-ink); font-size: 18px; line-height: 1; cursor: pointer; }
.ndx__clear[hidden] { display: none; }

/* topic chips: one line, swipe sideways */
.ndx__tags { display: flex; gap: 6px; margin: 0 -20px; padding: 2px 20px 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent); }
.ndx__tags::-webkit-scrollbar { display: none; }
.ndx__tags button { flex: none; scroll-snap-align: start; height: 34px; padding: 0 14px; border: 1px solid var(--x-line); border-radius: 999px; background: #fff; color: var(--x-ink); font: 500 13px/1 inherit; font-family: inherit; white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .1s; }
.ndx__tags button:hover { border-color: rgba(134, 79, 254, .4); }
.ndx__tags button:active { transform: scale(.96); }
.ndx__tags button.is-on { border-color: transparent; background: var(--x-grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(134, 79, 254, .9); }

/* cards */
.ndx__list { display: grid; gap: 6px; }
.ndx__card { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; color: inherit; text-decoration: none; transition: background .2s, transform .2s; }
.ndx__card:hover { background: var(--x-soft); transform: translateX(3px); }
.ndx__img { flex: none; width: 72px; height: 72px; overflow: hidden; border-radius: 14px; background: var(--x-soft); }
.ndx__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.ndx__card:hover .ndx__img img { transform: scale(1.06); }
.ndx__body { display: grid; gap: 3px; min-width: 0; }
.ndx__body b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--x-ink); }
.ndx__body small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.45; color: var(--x-mute); }
.ndx__meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 11.5px; color: var(--x-mute); }
.ndx__meta i { padding: 2px 8px; border-radius: 999px; background: rgba(134, 79, 254, .1); color: #6d3ae0; font-style: normal; font-weight: 600; font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndx__empty { margin: 8px 0; padding: 18px; border-radius: 16px; background: var(--x-soft); color: var(--x-mute); font-size: 14px; text-align: center; }
.ndx__empty button { border: 0; background: none; color: #6d3ae0; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* pages / arrows */
.ndx__nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--x-line); }
.ndx.is-single .ndx__nav { display: none; }
.ndx__pos { font-size: 13px; font-weight: 500; color: var(--x-mute); }
.ndx__arrow { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--x-line); border-radius: 50%; background: #fff; color: var(--x-ink); cursor: pointer; transition: background .2s, border-color .2s, opacity .2s, transform .1s; }
.ndx__arrow:hover:not(:disabled) { border-color: transparent; background: var(--x-grad); color: #fff; }
.ndx__arrow:active:not(:disabled) { transform: scale(.94); }
.ndx__arrow:disabled { opacity: .35; cursor: default; }
.ndx__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* phones + tablets: big swipe cards */
@media (max-width: 1023px) {
  .ndx { padding: 18px 16px; border-radius: 24px; }
  .ndx__tags { margin: 0 -16px; padding: 2px 16px 4px; }
  .ndx__viewport { margin: 0 -16px; }
  .ndx__list { display: flex; gap: 12px; padding: 4px 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .ndx__list::-webkit-scrollbar { display: none; }
  .ndx__card { flex: 0 0 78%; max-width: 300px; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border: 1px solid var(--x-line); border-radius: 20px; background: #fff; scroll-snap-align: start; box-shadow: 0 14px 30px -24px rgba(60, 30, 140, .5); }
  .ndx__card:hover { transform: none; background: #fff; }
  .ndx__img { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
  .ndx__body { gap: 5px; padding: 12px 14px 14px; }
  .ndx__body b { font-size: 15.5px; }
  .ndx__body small { -webkit-line-clamp: 2; font-size: 13px; }
  .ndx__empty { margin: 0 16px; flex: 1; }
  .ndx__nav { border-top: 0; padding-top: 0; }
}
@media (min-width: 640px) and (max-width: 1023px) { .ndx__card { flex-basis: 44%; } }
@media (prefers-reduced-motion: reduce) { .ndx__card, .ndx__img img { transition: none; } }

/* desktop: the side card stays in view while the project is read, then scrolls away with the section */
@media (min-width: 1024px) {
  .ndx-section { overflow: clip; }                 /* "hidden" would switch sticky off; clip keeps the same look */
  .ndx-row { align-items: stretch !important; }    /* the side column is as tall as the project column... */
  .ndx-col { align-self: stretch; }
  .ndx-col > .blog-sidebar-wrapper { position: sticky; top: 104px; }  /* ...so the card has room to stay put */
  .ndx { max-height: calc(100vh - 124px); grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
  .ndx__viewport { min-height: 0; overflow-y: auto; scrollbar-width: thin; margin-right: -8px; padding-right: 8px; }
}
/* numbered pages */
.ndx__pos { display: flex; align-items: center; gap: 4px; }
.ndx__pg { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--x-ink); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.ndx__pg:hover { border-color: var(--x-line); background: var(--x-soft); }
.ndx__pg.is-on { background: var(--x-grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(134, 79, 254, .9); }
.ndx__gap { padding: 0 2px; color: var(--x-mute); }
@media (min-width: 1024px) {
  .ndx { gap: 12px; padding: 18px; }
  .ndx__list { gap: 2px; }
  .ndx__card { padding: 6px; gap: 11px; }
  .ndx__img { width: 58px; height: 58px; border-radius: 12px; }
  .ndx__body b { -webkit-line-clamp: 1; font-size: 14px; }
  .ndx__body { gap: 2px; }
  .ndx__search { height: 42px; }
  .ndx__tags button { height: 32px; }
}
