/**
 * Typography System
 * Heading hierarchy, body text, and Google Fonts integration
 * 
 * @package OGULCAN_Theme
 * @requirements 3.4, 3.5
 */

/* ==========================================================================
   Google Fonts
   Inter (body) and Playfair Display (headings) with Turkish character support
   Subset: latin-ext includes Turkish characters (ç, ğ, ı, İ, ö, ş, ü)
   Note: Fonts are loaded via wp_enqueue_style in inc/enqueue.php
   ========================================================================== */

/* ==========================================================================
   Heading Styles (H1-H6 Hierarchy)
   Each level has a distinct font-size: H1 > H2 > H3 > H4 > H5 > H6
   ========================================================================== */

h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-dark);
    margin-bottom: var(--space-md);
}

/* H1 - 4rem (64px) - Page titles, hero headlines */
h1, .h1 {
    font-size: var(--font-size-4xl);
    letter-spacing: var(--letter-spacing-tight);
}

/* H2 - 3rem (48px) - Section titles */
h2, .h2 {
    font-size: var(--font-size-3xl);
    letter-spacing: var(--letter-spacing-tight);
}


/* H3 - 2rem (32px) - Subsection titles */
h3, .h3 {
    font-size: var(--font-size-2xl);
}

/* H4 - 1.5rem (24px) - Card titles, smaller sections */
h4, .h4 {
    font-size: var(--font-size-xl);
}

/* H5 - 1.125rem (18px) - Small headings */
h5, .h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

/* H6 - 1rem (16px) - Smallest headings */
h6, .h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
}

/* ==========================================================================
   Responsive Heading Sizes
   Mobile-first approach with min-width media queries
   ========================================================================== */

/* Mobile (default) - smaller sizes */
@media (max-width: 767px) {
    h1, .h1 {
        font-size: var(--font-size-2xl);
    }
    
    h2, .h2 {
        font-size: var(--font-size-xl);
    }
    
    h3, .h3 {
        font-size: var(--font-size-lg);
    }
}

/* Tablet and up */
@media (min-width: 768px) {
    h1, .h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2, .h2 {
        font-size: var(--font-size-2xl);
    }
}

/* Desktop and up */
@media (min-width: 1024px) {
    h1, .h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2, .h2 {
        font-size: var(--font-size-3xl);
    }
    
    h3, .h3 {
        font-size: var(--font-size-2xl);
    }
}

/* ==========================================================================
   Body Text Styles
   ========================================================================== */

p {
    margin-bottom: var(--space-md);
    max-width: 70ch; /* Optimal reading width */
}

p:last-child {
    margin-bottom: 0;
}

/* Lead paragraph - larger intro text */
.lead,
.text-lead {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-light);
}

/* Large text */
.text-lg {
    font-size: var(--font-size-lg);
}

/* Small text */
.text-sm,
small {
    font-size: var(--font-size-sm);
}

/* Extra small text */
.text-xs {
    font-size: var(--font-size-xs);
}


/* ==========================================================================
   Text Formatting
   ========================================================================== */

strong, b {
    font-weight: var(--font-weight-bold);
}

em, i {
    font-style: italic;
}

mark {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-sm);
}

del, s {
    text-decoration: line-through;
    color: var(--color-text-light);
}

ins, u {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* ==========================================================================
   Blockquotes
   ========================================================================== */

blockquote {
    position: relative;
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-xl) 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-style: italic;
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
    border-left: 4px solid var(--color-secondary);
    background-color: var(--color-gray-100);
}

blockquote::before {
    content: '"';
    position: absolute;
    top: var(--space-sm);
    left: var(--space-md);
    font-size: var(--font-size-4xl);
    font-family: var(--font-heading);
    color: var(--color-secondary);
    opacity: 0.3;
    line-height: 1;
}

blockquote cite {
    display: block;
    margin-top: var(--space-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-style: normal;
    color: var(--color-text-light);
}

blockquote cite::before {
    content: '— ';
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-normal);
}

li::marker {
    color: var(--color-secondary);
}

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
    margin-top: var(--space-xs);
    margin-bottom: 0;
}

/* Definition lists */
dl {
    margin-bottom: var(--space-md);
}

dt {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-dark);
}

dd {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}


/* ==========================================================================
   Code and Preformatted Text
   ========================================================================== */

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

code {
    padding: 0.2em 0.4em;
    background-color: var(--color-gray-100);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
}

pre {
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    background-color: var(--color-dark);
    color: var(--color-light);
    border-radius: var(--radius-md);
}

pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}

kbd {
    padding: 0.2em 0.4em;
    background-color: var(--color-dark);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Horizontal Rule
   ========================================================================== */

hr {
    height: 0;
    margin: var(--space-xl) 0;
    border: 0;
    border-top: 1px solid var(--color-gray-300);
}

/* Decorative HR */
hr.decorative {
    border: 0;
    height: 4px;
    width: 60px;
    background-color: var(--color-secondary);
    margin: var(--space-xl) auto;
}

/* ==========================================================================
   Text Alignment Utilities
   ========================================================================== */

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

/* ==========================================================================
   Text Color Utilities
   ========================================================================== */

.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-secondary);
}

.text-dark {
    color: var(--color-text-dark);
}

.text-light {
    color: var(--color-text-light);
}

.text-white {
    color: var(--color-white);
}

.text-muted {
    color: var(--color-gray-500);
}

/* ==========================================================================
   Text Weight Utilities
   ========================================================================== */

.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);
}

/* ==========================================================================
   Text Transform Utilities
   ========================================================================== */

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

.normal-case {
    text-transform: none;
}

/* ==========================================================================
   Line Clamp Utilities
   ========================================================================== */

.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;
}
