/* ================================================
   POST.CSS — Estilos exclusivos para layout de post
   Depende de las variables definidas en styles.css
   ================================================ */


/* ── LAYOUT SIDEBAR + CONTENIDO ──────────────── */

/* =======================
   RESET BÁSICO
======================= */

.post-layout {
    display: flex;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 0;
    align-items: flex-start;
    border-top: 1px solid rgba(180, 180, 180, 0.18);
    padding-top: 2rem;
    margin-top: 0;
}


/* ── CONTENIDO PRINCIPAL ─────────────────────── */

.post-main {
    flex: 1;
    min-width: 0;
    padding-left: 2rem;
}

/* Recuadro del título */
.post-header-box {
    background: var(--bg-card);
    border: 2px solid rgb(102, 22, 139);
    border-radius: 12px;
    padding: 1.4rem 1.8rem;
    margin-bottom: 1.8rem;
}

.post-title-main {
    color: var(--neon-purple);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.3;
    text-shadow: 0 0 18px rgba(217, 94, 255, 0.35);
}

/* Fecha debajo del título */
.post-date {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--neon-blue);
    letter-spacing: 1px;
    opacity: 0.9;
}


/* ── CONTENIDO MARKDOWN ──────────────────────── */

.post-content {
    background: transparent;
    border: none;
    padding: 0 2rem 2rem 0;
    line-height: 1.9;
    letter-spacing: 0.01em;
}

/* H1 dentro del contenido */
.post-content h1 {
    color: var(--neon-purple);
    font-size: 1.5rem;
    margin: 2.5rem 0 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(217, 94, 255, 0.25);
    text-shadow: 0 0 12px rgba(217, 94, 255, 0.158);
}

/* H2 — verde neón */
.post-content h2 {
    color: var(--neon-green);
    font-size: 1.25rem;
    margin: 1.9rem 0 1.2rem;
    padding-left: 0.6rem;
    border-bottom: 2px solid rgba(0, 155, 96, 0.76);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.25);
}

/* H3 — azul cian */
.post-content h3 {
    color: var(--neon-blue);
    font-size: 1.08rem;
    margin: 2.2rem 0 1.2rem;
    padding-left: 0.8rem;
    border-bottom: 2px solid rgba(0, 145, 158, 0.637);
}

/* H4 — rosa/pink apagado */
.post-content h4 {
    color: var(--neon-yellow);
    font-size: 1rem;
    margin: 2.4rem 0 1.2rem;
    opacity: 0.85;
    letter-spacing: 0.5px;
}

/* Párrafos */
.post-content p {
    color: var(--text-main);
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

/* Listas */
.post-content ul,
.post-content ol {
    margin: 0.8rem 0 1rem 1.5rem;
    color: var(--text-main);
}

.post-content li {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.post-content ul li::marker {
    color: var(--neon-green);
}

.post-content ol li::marker {
    color: var(--neon-blue);
}

/* Código inline */
.post-content code {
    background: rgba(0, 255, 157, 0.07);
    color: var(--neon-green);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-size: 0.88em;
    border: 1px solid rgba(0, 255, 157, 0.2);
    font-family: HackNerdFont, monospace;
}

/* ── BLOQUE DE CÓDIGO: wrapper inyectado por JS ── */

.code-block-wrapper {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 234, 255, 0.15);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

/* Barra superior estilo terminal */
.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Círculos macOS */
.code-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.code-dots span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dots .dot-red    { background: #ff5f57; box-shadow: 0 0 4px rgba(255, 95, 87, 0.6); }
.code-dots .dot-yellow { background: #ffbd2e; box-shadow: 0 0 4px rgba(255, 189, 46, 0.6); }
.code-dots .dot-green  { background: #28c840; box-shadow: 0 0 4px rgba(40, 200, 64, 0.6); }

/* Botón copiar */
.code-copy-btn {
    background: transparent;
    border: 1px solid rgba(0, 234, 255, 0.3);
    color: var(--neon-blue);
    font-size: 0.72rem;
    padding: 0.2rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: HackNerdFont, monospace;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.code-copy-btn:hover {
    background: rgba(0, 234, 255, 0.1);
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 234, 255, 0.2);
}

.code-copy-btn.copied {
    color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.25);
}

/* Bloque de código en sí */
.post-content pre {
    background: #0a0a12;
    border: none;
    border-radius: 0;
    padding: 1.2rem 1.4rem;
    overflow-x: auto;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.7;
    box-shadow: none;
}

.post-content pre code {
    background: transparent;
    border: none;
    color: #a8d8b0;
    padding: 0;
    font-size: inherit;
    font-family: HackNerdFont, monospace;
}

/* Blockquote */
.post-content blockquote {
    margin: 1.2rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 3px solid var(--neon-red);
    background: rgba(255, 46, 99, 0.06);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Tablas */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 0.9rem;
}

.post-content th {
    background: rgba(102, 22, 139, 0.35);
    color: var(--neon-purple);
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(217, 94, 255, 0.3);
}

.post-content td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.post-content tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Línea horizontal */
.post-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Links */
.post-content a {
    color: var(--neon-blue);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 234, 255, 0.3);
    transition: color 0.2s, border-color 0.2s;
}

.post-content a:hover {
    color: var(--neon-green);
    border-bottom-color: var(--neon-green);
}

/* Imágenes */
.post-content img {
    max-width: 80%;
    border: 2px solid rgba(76, 0, 95, 0.884);
    margin: 1rem 0 2.2rem;
    display: block;
}


/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 768px) {
    .post-layout {
        flex-direction: column;
    }

    .post-sidebar {
        width: 100%;
        position: static;
        padding-right: 0;
        padding-bottom: 1.2rem;
    }

    .sidebar-inner {
        border-right: none;
        border-bottom: 1px solid rgba(180, 180, 180, 0.18);
        padding: 0 0 1rem 0;
    }

    .post-header {
        flex-wrap: wrap;
        gap: 0.8rem;
        padding: 1rem;
    }

    .header-center h1 {
        font-size: 1.5rem;
    }

    .header-sobre-mi {
        order: -1;
        align-self: flex-end;
    }
}
