/* ==========================================================================
   components.css — NMF Digital
   CSS ports of the design-system React components (Button, Card), the
   hover rules the original page injected at runtime, wp_nav_menu styling,
   and the baked-in "video" hero treatment.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Button (port of NMFDigitalDesignSystem.Button)
   -------------------------------------------------------------------------- */
.nmf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    background var(--dur-base) var(--ease-standard);
}

.nmf-btn--sm { padding: 8px 16px;  font-size: 13px; gap: 6px; }
.nmf-btn--md { padding: 12px 24px; font-size: 15px; gap: 8px; }
.nmf-btn--lg { padding: 16px 32px; font-size: 17px; gap: 10px; }

.nmf-btn--primary {
  background: var(--gradient-brand);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
}
.nmf-btn--primary:hover {
  box-shadow: var(--shadow-brand-lg);
  transform: translateY(-1px);
}
.nmf-btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.nmf-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* --------------------------------------------------------------------------
   Card (port of NMFDigitalDesignSystem.Card, variant="plain" interactive)
   -------------------------------------------------------------------------- */
.nmf-card {
  border-radius: var(--radius-xl);
  transition:
    transform var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard);
}
.nmf-card--plain {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  box-shadow: var(--shadow-sm);
}
.nmf-card--interactive { cursor: pointer; }
.nmf-card--interactive:hover {
  transform: translateY(-3px);
}
.nmf-card--plain.nmf-card--interactive:hover {
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   Primary navigation (wp_nav_menu output)
   -------------------------------------------------------------------------- */
.nmf-primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 30px;
}
.nmf-primary-menu li { margin: 0; padding: 0; }

/* Anchor look — mirrors the original inline style (.nmf-x10) */
.nmf-primary-menu a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  text-decoration: none;
}

/* Footer menus (wp_nav_menu output re-uses .nmf-x148 / .nmf-x149) */
.nmf-x148 li { margin: 0; padding: 0; }

/* --------------------------------------------------------------------------
   Hover rules (formerly injected at runtime by _injectStyles)
   -------------------------------------------------------------------------- */
.nmf-navlink { position: relative; transition: color var(--dur-base) var(--ease-standard); }
.nmf-navlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--gradient-brand);
  transition: width var(--dur-base) var(--ease-standard);
}
.nmf-navlink:hover { color: var(--magenta-600); }
.nmf-navlink:hover::after { width: 100%; }

.nmf-hero-chip:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34) !important;
}

.nmf-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-body);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  transition: all var(--dur-base) var(--ease-standard);
  cursor: default;
}
.nmf-chip:hover {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.nmf-ind {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  transition:
    transform var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard);
  cursor: default;
}
.nmf-ind:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--magenta-200);
}
.nmf-ind-i {
  width: 26px;
  height: 26px;
  color: var(--magenta-600);
  transition: transform var(--dur-base) var(--ease-spring);
}
.nmf-ind:hover .nmf-ind-i { transform: scale(1.18) rotate(-6deg); }
.nmf-ind-t {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-strong);
  line-height: 1.15;
}

.nmf-logo-i { width: 20px; height: 20px; color: var(--magenta-600); }
.nmf-logo-t {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nmf-case:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl) !important; }
.nmf-case:hover .nmf-case-img { transform: scale(1.06); }
.nmf-case:hover .nmf-case-arrow { transform: translateX(5px); }

.nmf-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff !important;
  transform: translateY(-1px);
}

.nmf-flink { transition: color var(--dur-base) var(--ease-standard); }
.nmf-flink:hover { color: #fff !important; }

.nmf-marquee-track:hover { animation-play-state: paused; }

@media (max-width: 900px) {
  #nmf-hero { min-height: auto; }
}

/* --------------------------------------------------------------------------
   Hero treatment — "video" variant (site default), baked in as CSS instead
   of runtime JS. The video layer is visible; dark/gradient/light are hidden.
   Ink/sub/dot/chip colors follow the "light-on-video" branch of the original
   _applyTheme() logic. These rules load after layout.css so they win the
   cascade at equal specificity, just as the runtime overrides did.
   -------------------------------------------------------------------------- */
[data-hero-layer]         { display: none; }
[data-hero-layer="video"] { display: block; }

[data-hero-ink] { color: var(--text-strong); }
[data-hero-sub] { color: var(--text-body); }

[data-hero-dot] {
  background: var(--nmf-magenta);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--nmf-magenta) 25%, transparent);
}

.nmf-hero-chip {
  color: var(--text-strong);
  background: var(--white);
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Small WordPress niceties
   -------------------------------------------------------------------------- */
.custom-logo-link { display: flex; align-items: center; text-decoration: none; }
.custom-logo { max-height: 48px; width: auto; }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-anim],
  [data-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .track { animation: none !important; }
}

/* --------------------------------------------------------------------------
   Blog / archive templates (index.php) — future CMS integration
   -------------------------------------------------------------------------- */
.nmf-blog-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
.nmf-page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 0 0 40px;
}
.nmf-entry { padding: 32px; margin-bottom: 32px; overflow: hidden; }
.nmf-entry-thumb img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
  margin-bottom: 22px;
}
.nmf-entry-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.nmf-entry-title a { color: var(--text-strong); text-decoration: none; }
.nmf-entry-title a:hover { color: var(--magenta-600); }
.nmf-entry-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.nmf-entry-content { line-height: 1.7; }
.nmf-entry-content img { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Hamburger + mobile menu drawer (added v1.7.0)
   -------------------------------------------------------------------------- */

/* Hidden on desktop */
.nmf-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  z-index: 210;
}
.nmf-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-standard),
              opacity var(--dur-base) var(--ease-standard);
}
.nmf-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nmf-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nmf-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nmf-mobile-menu {
  position: fixed;
  top: 72px; /* leaves the sticky header row visible above (overridden in JS if needed) */
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px); /* dynamic viewport height for mobile browsers */
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
  padding: 24px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
  pointer-events: none;
  z-index: 199; /* just under the sticky header (which is at 200) */
}
.nmf-mobile-menu[hidden] { display: none; }
.nmf-mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* The scrollable list — no side margins; drawer padding handles the gutter */
.nmf-mobile-menu__list { margin: 0 0 20px; }
.nmf-mobile-menu .nmf-mobile-menu__cta { margin-top: 20px; margin-bottom: 20px; }
.nmf-mobile-menu ul,
.nmf-mobile-menu .nmf-mobile-menu__list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.nmf-mobile-menu li { margin: 0; padding: 0; }
.nmf-mobile-menu a {
  display: block;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  text-decoration: none;
}
.nmf-mobile-menu a:hover { color: var(--color-brand); }
.nmf-mobile-menu__cta {
  display: block;
  margin-top: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: var(--text-on-brand) !important;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  border-bottom: none !important;
  box-shadow: var(--shadow-brand);
}

/* Prevent scroll chaining from drawer to body without breaking sticky header.
   Using overscroll-behavior instead of body { overflow: hidden } — the
   latter would make body the scroll container and unstick the header. */
.nmf-mobile-menu { overscroll-behavior: contain; }
body.nmf-nav-open { touch-action: none; }
body.nmf-nav-open .nmf-mobile-menu { touch-action: auto; }

/* --------------------------------------------------------------------------
   Responsive header — collapse primary nav + CTA under 900px
   -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  .nmf-x4 {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .nmf-primary-nav,
  .nmf-header-cta { display: none !important; }
  .nmf-nav-toggle { display: inline-flex; }
  #nmf-nav { position: sticky; }
}

/* ==========================================================================
   v1.8.0 — Mega-menu, mobile accordion, footer sitemap grid
   ========================================================================== */

/* ---- Header layout: primary nav takes middle space ---- */
.nmf-x4 { position: relative; }
.nmf-primary-menu { gap: 6px; }
.nmf-menu-item { position: relative; }

/* Nav links + Services button share the same look */
.nmf-primary-menu .nmf-navlink,
.nmf-primary-menu .nmf-mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: color var(--dur-base) var(--ease-standard),
              background var(--dur-base) var(--ease-standard);
  white-space: nowrap;
}
.nmf-primary-menu .nmf-navlink:hover,
.nmf-primary-menu .nmf-mega-trigger:hover,
.nmf-primary-menu .nmf-navlink.is-current {
  color: var(--color-brand);
  background: color-mix(in oklch, var(--color-brand) 8%, transparent);
  text-decoration: none;
}

.nmf-mega-caret {
  width: 14px !important;
  height: 14px !important;
  transition: transform var(--dur-base) var(--ease-standard);
}
.nmf-mega-trigger[aria-expanded="true"] .nmf-mega-caret { transform: rotate(180deg); }
.nmf-has-mega:hover .nmf-mega-caret { transform: rotate(180deg); }

/* ---- Mega-menu panel ---- */
.nmf-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 12px);
  min-width: 780px;
  max-width: min(1100px, calc(100vw - 40px));
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.18);
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard),
              visibility 0s linear var(--dur-base);
  z-index: 200;
  margin-top: 8px;
}
.nmf-has-mega:hover .nmf-mega,
.nmf-has-mega:focus-within .nmf-mega,
.nmf-mega.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard),
              visibility 0s;
}

/* Invisible hover-bridge so the menu doesn't close between trigger and panel */
.nmf-mega::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.nmf-mega__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.nmf-mega__col { min-width: 0; }
.nmf-mega__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.nmf-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nmf-mega__list a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.nmf-mega__list a:hover,
.nmf-mega__list a.is-current {
  background: color-mix(in oklch, var(--color-brand) 10%, transparent);
  color: var(--color-brand);
  transform: translateX(2px);
  text-decoration: none;
}

/* ---- Mobile drawer: services accordion ---- */
.nmf-mobile-menu__group { border-bottom: 1px solid var(--border-subtle); }
.nmf-mobile-menu__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  text-align: left;
}
.nmf-mobile-menu__toggle:hover { color: var(--color-brand); }
.nmf-mobile-menu__toggle svg {
  width: 18px !important;
  height: 18px !important;
  transition: transform var(--dur-base) var(--ease-standard);
}
.nmf-mobile-menu__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nmf-mobile-menu__toggle[aria-expanded="true"] { color: var(--color-brand); }

.nmf-mobile-menu__sub {
  list-style: none;
  margin: 0 0 10px;
  padding: 0 0 8px 12px;
  border-left: 2px solid var(--border-subtle);
  display: none;
}
.nmf-mobile-menu__sub[hidden] { display: none; }
.nmf-mobile-menu__sub.is-open { display: block; }
.nmf-mobile-menu__sub li { margin: 0; padding: 0; }
.nmf-mobile-menu__sub a {
  display: block;
  padding: 10px 8px;
  border-bottom: 0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text-body) !important;
}
.nmf-mobile-menu__sub a:hover { color: var(--color-brand) !important; }

/* ---- Footer sitemap ---- */
.nmf-footer { }
.nmf-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  padding: 64px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.nmf-footer__brand { max-width: 340px; }
.nmf-footer__brand .nmf-x146 { margin-bottom: 20px; }
.nmf-footer__partners {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.nmf-footer__partners-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
}
.nmf-footer__col .nmf-x147 { margin-bottom: 14px; }
.nmf-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nmf-footer__list li { margin: 0; padding: 0; }
.nmf-footer__list a {
  display: inline-block;
  padding: 2px 0;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.nmf-footer__list a:hover {
  color: #fff;
  transform: translateX(2px);
  text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .nmf-primary-menu { gap: 2px; }
  .nmf-primary-menu .nmf-navlink,
  .nmf-primary-menu .nmf-mega-trigger { padding: 8px 10px; font-size: 13px; }
  .nmf-mega { min-width: 720px; padding: 24px; }
  .nmf-mega__inner { gap: 24px; }
}
@media (max-width: 1100px) {
  .nmf-header-cta { display: none !important; } /* extra breathing room for wide menu */
}
@media (max-width: 1024px) {
  .nmf-footer__inner {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
  }
  .nmf-footer__brand { grid-column: 1 / -1; max-width: 480px; }
}
@media (max-width: 640px) {
  .nmf-footer__inner {
    grid-template-columns: 1fr;
    padding: 48px 20px 24px;
    gap: 28px;
  }
  .nmf-footer__brand { grid-column: auto; }
}

/* v2.1.0 — Footer "Branded by" credit */
.nmf-footer__sep { opacity: 0.4; margin: 0 6px; }
.nmf-footer__credit a {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.28);
  transition: color var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}
.nmf-footer__credit a:hover {
  color: #fff;
  border-bottom-color: #fff;
  text-decoration: none;
}
@media (max-width: 640px) {
  .nmf-footer__sep { display: block; height: 0; overflow: hidden; margin: 4px 0; }
  .nmf-footer__credit { display: block; margin-top: 4px; }
}

/* v2.1.0 — Navigation and footer links use colour/underline-bar for hover
   feedback, never the browser's default underline from tokens/base.css. */
.nmf-primary-menu a:hover,
.nmf-navlink:hover,
.nmf-mega__list a:hover,
.nmf-mega a:hover,
.nmf-mobile-menu a:hover,
.nmf-footer__list a:hover,
.nmf-flink:hover,
.nmf-x5:hover,
.nmf-mobile-menu__cta:hover,
.nmf-header-cta:hover { text-decoration: none; }
