/**
 * Base Styles
 * Typography, links, and core element styling
 */

/* ===========================================
   ROOT & BODY
   =========================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

/* Prevent body scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
}


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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-5xl);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-4xl);
  letter-spacing: var(--letter-spacing-tight);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

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

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

/* Lead text */
.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* Small text */
small,
.small {
  font-size: var(--font-size-sm);
}

/* Bold */
strong,
b {
  font-weight: var(--font-weight-semibold);
}


/* ===========================================
   LINKS
   =========================================== */

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: var(--transition-colors);
}

a:hover {
  color: var(--color-text-link-hover);
}

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


/* ===========================================
   LISTS
   =========================================== */

ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

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

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

/* Remove default styles for navigation lists */
nav ul,
nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0;
}


/* ===========================================
   IMAGES & MEDIA
   =========================================== */

img {
  height: auto;
  vertical-align: middle;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-2);
}


/* ===========================================
   SELECTION
   =========================================== */

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}


/* ===========================================
   SKIP LINK (Accessibility)
   =========================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-tooltip);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

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


/* ===========================================
   HIDDEN / SCREEN READER ONLY
   =========================================== */

.hidden {
  display: none !important;
}

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


/* ===========================================
   TEXT UTILITIES
   =========================================== */

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

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

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

.text-accent {
  color: var(--color-primary);
}

.text-white {
  color: var(--color-white);
}

/* Icon utilities */
.icon-rotate-180 {
  transform: rotate(180deg);
}
