/* ============================================
   CourseraVoyant Inc. — Base Styles
   Reset · Typography · Elements · Utilities
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-navy);
  letter-spacing: var(--ls-tight);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

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

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

a {
  color: var(--color-navy-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-gold); }

strong, b {
  font-weight: var(--fw-semibold);
}

em, i { font-style: italic; }

small { font-size: var(--fs-body-sm); }

mark {
  background-color: var(--color-gold-light);
  color: var(--color-navy);
  padding: 0 4px;
  border-radius: var(--radius-sm);
}

/* ---- Lists ---- */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li { margin-bottom: var(--space-xs); }

/* ---- Blockquote ---- */
blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-xl) var(--space-2xl);
  border-left: 4px solid var(--color-gold);
  background-color: var(--color-bg-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-style: italic;
  color: var(--color-navy);
  line-height: var(--lh-snug);
}

blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-style: normal;
  color: var(--color-text-secondary);
}

/* ---- Code ---- */
code, pre {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: var(--fs-body-sm);
}

code {
  background-color: var(--color-bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-navy);
}

pre {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  font-size: var(--fs-body-sm);
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: var(--fw-semibold);
  color: var(--color-navy);
  background-color: var(--color-bg-light);
}

/* ---- Images & Media ---- */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: var(--space-xl) 0;
}

figcaption {
  margin-top: var(--space-xs);
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

/* ---- Form Elements ---- */
input, textarea, select, button {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
}

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

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--color-gold);
  outline-offset: 1px;
}

/* ---- Horizontal Rule ---- */
hr {
  border: none;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-2xl) 0;
}

/* ---- Selection ---- */
::selection {
  background-color: var(--color-gold);
  color: var(--color-white);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background-color: var(--color-bg-light);
}

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

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

/* ============================================
   Utility Classes
   ============================================ */

/* ---- Text Alignment ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ---- Text Colors ---- */
.text-navy { color: var(--color-navy); }
.text-gold { color: var(--color-gold); }
.text-white { color: var(--color-white); }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }

/* ---- Backgrounds ---- */
.bg-navy { background-color: var(--color-navy); }
.bg-navy-light { background-color: var(--color-navy-light); }
.bg-gold { background-color: var(--color-gold); }
.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-bg-light); }
.bg-alt { background-color: var(--color-bg-alt); }

/* ---- Text Transform ---- */
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

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

/* ---- Font Family ---- */
.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

/* ---- Letter Spacing ---- */
.ls-tight { letter-spacing: var(--ls-tight); }
.ls-wide { letter-spacing: var(--ls-wide); }
.ls-wider { letter-spacing: var(--ls-wider); }
.ls-widest { letter-spacing: var(--ls-widest); }

/* ---- Display ---- */
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

/* ---- Flex Utilities ---- */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ---- Margin ---- */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ---- Padding ---- */
.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }

/* ---- Position ---- */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* ---- Overflow ---- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-visible { overflow: visible; }

/* ---- Border Radius ---- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ---- Shadow ---- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ---- Width ---- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-half { width: 50%; }

/* ---- Height ---- */
.h-full { height: 100%; }
.h-auto { height: auto; }

/* ---- Visibility ---- */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ---- Overline Label ---- */
.overline {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-overline);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}

.overline--white { color: var(--color-gold-light); }

/* ---- Section Title ---- */
.section-title {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: var(--fs-body-lg);
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Divider ---- */
.divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-gold);
  border: none;
  margin: var(--space-md) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

.divider--white {
  background-color: var(--color-gold-light);
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Visually Hidden (a11y) ---- */
.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;
}

/* ---- Screen Reader Only Skip Link ---- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-modal);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  color: var(--color-white);
}
