/* Modern Typography Enhancements */

/* Import modern web fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Override font families */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Smooth font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced paragraph readability */
p {
    max-width: 65ch;
    margin-bottom: 1.5rem;
}

/* Better link styling */
a {
    transition: all 0.2s ease;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* Improved heading hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-top: 2.5rem;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Enhanced list styling */
ul, ol {
    line-height: 1.8;
}

li {
    margin-bottom: 0.5rem;
}

/* Better blockquote styling */
blockquote {
    position: relative;
    padding-left: 2rem;
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.9;
}

blockquote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    opacity: 0.3;
}

/* Code block enhancements */
.highlight {
    position: relative;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.highlight pre {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace !important;
    font-size: 0.875rem;
    line-height: 1.6;
    tab-size: 4;
}

/* Copy button for code blocks */
.highlight:hover .copy-button {
    opacity: 1;
}

.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Inline code styling */
code:not(.highlight code) {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace !important;
    font-size: 0.875em;
    padding: 0.125rem 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Table improvements */
table {
    font-size: 0.9rem;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

table thead {
    background: rgba(255, 255, 255, 0.03);
}

table th {
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
}

table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive typography */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    p {
        max-width: 100%;
    }
    
    .highlight pre {
        font-size: 0.8rem;
    }
}

/* Subtle animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

article {
    animation: fadeIn 0.5s ease-out;
}

/* Selection styling */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}