/* Shared by every portal page, linked last in <head> so it wins ties with the page's own <style>.
 * Each page still owns its look; this file only holds what Apple's HIG asks of all of them. */

/* Text follows the phone's text-size setting (HIG typography.md › Supporting Dynamic Type).
 * Page sizes are written calc(Nrem/17): N px at iOS's default body size (17px), scaled with the setting.
 * Elsewhere the root stays 17px, so desktops and Android render N px exactly as before.
 * The touch-callout test keeps macOS Safari, whose system body size is 13px, on the 17px root. */
html { font-size: 17px; }
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

/* .hit: a 44pt-tall touch area around a control drawn smaller (HIG accessibility.md › Mobility).
 * :where() keeps the page's own position (absolute badges stay absolute); not for elements with their own ::after. */
:where(.hit) { position: relative; }
.hit::after { content: ''; position: absolute; left: 0; right: 0; top: calc(50% - 22px); height: 44px; }

/* iOS Safari ignores min-height on a native menu and on a date or time field: it draws them 29 and 31 pt high
 * whatever the page asks. height it obeys. Touch screens only, so desktops keep each page's own compact size
 * (HIG accessibility.md › Mobility: 44 pt on iOS and iPadOS, 28 pt on macOS). */
@media (pointer: coarse) {
  select:not([multiple]):not([size]), input[type=date], input[type=time], input[type=datetime-local], input[type=month] { height: 44px; }
}

/* A visible focus ring for keyboard use: iPad keyboards, desktop managers (HIG accessibility.md › Speech). */
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible,
[role="button"]:focus-visible, [role="tab"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent, #22d3ee);
  outline-offset: 2px;
}

/* Reduce Motion (HIG accessibility.md › Cognitive): slides, zooms and bounces become fades or stop.
 * Spinners keep turning: they are progress, not decoration. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
  :active { transform: none !important; }
  @keyframes fadeUp { from { opacity: 0; } to { opacity: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes rise { from { opacity: 0; } to { opacity: 1; } }
  @keyframes cardin { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slidein { from { opacity: 0; } to { opacity: 1; } }
  @keyframes toastin { from { opacity: 0; } to { opacity: 1; } }
  @keyframes toastout { to { opacity: 0; } }
  @keyframes pop { from { opacity: .3; } to { opacity: 1; } }
  @keyframes bounce { to { opacity: 1; } }
  @keyframes drift { to { opacity: 1; } }
  @keyframes flow { to { opacity: 1; } }
}
