/*
 * Base Styles & Typography
 * Foundational styles for all pages
 */

/* ============================================
   BASE HTML & BODY SETUP
   ============================================ */

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

html {
  font-size: 10px; /* 1rem = 10px */
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.no-js body {
  visibility: hidden;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

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

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

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: var(--font-size-3xl);
}

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(--spacing-md);
  color: var(--color-text-primary);
  font-family: 'OpenAI Sans', sans-serif;
  font-feature-settings: "liga" on, "calt" on;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

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

ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-sm);
}

/* Remove list styling for navigation and utility lists */
.list-none {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-none li {
  margin-bottom: 0;
}

/* ============================================
   IMAGES
   ============================================ */

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

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

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

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.container {
  width: 90%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) 0;
}

.container-narrow {
  max-width: var(--max-width-text);
}

/* ============================================
   SECTIONS
   ============================================ */

section {
  padding: var(--spacing-3xl) 0;
}

.section-heading {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
}

.section-heading h1,
.section-heading h2 {
  position: relative;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--font-size-3xl);
}

/* Decorative underline for section headings */
.section-heading h1::after,
.section-heading h2::after {
  content: '';
  display: block;
  width: 100px;
  height: 3px;
  background-color: var(--color-heading);
  margin: var(--spacing-md) auto 0;
  border-radius: var(--border-radius-sm);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text alignment */
.text-center {
  text-align: center;
}

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

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

/* Display utilities */
.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.hidden {
  display: none;
}

/* Flexbox utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

/* Spacing utilities */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-xl { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip to main content link (for keyboard navigation) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-link);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: var(--z-tooltip);
  border-radius: var(--border-radius-sm);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
}

/* Visually hidden but accessible to screen readers */
.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;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet and below */
@media (max-width: 1024px) {
  .container {
    width: 95%;
  }
}

/* Mobile and below */
@media (max-width: 768px) {
  html {
    font-size: 9px; /* Slightly smaller base for mobile */
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

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

  section {
    padding: var(--spacing-2xl) 0;
  }

  .section-heading {
    margin-bottom: var(--spacing-2xl);
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md);
  }
}
