/* ==========================================================================
   Article Typography — post.css
   Applied on single post pages for rich content styling.
   ========================================================================== */

/* Prose container */
.prose {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-primary);
}

/* Spacing between elements */
.prose > * + * {
    margin-top: 1.5em;
}

/* Headings */
.prose h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.2;
    margin-top: 3rem;
    margin-bottom: 0.5rem;
}

.prose h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
}

.prose h4 {
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 0.25rem;
}

/* Paragraphs */
.prose p {
    margin-top: 1.25em;
    margin-bottom: 0;
}

/* Drop cap on first paragraph */
.prose > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 3.5em;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: var(--color-text-primary);
}

/* Links */
.prose a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: opacity 0.2s;
}

.prose a:hover {
    opacity: 0.6;
}

/* Blockquotes */
.prose blockquote {
    border-left: 3px solid var(--color-text-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--color-text-primary);
}

.prose blockquote p {
    margin-top: 0;
}

.prose blockquote cite {
    display: block;
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

/* Lists */
.prose ul,
.prose ol {
    padding-left: 1.5em;
    margin: 1.25em 0;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose li > ul,
.prose li > ol {
    margin-top: 0.25em;
    margin-bottom: 0;
}

/* Inline code */
.prose code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    font-size: 0.88em;
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
}

/* Code blocks */
.prose pre {
    background: #1a1a1a;
    color: #e5e5e5;
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 2rem 0;
}

.prose pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Images */
.prose img {
    border-radius: var(--radius);
    margin: 2rem auto;
}

.prose figure {
    margin: 2rem 0;
}

.prose figcaption,
.prose .wp-caption-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
    font-weight: 300;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.prose th {
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

/* Horizontal rule */
.prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 3rem 0;
}

/* WordPress specific */
.prose .wp-block-image {
    margin: 2rem 0;
}

.prose .aligncenter {
    text-align: center;
}

.prose .alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.prose .alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose .wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

/* Video embeds */
.prose .wp-block-embed,
.prose iframe {
    max-width: 100%;
    margin: 2rem auto;
}

.prose .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.prose .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .prose {
        font-size: 1rem;
    }

    .prose h2 {
        font-size: 1.6rem;
    }

    .prose h3 {
        font-size: 1.3rem;
    }

    .prose blockquote {
        font-size: 1.15rem;
        padding-left: 1rem;
    }

    .prose > p:first-of-type::first-letter {
        font-size: 3em;
    }

    .prose .alignleft,
    .prose .alignright {
        float: none;
        margin-left: 0;
        margin-right: 0;
    }
}
