/* =====================================================================
   Global element resets — CUHK Business School 2026 style guide.

   Ported from the reference's own base.css reset section (which every
   pattern's CSS implicitly assumes is already in place, the same way it
   assumes p{margin-bottom:1.4em}) — added 2026-07-04 after this exact gap
   caused a real, visible bug: <img> defaults to display:inline in
   browsers, which our own patterns' CSS never overrode anywhere. An
   inline image sitting next to text in a flex row (any "icon-row" —
   Avatar List 2, Contact List) picks up extra inline-context spacing
   (the classic "line-box descender gap" under inline replaced elements),
   which is what actually caused the icon/text vertical misalignment —
   not the flex/gap values themselves, which were already correct.

   Loaded once, globally, via cuhk-shared.php — the fix belongs here, not
   patched into each pattern's own CSS individually, so every current and
   future pattern gets it automatically.
   ===================================================================== */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
	display: block;
	vertical-align: middle;
}

/* Neutralizes WP's own global style (not this theme.json — generated by
   wp-includes/block-supports/layout.php, applies regardless of theme):

     :root :where(.wp-block-group-is-layout-flow) > * {
         margin-block-start: var(--wp--preset--spacing--20);
     }

   This targets every NON-FIRST child of any flow-layout group (":root
   :where(...) > :first-child" already zeroes it for the first child) —
   not just :last-child. Every pattern's own layout in this project
   already handles inter-item spacing itself (grid/flex "gap"), so this
   default is pure interference every time, not a value ever worth
   keeping — confirmed by needing to zero it by hand, per grid, in every
   single pattern built this session (see AUDIT_CHECKLIST.md item #3).

   Same selector shape and specificity as the rule above (":root" alone
   contributes (0,1,0); ":where()" always zeroes whatever's inside it) —
   this only reliably wins because cuhk-shared-reset is registered with
   an explicit dependency on WP's own 'global-styles' handle (see
   cuhk-shared.php), guaranteeing it prints later in the page's <head>.
   Confirmed via the actual rendered page source, not just assumed:
   without that dependency, this stylesheet printed BEFORE
   global-styles-inline-css, and a same-specificity rule would have
   silently lost.

   Existing per-pattern "`.my-list > .my-item { margin-block-start: 0 }`"
   overrides elsewhere are now redundant but harmless (same value, same
   or higher specificity) — no need to remove them retroactively, but
   new patterns don't need to repeat this fix anymore. */
:root :where(.wp-block-group-is-layout-flow) > * {
	margin-block-start: 0;
}

/* Prevents horizontal scroll/overflow site-wide. !important since this is a
   hard constraint that should never lose to a more specific or later-loaded
   rule - not relying only on this file's usual load-order priority (its
   dependency on WP's 'global-styles' handle, see cuhk-shared.php), since
   that guarantees winning ties against global-styles specifically, not
   against every other stylesheet that might load after it. */
html,
body {
	overflow-x: hidden !important;
}

/* Removes the default focus outline across the site. :where() keeps this
   selector's own specificity at zero (same technique as the
   .wp-block-group-is-layout-flow rule above) - !important since a
   deliberately zero-specificity selector would otherwise lose to nearly any
   other real rule targeting the same element, regardless of load order. */
:where(.wp-site-blocks :focus) {
	outline-style: none !important;
}
