/* ============================================
   Base Styles - Typography and Elements
   ============================================ */

/* ========== Root & Body ========== */
html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--gray-900);
  background-color: var(--white);
  overflow-x: hidden;
}

/* ========== Headings ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  color: var(--black);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

h3 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

h5 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

h6 {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* Desktop heading sizes */
@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-5xl);
  }

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

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

/* Large desktop heading sizes */
@media (min-width: 1280px) {
  h1 {
    font-size: var(--text-6xl);
  }
}

/* ========== Paragraphs ========== */
p {
  margin-bottom: var(--space-4);
  color: var(--gray-600);
}

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

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--gray-600);
  text-wrap: balance;
}

@media (min-width: 1024px) {
  .lead {
    font-size: var(--text-xl);
  }
}

/* ========== Links ========== */
a {
  color: var(--primary);
  transition: color var(--transition-fast);
}

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

/* ========== Strong & Emphasis ========== */
strong,
b {
  font-weight: var(--font-semibold);
}

em,
i {
  font-style: italic;
}

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

/* ========== Code ========== */
code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--gray-100);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  background-color: var(--gray-900);
  color: var(--white);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

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

/* ========== Horizontal Rule ========== */
hr {
  border: none;
  height: 1px;
  background-color: var(--gray-200);
  margin: var(--space-8) 0;
}

/* ========== Blockquote ========== */
blockquote {
  border-left: 4px solid var(--primary);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  font-style: italic;
  color: var(--gray-600);
}

/* ========== Lists ========== */
.list-disc {
  list-style-type: disc;
  padding-left: var(--space-6);
}

.list-decimal {
  list-style-type: decimal;
  padding-left: var(--space-6);
}

.list-disc li,
.list-decimal li {
  margin-bottom: var(--space-2);
}

/* ========== Images ========== */
img {
  object-fit: cover;
}

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

figcaption {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: var(--space-2);
  text-align: center;
}

/* ========== Tables ========== */
table {
  width: 100%;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  background-color: var(--gray-50);
}

/* ========== Form Elements ========== */
label {
  display: block;
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
  color: var(--gray-700);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background-color: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha-10);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

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

/* Text colors */
.text-primary {
  color: var(--primary);
}

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

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

.text-gray-900 {
  color: var(--gray-900);
}

.text-gray-600 {
  color: var(--gray-600);
}

.text-gray-400 {
  color: var(--gray-400);
}

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

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

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

/* Font weight */
.font-normal {
  font-weight: var(--font-normal);
}

.font-medium {
  font-weight: var(--font-medium);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

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

.lowercase {
  text-transform: lowercase;
}

.capitalize {
  text-transform: capitalize;
}

/* Text decoration */
.underline {
  text-decoration: underline;
}

.line-through {
  text-decoration: line-through;
}

.no-underline {
  text-decoration: none;
}

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