/*
 * Ricardo Valverde Photography LLC - Typography
 * Bold, modern type system with fluid responsive scaling
 *
 * ===========================================================================
 * TYPOGRAPHY PHILOSOPHY
 * ===========================================================================
 *
 * "BOLD BUT READABLE"
 * WHY: Stand out in fine art photography market
 * - Heavy font weights (700-800): Confident, premium gallery aesthetic
 * - High contrast: Easy to scan
 * - Generous line-height: Comfortable reading
 *
 * SYSTEM FONTS DECISION:
 * WHY NOT custom web fonts (like Google Fonts):
 * ✅ Performance: 0ms load time (vs 100-500ms for web fonts)
 * ✅ Familiarity: User's native UI font
 * ✅ Accessibility: User's chosen font with customizations
 * ✅ Privacy: No Google tracking
 * ✅ Cost: $0 vs $199/year for premium fonts
 *
 * ❌ Trade-off: Less unique branding
 * ✅ Solution: Bold colors + layout make us distinctive
 *
 * ===========================================================================
 * FLUID TYPOGRAPHY - clamp() Function
 * ===========================================================================
 *
 * WHY CLAMP: Smooth scaling between breakpoints
 * Old way: Fixed sizes with media query jumps
 * - 320px: 24px
 * - 768px: 32px (sudden jump!)
 * - 1200px: 48px (another jump!)
 *
 * New way: Smooth scaling with clamp()
 * - clamp(min, preferred, max)
 * - min: Smallest size on mobile
 * - preferred: Fluid size based on viewport (vw units)
 * - max: Largest size on desktop
 *
 * EXAMPLE: h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
 * - Mobile (320px): 2rem = 32px (minimum)
 * - Tablet (768px): 5vw = 38.4px (scales smoothly)
 * - Desktop (1400px): 3.5rem = 56px (maximum)
 *
 * BENEFITS:
 * ✅ Smooth scaling: No jarring size jumps
 * ✅ Less code: No media queries needed for font sizes
 * ✅ Viewport-aware: Automatically adapts
 * ✅ User control: Respects browser font size settings
 *
 * BROWSER SUPPORT: 90%+ (IE11 not supported)
 * Fallback: Browsers without clamp() use middle value (5vw)
 *
 * ===========================================================================
 * TYPE SCALE - Modular Scale Ratio 1.25 (Major Third)
 * ===========================================================================
 *
 * WHY MODULAR SCALE: Visual hierarchy and harmony
 * - Each size is 1.25x the previous
 * - Creates consistent rhythm
 * - Music theory: Major third interval (pleasing ratio)
 *
 * SCALE:
 * h1: 56px (3.5rem) - Hero headlines
 * h2: 44px (2.75rem) - Section titles
 * h3: 32px (2rem) - Subsection titles
 * h4: 24px (1.5rem) - Card titles
 * h5: 20px (1.25rem) - Small headings
 * body: 16px (1rem) - Base text
 * small: 14px (0.875rem) - Meta text
 *
 * RESPONSIVE SCALING:
 * Ratio compresses on mobile (less dramatic hierarchy)
 * Expands on desktop (more dramatic contrast)
 *
 * ===========================================================================
 * LETTER SPACING (Tracking)
 * ===========================================================================
 *
 * WHY NEGATIVE LETTER SPACING on large headlines:
 * - Optical correction: Large text looks too loose
 * - Professional: Tighter = more polished
 * - Industry standard: Apple, Stripe use negative tracking
 *
 * h1: -0.02em (-2% of font size)
 * h2: -0.01em (-1% of font size)
 * h3+: 0em (normal spacing)
 *
 * ===========================================================================
 * LINE HEIGHT (Leading)
 * ===========================================================================
 *
 * HEADINGS: 1.2 (tight)
 * WHY: Multi-line headings should feel connected
 * Too loose (1.5): Feels disconnected, harder to read
 *
 * BODY TEXT: 1.6 (comfortable)
 * WHY: Balance readability and density
 * WCAG recommendation: 1.5 minimum
 * 1.6: Extra breathing room for long-form content
 *
 * ===========================================================================
 * UTILITY CLASSES
 * ===========================================================================
 *
 * .text-xs, .text-sm, .text-lg, .text-xl:
 * WHY: Quick size adjustments without custom CSS
 * Use case: Fine-tune specific elements
 *
 * .text-center, .text-left, .text-right:
 * WHY: Common alignments, saves repetition
 *
 * .text-muted, .text-primary, .text-accent:
 * WHY: Semantic color control
 * Better than inline styles: Consistent, themeable
 */

/* Heading Styles */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
}

h5 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    font-weight: 600;
}

h6 {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 600;
}

/* Paragraph Styles */
p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    color: var(--text-primary);
}

p:last-child {
    margin-bottom: 0;
}

/* Lead Text */
.lead {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Small Text */
small,
.text-small {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Bold Text */
strong,
b {
    font-weight: 700;
}

/* Emphasis */
em,
i {
    font-style: italic;
}

/* Code */
code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    background-color: var(--bg-light);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--secondary);
}

pre {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
}

pre code {
    background: none;
    padding: 0;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--accent);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    font-size: 1.125rem;
    font-style: italic;
    color: var(--text-secondary);
}

blockquote cite {
    display: block;
    margin-top: var(--spacing-md);
    font-size: 0.875rem;
    font-style: normal;
    color: var(--text-muted);
}

/* Lists */
ul,
ol {
    margin-bottom: var(--spacing-lg);
    padding-left: var(--spacing-xl);
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

li:last-child {
    margin-bottom: 0;
}

/* Definition Lists */
dl {
    margin-bottom: var(--spacing-lg);
}

dt {
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

dd {
    margin-bottom: var(--spacing-md);
    margin-left: var(--spacing-lg);
    color: var(--text-secondary);
}

/* Text Alignment */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

/* Text Transform */
.text-uppercase {
    text-transform: uppercase;
}

.text-lowercase {
    text-transform: lowercase;
}

.text-capitalize {
    text-transform: capitalize;
}

/* Text Weight */
.text-light {
    font-weight: 300;
}

.text-normal {
    font-weight: 400;
}

.text-medium {
    font-weight: 500;
}

.text-semibold {
    font-weight: 600;
}

.text-bold {
    font-weight: 700;
}

.text-extrabold {
    font-weight: 800;
}

/* Text Colors */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-white {
    color: var(--text-white);
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

/* Text Sizes */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

/* Line Height */
.leading-tight {
    line-height: 1.25;
}

.leading-normal {
    line-height: 1.5;
}

.leading-relaxed {
    line-height: 1.75;
}

.leading-loose {
    line-height: 2;
}

/* Letter Spacing */
.tracking-tight {
    letter-spacing: -0.05em;
}

.tracking-normal {
    letter-spacing: 0;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.tracking-wider {
    letter-spacing: 0.1em;
}

/* Text Decoration */
.underline {
    text-decoration: underline;
}

.line-through {
    text-decoration: line-through;
}

.no-underline {
    text-decoration: none;
}

/* Text Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Subsection Title */
.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* Info Text */
.info-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

/* Stat Values */
.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Responsive Typography */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* Dark Background Typography */
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-dark p,
.bg-dark li {
    color: var(--text-white);
}

.bg-dark .text-secondary {
    color: var(--text-light);
    opacity: 0.9;
}

.bg-dark .text-muted {
    color: var(--text-light);
    opacity: 0.7;
}

/* Print Typography */
@media print {

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }
}
