/* ============================================================
   MatthyGD — Temario Theme
   Re-temaza los HTML exportados por StackEdit sin tocar contenido.
   ============================================================ */

:root {
    --bg:              #0a0d12;
    --bg-elevated:     #10141c;
    --bg-overlay:      #0c1018;
    --border:          rgba(255,255,255,0.06);
    --border-strong:   rgba(255,255,255,0.10);
    --border-accent:   rgba(34,214,138,0.40);
    --text:            #e6e8ec;
    --text-muted:      #8b94a3;
    --text-dim:        #4a5263;
    --accent:          #22d68a;
    --accent-dim:      rgba(34,214,138,0.12);
    --danger:          #ef4444;
    --warning:         #fbbf24;
    --f-display: 'Syne', system-ui, sans-serif;
    --f-sans:    'Inter', 'DM Sans', system-ui, sans-serif;
    --f-mono:    'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body, body.stackedit {
    margin: 0; padding: 0;
    background: var(--bg) !important;
    color: var(--text);
    font-family: var(--f-sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Header sticky inyectado ── */
.mgd-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(10,13,18,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.mgd-header .mgd-brand {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--f-display); font-weight: 800; font-size: 0.95rem;
    color: var(--text); text-decoration: none;
}
.mgd-header .mgd-brand::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}
.mgd-header .mgd-path {
    font-family: var(--f-mono); font-size: 0.78rem; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1;
}
.mgd-header .mgd-path b { color: var(--accent); font-weight: 500; }
.mgd-header .mgd-actions { display: flex; gap: 8px; }
.mgd-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    font-family: var(--f-mono); font-size: 0.74rem;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    color: var(--text);
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mgd-btn:hover { border-color: var(--border-accent); color: var(--accent); background: var(--accent-dim); }
.mgd-btn.danger:hover { border-color: rgba(239,68,68,0.5); color: var(--danger); background: rgba(239,68,68,0.08); }
.mgd-btn svg { width: 12px; height: 12px; }
@media (max-width: 640px) {
    .mgd-header { padding: 12px 14px; }
    .mgd-header .mgd-path { display: none; }
}

/* ── StackEdit layout overrides ── */
.stackedit__left {
    background: var(--bg-elevated) !important;
    border-right: 1px solid var(--border) !important;
    width: 280px !important;
}
.stackedit__toc {
    padding: 24px 20px !important;
    color: var(--text);
}
.stackedit__toc ul {
    list-style: none !important;
    padding-left: 12px !important;
    margin: 4px 0 8px 0 !important;
    border-left: 1px solid var(--border);
}
.stackedit__toc > ul {
    padding-left: 0 !important;
    border: none;
}
.stackedit__toc li { margin: 0 !important; }
.stackedit__toc a {
    display: block;
    padding: 4px 10px !important;
    font-family: var(--f-mono) !important;
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    border-radius: 4px;
    text-decoration: none !important;
    transition: color 0.15s ease, background 0.15s ease;
    border-bottom: none !important;
}
.stackedit__toc a:hover { color: var(--accent) !important; background: var(--accent-dim) !important; }

.stackedit__right {
    background: var(--bg) !important;
}
.stackedit__html {
    max-width: 880px !important;
    margin: 0 auto !important;
    padding: 48px 32px 80px !important;
    color: var(--text) !important;
    font-family: var(--f-sans) !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
}

/* Tipografía dentro del contenido */
.stackedit__html h1,
.stackedit__html h2,
.stackedit__html h3,
.stackedit__html h4,
.stackedit__html h5,
.stackedit__html h6 {
    font-family: var(--f-display) !important;
    color: var(--text) !important;
    letter-spacing: -0.01em;
    line-height: 1.2 !important;
    margin: 2em 0 0.6em !important;
    border-bottom: none !important;
    padding: 0 !important;
}
.stackedit__html h1 {
    font-size: 2.2rem !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid var(--border) !important;
}
.stackedit__html h2 {
    font-size: 1.6rem !important;
    color: var(--accent) !important;
}
.stackedit__html h3 { font-size: 1.2rem !important; }
.stackedit__html h4 { font-size: 1.05rem !important; }

.stackedit__html p, .stackedit__html li { color: var(--text) !important; }
.stackedit__html a { color: var(--accent) !important; text-decoration: underline; text-decoration-color: rgba(34,214,138,0.3); text-underline-offset: 3px; transition: text-decoration-color 0.2s ease; }
.stackedit__html a:hover { text-decoration-color: var(--accent); }

.stackedit__html hr {
    border: 0 !important;
    border-top: 1px solid var(--border) !important;
    margin: 2.5em 0 !important;
}

.stackedit__html ul, .stackedit__html ol {
    padding-left: 1.5em !important;
    margin: 0.6em 0 1.2em !important;
}
.stackedit__html li { margin-bottom: 0.3em; }
.stackedit__html ul li::marker { color: var(--accent); }
.stackedit__html ol li::marker { color: var(--accent); font-family: var(--f-mono); font-size: 0.9em; }

/* Blockquote — destacado en lateral verde */
.stackedit__html blockquote {
    margin: 1.4em 0 !important;
    padding: 16px 20px !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: 0 8px 8px 0 !important;
    color: var(--text) !important;
}
.stackedit__html blockquote p { margin: 0 !important; color: var(--text-muted) !important; }

/* Inline code */
.stackedit__html code {
    font-family: var(--f-mono) !important;
    font-size: 0.88em !important;
    padding: 2px 6px !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    color: var(--accent) !important;
}

/* Code blocks */
.stackedit__html pre {
    background: var(--bg-overlay) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 18px 20px !important;
    overflow-x: auto;
    margin: 1.2em 0 !important;
    position: relative;
}
.stackedit__html pre code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--text) !important;
    font-size: 0.86em !important;
    line-height: 1.55;
}

/* Tables */
.stackedit__html table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.92rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.stackedit__html th {
    background: var(--bg-overlay) !important;
    color: var(--accent) !important;
    font-family: var(--f-mono) !important;
    font-size: 0.78rem !important;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 12px 16px !important;
    text-align: left;
    border-bottom: 1px solid var(--border) !important;
}
.stackedit__html td {
    padding: 10px 16px !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.stackedit__html tr:last-child td { border-bottom: none !important; }

/* Imágenes */
.stackedit__html img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 1em 0;
}

/* Scrollbar (sutil) */
.stackedit__left::-webkit-scrollbar,
.stackedit__right::-webkit-scrollbar,
.stackedit__html pre::-webkit-scrollbar { width: 8px; height: 8px; }
.stackedit__left::-webkit-scrollbar-thumb,
.stackedit__right::-webkit-scrollbar-thumb,
.stackedit__html pre::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
.stackedit__left::-webkit-scrollbar-thumb:hover,
.stackedit__right::-webkit-scrollbar-thumb:hover {
    background: var(--border-accent);
}

@media (max-width: 880px) {
    .stackedit__left { display: none !important; }
    .stackedit__html { padding: 24px 18px 60px !important; }
}
