/* ==========================================================================
   NVC Learning Center — Review Fixes (CSS layer)
   Load AFTER design12.css (and after nvc-warm.css if possible).
   Only additive overrides; no template rewrites. Version 1.0.0.
   ========================================================================== */

/* ---------- shared tokens / helpers ---------- */
:root {
  --nvc-rf-ink: #2e2a26;
  --nvc-rf-ink-soft: #5f5148;
  --nvc-rf-teal: #2f6b75;
  --nvc-rf-teal-dark: #245560;
  --nvc-rf-line: rgba(46, 42, 38, .14);
  --nvc-rf-paper: #fffdf9;
  --nvc-rf-warm: #fff8f0;
}

/* design-tokens.css normally provides this; keep a local fallback for the
   review bundle when it is enqueued without design-tokens.css. */
.nvc12-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[data-nvc-rf-empty] { display: none !important; }

/* Visible focus ring for keyboard users (mouse clicks unaffected). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--nvc-rf-teal);
  outline-offset: 2px;
}

/* ==========================================================================
   R13 / R26 — mobile menu: solid full-height panel, scrim, no glass bleed
   ========================================================================== */
@media (max-width: 960px) {
  body.nvc-rf-menu-open {
    overflow: hidden !important;
    touch-action: none;
  }

  /* Keep the bar (and its toggle) above the scrim. */
  body.nvc-rf-menu-open #siteNav {
    z-index: 80 !important;
    background: var(--nvc-rf-paper) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--nvc-rf-line);
  }

  .nvc-rf-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(28, 25, 23, .38);
  }

  /* The theme opens the panel with nav.menu-open; design12.js looked for
     .mobile-menu.is-open, which never matches. Target both states. */
  #siteNav.menu-open #mobileMenu,
  #mobileMenu.nvc-rf-menu-open {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: calc(100vh - var(--nvc-rf-navh, 64px)) !important;
    height: calc(100dvh - var(--nvc-rf-navh, 64px)) !important;
    max-height: none !important;
    z-index: 78 !important;
    margin: 0 !important;
    padding: 12px 20px calc(28px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: var(--nvc-rf-paper) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 24px 48px rgba(74, 59, 82, .16) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #siteNav.menu-open #mobileMenu a,
  #mobileMenu.nvc-rf-menu-open a {
    min-height: 46px;
    background: transparent;
    border-radius: 12px;
  }

  /* Floating helpers (lens/growth/night/companion CTA) sit above the menu
     in the theme's z-index scale; hide them while the menu owns the screen. */
  body.nvc-rf-menu-open .nvc12-lens-toggle,
  body.nvc-rf-menu-open .nvc12-growth,
  body.nvc-rf-menu-open .nvc12-night-toggle,
  body.nvc-rf-menu-open .nvc12-mood-chip,
  body.nvc-rf-menu-open .nfs-companion,
  body.nvc-rf-menu-open .nvc-float-stack,
  body.nvc-rf-menu-open .mobile-cta-bar {
    display: none !important;
  }

  #siteNav.menu-open #mobileMenu a:hover,
  #mobileMenu.nvc-rf-menu-open a:hover {
    background: #f4eee6;
  }

  body[data-night="1"].nvc-rf-menu-open #siteNav,
  body[data-night="1"] #siteNav.menu-open #mobileMenu,
  body[data-night="1"] #mobileMenu.nvc-rf-menu-open {
    background: #262220 !important;
    color: #e8dfd3;
    border-color: rgba(232, 223, 211, .16);
  }

  /* Link color must follow the dark panel, not the theme's dark ink. */
  body[data-night="1"] #siteNav.menu-open #mobileMenu a,
  body[data-night="1"] #mobileMenu.nvc-rf-menu-open a {
    color: #e8dfd3 !important;
  }

  body[data-night="1"] #siteNav.menu-open #mobileMenu .mm-cta,
  body[data-night="1"] #mobileMenu.nvc-rf-menu-open .mm-cta {
    color: #fff !important;
  }

  body[data-night="1"] #mobileMenu.nvc-rf-menu-open a:hover {
    background: #332d29;
  }
}

@media (min-width: 961px) {
  .nvc-rf-menu-scrim { display: none !important; }
}

/* ==========================================================================
   R22 — footer heading hierarchy / 4-column layout / legal line
   ========================================================================== */
@media (min-width: 901px) {
  .nv-footer-in {
    grid-template-columns: 1.4fr 1fr 1fr 1fr !important;
    max-width: 1080px;
  }
}

.nv-foot-col h2.nvc-rf-footer-h,
.nvc-rf-footer-h {
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--nv-ink, var(--nvc-rf-ink));
  margin: 0 0 14px;
  letter-spacing: 0;
}

.nvc-rf-legal {
  max-width: 760px;
  margin: 14px auto 0;
  padding: 0 16px;
  text-align: center;
  font-size: .75rem;
  line-height: 1.75;
  color: #6b5e54;
}

.nvc-rf-legal a,
#nvc-terms-link a,
.nv-foot-bottom a {
  color: #2f6b75;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nvc-rf-legal a:hover,
#nvc-terms-link a:hover,
.nv-foot-bottom a:hover {
  color: #245560;
}

/* The JS-injected terms line from design12 has no styling of its own. */
#nvc-terms-link {
  color: #6b5e54 !important;
}

.nv-foot-copy {
  opacity: .86 !important;
}

.nv-foot-beian,
.nv-foot-beian a {
  color: #6b625b !important;
  opacity: 1 !important;
}

/* ==========================================================================
   R16 / R21 — contrast fixes (white-on-light-pastel failures)
   ========================================================================== */
/* The warm palette turns teal into coral; white on #C9705A is 3.5:1. */
.btn-main {
  background-image: linear-gradient(125deg, #b4553f 0%, #a24a6b 45%, #6b5aa8 100%);
}

.nv-btn.nv-btn-solid,
.nv-btn-solid {
  background-color: var(--nvc-rf-teal);
  background-image: none;
  color: #fff;
}

.nv-btn.nv-btn-solid:hover,
.nv-btn-solid:hover {
  background-color: var(--nvc-rf-teal-dark);
}

.nfs-companion {
  background-color: var(--nvc-rf-teal);
  background-image: none;
  color: #fff;
}

.nfs-companion:hover {
  background-color: var(--nvc-rf-teal-dark);
}

/* Four-element labels: keep the semantic colours, use dark ink. */
.nv-bt-label {
  color: #2e2a26 !important;
  font-weight: 700;
}

.nvc12-mood-chip {
  background: #8a5b21 !important;
  color: #fff !important;
}

.nvc-safety-line {
  color: #5f5148 !important;
}

.nvc12-stat-src {
  color: #6b5e54 !important;
  font-weight: 500;
}

/* ==========================================================================
   R05 / R25 — course status badges, result count, empty state
   ========================================================================== */
.nvc12-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
  vertical-align: middle;
  white-space: nowrap;
  background: #ede8f8;
  color: #4a3f78;
}

.nvc12-status.open {
  background: #e3f0e7;
  color: #2f6b4f;
}

.nvc12-status.ongoing {
  background: #fff0d2;
  color: #7a4a12;
}

.nvc12-status.ended {
  background: #f1ece6;
  color: #675a4f;
}

.nvc12-status.evergreen {
  background: #e4eff2;
  color: #245560;
}

.nvc-rf-course-count {
  margin: 6px 0 0;
  font-size: .8rem;
  line-height: 1.6;
  color: #5f5148;
}

.nvc-rf-course-empty {
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 3px solid #b4553f;
  border-radius: 0 10px 10px 0;
  background: #fff8f5;
  color: #5f3a30;
  line-height: 1.7;
}

.nvc-rf-course-empty[hidden] {
  display: none !important;
}

.nvc-rf-course-note {
  margin: 14px 0 0;
  font-size: .78rem;
  line-height: 1.7;
  color: #5f5148;
}

/* ==========================================================================
   R15 / R28 — captcha help + keyboard refresh
   ========================================================================== */
.nv-sub-captcha,
.sub-captcha {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nv-sub-captcha img,
.sub-captcha img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.nvc-rf-captcha-help {
  flex-basis: 100%;
  margin: 4px 0 0;
  max-width: 38em;
  font-size: .76rem;
  line-height: 1.65;
  color: #5f5148;
}

.nvc-rf-captcha-help a {
  color: #2f6b75;
  text-decoration: underline;
}

.nvc-rf-captcha-refresh {
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid rgba(46, 42, 38, .2);
  border-radius: 999px;
  background: #fff;
  color: #2e2a26;
  font: inherit;
  font-size: .76rem;
  cursor: pointer;
}

.nvc-rf-captcha-refresh:hover {
  background: #f7f1e8;
}

/* ==========================================================================
   R24 — subscription status / legal line
   ========================================================================== */
.sub-msg,
.nv-sub-form .sub-msg {
  line-height: 1.7;
}

.nv-sub-consent a,
.sub-consent a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   R10 / R29 — AI disclosure, retry note, ghost guard
   ========================================================================== */
.nvc-rf-ai-note {
  margin: 10px 0;
  padding: 9px 12px;
  border-left: 3px solid #e8a33d;
  border-radius: 0 10px 10px 0;
  background: var(--nvc-rf-warm);
  color: #5f5148;
  font-size: .78rem;
  line-height: 1.7;
}

.nvc-rf-ai-note a {
  color: #2f6b75;
  text-decoration: underline;
}

.nvc-rf-ai-extra {
  display: block;
  margin-top: 4px;
  color: #6b5e54;
  font-size: .75rem;
  line-height: 1.65;
}

#nvc-ai-disclaimer {
  margin: 6px 0 10px;
  padding: 8px 12px;
  border-left: 3px solid #e8a33d;
  border-radius: 0 10px 10px 0;
  background: var(--nvc-rf-warm);
  color: #5f5148;
  font-size: .76rem;
  line-height: 1.65;
}

body[data-night="1"] #nvc-ai-disclaimer {
  background: #2b2522;
  color: #cfc3b7;
  border-left-color: #d9a066;
}

.nvc-rf-note {
  margin: 10px 0;
  padding: 9px 12px;
  border: 1px solid rgba(180, 85, 63, .28);
  border-radius: 10px;
  background: #fff7f4;
  color: #5f3a30;
  font-size: .8rem;
  line-height: 1.6;
}

.nvc-rf-retry {
  margin-left: 8px;
  min-height: 32px;
  padding: 3px 12px;
  border: 1px solid rgba(46, 42, 38, .2);
  border-radius: 999px;
  background: #fff;
  color: #2e2a26;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.nvc-rf-retry:hover {
  background: #f7f1e8;
}

/* ==========================================================================
   R21 — social-proof source footnote
   ========================================================================== */
.nvc-rf-source {
  margin: 10px 0 0;
  font-size: .75rem;
  line-height: 1.65;
  color: #6b5e54;
  text-align: center;
}

/* Keep injected legal/source text readable at 320–360px. */
@media (max-width: 420px) {
  .nvc-rf-legal,
  .nvc-rf-source,
  .nvc-rf-ai-note {
    font-size: .75rem;
  }

  .nvc-rf-captcha-refresh {
    min-height: 38px;
  }
}

/* Dark mode (the theme's night mode uses body[data-night="1"]). */
body[data-night="1"] .nvc-rf-legal,
body[data-night="1"] .nvc-rf-source,
body[data-night="1"] .nvc-rf-ai-note,
body[data-night="1"] .nvc-rf-course-note,
body[data-night="1"] .nvc-rf-course-count {
  color: #cfc3b7;
}

body[data-night="1"] .nvc-rf-ai-note {
  background: #2b2522;
  border-left-color: #d9a066;
}

body[data-night="1"] .nvc-rf-legal a,
body[data-night="1"] .nvc-rf-ai-note a {
  color: #e8c48e;
}
