/**
 * SHA Student Portal - Base & Reset Styles
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ==========================================================================
   1. Minimal CSS Reset & Predictable Box Sizing
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height, 68px) + var(--space-4, 1rem));
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

section[id],
div[id] {
  scroll-margin-top: calc(var(--header-height, 68px) + var(--space-4, 1rem));
}

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
  background-color: var(--color-canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. Typography Defaults & Heading Hierarchy
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-headings);
  color: var(--color-text-primary);
  line-height: var(--line-height-snug);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-4xl); font-weight: var(--font-weight-extrabold); }
h2 { font-size: var(--font-size-3xl); font-weight: var(--font-weight-bold); }
h3 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); }
h4 { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
h5 { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
h6 { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }

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

p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   3. Link & Image Defaults
   ========================================================================== */
a {
  color: var(--color-brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brand-blue-hover);
}

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

/* ==========================================================================
   4. Form-Control & Button Inheritance
   ========================================================================== */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   5. Accessible Keyboard Focus & Selection
   ========================================================================== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

::selection {
  background-color: var(--color-brand-purple-subtle);
  color: var(--color-brand-purple);
}

/* ==========================================================================
   6. Screen Reader & Accessibility Landmarks
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -9999px;
  left: var(--space-4);
  background: var(--color-navy-950);
  color: var(--color-text-white);
  padding: var(--space-2) var(--space-4);
  z-index: 9999;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   7. Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
