/* ========================================
   Typography Styles - Optimized for YekanBakh Font
   ======================================== */

/* ========================================
   Body
   ======================================== */

body {
    font-family: var(--lc-font-family-base, 'YekanBakh', -apple-system, sans-serif);
    font-size: var(--lc-font-size-base);
    font-weight: var(--lc-font-weight-normal);
    line-height: var(--lc-line-height-base);
    color: var(--lc-color-text);
    letter-spacing: var(--lc-letter-spacing-normal, -0.01em);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========================================
   Headings
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--lc-font-family-headings, 'YekanBakh', sans-serif);
    font-weight: var(--lc-font-weight-bold);
    line-height: var(--lc-line-height-headings);
    color: var(--lc-color-text);
    margin-bottom: var(--lc-spacing-sm);
    letter-spacing: var(--lc-letter-spacing-tight, -0.02em);
}

h1 {
    font-size: var(--lc-font-size-4xl);
    font-weight: var(--lc-font-weight-black, 900);
}

h2 {
    font-size: var(--lc-font-size-3xl);
    font-weight: var(--lc-font-weight-bold, 700);
}

h3 {
    font-size: var(--lc-font-size-2xl);
    font-weight: var(--lc-font-weight-bold, 700);
}

h4 {
    font-size: var(--lc-font-size-xl);
    font-weight: var(--lc-font-weight-semibold, 600);
}

h5 {
    font-size: var(--lc-font-size-lg);
    font-weight: var(--lc-font-weight-semibold, 600);
}

h6 {
    font-size: var(--lc-font-size-md);
    font-weight: var(--lc-font-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Paragraphs
   ======================================== */

p {
    margin-bottom: var(--lc-spacing-unit);
    line-height: var(--lc-line-height-base);
}

/* First paragraph - no top margin */
p:first-child {
    margin-top: 0;
}

/* Last paragraph - no bottom margin */
p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Text Emphasis
   ======================================== */

strong,
b {
    font-weight: var(--lc-font-weight-bold);
}

em,
i {
    font-style: italic;
}

small {
    font-size: var(--lc-font-size-sm);
}

mark {
    background-color: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    color: inherit;
}

/* ========================================
   Code & Preformatted
   ======================================== */

code,
kbd,
samp,
pre {
    font-family: var(--lc-font-family-monospace, 'Courier New', monospace);
    font-size: 0.875em;
    direction: ltr;
    text-align: left;
}

pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: var(--lc-border-radius-sm);
    overflow-x: auto;
    margin-bottom: var(--lc-spacing-unit);
    line-height: 1.6;
}

code {
    background-color: #f0f4f8;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    color: #0f3460;
}

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

/* ========================================
   Blockquotes
   ======================================== */

blockquote {
    border-inline-start: 4px solid var(--lc-color-primary, #0f3460);
    padding-inline-start: 1.25rem;
    margin: var(--lc-spacing-unit) 0;
    color: var(--lc-color-text-secondary, #555555);
    font-size: var(--lc-font-size-md);
    line-height: var(--lc-line-height-base);
    font-style: italic;
}

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

blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: var(--lc-font-size-sm);
    font-style: normal;
    font-weight: var(--lc-font-weight-semibold);
    color: var(--lc-color-primary, #0f3460);
}

/* ========================================
   Links
   ======================================== */

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

a:hover,
a:focus {
    color: var(--lc-color-link-hover);
    text-decoration: underline;
}

/* ========================================
   Lists
   ======================================== */

ul,
ol {
    margin-bottom: var(--lc-spacing-unit);
    padding-inline-start: 1.5rem;
    line-height: var(--lc-line-height-base);
}

li {
    margin-bottom: 0.375rem;
}

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

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
    margin-top: 0.375rem;
    margin-bottom: 0;
}

/* Description lists */
dl {
    margin-bottom: var(--lc-spacing-unit);
}

dt {
    font-weight: var(--lc-font-weight-bold);
    margin-bottom: 0.25rem;
}

dd {
    margin-inline-start: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ========================================
   Persian Number Optimization
   ======================================== */

[dir="rtl"] {
    font-family: 'YekanBakh', sans-serif;
}

/* Numbers in specific elements */
.price,
.amount,
.woocommerce-Price-amount,
.lc-cart-badge,
.lc-search-count,
.woocommerce-result-count,
.woocommerce-pagination .page-numbers {
    font-feature-settings: "tnum";
    font-variant-numeric: normal;
}

/* ========================================
   RTL Adjustments
   ======================================== */

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
    letter-spacing: -0.02em;
}

[dir="rtl"] p,
[dir="rtl"] li {
    line-height: var(--lc-line-height-base);
}

/* ========================================
   Responsive Typography
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: var(--lc-font-size-3xl);
    }
    
    h2 {
        font-size: var(--lc-font-size-2xl);
    }
    
    h3 {
        font-size: var(--lc-font-size-xl);
    }
    
    body {
        font-size: var(--lc-font-size-base);
        line-height: 1.8;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: var(--lc-font-size-2xl);
    }
    
    h2 {
        font-size: var(--lc-font-size-xl);
    }
    
    h3 {
        font-size: var(--lc-font-size-lg);
    }
}