/*
 * NMF Digital — CMS styles (Case Studies + Blog & Insights)
 * Designed in the flat system: Archivo regular headings, Manrope body,
 * JetBrains Mono eyebrows, signature blue #0053b7, flat black ink bands.
 * Everything is scoped under .nmf-cms (which sits inside .nmf-flat).
 */

/* ---------- Shells ---------- */
.nmf-cms { background: var(--surface-page); }
.nmf-cms-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
/*.nmf-cms-shell--narrow { max-width: 820px; }*/

/* ---------- Hero bands ---------- */
.nmf-cms-hero {
  padding: clamp(64px, 10vw, 120px) 0 clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--border-subtle);
}
.nmf-cms-hero--ink {
  background: var(--surface-inverse);
  border-bottom: none;
}
.nmf-cms-hero__eyebrow { display: inline-block; margin-bottom: 18px; }
.nmf-cms-hero--ink .nmf-cms-hero__eyebrow { color: var(--nmf-pink); }
.nmf-cms-hero__title {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tighter);
  max-width: 16ch;
  margin: 0 0 18px;
}
.nmf-cms .nmf-cms-hero--ink .nmf-cms-hero__title { color: var(--text-on-dark); }
.nmf-cms-hero__lede {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  max-width: 56ch;
  margin: 0;
  color: var(--text-body);
}
.nmf-cms-hero--ink .nmf-cms-hero__lede { color: var(--neutral-300); }

/* ---------- Filter chips ---------- */
.nmf-cms-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 28px;
  padding-bottom: 4px;
}
.nmf-cms .nmf-cms-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-body);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard),
              background var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-chip:hover {
  border-color: var(--border-brand);
  color: var(--color-brand);
  text-decoration: none;
}
.nmf-cms .nmf-cms-chip.is-active {
  background: var(--surface-brand);
  border-color: var(--surface-brand);
  color: var(--text-on-brand);
}
.nmf-cms-chip__count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.65;
}

/* ---------- Meta / tags ---------- */
.nmf-cms-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.nmf-cms-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--magenta-100);
  color: var(--color-brand);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nmf-cms-tag--ghost {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
}
.nmf-cms-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-brand);
  color: var(--text-on-brand);
  font-family: var(--font-display);
  font-size: 14px;
}

/* ---------- Listing wrap ---------- */
.nmf-cms-list { padding-top: 40px; padding-bottom: clamp(56px, 8vw, 96px); }

/* ---------- Feature card (latest post) ---------- */
.nmf-cms-feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  transition: box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.nmf-cms-feature:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.nmf-cms-feature__media { display: block; background: var(--neutral-100); min-height: 320px; }
.nmf-cms-feature__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nmf-cms-feature__body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.nmf-cms-feature__title {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.nmf-cms-feature__title a { color: var(--text-strong); text-decoration: none; }
.nmf-cms-feature__title a:hover { color: var(--color-brand); }
.nmf-cms-feature__excerpt {
  margin: 0;
  color: var(--text-body);
  line-height: var(--leading-relaxed);
}

/* ---------- Card grid ---------- */
.nmf-cms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.nmf-cms-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}
.nmf-cms-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border-default);
}
.nmf-cms-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--neutral-100);
  overflow: hidden;
}
.nmf-cms-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.nmf-cms-card:hover .nmf-cms-card__media img { transform: scale(1.04); }
.nmf-cms-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  flex: 1;
}
.nmf-cms-card__title {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  line-height: var(--leading-snug);
}
.nmf-cms-card__title a { color: var(--text-strong); text-decoration: none; }
.nmf-cms-card__title a:hover { color: var(--color-brand); }
.nmf-cms-card__excerpt {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-body);
}
.nmf-cms-card__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nmf-cms-card__foot svg { width: 15px; height: 15px; color: var(--color-brand); }

/* ---------- "Read more" link ---------- */
.nmf-cms .nmf-cms-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  color: var(--color-brand);
  text-decoration: none;
}
.nmf-cms .nmf-cms-more svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-standard); }
.nmf-cms .nmf-cms-more:hover { text-decoration: none; }
.nmf-cms .nmf-cms-more:hover svg { transform: translateX(4px); }

/* ---------- Case study cards (alternating wide rows) ---------- */
.nmf-cms-cases { display: flex; flex-direction: column; gap: 32px; }
.nmf-cms-case {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.nmf-cms-case:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.nmf-cms-case:nth-child(even) .nmf-cms-case__media { order: 2; }
.nmf-cms-case__media {
  position: relative;
  display: block;
  min-height: 300px;
  background: var(--neutral-100);
}
.nmf-cms-case__media img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.nmf-cms-case__stat {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-inverse);
  color: var(--neutral-300);
  font-size: 12px;
  box-shadow: var(--shadow-md);
}
.nmf-cms-case__stat strong {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: 26px;
  letter-spacing: var(--tracking-tight);
  color: #fff;
}
.nmf-cms-case__body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.nmf-cms-case__client {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nmf-cms-case__title {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.nmf-cms-case__title a { color: var(--text-strong); text-decoration: none; }
.nmf-cms-case__title a:hover { color: var(--color-brand); }
.nmf-cms-case__excerpt { margin: 0; color: var(--text-body); line-height: var(--leading-relaxed); }

/* ---------- Article (single post / case study) ---------- */
.nmf-cms-article__head { padding: clamp(56px, 8vw, 96px) 0 clamp(28px, 4vw, 44px); }
.nmf-cms-case-single__head { padding-bottom: clamp(44px, 6vw, 72px); }
.nmf-cms-article__title {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tighter);
  max-width: 22ch;
  margin: 0 0 20px;
}
.nmf-cms-article__meta { margin-top: 4px; }
.nmf-cms-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nmf-cms-crumbs a { color: var(--color-brand); text-decoration: none; }
.nmf-cms-crumbs a:hover { text-decoration: underline; }
.nmf-cms-crumbs span { color: var(--text-muted); }
.nmf-cms-crumbs svg { width: 13px; height: 13px; color: var(--text-muted); }
.nmf-cms-crumbs--onink a { color: var(--nmf-pink); }
.nmf-cms-crumbs--onink span,
.nmf-cms-crumbs--onink svg { color: var(--neutral-400); }

.nmf-cms-article__hero {
  margin: 8px 0 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.nmf-cms-article__hero img { width: 100%; height: auto; display: block; }

/* ---------- Fact bar (case study hero) ---------- */
.nmf-cms-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 36px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.nmf-cms-facts__item dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neutral-500);
  margin-bottom: 6px;
}
.nmf-cms-facts__item dd {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-on-dark);
}

/* ---------- Stats row (case study) ---------- */
.nmf-cms-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: -36px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.nmf-cms-stats__item {
  background: var(--surface-card);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nmf-cms-stats__item strong {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--color-brand);
}
.nmf-cms-stats__item span { font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- Editor body ---------- */
.nmf-cms-body {
  padding: clamp(32px, 5vw, 56px) 0 8px;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}
.nmf-cms-body > * + * { margin-top: 1.1em; }
.nmf-cms-body h2 { font-size: var(--text-xl); margin-top: 1.8em; }
.nmf-cms-body h3 { font-size: var(--text-lg); margin-top: 1.6em; }
.nmf-cms-body a { color: var(--text-link); text-decoration: underline; text-underline-offset: 3px; }
.nmf-cms-body img,
.nmf-cms-body figure { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.nmf-cms-body figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}
.nmf-cms-body blockquote {
  margin: 1.6em 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--border-brand);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--text-strong);
}
.nmf-cms-body blockquote p { margin: 0; }
.nmf-cms-body ul,
.nmf-cms-body ol { padding-left: 1.3em; }
.nmf-cms-body li { margin: 0.4em 0; }
.nmf-cms-body li::marker { color: var(--color-brand); }
.nmf-cms-body pre,
.nmf-cms-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--neutral-100);
  border-radius: var(--radius-sm);
}
.nmf-cms-body code { padding: 2px 6px; }
.nmf-cms-body pre { padding: 18px 20px; overflow-x: auto; }
.nmf-cms-body pre code { padding: 0; background: none; }
.nmf-cms-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2.2em 0;
}
.nmf-cms-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.nmf-cms-body th,
.nmf-cms-body td { padding: 10px 14px; border: 1px solid var(--border-subtle); text-align: left; }
.nmf-cms-body th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--neutral-100);
  color: var(--text-strong);
}
.nmf-cms-pagelinks { margin-top: 1.6em; font-weight: var(--fw-semibold); }

/* ---------- Tags row ---------- */
.nmf-cms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.nmf-cms-tags a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-tags a:hover { border-color: var(--border-brand); color: var(--color-brand); }

/* ---------- Prev / next navigation ---------- */
.nmf-cms-postnav-wrap { padding-bottom: 8px; }
.nmf-cms-postnav { margin: 40px 0 0; }
.nmf-cms-postnav .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nmf-cms-postnav .nav-previous a,
.nmf-cms-postnav .nav-next a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  height: 100%;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.nmf-cms-postnav .nav-previous a:hover,
.nmf-cms-postnav .nav-next a:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}
.nmf-cms-postnav .nav-next { text-align: right; }
.nmf-cms-postnav .nav-next a { align-items: flex-end; }
.nmf-cms-postnav__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nmf-cms-postnav__label svg { width: 14px; height: 14px; color: var(--color-brand); }
.nmf-cms-postnav__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--text-strong);
  line-height: var(--leading-snug);
}

/* ---------- Related section ---------- */
.nmf-cms-related {
  margin-top: clamp(48px, 7vw, 80px);
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--neutral-100);
  border-top: 1px solid var(--border-subtle);
}
.nmf-cms-related__title {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  margin: 12px 0 28px;
}

/* ---------- Pagination ---------- */
.nmf-cms-pagination { margin-top: 48px; }
.nmf-cms-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nmf-cms-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-body);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-pagination .page-numbers:hover { border-color: var(--border-brand); color: var(--color-brand); }
.nmf-cms-pagination .page-numbers.current {
  background: var(--surface-brand);
  border-color: var(--surface-brand);
  color: var(--text-on-brand);
}
.nmf-cms-pagination .page-numbers.dots { border: none; }
.nmf-cms-pagination svg { width: 15px; height: 15px; }

/* ---------- Empty state ---------- */
.nmf-cms-empty {
  text-align: center;
  padding: clamp(48px, 8vw, 96px) 24px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-xl);
}
.nmf-cms-empty h2 { font-size: var(--text-xl); margin-bottom: 8px; }
.nmf-cms-empty p { margin: 0; color: var(--text-muted); }

/* ---------- CTA band ---------- */
.nmf-cms-cta {
  background: var(--surface-inverse);
  padding: clamp(48px, 7vw, 88px) 0;
}
.nmf-cms-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.nmf-cms-cta .nmf-eyebrow { color: var(--nmf-pink); }
.nmf-cms .nmf-cms-cta__title {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--text-on-dark);
  margin: 10px 0 8px;
}
.nmf-cms-cta__text { margin: 0; color: var(--neutral-400); max-width: 46ch; }
.nmf-cms .nmf-cms-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: var(--text-on-brand);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
  white-space: nowrap;
}
.nmf-cms .nmf-cms-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand-lg);
  text-decoration: none;
}
.nmf-cms .nmf-cms-btn svg { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nmf-cms-grid { grid-template-columns: repeat(2, 1fr); }
  .nmf-cms-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nmf-cms-feature,
  .nmf-cms-case { grid-template-columns: 1fr; }
  .nmf-cms-case:nth-child(even) .nmf-cms-case__media { order: 0; }
  .nmf-cms-feature__media { min-height: 240px; }
  .nmf-cms-case__media { min-height: 240px; }
  .nmf-cms-case__media img { position: static; height: 240px; }
  .nmf-cms-stats { margin-top: 24px; }
}
@media (max-width: 640px) {
  .nmf-cms-grid { grid-template-columns: 1fr; }
  .nmf-cms-postnav .nav-links { grid-template-columns: 1fr; }
  .nmf-cms-postnav .nav-next { text-align: left; }
  .nmf-cms-postnav .nav-next a { align-items: flex-start; }
  .nmf-cms-facts { grid-template-columns: 1fr; gap: 16px; }
  .nmf-cms-cta__inner { flex-direction: column; align-items: flex-start; }
}

/* Kill the global underline-on-hover inside chip/button affordances */
.nmf-cms .nmf-cms-chip:hover,
.nmf-cms .nmf-cms-btn:hover,
.nmf-cms .nmf-cms-more:hover,
.nmf-cms .nmf-cms-tags a:hover,
.nmf-cms .nmf-cms-pagination .page-numbers:hover,
.nmf-cms .nmf-cms-postnav .nav-links a:hover,
.nmf-cms .nmf-cms-card__title a:hover,
.nmf-cms .nmf-cms-case__title a:hover,
.nmf-cms .nmf-cms-feature__title a:hover { text-decoration: none; }

/* =========================================================================
 * Sitemap additions: filter groups, search, case card details,
 * challenge→approach→results, related solutions, subscribe band
 * ====================================================================== */

/* ---------- Filter bar with labelled groups ---------- */
.nmf-cms-filterbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 28px;
  padding-bottom: 4px;
}
.nmf-cms-filterbar .nmf-cms-filter { padding: 0; }
.nmf-cms-filter-group {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.nmf-cms-filter-group__label {
  flex: 0 0 92px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nmf-cms-filter--solo { padding-top: 28px; }

/* ---------- Hero search (Blog & Insights) ---------- */
.nmf-cms .nmf-cms-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin-top: 28px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-search:focus-within {
  border-color: var(--border-brand);
  box-shadow: 0 0 0 4px var(--magenta-100);
}
.nmf-cms .nmf-cms-search svg { width: 17px; height: 17px; color: var(--text-muted); flex: 0 0 auto; }
.nmf-cms .nmf-cms-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-strong);
}
.nmf-cms .nmf-cms-search input::placeholder { color: var(--text-muted); }
.nmf-cms .nmf-cms-search button {
  border: none;
  cursor: pointer;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--surface-brand);
  color: var(--text-on-brand);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  transition: opacity var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-search button:hover { opacity: 0.9; }

/* ---------- Bylines / small avatar ---------- */
.nmf-cms-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.nmf-cms-avatar--sm { width: 22px; height: 22px; font-size: 11px; }
.nmf-cms-card__author {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-size: 12px;
}

/* ---------- Case card: brand row, challenge/solution lines, metrics ---------- */
.nmf-cms-case__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.nmf-cms-case__logo img {
  display: block;
  max-height: 34px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}
.nmf-cms-case__line {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-body);
}
.nmf-cms-case__line strong {
  display: block;
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 3px;
}
.nmf-cms-case__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.nmf-cms-case__metric { display: flex; flex-direction: column; gap: 1px; }
.nmf-cms-case__metric strong {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
}
.nmf-cms-case__metric span { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Case single: hero logo ---------- */
.nmf-cms-case-single__logo {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
}
.nmf-cms-case-single__logo img {
  display: block;
  max-height: 34px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
}

/* ---------- Challenge → Approach → Results steps ---------- */
.nmf-cms-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: clamp(32px, 5vw, 56px);
}
.nmf-cms-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.nmf-cms-step:first-child { border-top: 1px solid var(--border-subtle); }
.nmf-cms-step__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-brand);
  padding-top: 6px;
}
.nmf-cms .nmf-cms-step__title {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 10px;
}
.nmf-cms-step p {
  margin: 0;
  color: var(--text-body);
  line-height: var(--leading-relaxed);
}
.nmf-cms-step__results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nmf-cms-step__results li { color: var(--text-body); }
.nmf-cms-step__results li strong {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  color: var(--color-brand);
  margin-right: 8px;
}

/* ---------- Related solutions & services used ---------- */
.nmf-cms-used {
  margin-top: clamp(32px, 5vw, 48px);
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--neutral-100);
}
.nmf-cms .nmf-cms-used__title {
  font-size: var(--text-md);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 16px;
}
.nmf-cms-used__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.nmf-cms .nmf-cms-used__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-strong);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-used__item:hover {
  border-color: var(--border-brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
}
.nmf-cms-used__item svg { width: 16px; height: 16px; color: var(--color-brand); flex: 0 0 auto; }
.nmf-cms-used__item .nmf-cms-used__go { margin-left: auto; color: var(--text-muted); width: 14px; height: 14px; }

/* ---------- Subscribe to Insights band ---------- */
.nmf-cms-subscribe {
  background: var(--neutral-100);
  border-top: 1px solid var(--border-subtle);
  padding: clamp(44px, 6vw, 72px) 0;
}
.nmf-cms-subscribe__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.nmf-cms .nmf-cms-subscribe__title {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  margin: 10px 0 8px;
}
.nmf-cms-subscribe__text { margin: 0; color: var(--text-body); max-width: 44ch; }
.nmf-cms .nmf-cms-subscribe__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  min-width: min(420px, 100%);
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-subscribe__form:focus-within {
  border-color: var(--border-brand);
  box-shadow: 0 0 0 4px var(--magenta-100);
}
.nmf-cms .nmf-cms-subscribe__form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-strong);
}
.nmf-cms .nmf-cms-btn--solid {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 12px 26px;
  box-shadow: none;
}
.nmf-cms-subscribe__ok,
.nmf-cms-subscribe__err {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: var(--fw-semibold);
}
.nmf-cms-subscribe__ok { color: var(--color-brand); }
.nmf-cms-subscribe__ok svg { width: 20px; height: 20px; }
.nmf-cms-subscribe__err { color: #b42318; font-size: var(--text-sm); flex-basis: 100%; }

/* ---------- Responsive for the new pieces ---------- */
@media (max-width: 860px) {
  .nmf-cms-filter-group { flex-direction: column; gap: 8px; }
  .nmf-cms-filter-group__label { flex: none; }
  .nmf-cms-step { grid-template-columns: 44px 1fr; gap: 14px; }
  .nmf-cms-subscribe__inner { flex-direction: column; align-items: stretch; }
  .nmf-cms .nmf-cms-subscribe__form { min-width: 0; }
  .nmf-cms .nmf-cms-search { max-width: none; }
  .nmf-cms .nmf-cms-search button { padding: 10px 16px; }
}

/* ---------- Two-level case filter tabs ---------- */
.nmf-cms .nmf-cms-tabs { padding: 0; }
.nmf-cms .nmf-cms-tab {
  font-family: var(--font-body);
  background: transparent;
  cursor: pointer;
}
.nmf-cms .nmf-cms-tab svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-tab.is-open svg,
.nmf-cms .nmf-cms-tab[aria-expanded="true"] svg { transform: rotate(180deg); }
.nmf-cms .nmf-cms-tab.is-active { background: var(--surface-brand); border-color: var(--surface-brand); color: var(--text-on-brand); }
.nmf-cms-subfilter {
  padding: 14px 0 2px;
  margin-top: 2px;
  border-top: 1px dashed var(--border-subtle);
}
.nmf-cms-subfilter[hidden] { display: none; }

/* ---------- v1.5.0: single-page dynamic filtering ---------- */

/* Chips as buttons (identical look to the anchor chips) */
.nmf-cms .nmf-cms-chip { font-family: var(--font-body); }
.nmf-cms button.nmf-cms-chip { background: var(--surface-card); cursor: pointer; }
.nmf-cms button.nmf-cms-chip.is-active { background: var(--surface-brand); border-color: var(--surface-brand); color: var(--text-on-brand); }

/* Second-level tiles: one single row, horizontal scroll when needed */
.nmf-cms-subfilter {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
  padding-bottom: 10px;
}
.nmf-cms-subfilter::-webkit-scrollbar { height: 6px; }
.nmf-cms-subfilter::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 999px; }
.nmf-cms-subfilter .nmf-cms-chip { flex: 0 0 auto; white-space: nowrap; }

/* Results container: fade while loading, height locked by JS = no jumping */
.nmf-cms-results { transition: opacity var(--dur-base) var(--ease-standard); }
.nmf-cms-results.is-loading { opacity: 0.45; pointer-events: none; }

/* Appended/replaced cards ease in */
.nmf-cms-grid > *,
.nmf-cms-cases > * { animation: nmf-cms-in 0.35s var(--ease-out) both; }
@keyframes nmf-cms-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nmf-cms-grid > *,
  .nmf-cms-cases > * { animation: none; }
}

/* Load more */
.nmf-cms-loadwrap { display: flex; justify-content: center; margin-top: 40px; }
.nmf-cms .nmf-cms-loadmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.nmf-cms .nmf-cms-loadmore:hover {
  border-color: var(--border-brand);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}
.nmf-cms .nmf-cms-loadmore:disabled { opacity: 0.55; cursor: wait; }
.nmf-cms .nmf-cms-loadmore svg { width: 16px; height: 16px; }
.nmf-cms .nmf-cms-loadmore[hidden] { display: none; }
/* =========================================================================
 * v2.1.0 — Remove the global underline-on-hover from card links.
 *
 * tokens/base.css sets `a:hover { text-decoration: underline; }` for body
 * copy. Card titles, media wrappers, and CTAs are UI elements, not prose,
 * so they must never pick up that underline. Their own hover colour and
 * transform already communicate the interaction.
 * ====================================================================== */

.nmf-cms a:hover,
.nmf-cms a:focus,
.nmf-cms-card__media:hover,
.nmf-cms-case__media:hover,
.nmf-cms-card__title a:hover,
.nmf-cms-case__title a:hover,
.nmf-cms-feature__title a:hover,
.nmf-cms-card__author:hover,
.nmf-cms-btn:hover,
.nmf-cms-more:hover,
.nmf-cms-chip:hover,
.nmf-cms-tile:hover,
.nmf-cms-pill:hover { text-decoration: none; }

/* Prose links inside article bodies keep their underline — that is correct
   for readability, so re-assert it after the blanket rule above. */
.nmf-cms-body a:hover { text-decoration: underline; }
.nmf-cms-crumbs a:hover { text-decoration: underline; }
