/* ================================================
       ARTÍCULO BLOG - LAYOUT PRINCIPAL
       ================================================ */

.article-layout {
    display: flex;
    gap: 60px;
    align-items: start;
    flex-direction: row;
}

.article-main {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

/* ================================================
   ARTÍCULO PRINCIPAL
   ================================================ */

.post-article {
    background-color: var(--white);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--primary-color);
}

/* === HEADER DEL ARTÍCULO === */
.article-header {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.article-meta {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--text-color);
}

.article-meta time,
.article-meta .article-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-meta i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.article-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 600;
}

.article-excerpt {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 0;
}

.article-excerpt p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    font-style: italic;
}

/* === IMAGEN DESTACADA === */
.article-featured-image {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.article-featured-image:hover img {
    transform: scale(1.02);
}

/* === CONTENIDO DEL ARTÍCULO === */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 40px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);*/
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content blockquote {
    background-color: var(--light-gray);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.article-content ul,
.article-content ol {
    padding-left: 30px;
    margin-bottom: 20px;
}

.article-content li {
    margin-bottom: 8px;
}

/* === DOCUMENTO ADJUNTO === */
.article-download {
    margin: 30px 0;
    padding: 25px;
    background-color: rgba(0, 152, 227, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(0, 152, 227, 0.2);
}

.download-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.download-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-icon i {
    font-size: 1.5rem;
}

.download-info {
    flex: 1;
}

.download-info h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.download-info p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

.btn-download {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-download:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* === FOOTER DEL ARTÍCULO === */
.article-footer {
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article-tags i {
    color: var(--primary-color);
}

.article-tag {
    background-color: rgba(0, 152, 227, 0.1);
    color: var(--primary-color);
    padding: 6px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 152, 227, 0.2);
    transition: all 0.3s ease;
}

.article-tag:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.article-share {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.article-share span {
    font-weight: 600;
    color: var(--text-color);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--white);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn.facebook {
    background-color: #1877f2;
}

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

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

.share-btn.copy-link {
    background-color: var(--text-color);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ================================================
   NAVEGACIÓN ENTRE ARTÍCULOS
   ================================================ */

.article-navigation {
    background-color: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--primary-color);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    flex: 1;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 152, 227, 0.2);
}

.nav-link.prev {
    justify-content: flex-start;
}

.nav-link.next {
    justify-content: flex-end;
    text-align: right;
}

.nav-link span {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-link small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-link strong {
    font-size: 1rem;
    font-weight: 600;
}

.nav-link i {
    font-size: 1.2rem;
}

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

.related-posts {
    background-color: var(--white);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 60px;
}

.related-posts h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.related-posts h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 50px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.related-post-card {
    background-color: var(--light-gray);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.related-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 152, 227, 0.15);
    border-color: var(--primary-color);
}

.related-post-image {
    height: 160px;
    overflow: hidden;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.1);
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 2rem;
    height: 100%;
}

.related-post-content {
    padding: 20px;
}

.related-post-meta {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.related-post-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.related-post-content h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-content h3 a:hover {
    color: var(--secondary-color);
}

.related-post-content p {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 8px;
}

/* ================================================
   SIDEBAR
   ================================================ */

.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--primary-color);
}

.sidebar-widget h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

/* === POSTS RECIENTES === */
.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-post-item {
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-item h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    line-height: 1.4;
}

.recent-post-item h4 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-item h4 a:hover {
    color: var(--secondary-color);
}

.recent-post-item time {
    font-size: 0.85rem;
    color: #777;
    font-weight: 500;
}

/* === CTA WIDGET === */
.cta-widget {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
}

.cta-widget h3 {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.cta-widget p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 20px;
}

.cta-button {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* === SIDEBAR LINK === */
.sidebar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    background-color: rgba(0, 152, 227, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 152, 227, 0.2);
}

.sidebar-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

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

@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .article-title {
        font-size: 2rem;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nav-links {
        flex-direction: column;
    }

    .nav-link.next {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .post-article {
        padding: 30px 20px;
    }

    .related-posts {
        padding: 30px 20px;
    }

    .article-navigation {
        padding: 25px 20px;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .article-meta {
        gap: 15px;
        font-size: 0.9rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .download-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .article-footer {
        gap: 15px;
    }

    .article-tags {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .article-share {
        justify-content: center;
    }

    .nav-link {
        padding: 15px;
        text-align: center;
    }

    .nav-link span {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .article-layout {
        gap: 30px;
    }

    .post-article,
    .related-posts,
    .article-navigation {
        padding: 20px 15px;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 8px;
    }

    .sidebar-widget {
        padding: 20px 15px;
    }

    .share-btn {
        width: 35px;
        height: 35px;
    }

    .article-tags {
        gap: 6px;
    }

    .article-tag {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .nav-link {
        gap: 10px;
    }

    .nav-link i {
        font-size: 1rem;
    }

    .related-post-image {
        height: 140px;
    }

    .related-post-content {
        padding: 15px;
    }
}

/* ================================================
   ANIMACIONES Y MEJORAS
   ================================================ */

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-article {
    animation: fadeInUp 0.6s ease-out;
}

.article-navigation {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.related-posts {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.sidebar-widget:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.sidebar-widget:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.sidebar-widget:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

/* Efectos hover mejorados */
.related-post-card,
.sidebar-widget,
.post-article {
    will-change: transform;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus states para accesibilidad */
.share-btn:focus,
.btn-download:focus,
.cta-button:focus,
.sidebar-link:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .article-sidebar,
    .article-navigation,
    .related-posts,
    .article-share {
        display: none !important;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .post-article {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .article-content {
        font-size: 12pt;
        line-height: 1.6;
    }

    .article-title {
        font-size: 20pt;
        color: #000;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .notification {
        box-shadow: 0 4px 12px rgba(255,255,255,0.1);
    }
}

/* Estados de carga para imágenes lazy */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Mejoras de performance */
.related-post-image img,
.article-featured-image img {
    will-change: transform;
}

/* Scrollbar personalizada para webkit */
.article-content::-webkit-scrollbar {
    width: 6px;
}

.article-content::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.article-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.article-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}