/**
 * Typography System
 * Professional type scale and heading styles
 */

/* =============================================================================
   HEADINGS
   ============================================================================= */

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

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

h2 {
    font-size: var(--font-size-3xl);
    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);
    font-weight: var(--font-weight-semibold);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2 {
        font-size: var(--font-size-2xl);
    }
    
    h3 {
        font-size: var(--font-size-xl);
    }
}

/* =============================================================================
   BODY TEXT
   ============================================================================= */

p {
    margin-bottom: var(--space-4);
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
}

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

/* Text Sizes */
.text-xs {
    font-size: var(--font-size-xs);
}

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

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

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

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

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

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

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

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

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

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

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

/* Text Weights */
.font-light {
    font-weight: var(--font-weight-light);
}

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

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

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

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

/* =============================================================================
   SPECIAL TEXT ELEMENTS
   ============================================================================= */

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

/* Emphasis */
em, i {
    font-style: italic;
}

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

/* Code & Monospace */
code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: var(--color-gray-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

[data-theme="dark"] code,
[data-theme="dark"] kbd,
[data-theme="dark"] samp,
[data-theme="dark"] pre {
    background-color: var(--color-gray-200);
}

pre {
    padding: var(--space-4);
    overflow-x: auto;
    border: var(--border-width-1) solid var(--color-border);
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* Blockquote */
blockquote {
    margin: var(--space-6) 0;
    padding-left: var(--space-6);
    border-left: var(--border-width-4) solid var(--color-primary);
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: var(--border-width-1) solid var(--color-border);
    margin: var(--space-8) 0;
}

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

ul, ol {
    margin-bottom: var(--space-4);
    color: var(--color-text);
}

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

ul ul, ol ol, ul ol, ol ul {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

/* =============================================================================
   SPECIALIZED TEXT ELEMENTS
   ============================================================================= */

/* Ethereum Addresses & Hashes */
.address, .hash, .monospace {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background-color: var(--color-gray-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    word-break: break-all;
}

[data-theme="dark"] .address,
[data-theme="dark"] .hash,
[data-theme="dark"] .monospace {
    background-color: var(--color-gray-200);
}

/* Truncated Address */
.address-truncated {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

/* Badge Text */
.badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
}

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

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

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

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

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

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

/* 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;
}

/* Text Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line Clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Whitespace */
.whitespace-normal {
    white-space: normal;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.whitespace-pre {
    white-space: pre;
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

