/**
 * Post Navigation Widget Styles
 */

/* Base Styles */
.post-navigation-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 20px;
}

/* Horizontal Layout */
.post-nav-layout-horizontal {
    flex-direction: row;
}

/* Vertical Layout */
.post-nav-layout-vertical {
    flex-direction: column;
}

/* Navigation Link */
.post-nav-link {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-nav-link:hover {
    background-color: #6C5CE7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.post-nav-link::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-nav-link:hover::before {
    left: 100%;
}

/* Disabled State */
.post-nav-link.post-nav-disabled {
    opacity: 0;
    pointer-events: none;
    flex: 0;
    padding: 0;
    min-width: 0;
}

/* Previous Post */
.post-nav-prev {
    justify-content: flex-start;
}

.post-nav-prev .post-nav-content {
    text-align: left;
}

/* Next Post */
.post-nav-next {
    justify-content: flex-end;
}

.post-nav-next .post-nav-content {
    text-align: right;
}

/* Content Area */
.post-nav-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

/* Label */
.post-nav-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666666;
    transition: color 0.3s ease;
    margin-bottom: 8px;
}

.post-nav-link:hover .post-nav-label {
    color: #ffffff;
}

/* Title */
.post-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    transition: color 0.3s ease;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-nav-link:hover .post-nav-title {
    color: #ffffff;
}

/* Arrow */
.post-nav-arrow {
    font-size: 24px;
    color: #6C5CE7;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
}

.post-nav-link:hover .post-nav-arrow {
    color: #ffffff;
}

.post-nav-arrow-prev {
    margin-right: 15px;
}

.post-nav-link:hover .post-nav-arrow-prev {
    transform: translateX(-5px);
}

.post-nav-arrow-next {
    margin-left: 15px;
}

.post-nav-link:hover .post-nav-arrow-next {
    transform: translateX(5px);
}

/* Thumbnail */
.post-nav-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    margin-right: 15px;
}

.post-nav-next .post-nav-thumbnail {
    margin-right: 0;
    margin-left: 15px;
    order: 2;
}

.post-nav-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-nav-link:hover .post-nav-thumbnail img {
    transform: scale(1.1);
}

/* Vertical Layout Adjustments */
.post-nav-layout-vertical .post-nav-link {
    width: 100%;
}

.post-nav-layout-vertical .post-nav-prev,
.post-nav-layout-vertical .post-nav-next {
    justify-content: flex-start;
}

.post-nav-layout-vertical .post-nav-prev .post-nav-content,
.post-nav-layout-vertical .post-nav-next .post-nav-content {
    text-align: left;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .post-navigation-wrapper {
        gap: 15px;
    }

    .post-nav-link {
        padding: 15px 20px;
    }

    .post-nav-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .post-nav-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .post-nav-arrow {
        font-size: 20px;
    }

    .post-nav-arrow-prev {
        margin-right: 10px;
    }

    .post-nav-arrow-next {
        margin-left: 10px;
    }

    .post-nav-thumbnail {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }

    .post-nav-next .post-nav-thumbnail {
        margin-left: 12px;
    }
}

@media (max-width: 576px) {
    /* Stack horizontally on mobile */
    .post-nav-layout-horizontal {
        flex-direction: column;
    }

    .post-navigation-wrapper {
        gap: 10px;
    }

    .post-nav-link {
        padding: 12px 15px;
    }

    .post-nav-label {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .post-nav-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }

    .post-nav-arrow {
        font-size: 18px;
    }

    .post-nav-arrow-prev {
        margin-right: 8px;
    }

    .post-nav-arrow-next {
        margin-left: 8px;
    }

    .post-nav-thumbnail {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }

    .post-nav-next .post-nav-thumbnail {
        margin-left: 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .post-nav-link {
        background-color: #2d3436;
    }

    .post-nav-title {
        color: #ffffff;
    }

    .post-nav-label {
        color: #b2bec3;
    }
}

/* Accessibility */
.post-nav-link:focus {
    outline: 2px solid #6C5CE7;
    outline-offset: 2px;
}

.post-nav-link:focus-visible {
    outline: 2px solid #6C5CE7;
    outline-offset: 2px;
}

/* Animation for loading */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-navigation-wrapper {
    animation: fadeInSlide 0.5s ease-out;
}

/* RTL Support */
[dir="rtl"] .post-nav-arrow-prev {
    margin-right: 0;
    margin-left: 15px;
    transform: scaleX(-1);
}

[dir="rtl"] .post-nav-arrow-next {
    margin-left: 0;
    margin-right: 15px;
    transform: scaleX(-1);
}

[dir="rtl"] .post-nav-thumbnail {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .post-nav-next .post-nav-thumbnail {
    margin-left: 0;
    margin-right: 15px;
}

/* Print Styles */
@media print {
    .post-navigation-wrapper {
        display: none;
    }
}
