/**
 * Edufin Design System - Base Styles
 * Reset, typography, and global utilities
 */

/* =================================
   CSS RESET
   ================================= */

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-base-black);
  background-color: var(--color-base-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* =================================
   TYPOGRAPHY
   ================================= */

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

h1 {
  font-size: var(--text-4xl);
  line-height: 1.14; /* 64/56 */
}

h2 {
  font-size: var(--text-3xl);
  line-height: 1.17; /* 42/36 */
}

h3 {
  font-size: var(--text-2xl);
  line-height: 1.25; /* 30/24 */
}

h4 {
  font-size: var(--text-xl);
  line-height: 1.3; /* 26/20 */
}

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

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

.text-sm {
  font-size: var(--text-sm);
  line-height: 1.71; /* 24/14 */
}

.text-lg {
  font-size: var(--text-lg);
  line-height: 1.67; /* 30/18 */
}

.text-xl {
  font-size: var(--text-xl);
  line-height: 1.8; /* 36/20 */
}

/* Font weights */
.font-regular { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Text colors */
.text-white { color: var(--color-base-white); }
.text-black { color: var(--color-base-black); }
.text-gray { color: var(--color-base-gray-text); }
.text-primary { color: var(--color-primary-green-dark); }
.text-accent { color: var(--color-primary-orange); }

/* =================================
   LAYOUT UTILITIES
   ================================= */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

@media (min-width: 64rem) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

.page-wrapper {
  width: 100%;
  overflow-x: hidden;
}

/* Full bleed sections that break out of container */
.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid utilities */
.grid { display: grid; }

/* =================================
   SECTION UTILITIES
   ================================= */

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (min-width: 48rem) {
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

.section-header {
  text-align: center;
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  color: var(--color-base-gray-text);
  font-size: var(--text-lg);
}

/* Background variants */
.bg-white { background-color: var(--color-base-white); }
.bg-light { background-color: var(--color-base-white-bg); }
.bg-green-lightest { background-color: var(--color-primary-green-lightest); }
.bg-dark { background-color: var(--color-primary-green-dark); }

/* =================================
   VISIBILITY UTILITIES
   ================================= */

.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;
}

/* =================================
   ANIMATIONS
   ================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-down {
  animation: slideDown var(--transition-base) ease-out;
}

/* =================================
   FOCUS STYLES
   ================================= */

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

/* =================================
   SCROLLBAR STYLING
   ================================= */

::-webkit-scrollbar {
  width: var(--space-2);
  height: var(--space-2);
}

::-webkit-scrollbar-track {
  background: var(--color-neutral-300);
}

::-webkit-scrollbar-thumb {
  background: var(--color-neutral-500);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-600);
}
