/*
 * reset-v3.css — ANZ v3 Base Reset Layer
 *
 * PURPOSE: collapse the defensive per-rule re-declarations in v3-shell.css by
 * establishing a single baseline that all components inherit from.
 * Introduced in Phase 3 after the Phase 2 code-reviewer flagged ~80 body.anz-v3
 * selectors redundantly re-declaring font-family / font-size / color / box-sizing.
 *
 * LOAD ORDER: this file MUST be linked FIRST — before v3-shell.css and before
 * any component file. See _Layout.cshtml link order.
 *
 * SCOPE: every selector is scoped to body.anz-v3 so it cannot bleed to
 * AGL, AMEX, ASAHI, or any other tenant.
 *
 * WHAT IT SCRUBS:
 *   - Bootstrap 3 box-model (content-box default) — replaced with border-box
 *   - Defensive font-family re-declarations on every component selector
 *   - Defensive font-size re-declarations on block-level children
 *   - Defensive color / line-height re-declarations
 *   After this file loads, component CSS files should NOT redeclare these
 *   baseline properties unless they intentionally diverge.
 *
 * Plan: .omc/plans/anz-refresh-explorative.md Phase 3 deliverable §1
 * Phase 2 reviewer: "Override-count balloon risk — ~80 body.anz-v3 selectors
 *   re-declaring base styles defensively."
 */


/* ===================================================================
 * 1. BOX SIZING — border-box for all elements
 *    Scrubs Bootstrap 3 content-box default.
 *    Components can rely on padding not inflating width/height.
 * =================================================================== */

body.anz-v3 *,
body.anz-v3 *::before,
body.anz-v3 *::after {
  box-sizing: border-box;
}


/* ===================================================================
 * 2. TYPOGRAPHY BASELINE
 *    font-family, font-size, line-height, color — inherited by ALL
 *    descendants so component CSS need not repeat them.
 *    font-size is set here at a safe value on block elements; body itself
 *    retains font-size: 0 in v3-shell.css to suppress the stray `}` text
 *    node from ModalMessage.cshtml line 7 (see §4 below for resolution path).
 * =================================================================== */

body.anz-v3 div,
body.anz-v3 nav,
body.anz-v3 header,
body.anz-v3 footer,
body.anz-v3 main,
body.anz-v3 section,
body.anz-v3 article,
body.anz-v3 aside,
body.anz-v3 form,
body.anz-v3 ul,
body.anz-v3 ol,
body.anz-v3 li,
body.anz-v3 table,
body.anz-v3 thead,
body.anz-v3 tbody,
body.anz-v3 tfoot,
body.anz-v3 tr,
body.anz-v3 th,
body.anz-v3 td,
body.anz-v3 noscript,
body.anz-v3 span,
body.anz-v3 label,
body.anz-v3 button,
body.anz-v3 input,
body.anz-v3 select,
body.anz-v3 textarea,
body.anz-v3 p,
body.anz-v3 a,
body.anz-v3 h1,
body.anz-v3 h2,
body.anz-v3 h3,
body.anz-v3 h4,
body.anz-v3 h5,
body.anz-v3 h6,
body.anz-v3 small,
body.anz-v3 strong,
body.anz-v3 em,
body.anz-v3 blockquote,
body.anz-v3 figure,
body.anz-v3 figcaption {
  font-family: var(--font-family);
}


/* ===================================================================
 * 3. BLOCK-LEVEL FONT SIZE — inherit body-m from root
 *    Replaces the defensive per-selector font-size re-declarations that
 *    were needed when only specific elements got font-size in Phase 2.
 *    Now the reset establishes it broadly; components override only
 *    when they intentionally differ (headings, captions, etc.).
 * =================================================================== */

body.anz-v3 div,
body.anz-v3 nav,
body.anz-v3 header,
body.anz-v3 footer,
body.anz-v3 main,
body.anz-v3 section,
body.anz-v3 article,
body.anz-v3 aside,
body.anz-v3 form,
body.anz-v3 ul,
body.anz-v3 ol,
body.anz-v3 li,
body.anz-v3 table,
body.anz-v3 noscript,
body.anz-v3 p,
body.anz-v3 span,
body.anz-v3 label,
body.anz-v3 button {
  font-size: var(--type-body-m-size);
  line-height: var(--type-body-m-lh);
  color: var(--text);
}


/* ===================================================================
 * 4. FONT-SIZE: 0 RESOLUTION — stray `}` in ModalMessage.cshtml:7
 *
 *    Root cause: Views/Modals/ModalMessage.cshtml line 7 has an orphan `}`
 *    closing brace from an incomplete Razor conditional block. This produces
 *    a bare text node at body level that browsers render as a visible `}`.
 *
 *    Phase 2 workaround: body.anz-v3 { font-size: 0 } (v3-shell.css) hides
 *    ALL body-level text nodes by making them zero-width.
 *
 *    Phase 3 resolution path chosen: ANZ uses its OWN modal fork (§4.8) — the
 *    shared ModalMessage.cshtml is no longer rendered for ANZ requests. The
 *    font-size:0 hack in v3-shell.css is therefore RETAINED as a safety net
 *    but is now effectively dead code for ANZ (the stray `}` never renders
 *    because ANZ gets Areas/ANZ/Views/Modals/v3/ModalMessage.cshtml instead).
 *
 *    The shared ModalMessage.cshtml IS NOT EDITED here because:
 *    (a) it is shared across all tenants — edit risk is cross-tenant regression,
 *    (b) AMEX smoke test would be required before any shared-file edit,
 *    (c) the ANZ modal fork eliminates the symptom for ANZ without any shared
 *        file change.
 *
 *    If a future phase wants to clean up the shared file, the change is:
 *    Remove line 7 `}` from Views/Modals/ModalMessage.cshtml and run AMEX
 *    smoke test (tenant-isolation-smoke.spec.mjs area=AMEX assertion).
 *
 *    Decision recorded in docs/08-v3-component-library.md §Architecture decisions.
 * =================================================================== */


/* ===================================================================
 * 5. LIST RESET
 *    Bootstrap / Site.css set list-style on ul/ol globally.
 *    Within v3 components that use semantic lists (nav, breadcrumbs,
 *    cards), the component CSS applies list-style: none. This reset
 *    avoids having to re-declare it per-component for nav-pattern lists.
 * =================================================================== */

body.anz-v3 ul,
body.anz-v3 ol {
  margin: 0;
  padding: 0;
  list-style: none;
}


/* ===================================================================
 * 6. MARGIN / PADDING BASELINE
 *    Bootstrap's Normalize sets margin on headings, p, figure etc.
 *    Reset to 0 here; component CSS adds intentional spacing via tokens.
 * =================================================================== */

body.anz-v3 h1,
body.anz-v3 h2,
body.anz-v3 h3,
body.anz-v3 h4,
body.anz-v3 h5,
body.anz-v3 h6,
body.anz-v3 figure,
body.anz-v3 blockquote {
  margin: 0;
  padding: 0;
}


/* ===================================================================
 * 7. IMAGE / MEDIA BASELINE
 * =================================================================== */

body.anz-v3 img,
body.anz-v3 svg,
body.anz-v3 video {
  display: block;
  max-width: 100%;
  height: auto;
}


/* ===================================================================
 * 8. FORM ELEMENT BASELINE
 *    Ensures form controls inherit font from the reset rather than
 *    browser UA sheet (which applies system-ui or Times New Roman).
 * =================================================================== */

body.anz-v3 input,
body.anz-v3 select,
body.anz-v3 textarea,
body.anz-v3 button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

body.anz-v3 button {
  cursor: pointer;
}
