/**
 * Typography System
 * Source Serif Pro (headings) + Source Sans Pro (body)
 */

/* ===== Headings ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    margin-bottom: var(--space-md);
    letter-spacing: var(--letter-spacing-tight);
}

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

h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
}

/* Hero Headline */
.hero-headline {
    font-size: var(--font-size-hero);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: var(--space-lg);
}

/* ===== Headings in Dark Sections (WCAG AA Compliance) ===== */
/* Headings inside dark background containers should inherit white text color */
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.newsletter-section h1,
.newsletter-section h2,
.newsletter-section h3,
.vision-cta-section h1,
.vision-cta-section h2,
.vision-cta-section h3,
/* Tailwind dark background utilities */
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-secondary h1,
.bg-secondary h2,
.bg-secondary h3,
.bg-secondary h4,
.bg-accent h1,
.bg-accent h2,
.bg-accent h3,
.bg-accent h4,
/* Tailwind text-white containers */
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6 {
    color: inherit;
}

/* Section Heading */
.section-heading {
    font-size: var(--font-size-h2);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

/* Footer Heading */
.footer-heading {
    font-size: var(--font-size-h4);
    font-family: var(--font-body);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--color-white);
}

/* ===== Body Text ===== */
p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-loose);
}

.text-large {
    font-size: var(--font-size-large);
}

.text-small {
    font-size: var(--font-size-small);
}

.text-caption {
    font-size: var(--font-size-caption);
}

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

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

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

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

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

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

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

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

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

/* Semantic text colors — WCAG AA compliant on white backgrounds */
.text-hint {
    color: #6b7280; /* gray-500, 4.6:1 — use ONLY for large text (18px+) or non-text elements */
}

.text-label {
    color: #374151; /* gray-700, 10.7:1 on white — for form labels, table headers */
}

.text-secondary-content {
    color: #4b5563; /* gray-600, 7.0:1 — for secondary body text */
}

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

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

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

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

/* ===== Links ===== */
a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-base);
}

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

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

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

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

/* ===== Blockquotes ===== */
blockquote {
    border-left: 4px solid var(--color-burgundy);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

/* ===== Code ===== */
code {
    font-family: var(--font-mono);
    background: var(--color-light-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

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

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

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

em, i {
    font-style: italic;
}

/* ===== Screen Reader Only ===== */
.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;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-navy);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    z-index: 100;
    font-weight: var(--font-weight-semibold);
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

/* ===== Maximum Line Length (Readability) ===== */
.readable {
    max-width: 65ch;
}
