/* ==========================================================================
   POST - Página individual de post
   ========================================================================== */

/* =============================================
   CONTENEDOR DEL POST
   ============================================= */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

/* =============================================
   ENCABEZADO DEL POST
   ============================================= */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.post-title {
    font-size: var(--step-3);
    margin: 0 0 1rem 0;
    color: var(--fg);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--font-body);
    font-size: var(--step--1);
    color: var(--muted);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =============================================
   IMAGEN DESTACADA
   ============================================= */
.post-featured-image {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-featured-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* =============================================
   CONTENIDO DEL POST
   ============================================= */
.post-content {
    font-size: var(--step-0);
    line-height: 1.8;
    color: var(--fg);
}

.post-content > * + * {
    margin-top: 1.5rem;
}

.post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--fg);
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

.post-content a {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s ease;
}

.post-content a:hover {
    text-decoration-color: currentColor;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--brand);
    color: var(--muted);
    font-style: italic;
}

.post-content code {
    background: var(--card-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* =============================================
   PIE DEL POST (categorías, tags)
   ============================================= */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-categories,
.post-tags {
    margin-bottom: 1rem;
}

.post-categories-title,
.post-tags-title {
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.post-categories-list,
.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-badge,
.tag-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--card-bg);
    color: var(--fg);
    text-decoration: none;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: var(--step--1);
    transition: all 0.2s ease;
}

.category-badge:hover,
.tag-badge:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* =============================================
   NAVEGACIÓN ENTRE POSTS (prev/next)
   ============================================= */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    clear: both;
}

.post-nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-nav-link {
    display: block;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
}

.post-nav-link:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    transform: translateY(-2px);
}

.post-nav-link-label {
    font-size: var(--step--1);
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.post-nav-link:hover .post-nav-link-label {
    color: rgba(255, 255, 255, 0.8);
}

.post-nav-link-title {
    font-weight: 600;
    color: var(--fg);
}

.post-nav-link:hover .post-nav-link-title {
    color: white;
}

/* Alineación prev/next */
.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .post-header {
        margin-bottom: 1.5rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .post-content {
        font-size: var(--step--1);
    }

    .post-nav-links {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }
}

/* =============================================
   VÍDEOS EMBEBIDOS RESPONSIVE
   ============================================= */
.post-content iframe,
.contenido iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: var(--radius, 8px);
    margin: 1.5rem 0;
    display: block;
}

/* =============================================
   IMÁGENES CON ENLACES - EFECTO HOVER
   ============================================= */
.post-content a img,
.contenido a img {
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    cursor: pointer;
}

.post-content a:hover img,
.contenido a:hover img {
    opacity: 0.85;
    transform: scale(1.02);
}

/* Asegurar que las imágenes enlazadas mantengan sus estilos */
.post-content a:has(img),
.contenido a:has(img) {
    display: inline-block;
    border: none;
    text-decoration: none;
}

/* =============================================
   CONTENIDO - ESTILOS ADICIONALES PARA COMPATIBILIDAD
   ============================================= */

/* Listas - Asegurar estilos consistentes */
.contenido ul,
.post-content ul {
    list-style: disc;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.contenido ol,
.post-content ol {
    list-style: decimal;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.contenido li,
.post-content li {
    margin-bottom: 0.5rem;
}

/* Enlaces - Asegurar color y hover */
.contenido a {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.2s ease;
}

.contenido a:hover {
    text-decoration-color: currentColor;
    opacity: 0.9;
}

/* Imágenes - Todas responsive y centradas */
.contenido img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: var(--radius, 8px);
}

/* Párrafos */
.contenido p {
    margin-bottom: 1rem;
}

/* Títulos adicionales */
.contenido h2 {
    font-size: var(--step-2, 1.8rem);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--fg);
}

.contenido h3 {
    font-size: var(--step-1, 1.5rem);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--fg);
}

.contenido h4 {
    font-size: var(--step-0, 1.2rem);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--fg);
}

/* Negrita y cursiva */
.contenido strong {
    font-weight: 700;
}

.contenido em {
    font-style: italic;
}

/* Blockquotes */
.contenido blockquote {
    border-left: 4px solid var(--brand);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--muted);
}

/* Code */
.contenido code {
    background: var(--card-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: monospace;
}

.contenido pre {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2rem 0;
}

.contenido pre code {
    background: none;
    padding: 0;
}

/* Centrado manual (para cuando uses el botón de centrar en TinyMCE) */
.contenido [style*='text-align: center'],
.contenido [style*='text-align:center'] {
    text-align: center;
}

/* Separadores visuales */
.contenido hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
}

/* Tablas */
.contenido table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.contenido table th,
.contenido table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.contenido table th {
    background: var(--card-bg);
    font-weight: 700;
}

/* Figuras con caption (TinyMCE) */
.contenido figure {
    margin: 1.5rem 0;
}

.contenido figcaption {
    text-align: center;
    font-size: var(--step--1, 0.9rem);
    color: var(--muted);
    margin-top: 0.5rem;
    font-style: italic;
}
