/**
 * Author Website Templates - Native Typography Engine (BEM Pure SCSS)
 * Replaces Tailwind .prose for the_content(), the_excerpt(), and rich text containers
 */

@use 'variables' as *;
@use 'mixins' as *;

.awt-prose {
    font-family: var(--awt-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1.125rem; // 18px base for optimal reading
    line-height: 1.75;
    color: #334155; // slate-700
    word-break: break-word;

    // Paragraphs & Lead
    > p,
    p {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
    }

    // Headings
    > h1, > h2, > h3, > h4, > h5, > h6,
    h1, h2, h3, h4, h5, h6 {
        color: var(--awt-color-navy, #0f172a);
        font-family: var(--awt-font-serif, Georgia, serif);
        font-weight: 700;
        line-height: 1.3;
        margin-top: 2em;
        margin-bottom: 0.75em;
    }

    > h1, h1 { font-size: 2.25rem; }
    > h2, h2 { font-size: 1.75rem; border-bottom: 1px solid #f1f5f9; padding-bottom: 0.3em; }
    > h3, h3 { font-size: 1.375rem; }
    > h4, h4 { font-size: 1.125rem; }
    > h5, h5 { font-size: 1rem; }
    > h6, h6 { font-size: 0.875rem; }

    // Hyperlinks
    a {
        color: var(--awt-color-primary, #0f172a);
        text-decoration: underline;
        text-underline-offset: 3px;
        font-weight: 600;
        transition: color 0.2s ease;

        &:hover {
            color: var(--awt-color-primary-hover, #bf360c);
        }
    }

    // Lists
    ul,
    ol {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
        padding-left: 1.625em;

        li {
            margin-top: 0.5em;
            margin-bottom: 0.5em;
            line-height: 1.7;
        }
    }

    ul {
        list-style-type: disc;
    }

    ol {
        list-style-type: decimal;
    }

    // Blockquotes
    blockquote {
        margin: 1.6em 0;
        padding: 0.5em 0 0.5em 1.25em;
        border-left: 4px solid var(--awt-color-primary, #ea580c);
        font-style: italic;
        color: #475569;
        background: #f8fafc;
        border-radius: 0 8px 8px 0;

        p {
            margin: 0.5em 0;
        }
    }

    // Images & Media
    img,
    figure {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 2em auto;
        display: block;
    }

    figcaption {
        font-size: 0.875rem;
        color: #64748b;
        text-align: center;
        margin-top: 0.5em;
    }

    // Tables
    table {
        width: 100%;
        table-layout: auto;
        text-align: left;
        margin-top: 2em;
        margin-bottom: 2em;
        font-size: 0.95rem;
        border-collapse: collapse;

        th {
            font-weight: 600;
            color: var(--awt-color-navy, #0f172a);
            border-bottom: 2px solid #cbd5e1;
            padding: 0.75rem 1rem;
        }

        td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #e2e8f0;
        }

        tr:nth-child(even) {
            background-color: #f8fafc;
        }
    }

    // Code blocks & Pre
    code {
        font-size: 0.875em;
        font-family: monospace;
        background-color: #f1f5f9;
        padding: 0.2em 0.4em;
        border-radius: 4px;
        color: #e11d48;
    }

    pre {
        background-color: #0f172a;
        color: #f8fafc;
        padding: 1.25rem;
        border-radius: 8px;
        overflow-x: auto;
        margin: 1.5em 0;

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

    // Horizontal Rule
    hr {
        border: 0;
        border-top: 1px solid #e2e8f0;
        margin: 3em 0;
    }
}
