/* ========================================
   HRStudyPro Global Stylesheet
   Design System Implementation
   ======================================== */

/* ========================================
   1. CSS VARIABLES (Design Tokens)
   ======================================== */

:root {
  /* Backgrounds */
  --cream: #FAF7F2;
  --cream-dark: #F0EBE3;

  /* Primary - Forest Green */
  --green: #2D5A47;
  --green-dark: #1B4D3E;
  --green-light: #3D7A5F;

  /* Secondary - Warm Coral */
  --coral: #D4876C;
  --coral-light: #E8A088;

  /* Tertiary - Plum */
  --plum: #6B5B7A;
  --plum-light: #8B7B9A;

  /* Text Colors */
  --text-dark: #2D2A26;
  --text-body: #4A4540;
  --text-muted: #7A756D;

  /* Feedback Colors */
  --success: #2D5A47;
  --success-bg: #E8F0EC;
  --error: #C45B4A;
  --error-bg: #FCF0EE;
  --warning-bg: #FEF3E2;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(45, 42, 38, 0.05);
  --shadow-md: 0 4px 6px rgba(45, 42, 38, 0.08);
  --shadow-lg: 0 10px 15px rgba(45, 42, 38, 0.1);

  /* Focus Ring */
  --focus-ring: 0 0 0 4px rgba(45, 90, 71, 0.2);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 100px;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Animation */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   2. CSS RESET
   ======================================== */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ========================================
   3. BASE STYLES
   ======================================== */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ========================================
   4. TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
}

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

a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--green-dark);
}

strong {
  font-weight: 600;
  color: var(--text-dark);
}

/* ========================================
   5. ACCESSIBILITY
   ======================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

/* ========================================
   6. REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   7. MEMBERSTACK CONTENT HIDING
   These rules prevent gated content from flashing briefly
   before MemberStack initializes.
   Do not remove unless replacing with an alternative gating strategy.
   ======================================== */

/* Hide member-only content by default (shown when logged in) */
[data-ms-content="member"] {
  display: none !important;
}

/* Show non-member content by default (hidden when logged in) */
[data-ms-content="!member"] {
  display: revert !important;
}

/* Ensure header buttons display correctly */
#header [data-ms-content="!member"] {
  display: inline-flex !important;
}
