/* Related Posts Block Styles with Swiper */
.related-posts-block {
    margin: 40px 0;
    padding: 0;
    position: relative;
}

/* Header Styles */
.related-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}

.related-posts-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

/* Navigation Buttons */
.related-posts-navigation {
    display: flex;
    gap: 12px;
    align-items: center;
}

.related-posts-nav-btn,
.swiper-button-prev,
.swiper-button-next {
    width: 48px !important;
    height: 48px !important;
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 50% !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.related-posts-nav-btn:hover,
.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.swiper-button-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.swiper-button-disabled:hover {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Override default Swiper button styles */
.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 16px !important;
    font-weight: bold !important;
}

/* Swiper Container */
.related-posts-swiper {
    overflow: hidden;
    padding: 0 4px;
    margin: 0 -4px;
}

.swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    height: auto;
    display: flex;
}

/* Post Item Styles */
.related-post-item {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #e2e8f0;
}

/* Image Styles */
.related-post-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: #f8fafc;
}

.related-post-image-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.related-post-item:hover .related-post-image {
    transform: scale(1.05);
}

/* Content Styles */
.related-post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Meta Information */
.related-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #64748b;
    flex-wrap: wrap;
}

.related-post-date {
    font-weight: 500;
}

.related-post-read-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.related-post-read-time svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Title Styles */
.related-post-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.related-post-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.related-post-title a:hover {
    color: #3b82f6;
}

/* Footer Styles */
.related-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.related-post-author {
    color: #374151;
    font-weight: 500;
}

.related-post-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .related-posts-title {
        font-size: 24px;
    }

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

    .related-post-title {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .related-posts-header {
        margin-bottom: 24px;
    }

    .related-posts-title {
        font-size: 22px;
    }

    .related-posts-navigation {
        gap: 8px;
    }

    .related-posts-nav-btn,
    .swiper-button-prev,
    .swiper-button-next {
        width: 42px !important;
        height: 42px !important;
    }

    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 14px !important;
    }

    .related-post-content {
        padding: 16px;
        gap: 12px;
    }

    .related-post-title {
        font-size: 16px;
    }

    .related-post-meta {
        gap: 12px;
        font-size: 13px;
    }

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

@media (max-width: 480px) {
    .related-posts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .related-posts-title {
        font-size: 20px;
    }

    .related-posts-swiper {
        margin: 0;
        padding: 0;
    }

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

    .related-post-title {
        font-size: 15px;
        line-height: 1.3;
    }

    .related-post-meta {
        font-size: 12px;
    }

    .related-post-category {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Loading Animation */
.related-posts-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.related-posts-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Swiper Pagination (if needed) */
.swiper-pagination {
    position: static !important;
    margin-top: 24px;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #cbd5e1;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #3b82f6;
    transform: scale(1.2);
}

/* Focus styles for accessibility */
.swiper-button-prev:focus,
.swiper-button-next:focus,
.related-post-item:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.related-post-title a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {

    .related-posts-navigation,
    .swiper-button-prev,
    .swiper-button-next {
        display: none !important;
    }

    .related-posts-swiper {
        overflow: visible !important;
    }

    .swiper-wrapper {
        transform: none !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .swiper-slide {
        transform: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .related-posts-title {
        color: #f9fafb;
    }

    .related-post-item {
        background: #1f2937;
        border-color: #374151;
    }

    .related-post-item:hover {
        border-color: #4b5563;
    }

    .related-post-title a {
        color: #f9fafb;
    }

    .related-post-title a:hover {
        color: #60a5fa;
    }

    .related-post-author {
        color: #d1d5db;
    }

    .related-post-meta {
        color: #9ca3af;
    }

    .related-post-footer {
        border-color: #374151;
    }

    .related-posts-nav-btn,
    .swiper-button-prev,
    .swiper-button-next {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #d1d5db !important;
    }

    .related-posts-nav-btn:hover,
    .swiper-button-prev:hover,
    .swiper-button-next:hover {
        background: #3b82f6 !important;
        border-color: #3b82f6 !important;
        color: white !important;
    }
}