@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@200..800&display=swap');

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oxanium', monospace;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.7;
    color: #3e2723;
    background-color: #faf6f0;
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1 {
    font-weight: 600;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 2.5rem;
    color: #2e1207;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 500;
    font-size: 2rem;
    line-height: 1.3;
    margin: 3rem 0 1.5rem 0;
    color: #2e1207;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 450;
    font-size: 1.5rem;
    line-height: 1.4;
    margin: 2.5rem 0 1rem 0;
    color: #2e1207;
}

h4, h5, h6 {
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 2rem 0 0.75rem 0;
    color: #4e342e;
}

/* Paragraph Spacing */
p {
    margin-bottom: 1.5rem;
    white-space: pre-line; /* Allows line breaks within paragraphs */
}

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

/* Links */
a {
    color: #5d4037;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-weight: 400;
    transition: all 0.2s ease;
}

a:hover {
    color: #3e2723;
    text-decoration-thickness: 2px;
}

a:visited {
    color: #6d4c41;
}

/* Custom Elements */
h {
    display: inline;
    font-weight: inherit;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
}

light {
    display: inline;
    padding: 0.1em 0.2em;
    border-radius: 2px;
    background-color: rgba(255, 255, 0, 0.3); /* default yellow */
    transition: background-color 0.2s ease;
}

light[color="1"] {
    background-color: rgba(144, 238, 144, 0.4); /* pale green */
}

light[color="2"] {
    background-color: rgba(173, 216, 230, 0.4); /* pale blue */
}

light[color="3"] {
    background-color: rgba(255, 255, 0, 0.3); /* pale yellow */
}

light[color="4"] {
    background-color: rgba(255, 182, 193, 0.4); /* pale pink */
}

/* Custom Divider Element */
divider {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 0.9rem;
    color: #6d4c41;
    margin: 3rem 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

divider::before {
    content: '';
    width: 3rem;
    height: 1px;
    background: #a1887f;
    margin-right: 1rem;
    flex-shrink: 0;
}

divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #a1887f;
    margin-left: 1rem;
}

/* When divider has no text content */
divider:empty {
    height: 1px;
    background: #a1887f;
    margin: 2.5rem 0;
}

divider:empty::before,
divider:empty::after {
    display: none;
}

/* Lists */
ul, ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Blockquotes */
blockquote {
    font-weight: 300;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5d4037;
    margin: 2rem 0;
    padding-left: 2rem;
    border-left: 3px solid #bcaaa4;
}

/* Code */
code {
    font-family: 'Oxanium', monospace;
    font-weight: 400;
    font-size: 0.9em;
    background-color: #efebe9;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #8d6e63;
}

pre {
    background-color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #d7ccc8;
}

pre code {
    background: none;
    padding: 0;
    color: #4e342e;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 2rem 1.5rem;
        font-size: 17px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
        margin: 2.5rem 0 1.25rem 0;
    }
    
    h3 {
        font-size: 1.4rem;
        margin: 2rem 0 1rem 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 1rem;
        font-size: 16px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}