/* nr-chrome.css -- shared styles for the footer fragment.
 *
 * SOURCE OF TRUTH for everything it contains: these rules used to live in the
 * <style> block of _includes/footer-v2.html, which no longer has one.
 *
 * =============================================================================
 * SCOPE: FOOTER ONLY -- and that is a measured decision, not an omission.
 *
 * The header's styles stay inline in _includes/header.html. Its dropdown menus
 * (three <ul> groups, ~40 <li>) sit in the header's own markup and are hidden
 * by CSS, so "hide the dropdowns" is itself what gives the header its height.
 * Serving those rules from here left the header 1411px tall until the
 * stylesheet arrived, against 84px once it did -- a 1327px shift that pushes
 * the whole page down. No split of the header's rules avoids it: skeleton-only
 * measured 874px, dropdown-rules-only 316px, and dropping just the six
 * display:none rules left 818px.
 *
 * The footer has no such coupling -- it renders below the fold -- so its 321
 * lines move here and are cached across pages, which is ~60% of the chrome CSS
 * at zero layout-shift risk.
 *
 * Moving the header here later means first taking the dropdown markup out of
 * the header or injecting it on demand. That touches Bootstrap's hook classes
 * and is a separate job -- see specs/a-prime-local-build-spec.md §7.1, §9.
 * =============================================================================
 *
 * Scoped by #nr_main_footer so host page CSS cannot reach in and these rules
 * cannot leak out. Class names are .nr-* prefixed.
 *
 * Colours come from the --nr-* tokens in /usecase/theme-tokens.css, which must
 * be linked BEFORE this file. Every other value is an inline literal so the
 * fragment never depends on a host page defining anything.
 *
 * [data-theme] selectors must stay OUTSIDE the scope id --
 * [data-theme="dark"] #nr_main_footer .x -- because the attribute sits on
 * <body>, an ancestor of the fragment. Writing #nr_main_footer [data-theme=...]
 * never matches.
 *
 * Spacing follows the 8-point grid; audited by infra/check-spacing.py.
 */

/* ==========================================================================
 * FOOTER -- from _includes/footer-v2.html
 * ========================================================================== */

#nr_main_footer, #nr_main_footer *, #nr_main_footer *::before, #nr_main_footer *::after { box-sizing: border-box; }

#nr_main_footer {
  background: var(--nr-footer-bg);
  border-top: 1px solid var(--nr-footer-border);
  padding-block: 48px;
  color: var(--nr-footer-fg-muted);
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Container/gutter, UNIFIED (2026-08-19) with _includes/header.html and
   policies.css's .nr-policies2 so all three layers' content edges align --
   see Slack CAUS5DAHM/p1787068524168019 (Angus: header/body/footer should
   share the same left/right margins). Was a page-relative 1280px+gutter
   ladder inlined from edu-v2.html (24/28/32/40 @ 460/768/1440); now a flat
   1440px viewport-relative cap. Content width grows from 1280px to
   1440-2*gutter (1312px @ 1440+) -- the five-column grid spaces out
   slightly; expected.
   GUTTER LADDER (2026-08-19): 24 base / 32 @768 / 40 @1200 / 64 @1440.
   All three layers (this file, header.html, policies.css) must carry THE
   SAME four values at THE SAME breakpoints -- that identity is the whole
   point of the unification, so never re-tier one of them alone.
   History: a first pass used 24/32/40/64 @ 576/992/1440; a second added
   768 and 1200 with an off-grid 28px at 768 (carried over from the old
   1280px-era ladder). 28 is not a multiple of 8, and the 992 tier it fed
   into was 32 anyway -- so 768 now goes straight to 32 and the redundant
   992 gutter step is gone (992 still exists below, but only to switch the
   grid to 4 columns). Verified at 768px: all three layers' content edges
   land on the same x, no panel overflow, no horizontal scroll.
   460 and 576 are deliberately NOT gutter tiers -- no column-count change
   happens at 460, and 576 (where the grid first appears) reads fine at the
   24px base. */
#nr_main_footer .nr-footer-inner {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex; flex-direction: column; gap: 48px;
}

/* Visually hidden but available to screen readers (edu-v2.html:150-153,
   self-contained here rather than relying on a global .sr-only). */
#nr_main_footer .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Wraps .nr-footer-brand + .nr-footer-cols. Below 1200px both stack full-width,
   same gap (48px) .nr-footer-inner used to give them directly before
   this wrapper existed -- Figma has no design for this width range (its
   only rendered frame is 1160px content-wide), so this is a "stack until
   there's room" fallback, not something Figma specifies. Becomes a
   1fr/3fr grid row at 1200px+ -- see that breakpoint below. */
#nr_main_footer .nr-footer-main { display: flex; flex-direction: column; gap: 48px; }
/* Footer's own brand lockup: full wordmark at every width, glyph+wordmark
   bottom-aligned. Does NOT inherit the header's responsive wordmark-collapse
   (header hides the wordmark below 768px; this footer always shows it) —
   so these rules are self-contained rather than reusing the header's brand
   classes. */
#nr_main_footer .nr-footer-brand { display: flex; flex-direction: column; gap: 12px; }
#nr_main_footer .nr-footer-brand .nr-footer-brand-link {
  display: inline-flex; align-items: flex-end; height: auto;
  text-decoration: none;
}
/* Same brand color rule as _includes/header.html's .nr-logo-wrapper: fixed
   white in dark theme, product accent in light theme (Figma 3:834's logo
   mark is #146ef4, not the neutral text color) -- --nr-icon-brand, not
   --nr-footer-fg/-muted.

   `fill` is declared HERE, in CSS, and not left to the fill="currentColor"
   presentation attribute on the <svg> (which is kept as a fallback for a
   host with no CSS at all). A presentation attribute loses to ANY CSS rule
   regardless of specificity, so a host carrying a bare `svg{fill:...}`
   -- usecase/student.html ships exactly that, fill:rgba(0,0,0,.87) -- would
   otherwise repaint this mark black. Verified 2026-08-18: black before this
   rule, --nr-icon-brand after. Same class of fix as the display:inline-block
   rule below: state what the fragment needs, never inherit it by luck. */
#nr_main_footer .nr-footer-brand .nr-footer-brand-mark {
  width: 29.93px; height: 32.03px; color: var(--nr-icon-brand);
  fill: currentColor; flex: 0 0 auto;
}
#nr_main_footer .nr-footer-brand .nr-footer-brand-word {
  display: inline; font-size: 24px; line-height: 20.29px; font-weight: 500;
  letter-spacing: -.36px; color: var(--nr-icon-brand); white-space: nowrap;
  padding-inline-start: 1.5px;
}
/* Figma 3:719/3:3756: 14px/21.7px, no letter-spacing. */
/* Fiona 2026-08-18: high-emphasis body color (rgba(255,255,255,.87) dark /
   rgba(0,0,0,.87) light) -- i.e. --nr-footer-fg, not the subtle step. */
#nr_main_footer .nr-footer-tagline {
  font-size: 14px; line-height: 21.7px;
  color: var(--nr-footer-fg); margin: 0; max-width: 280px;
}
#nr_main_footer .nr-footer-trust {
  font-size: 13px; line-height: 19.5px;
  color: var(--nr-footer-fg-subtle); margin: 0;
}

/* Mobile: category index left, active category's links right (Figma 391:1748). */
#nr_main_footer .nr-footer-cols {
  display: flex; align-items: flex-start;
  /* justify-content: flex-start (2026-08-19, was space-between) -- FLEX
     (i.e. <576px) ONLY: space-between stretched the gap between the index
     and the panel to fill the whole row, reading as two unrelated blocks
     with a wide dead zone between them. flex-start lets the 16px gap
     actually be the gap, so the index and its panel read as one control.
     ⚠️ MUST be re-set to space-between at >=576px (it is, in that block):
     this property does NOT stop mattering once display flips to grid. On
     the >=1200px `repeat(4, max-content)` tier the tracks are narrower
     than the container, so justify-content still distributes them -- and
     flex-start there bunches all four columns against the left edge,
     leaving ~460px dead space on the right at 1440px. It is inert only on
     the minmax(0,1fr) tiers (576-1199px), where the tracks already fill
     the container. */
  justify-content: flex-start;
  gap: 16px; padding-block: 8px;
}
#nr_main_footer .nr-footer-index { display: flex; flex-direction: column; gap: 16px; }
#nr_main_footer .nr-footer-index button {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: inherit;
  font-size: 16px; line-height: 18px; font-weight: 700;
  letter-spacing: .4px; color: var(--nr-footer-fg-muted);
  opacity: .65; transition: opacity .15s;
}
/* Fiona 2026-08-18: the selected category reads pure #fff (dark) / #000
   (light). opacity:1 alone left it at --nr-footer-fg-muted's .6 alpha, so
   the color is stated explicitly here rather than inherited. */
#nr_main_footer .nr-footer-index button[aria-selected="true"] {
  opacity: 1; color: var(--nr-link-fg);
}
/* Mobile: the left index already labels the category, so the panel's own
   heading is redundant (Figma 391:1748). Shown again from 768px, since the
   >=1200px .nr-footer-panel > strong rule below applies at every width where
   the index is hidden -- see that rule's comment for the size source. */
#nr_main_footer .nr-footer-panel > strong { display: none; }
/* Figma 3:740 etc. ("List"): 11px between links, at every width -- no
   responsive variant, so this is not overridden at 768px+ the way
   footer-v2.html's ported edu-v2.html gap is.
   SNAPPED TO GRID: Figma's 11px -> 12px (4x3) per the 8-point grid rule
   (2026-08-17). 1px visual delta, no layout mechanism depends on it. */
#nr_main_footer .nr-footer-links { display: flex; flex-direction: column; gap: 12px; }
/* Figma 3:742 etc.: 14px/19.6px, weight 400 (Regular), --nr-footer-fg-muted.
   Applies at every width -- Figma's footer-v2 has no larger desktop size
   for link text (unlike footer-v2.html's edu-v2-derived 768px+ jump to
   18px/36px, which this file does NOT replicate; see the .nr-footer-panel >
   strong rule below for the matching decision on category titles). */
/* Fiona 2026-08-18: link color raised from --nr-footer-fg-muted (.6) to
   --nr-footer-fg (.87) -- high emphasis in both themes. */
#nr_main_footer .nr-footer-links a {
  text-decoration: none;
  font-size: 14px; line-height: 19.6px; font-weight: 400;
  color: var(--nr-footer-fg);
}
#nr_main_footer .nr-footer-links a:hover { text-decoration: underline; }
#nr_main_footer .nr-footer-panel[hidden] { display: none; }

/* Figma 3:819/3:3856: border-top #e1e1e1 in light -- distinct from every
   --nr-footer-* token (dark's equivalent already equals --nr-footer-border
   exactly, hence the theme-conditional literal instead of a new token used
   in only this one rule; see the top comment). */
/* SNAPPED TO GRID: Figma's 25px padding-top -> 24px (8x3) (2026-08-17). */
#nr_main_footer .nr-footer-bottom {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding-top: 24px; border-top: 1px solid var(--nr-footer-border);
}
[data-theme="light"] #nr_main_footer .nr-footer-bottom { border-top-color: #e1e1e1; }
/* Figma 3:821/3:3858: 13px, normal line-height, --nr-footer-fg-subtle, at
   every width -- no mobile/desktop distinction and no letter-spacing
   (unlike the 16px/24px/.15px this used before the 2026-08-17 audit). */
#nr_main_footer .nr-footer-bottom-copy {
  font-size: 13px; line-height: normal;
  color: var(--nr-footer-fg-subtle);
}
/* SNAPPED TO GRID: Figma's 18px -> 16px (8x2) (2026-08-17). */
#nr_main_footer .nr-footer-badges { display: flex; align-items: center; gap: 16px; }
/* Figma 3:824 etc.: 12px, normal line-height, --nr-footer-fg-subtle, no
   letter-spacing -- was --nr-footer-fg-muted with .4px tracking. */
#nr_main_footer .nr-footer-badge { font-size: 12px; line-height: normal; color: var(--nr-footer-fg-subtle); }
/* 3px round separators — Figma renders these as filled 3px shapes with 1.5px
   radius, not a "·" glyph, so they are real elements and theme cleanly.
   Figma 3:3862 etc. (dark): rgba(255,255,255,.6), same as --nr-footer-fg-
   subtle exactly, so the base rule below is correct for dark theme as-is.
   Figma 3:825 etc. (LIGHT): #c4c4c4 -- a fourth, even fainter gray, NOT the
   same as --nr-footer-fg-subtle's #646464 used by the text beside it. One
   more theme-conditional literal (like the light-only bottom-border color
   above) rather than a token used in a single rule. */
#nr_main_footer .nr-footer-dot { width: 3px; height: 3px; border-radius: 1.5px; background: var(--nr-footer-fg-subtle); }
[data-theme="light"] #nr_main_footer .nr-footer-dot { background: #c4c4c4; }

@media (min-width: 576px) {
  /* From this width up the footer shows every category at once — the
     mobile index/panel split is replaced by a real multi-column grid.
     MOVED HERE from 768px (2026-08-19) -- see .nr-footer-grid's 3-column
     rule below for why 768 no longer needs to be this transition's home.
     Verified (screenshot + scrollWidth check) that the panels' text does
     NOT overflow their columns at 576px, same as it doesn't at 768px --
     the earlier "576 overflows" finding was a test-harness gap (this
     block's .nr-footer-group flex rule wasn't applied), not a real
     content-width limit. */
  #nr_main_footer { color: var(--nr-footer-fg); padding-block: 64px; }
  /* No gutter change here: the 24px base still applies through 767px.
     576 is a column-count breakpoint only -- see the gutter ladder in
     .nr-footer-inner above, which starts moving at 768. */
  /* .nr-footer-tagline/.nr-footer-trust/.nr-footer-brand-word intentionally NOT swapped to
     --nr-footer-fg here -- Figma shows the same subtle/brand colors at
     every width for these three (no mobile-muted -> desktop-full jump).
     That swap is real for --nr-footer-fg-muted elsewhere in this file
     (links, section text) -- it just doesn't apply to these three roles. */

  /* justify-content back to space-between -- the base rule's flex-start is
     for the mobile flex layout only (see that rule's warning). Inert on
     this tier's minmax(0,1fr) tracks, but it must be restored HERE rather
     than in the >=1200px block, so the max-content tier inherits the right
     value no matter which breakpoints get edited later. */
  #nr_main_footer .nr-footer-cols { display: grid; justify-content: space-between; gap: 32px 40px; padding-block: 0; }
  /* 3 columns from 576px (2026-08-19, was 2 from 768px) -- verified at
     576/768px with minmax(0,1fr) equal columns, no overflow. Policies is
     NOT pinned to column 1 here the way it is at >=992px below -- left on
     plain grid-auto-flow, it lands right after Resources (row2: Resources,
     Policies), which is the simpler behavior and was explicitly preferred
     over replicating the >=992px Figma-driven pin at this narrower width. */
  #nr_main_footer .nr-footer-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #nr_main_footer .nr-footer-index { display: none; }
  #nr_main_footer .nr-footer-panel[hidden] { display: flex; }        /* reveal all categories */
  /* Figma 3:737 etc.: 14px between the category title and its link list
     (only visible >=576px -- mobile hides the title via .nr-footer-panel >
     strong { display: none } above, so this gap has no mobile equivalent
     to match against).
     SNAPPED TO GRID: 14px -> 16px (8x2) (2026-08-17). */
  #nr_main_footer .nr-footer-group { display: flex; flex-direction: column; gap: 16px; }
  /* Figma 3:739 etc.: 14px, normal line-height, weight 600 (Semi Bold),
     --nr-footer-fg, no letter-spacing, no text-transform -- Figma's labels
     ("Products", "Personal Solutions", ...) are already in the case they
     render in; UPPERCASE-via-capitalize was footer-v2.html's own convention,
     not something this design does. Same 14px at every width -- Figma has
     no larger desktop size for this text (contrast footer.html, which
     still uses 18px/36px/700/uppercase here; that file is unchanged). */
  #nr_main_footer .nr-footer-panel > strong {
    display: block;
    font-size: 14px; line-height: normal; font-weight: 600;
    color: var(--nr-footer-fg);
  }
  #nr_main_footer .nr-footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  /* .nr-footer-bottom-copy/.nr-footer-badge/.nr-footer-dot intentionally NOT swapped
     to --nr-footer-fg here, same reasoning as .nr-footer-tagline/.nr-footer-trust
     above -- Figma's bottom bar stays --nr-footer-fg-subtle at every width. */
}
@media (min-width: 768px) {
  /* Pure gutter tightening -- no column-count or layout change happens at
     768 any more (moved to 576px above, 2026-08-19). */
  #nr_main_footer .nr-footer-inner { padding-inline: 32px; }
}
@media (min-width: 992px) {
  /* 4 columns from 992px (2026-08-19, was 1200px) -- verified with
     minmax(0,1fr) equal columns, no overflow (each column ~208px @ 992,
     gap 32px). Policies IS pinned to column 1 here, unlike the 576/768px
     3-column tier above -- this reproduces the >=1200px Figma-driven
     placement (see that block's comment) one tier earlier, now that 4
     columns starts here instead of at 1200px. */
  #nr_main_footer .nr-footer-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  #nr_main_footer #fpanel-policies { grid-column: 1; grid-row: 2; }
  /* No gutter change here: 768's 32px already applies. This tier is
     column-count only. */
}
@media (min-width: 1200px) {
  #nr_main_footer { padding-block: 96px; }    /* Figma py-96 */
  /* Gutter tier of the unified container -- see .nr-footer-inner above.
     Lands on the same breakpoint as the 4-column grid switch below. */
  #nr_main_footer .nr-footer-inner { padding-inline: 40px; }
  /* Figma 3:718/3:3755 (this file's actual source, corrected 2026-08-17 --
     see the top comment): .nr-footer-brand and .nr-footer-cols are grid-cols-
     [minmax(0,1fr)_minmax(0,3fr)] siblings in ONE row -- brand takes the
     narrow 1fr column, the four link panels share the wide 3fr column.
     This is DIFFERENT from footer.html, where brand stays a flex sibling
     stacked above .nr-footer-cols at every width (that file's source,
     edu-v2.html/391:778, never puts brand beside the links). Do not
     "reconcile" the two footers on this point -- it is a real, verified
     difference between the two designs, not drift. */
  /* Figma 3:718: brand column is exactly 290px wide (of an 1160px content
     area, ~1:3 with the 870px-wide links column) and the two columns are
     directly adjacent -- links-column x (290) equals brand-column width
     (290) exactly, so the grid's own column-gap is 0. Nothing wider is
     needed since minmax(0,1fr)/minmax(0,3fr) already reproduces the ratio
     at any container width, not just 1160px. */
  #nr_main_footer .nr-footer-main {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,3fr);
    gap: 0; align-items: start;
  }
  /* Figma 3:719: the brand column's own content caps at 280px (tagline's
     max-width, already set on .nr-footer-tagline) inside a 290px column --
     the column itself does not need its own max-width beyond what the
     1fr track already gives it. */
  /* .nr-footer-cols holds only the 4 category panels visible at once — 4
     columns (Products/Personal/Commercial/Resources), Policies placed
     under Products (col 1, row 2).
     DESIGN FIX vs edu-v2.html: edu-v2.html's `gap: 24px 63px` pulls
     Policies tight under Products' last link. Figma 391:778 instead has
     Policies clear the *tallest* row-1 column (Personal/Commercial) plus
     ~24px. Because columns are `max-content` sized, CSS grid already
     sizes row 1 to its tallest cell — so column-gap stays 63px but the
     ROW gap must be driven by the row's own height, not a flat 24px that
     assumes Products is tallest. Using `gap: 24px 63px` on a 2-row grid
     applies 24px between EVERY row, which happens to equal the desired
     clearance here since row-1 height is already tallest-column-driven;
     verified empirically in Step 5.
     SNAPPED TO GRID: the inherited 63px column-gap -> 64px (8x8)
     (2026-08-17), same change as footer.html -- these two must stay in
     step. Columns are max-content, so the +3px total was re-verified not
     to overflow the inner width -- 1280px at the time, since widened to
     1440px-gutter (2026-08-19, see .nr-footer-inner above), so this only
     got more headroom, not less. */
  #nr_main_footer .nr-footer-grid { grid-template-columns: repeat(4, max-content); gap: 24px 64px; }
  #nr_main_footer #fpanel-policies { grid-column: 1; grid-row: 2; }
}
@media (min-width: 1440px) {
  /* Final gutter tier of the unified 1440px container -- see the
     .nr-footer-inner comment above. */
  #nr_main_footer .nr-footer-inner { padding-inline: 64px; }
}
