﻿/* ============================================================
   blog-detail.css  —  Vista de detalle de artículo
   ============================================================ */

/* ── Wrapper centrado ─────────────────────────────────────── */
.blog-detail-wrap {
    animation: detailFadeIn .4s ease both;
}

@keyframes detailFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Hero ─────────────────────────────────────────────────── */
.blog-detail-hero {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f3f5;
    line-height: 0;
}

.blog-detail-hero-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

/* ── Tags ─────────────────────────────────────────────────── */
.blog-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* ── Título ───────────────────────────────────────────────── */
.blog-detail-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111827;
}

/* ── Meta descripción ─────────────────────────────────────── */
.blog-detail-description {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #6b7280;
}

.blog-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.byline-info {
    display: flex;
    flex-direction: column;
    font-size: .875rem;
}

.byline-author {
    font-weight: 600;
    color: #374151;
}

.byline-meta {
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ── Divider ──────────────────────────────────────────────── */
.blog-detail-divider {
    border: none;
    border-top: 1px solid #f1f3f5;
    margin: 1.5rem 0;
}

/* ── Cuerpo del artículo ──────────────────────────────────── */
.blog-detail-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}

    .blog-detail-body h2 {
        font-size: 1.4rem;
        font-weight: 700;
        margin: 2rem 0 .75rem;
        color: #111827;
    }

    .blog-detail-body h3 {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 1.5rem 0 .5rem;
        color: #111827;
    }

    .blog-detail-body p {
        margin-bottom: 1.25rem;
    }

    .blog-detail-body a {
        color: #2563eb;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .blog-detail-body ul,
    .blog-detail-body ol {
        padding-left: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .blog-detail-body li {
        margin-bottom: .4rem;
    }

    .blog-detail-body blockquote {
        border-left: 4px solid #bae6fd;
        padding: .75rem 1.25rem;
        margin: 1.5rem 0;
        color: #6b7280;
        font-style: italic;
        background: #f8fafc;
        border-radius: 0 8px 8px 0;
    }

    .blog-detail-body img {
        max-width: 100%;
        border-radius: 12px;
        margin: 1.5rem 0;
        display: block;
    }

    .blog-detail-body pre {
        background: #1e293b;
        color: #e2e8f0;
        padding: 1.25rem;
        border-radius: 10px;
        overflow-x: auto;
        font-size: .875rem;
        line-height: 1.65;
        margin-bottom: 1.5rem;
    }

    .blog-detail-body code {
        font-size: .875em;
        background: #f1f5f9;
        color: #e11d48;
        padding: .15em .4em;
        border-radius: 4px;
    }

    .blog-detail-body pre code {
        background: transparent;
        color: inherit;
        padding: 0;
    }

/* ── Author card ──────────────────────────────────────────── */
.author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.author-card-name {
    font-weight: 700;
    font-size: .95rem;
    color: #111827;
}

/* ── Galería ──────────────────────────────────────────────── */
.blog-detail-gallery {
    border-top: 1px solid #f1f3f5;
    padding-top: 2rem;
}

/* ── Related Posts ────────────────────────────────────────── */

.related-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .related-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
        color: inherit;
        text-decoration: none;
    }

.related-card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: #f1f3f5;
    flex-shrink: 0;
}

.related-card-img-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .related-card-img-placeholder i {
        font-size: 2rem;
        color: #bae6fd;
    }

.related-card-body {
    padding: .875rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: .4rem;
}

.related-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.related-card-title {
    font-size: .925rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.related-card-excerpt {
    font-size: .8rem;
    color: #6b7280;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}

.related-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .6rem;
    margin-top: auto;
    border-top: 1px solid #f3f4f6;
}

.related-card-author {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.related-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .65rem;
    flex-shrink: 0;
}

.related-author-name {
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card-date {
    font-size: .75rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: .5rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 576px) {
    .blog-detail-title {
        font-size: 1.5rem;
    }

    .blog-detail-hero-img {
        height: 220px;
    }

    .blog-detail-wrap {
        margin-top: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .related-card-img,
    .related-card-img-placeholder {
        height: 180px;
    }
}

@media (min-width: 577px) and (max-width: 900px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
