.post-container {
    max-width: 900px;
    margin: 0 auto;
    padding-left: var(--bs-gutter-x, 1.5rem);
    padding-right: var(--bs-gutter-x, 1.5rem);
}

.post-header {
    background: var(--color-purple);
    color: var(--color-white);
    padding: 3rem var(--bs-gutter-x, 1.5rem);
    margin-bottom: 2rem;
    border-radius: var(--bs-border-radius-xl);
    box-shadow: var(--bs-box-shadow-sm);
}

.post-header .badge {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

.post-meta,
.post-content,
.comments-section,
.related-posts {
    color: var(--bs-body-color);
    padding: 1rem;
    box-shadow: var(--bs-box-shadow-sm);
}

.author-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 3px solid var(--bs-primary);
}

.post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1rem 0;
    color: var(--bs-secondary-color);
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.stat-item i {
    margin-right: 0.5rem;
    font-size: 1.1em;
    color: var(--bs-primary);
}

.post-content {
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bs-border-radius-lg);
    margin: 1rem 0;
}

.post-content h2, .post-content h3, .post-content h4 {
    color: var(--bs-heading-color);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.post-content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--bs-secondary-color);
    background-color: var(--bs-light-bg-subtle);
    border-radius: var(--bs-border-radius-sm);
    padding: 1rem;
}

.interaction-buttons {
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid var(--bs-border-color-translucent);
}

.btn-interaction {
    margin: 0 0.5rem 0.5rem 0;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.comments-section h3 {
    color: var(--bs-heading-color);
}

.comment-form {
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--bs-border-color-translucent);
}

.comment-item {
    border-bottom: 1px solid var(--bs-border-color-translucent);
    padding: 1.5rem 0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
}

.comment-content {
    margin-bottom: 1rem;
    line-height: 1.6;
    word-wrap: break-word; /* Ensure long words wrap */
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

.comment-actions button:hover {
    color: var(--bs-primary);
}

.comment-replies {
    margin-left: 3rem;
    margin-top: 1rem;
    border-left: 2px solid var(--bs-border-color-translucent);
    padding-left: 1rem;
}

.related-posts h3 {
    color: var(--bs-heading-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.related-post-item {
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bs-body-bg);
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--bs-box-shadow);
}

.related-post-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.related-post-item .card-body {
    padding: 1rem;
}

@media (max-width: 992px) {
    .post-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .post-header {
        padding: 2rem 1rem;
        text-align: center;
        border-radius: var(--bs-border-radius-lg);
    }

    .interaction-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }

    .comment-replies {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .post-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .comment-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   BLOG INDEX - DISEÑO PROFESIONAL SIN BORDES REDONDOS
   ========================================================================== */

/* CSS Custom Properties para mejor mantenibilidad */
:root {
    --blog-transition-fast: 0.15s ease;
    --blog-transition-normal: 0.2s ease;
    --blog-transition-slow: 0.3s ease;
    --blog-shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --blog-shadow-md: 0 2px 8px rgba(0,0,0,0.15);
    --blog-shadow-lg: 0 4px 16px rgba(0,0,0,0.2);
    --blog-grid-gap: 2rem;
    --blog-mobile-gap: 1.5rem;
}

/* FORZAR SIN BORDES REDONDOS EN TODO EL BLOG */
.blog-section,
.blog-section *,
.blog-section *::before,
.blog-section *::after,
.blog-section .btn,
.blog-section .badge,
.blog-section .card,
.blog-section .form-control,
.blog-section .alert,
.blog-section img,
.blog-section .offcanvas {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

/* Forzar también en pseudo-elementos de Bootstrap */
.blog-section .btn::before,
.blog-section .btn::after,
.blog-section .badge::before,
.blog-section .badge::after {
    border-radius: 0 !important;
}

.blog-section {
    min-height: 100vh;
    padding: 0;
}

/* Header del blog - PROFESIONAL */
.blog-header {
    padding: 4rem 0;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.blog-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Layout principal */
.blog-main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* Sidebar FIJO - SIEMPRE VISIBLE en desktop */
.blog-sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.category-item:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
    text-decoration: none;
    border-color: var(--border-color);
}

.category-item.active {
    background: var(--primary-color);
    color: var(--bg-secondary);
    border-color: var(--primary-color);
}

.category-count {
    background: var(--bg-tags);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 0 !important;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.2);
    color: var(--bg-secondary);
}

/* Contenido principal */
.blog-content {
    flex: 1;
    padding: 1rem;
}

/* Grid de posts - PROFESIONAL con mejor responsive */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--blog-grid-gap);
    margin-bottom: 3rem;
    /* Asegurar que el grid sea accesible */
    container-type: inline-size;
}

/* CARDS MINIMALISTAS Y PROFESIONALES */
.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: border-color var(--blog-transition-normal), transform var(--blog-transition-normal), box-shadow var(--blog-transition-normal);
    overflow: hidden;
    will-change: transform, border-color, box-shadow;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--blog-shadow-md);
}

/* Imagen principal */
.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: var(--bg-primary);
    display: block;
}

/* Contenido de la card */
.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Contenedor de la descripción con altura mínima */
.post-excerpt-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    margin-bottom: 1rem;
}

/* Categoría */
.post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* Título */
.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary-color);
}

/* Descripción */
.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    word-wrap: break-word;
    hyphens: auto;
}

/* Autor, fecha y botón - Layout mejorado */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-author-date {
    display: flex;
    align-items: center;
    flex: 1;
}

.read-more-btn {
    flex-shrink: 0;
    margin-left: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
}

/* Separador entre autor y fecha */
.author-date-separator {
    color: var(--text-muted);
    font-weight: bold;
    margin: 0 0.5rem;
    font-size: 0.8rem;
}

.post-author img {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    border: 1px solid var(--border-color);
}

.post-date {
    font-size: 0.8rem;
}

/* Botón móvil para offcanvas */
.mobile-categories-toggle {
    position: fixed;
    bottom: 1rem;
    left: 2rem;
    background: var(--primary-color);
    color: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 0 !important;
    z-index: 1050;
    display: none;
    font-size: 1.4rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.mobile-categories-toggle:hover {
    background: var(--primary-hover);
}

/* Responsive con mejor accesibilidad */
@media (max-width: 1199px) {
    .blog-sidebar {
        display: none;
    }

    .blog-main-layout {
        display: block;
    }

    .blog-content {
        padding: 2rem 1rem;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--blog-mobile-gap);
    }

    .mobile-categories-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--blog-mobile-gap);
    }

    .blog-header {
        padding: 3rem 1rem;
    }

    .blog-header h1 {
        font-size: 2.5rem;
    }

    .blog-content {
        padding: 1.5rem 1rem;
    }

    /* Mejor accesibilidad en móvil */
    .post-card {
        margin-bottom: 1rem;
    }

    .post-card:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* Ajustes para separador en móvil */
    .author-date-separator {
        margin: 0 0.3rem;
    }

    .post-author-date {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .post-excerpt-container {
        min-height: 100px;
    }
}

@media (max-width: 576px) {
    .blog-header h1 {
        font-size: 2rem;
    }

    .posts-grid {
        gap: 1rem;
    }

    .mobile-categories-toggle {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Mejor legibilidad en pantallas pequeñas */
    .post-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .post-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .post-excerpt-container {
        min-height: 80px;
    }

    .author-date-separator {
        margin: 0 0.25rem;
    }
}

/* Soporte para navegación por teclado */
.post-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}

.category-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Soporte para modo de alto contraste */
@media (prefers-contrast: high) {
    .post-card {
        border: 2px solid;
    }

    .category-item {
        border: 2px solid;
    }
}

/* Soporte para reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    .post-card,
    .category-item,
    .related-post-item {
        transition: none;
    }

    .post-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   ESTADOS DE CARGA Y MICROINTERACCIONES
   ========================================================================== */

/* Estados de carga */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Skeleton para cards de posts */
.post-card-skeleton {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0;
}

.post-card-skeleton .skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 1rem;
    border-radius: 0;
}

.post-card-skeleton .skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0;
}

.post-card-skeleton .skeleton-text:last-child {
    width: 60%;
}

.post-card-skeleton .skeleton-image {
    height: 200px;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 0;
}

/* Estados de carga para botones */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* Microinteracciones */
.interaction-feedback {
    position: relative;
    overflow: hidden;
}

.interaction-feedback::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.3s ease, height 0.3s ease;
    transform: translate(-50%, -50%);
}

.interaction-feedback:active::before {
    width: 300px;
    height: 300px;
}

/* Animación de entrada para cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card-animated {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Estagger animation para múltiples cards */
.post-card-animated:nth-child(1) { animation-delay: 0.1s; }
.post-card-animated:nth-child(2) { animation-delay: 0.2s; }
.post-card-animated:nth-child(3) { animation-delay: 0.3s; }
.post-card-animated:nth-child(4) { animation-delay: 0.4s; }
.post-card-animated:nth-child(5) { animation-delay: 0.5s; }
.post-card-animated:nth-child(6) { animation-delay: 0.6s; }

/* Estados hover mejorados */
.post-card {
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.post-card:hover::before {
    left: 100%;
}

/* Indicador de carga para paginación */
.pagination-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 0;
    box-shadow: var(--blog-shadow-lg);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    border-left: 4px solid #28a745;
}

.toast-notification.error {
    border-left: 4px solid #dc3545;
}

.toast-notification.info {
    border-left: 4px solid #17a2b8;
}

/* Offcanvas del blog respetando temas */
.blog-offcanvas {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.blog-offcanvas .offcanvas-header {
    background: var(--primary-color);
    color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.blog-offcanvas .offcanvas-title {
    color: var(--bg-secondary);
    font-weight: 600;
}

.blog-offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.blog-offcanvas .offcanvas-body {
    padding: 1.5rem;
}

/* Tema dark específico para offcanvas */
[data-bs-theme="dark"] .blog-offcanvas .btn-close {
    filter: invert(0) grayscale(0%) brightness(100%);
}