/* prose-emviui.css — Article body typography
 *
 * Served from blog-staging/blog/_prose-emviui.css. Referenced by
 * posts/index.php (EN + ES) when the page renders an article body.
 *
 * Tailwind's @tailwindcss/typography plugin would give us the "prose" class,
 * but it's not loaded in the production site. We define a hand-tuned subset
 * that matches EmviUI's visual identity (Inter font, gray-800 text, generous
 * spacing, emvi-500 for accents).
 */
.prose-emviui {
    color: #1f2937;
    font-size: 1.0625rem;
    line-height: 1.75;
    max-width: 100%;
    word-wrap: break-word;
}

/* Headings */
.prose-emviui h1,
.prose-emviui h2,
.prose-emviui h3,
.prose-emviui h4,
.prose-emviui h5,
.prose-emviui h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.6em;
    scroll-margin-top: 80px;
}
.prose-emviui h1 { font-size: 2.25rem; margin-top: 0; }
.prose-emviui h2 {
    font-size: 1.75rem;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #e5e7eb;
}
.prose-emviui h3 { font-size: 1.4rem; }
.prose-emviui h4 { font-size: 1.15rem; }
.prose-emviui h5 { font-size: 1rem; }
.prose-emviui h6 { font-size: 0.9rem; color: #4b5563; }

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

/* Inline */
.prose-emviui a {
    color: #10b981; /* emvi-500 */
    text-decoration: underline;
    text-decoration-color: rgba(16, 185, 129, 0.3);
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.prose-emviui a:hover {
    color: #059669; /* emvi-600 */
    text-decoration-color: #059669;
}
.prose-emviui strong { color: #111827; font-weight: 700; }
.prose-emviui em { font-style: italic; }
.prose-emviui code {
    background: #f3f4f6;
    color: #be185d;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Courier New', monospace;
}
.prose-emviui pre {
    background: #0f172a !important; /* slate-900 */
    color: #f8fafc !important;
    padding: 1.25em !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 1.5em 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    border: 1px solid #1e293b !important;
}
.prose-emviui pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    font-size: inherit !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* Lists */
.prose-emviui ul,
.prose-emviui ol {
    margin: 0 0 1.25em 0;
    padding-left: 1.5em;
}
.prose-emviui li {
    margin-bottom: 0.4em;
}
.prose-emviui li > ul,
.prose-emviui li > ol {
    margin: 0.4em 0;
}
.prose-emviui ul { list-style-type: disc; }
.prose-emviui ul ul { list-style-type: circle; }
.prose-emviui ul ul ul { list-style-type: square; }
.prose-emviui ol { list-style-type: decimal; }

/* Blockquote */
.prose-emviui blockquote {
    margin: 1.5em 0;
    padding: 0.75em 1.25em;
    border-left: 4px solid #10b981;
    background: #f0fdf4;
    color: #374151;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}
.prose-emviui blockquote p:last-child { margin-bottom: 0; }

/* Images & figures */
.prose-emviui img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.prose-emviui figure { margin: 1.5em 0; }
.prose-emviui figcaption {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5em;
    font-style: italic;
}

/* Tables */
.prose-emviui .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    /* A subtle gradient on the right edge to hint that the table scrolls
     * horizontally on narrow viewports. */
    background: linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0));
}
.prose-emviui .table-wrap > table {
    width: 100%;
    min-width: max-content;  /* let the table expand beyond the container */
    border-collapse: collapse;
    margin: 0;  /* margin is on .table-wrap now */
    font-size: 0.95em;
    border: 0;  /* border is on .table-wrap now */
    border-radius: 0;
}
.prose-emviui thead {
    background: #f9fafb;
}
.prose-emviui th,
.prose-emviui td {
    padding: 0.65em 0.9em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;  /* keep cells on one line, scroll the table */
}
.prose-emviui th { font-weight: 700; color: #111827; }
.prose-emviui tbody tr:last-child td { border-bottom: none; }
.prose-emviui tbody tr:nth-child(even) { background: #fafafa; }
/* Allow text to wrap inside table cells if it's very long (e.g. URLs). */
.prose-emviui td code,
.prose-emviui td a {
    word-break: break-word;
}

/* HR */
.prose-emviui hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2.5em 0;
}

/* Mark / highlights */
.prose-emviui mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* First paragraph as lead */
.prose-emviui > p:first-of-type {
    font-size: 1.125rem;
    color: #374151;
}

/* Responsive */
@media (max-width: 640px) {
    .prose-emviui { font-size: 1rem; }
    .prose-emviui h1 { font-size: 1.75rem; }
    .prose-emviui h2 { font-size: 1.4rem; }
    .prose-emviui h3 { font-size: 1.2rem; }
    .prose-emviui pre { padding: 0.9em; }
    .prose-emviui .table-wrap > table { font-size: 0.85em; }
    /* On mobile, allow cells to wrap to fit narrow screens better. */
    .prose-emviui th,
    .prose-emviui td {
        white-space: normal;
        word-break: break-word;
    }
}

/* Table of Contents & Sidebar */
html {
    scroll-behavior: smooth;
}

#toc .list-blog {
    display: block;
    padding: 0.35rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}
#toc .list-blog:hover {
    color: #00a672;
    background-color: #f3f4f6;
    font-weight: 600;
}
#toc .list-blog.active {
    color: #00a672;
    font-weight: 700;
    background-color: #f0fdf4;
}
