/* mg-topnav.css — 1.1.8
   Cascade fix after r1 self-audit.

   Goal: homepage computed styles stay as official 1.1.7 (tw-index preflight
   + utilities + contrast-patch + header <style>); academy pages only receive
   the missing preflight behaviors.

   r1 used nav.mg-topnav a {color:inherit} at specificity (0,1,2), which beats
   .text-[#003731] (0,1,0) on the consult CTA and .mg-ai-btn {color:#003731}
   (0,1,0) in the header <style> block. r1 also used nav.mg-topnav button
   {font-size:100%;font-weight:inherit} at (0,1,2), which would beat
   .text-sm / .font-medium (500) if those utilities are on a button.
   r1 also set a guessed Inter font stack and font-size:16px on the nav.

   This file keeps preflight-equivalent resets inside :where() so their
   specificity matches Tailwind preflight (type-only). Utilities and
   contrast-patch keep priority. No invented font-family.
   Do not load academy.css on the homepage. Do not add unscoped preflight.
*/

/* Homepage preflight already sets box-sizing on *. :where → specificity 0. */
:where(nav.mg-topnav, nav.mg-topnav *) {
  box-sizing: border-box;
}

/* Homepage html{line-height:1.5} (preflight). Academy documents omit it.
   Do not set font-family or font-size here: the header already has
   font-['Inter'] and size utilities (.text-sm, .text-2xl, .text-xs). */
:where(nav.mg-topnav) {
  line-height: 1.5;
}

/* Exact analogue of tw-index preflight: a{color:inherit;text-decoration:inherit}.
   :where(nav.mg-topnav) a has specificity (0,0,1), same as preflight `a`.
   Therefore these lose to:
     .text-[#003731] (0,1,0)  → CTA 浅绿底深字 rgb(0 55 49)
     .text-primary (0,1,0)    → 青绿链标/品牌字
     .mg-ai-btn (0,1,0)       → header <style> color:#003731; font-weight:700
     .text-white/70 etc.      → plus higher-specificity contrast-patch
     nav.fixed.top-0.z-50 …   → contrast-patch (no !important on nav colors)
*/
:where(nav.mg-topnav) a {
  color: inherit;
  text-decoration: inherit;
}
:where(nav.mg-topnav) a:hover,
:where(nav.mg-topnav) a:focus,
:where(nav.mg-topnav) a:focus-visible,
:where(nav.mg-topnav) a:active {
  text-decoration: inherit;
}

/* Preflight: audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}
   and img,video{max-width:100%;height:auto}. Height/width utilities (.h-14, .w-auto,
   .object-contain, .flex-shrink-0) remain in charge of logo scale. */
:where(nav.mg-topnav) img,
:where(nav.mg-topnav) svg,
:where(nav.mg-topnav) video {
  display: block;
  vertical-align: middle;
}
:where(nav.mg-topnav) img,
:where(nav.mg-topnav) video {
  max-width: 100%;
  height: auto;
}

/* Preflight: button,input,… {font-family:inherit;font-size:100%;font-weight:inherit;
   line-height:inherit;letter-spacing:inherit}. Specificity (0,0,1).
   Does not set color (contrast-patch and .text-white/70 own button color).
   .font-medium {font-weight:500} and .text-sm {font-size:.875rem} keep winning. */
:where(nav.mg-topnav) button {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* tw-shared lacks the CTA hover-shadow utility already in tw-index.
   Academy-only; homepage still gets it from tw-index.css.
   Glow figure is the tw-index original --tw-shadow:0 0 20px rgba(20,184,166,.4)
   (equivalent rgba spacing). Not a new radius. */
body.mg-ftb-page nav.mg-topnav a.mg-consult-btn:hover,
body.mg-ftb-page nav.mg-topnav a.mg-consult-btn:focus-visible {
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
}
