/* ==========================================================================
   EasyUni Edu — Base Reset & Typography v2
   Minimal reset on top of tokens.css. No framework.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}
a:hover { color: var(--color-primary-dark); }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  color: var(--color-ink);
  font-weight: var(--weight-bold);
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.03em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h3 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h4 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); line-height: var(--leading-relaxed); }
p:last-child { margin-bottom: 0; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* Utility helpers */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Skip link */
.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  background: var(--color-primary); color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: var(--z-modal);
  font-weight: var(--weight-semibold);
  transition: top var(--duration-fast);
}
.skip-link:focus { top: var(--space-2); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb { background: var(--color-ink-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-ink-soft); }

/* ==========================================================================
   Mobile platform layer (v1.6) — applies to every page
   Measured problems this fixes:
   - Every form control on the site was 14px, and iOS Safari ZOOMS the whole
     page in when a control with font-size < 16px receives focus (and leaves it
     zoomed). 16px is the floor. `!important` is deliberate: several pages set
     the size in an inline `style=` (programs/contact/scholarships search
     inputs), which nothing else can override.
   - iOS/Android flash a grey box over every tapped link unless
     -webkit-tap-highlight-color is cleared; we give our own :active feedback.
   - Hover-only affordances never fire on touch, so the reveal-on-hover
     transitions are neutralised on hover-less devices (they stay for mice).
   - 100vh on iOS = the *large* viewport (URL bar hidden) → full-height pages
     jump when the bar appears. 100dvh tracks the live viewport.
   ========================================================================== */
html {
  -webkit-tap-highlight-color: transparent;
}

/* iPad Safari auto-zooms exactly like iPhone Safari, and iPads are 768-1194px
   wide — so this must NOT be gated at 768px. `pointer: coarse` catches every
   touch device at any width; the max-width limb covers narrow desktop windows
   (a 16px form control there is fine). */
@media (max-width: 1280px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px !important;   /* kills the iOS focus-zoom */
  }
}

/* Touch feedback where there is no hover to rely on. */
@media (hover: none) {
  a:active, button:active, .btn:active, .filter-chip:active { opacity: 0.72; }
}

/* Live viewport height (browsers without dvh keep the vh value above). */
.auth-page, .dash-shell, .admin-shell, .hero { min-height: 100dvh; }
