/**
 * Estilos del Blog Publico - Fordema
 * Listado de posts y vista individual
 */

/* ===== LISTADO DE POSTS ===== */

.blog-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.blog-header {
    padding: 30px 0;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(to right, #3b6fa0, #a8c528, #ecb94a) 1;
    margin-bottom: 30px;
}

.blog-header h1 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 2em;
    font-weight: 300;
    color: #3b6fa0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.blog-listado {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.no-posts {
    text-align: center;
    color: #666;
    padding: 60px 20px;
    font-style: italic;
}

/* Card de post */
.blog-card {
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.blog-card .card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.blog-card:hover {
    box-shadow: 0 5px 20px rgba(59,111,160,0.1);
}

.card-imagen {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
    overflow: hidden;
}

.card-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-imagen img.placeholder {
    object-fit: contain;
    padding: 30px;
    background: #f5f5f5;
}

.blog-card:hover .card-imagen img {
    transform: scale(1.05);
}

.card-contenido {
    flex: 1;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-autor {
    display: flex;
    align-items: center;
    gap: 10px;
}

.autor-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: contain;
    background: #f5f5f5;
    padding: 3px;
}

.autor-info {
    display: flex;
    flex-direction: column;
}

.autor-nombre {
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
}

.autor-fecha {
    font-size: 0.8em;
    color: #999;
}

.card-titulo {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-extracto {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
    flex: 1;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
}

.stat {
    font-size: 0.85em;
    color: #999;
}

.stat-numero {
    color: #666;
}

/* ===== VISTA INDIVIDUAL DEL POST ===== */

.post-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.post-article {
    background: #fff;
}

.post-header {
    margin-bottom: 30px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.post-meta .autor-avatar {
    width: 45px;
    height: 45px;
}

.post-titulo {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 2.2em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 15px;
}

.post-imagen {
    margin-bottom: 30px;
}

.post-imagen img {
    width: 100%;
    height: auto;
}

.post-contenido {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.post-contenido p {
    margin-bottom: 1.5em;
}

.post-contenido h2 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.5em;
    font-weight: 600;
    margin: 2em 0 1em;
    color: #3b6fa0;
}

.post-contenido h3 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.3em;
    font-weight: 600;
    margin: 1.5em 0 0.8em;
}

.post-contenido ul,
.post-contenido ol {
    margin-bottom: 1.5em;
    padding-left: 30px;
}

.post-contenido li {
    margin-bottom: 0.5em;
}

.post-contenido img {
    max-width: 100%;
    height: auto;
    margin: 1.5em 0;
}

.post-contenido a {
    color: #3b6fa0;
    text-decoration: none;
}

.post-contenido a:hover {
    text-decoration: underline;
}

.post-contenido blockquote {
    border-left: 4px solid #a8c528;
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: #666;
}

/* Footer del post (stats y like) */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-top: 30px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.post-stats {
    display: flex;
    gap: 25px;
}

.post-stats .stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: #666;
}

.btn-like-grande {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 2px solid #eee;
    border-radius: 30px;
    padding: 12px 25px;
    cursor: pointer;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1em;
    color: #666;
    transition: all 0.3s ease;
}

.btn-like-grande:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-like-grande.liked {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef5f5;
}

.btn-like-grande .heart-icon {
    transition: all 0.3s ease;
}

/* ===== SECCION DE COMENTARIOS ===== */

.comentarios-section {
    margin-top: 50px;
    padding-top: 30px;
}

.comentarios-section h2 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #a8c528;
}

.comentario-form {
    background: #f9f9f9;
    padding: 25px;
    margin-bottom: 40px;
    border-radius: 5px;
}

.comentario-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.comentario-form .form-group {
    flex: 1;
}

.comentario-form input,
.comentario-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.comentario-form input:focus,
.comentario-form textarea:focus {
    outline: none;
    border-color: #3b6fa0;
}

.comentario-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-comentar {
    background: #ecb94a;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.btn-comentar:hover {
    background: #d4a53e;
}

.no-comentarios {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

.comentarios-lista {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.comentario {
    display: flex;
    gap: 15px;
}

.comentario-avatar {
    width: 45px;
    height: 45px;
    background: #3b6fa0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.comentario-contenido {
    flex: 1;
}

.comentario-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.comentario-nombre {
    color: #333;
}

.comentario-fecha {
    color: #999;
    font-size: 0.85em;
}

.comentario-texto {
    color: #555;
    line-height: 1.6;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 3px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Volver al blog */
.volver-blog {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.btn-volver:hover {
    color: #3b6fa0;
}

/* ===== BUSQUEDA ===== */

.blog-busqueda {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    max-width: 500px;
}

.blog-busqueda input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 0.95em;
}

.blog-busqueda input:focus {
    outline: none;
    border-color: #3b6fa0;
}

.blog-busqueda button {
    padding: 10px 20px;
    background: #3b6fa0;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Raleway', Arial, sans-serif;
    font-weight: 600;
    transition: background 0.3s;
}

.blog-busqueda button:hover {
    background: #2d5a84;
}

.search-count {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

/* ===== CATEGORIAS ===== */

.blog-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.blog-categorias .btn.btn-small {
    padding: 6px 16px;
    font-size: 0.85em;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}

.blog-categorias .btn.btn-small:hover,
.blog-categorias .btn.btn-small.active {
    background: #3b6fa0;
    color: #fff;
    border-color: #3b6fa0;
}

.card-categoria {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #3b6fa0;
    color: #fff;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
}

.card-imagen {
    position: relative;
}

/* ===== PAGINACION ===== */

.blog-paginacion {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.blog-paginacion .btn.btn-small {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s;
}

.blog-paginacion .btn.btn-small:hover,
.blog-paginacion .btn.btn-small.active {
    background: #3b6fa0;
    color: #fff;
    border-color: #3b6fa0;
}

/* ===== COMPARTIR ===== */

.compartir-section {
    margin-top: 30px;
    padding: 20px 0;
}

.compartir-section h3 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
}

.compartir-botones {
    display: flex;
    gap: 10px;
}

.btn-compartir {
    padding: 8px 20px;
    border-radius: 3px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn-compartir:hover {
    opacity: 0.85;
}

.btn-twitter {
    background: #1da1f2;
}

.btn-linkedin {
    background: #0077b5;
}

.btn-facebook {
    background: #4267b2;
}

/* ===== POSTS RELACIONADOS ===== */

.relacionados-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.relacionados-section h2 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
}

.relacionados-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.relacionado-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
}

.relacionado-card:hover {
    transform: translateY(-3px);
}

.relacionado-imagen {
    height: 150px;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 10px;
}

.relacionado-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.relacionado-info h3 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.relacionado-fecha {
    font-size: 0.8em;
    color: #999;
}

/* ===== ALERTAS ===== */

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px 20px;
    border-radius: 3px;
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */

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

    .card-imagen {
        width: 100%;
        height: 200px;
    }

    .card-contenido {
        padding: 20px;
    }

    .post-titulo {
        font-size: 1.6em;
    }

    .comentario-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .post-footer {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .relacionados-grid {
        grid-template-columns: 1fr;
    }

    .compartir-botones {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .card-stats {
        flex-wrap: wrap;
    }
}
