/**
 * MN Vertical Post Widget Styles
 * Vertical carousel with sticky scroll and overlay gradient
 */

/* Container */
.mn-vpost-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mn-vpost-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
}

.mn-vpost-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Track */
.mn-vpost-track {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Items */
.mn-vpost-item {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.mn-vpost-item.mn-vpost-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 3;
}

.mn-vpost-item.mn-vpost-prev,
.mn-vpost-item.mn-vpost-next {
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

/* Overlay Gradient at container top and bottom to cover prev/next slides */
.mn-vpost-container::before,
.mn-vpost-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 30%;
    z-index: 10;
    pointer-events: none;
}

/* Top overlay - covers previous slide with gradient from solid to transparent */
.mn-vpost-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

/* Bottom overlay - covers next slide with gradient from transparent to solid */
.mn-vpost-container::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

/* Layout 1: Full Width Image */
.mn-vpost-layout-layout_1 .mn-vpost-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mn-vpost-layout-layout_1 .mn-vpost-image-wrapper {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    overflow: hidden;
}

.mn-vpost-layout-layout_1 .mn-vpost-content {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: #ffffff;
}

.mn-vpost-layout-layout_1 .mn-vpost-content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mn-vpost-layout-layout_1 .mn-vpost-content-right {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

/* Layout 2: Side by Side */
.mn-vpost-layout-layout_2 .mn-vpost-item {
    display: flex;
    height: 100%;
}

.mn-vpost-layout-layout_2 .mn-vpost-content {
    display: flex;
    width: 100%;
    height: 100%;
}

.mn-vpost-layout-layout_2 .mn-vpost-col-left,
.mn-vpost-layout-layout_2 .mn-vpost-col-right {
    flex: 1;
    width: 50%;
}

.mn-vpost-layout-layout_2 .mn-vpost-col-left {
    position: relative;
    overflow: hidden;
}

.mn-vpost-layout-layout_2 .mn-vpost-col-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 40px;
    background: #ffffff;
}

/* Image */
.mn-vpost-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.mn-vpost-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.mn-vpost-item:hover .mn-vpost-image img {
    transform: scale(1.05);
}

/* Hover Arrow */
.mn-vpost-hover-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    cursor: pointer;
    text-decoration: none;
}

.mn-vpost-hover-arrow i,
.mn-vpost-hover-arrow svg {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.mn-vpost-image:hover .mn-vpost-hover-arrow {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1.1);
}

.mn-vpost-hover-arrow:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.2);
}

/* Content Typography */
.mn-vpost-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #333333;
}

.mn-vpost-excerpt {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
}

.mn-vpost-date {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation Arrows */
.mn-vpost-navigation {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    top: 50%;
    transform: translateY(-50%);
}

.mn-vpost-nav-left {
    left: 30px;
}

.mn-vpost-nav-right {
    right: 30px;
}

.mn-vpost-nav-center {
    left: 50%;
    transform: translate(-50%, -50%);
}

.mn-vpost-arrow {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.mn-vpost-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.mn-vpost-arrow:active {
    transform: scale(0.95);
}

.mn-vpost-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mn-vpost-arrow:disabled:hover {
    transform: none;
}

.mn-vpost-arrow i,
.mn-vpost-arrow svg {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Loading State */
.mn-vpost-loading {
    position: relative;
    pointer-events: none;
}

.mn-vpost-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: mn-vpost-spin 0.8s linear infinite;
    z-index: 1000;
}

@keyframes mn-vpost-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .mn-vpost-layout-layout_1 .mn-vpost-content {
        flex-direction: column;
        gap: 15px;
        padding: 25px;
    }
    
    .mn-vpost-layout-layout_1 .mn-vpost-content-right {
        justify-content: flex-start;
    }
    
    .mn-vpost-layout-layout_2 .mn-vpost-col-right {
        padding: 30px;
    }
    
    .mn-vpost-title {
        font-size: 24px;
    }
    
    .mn-vpost-excerpt {
        font-size: 15px;
    }
    
    .mn-vpost-navigation {
        gap: 10px;
    }
    
    .mn-vpost-nav-left {
        left: 20px;
    }
    
    .mn-vpost-nav-right {
        right: 20px;
    }
    
    .mn-vpost-arrow {
        width: 45px;
        height: 45px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .mn-vpost-container {
        height: 100vh;
    }
    
    /* Layout 1 Mobile */
    .mn-vpost-layout-layout_1 .mn-vpost-content {
        padding: 20px;
        gap: 12px;
    }
    
    /* Layout 2 Mobile - Stack vertically */
    .mn-vpost-layout-layout_2 .mn-vpost-content {
        flex-direction: column;
    }
    
    .mn-vpost-layout-layout_2 .mn-vpost-col-left,
    .mn-vpost-layout-layout_2 .mn-vpost-col-right {
        width: 100%;
    }
    
    .mn-vpost-layout-layout_2 .mn-vpost-col-left {
        height: 50%;
    }
    
    .mn-vpost-layout-layout_2 .mn-vpost-col-right {
        height: 50%;
        padding: 20px;
    }
    
    .mn-vpost-title {
        font-size: 20px;
    }
    
    .mn-vpost-excerpt {
        font-size: 14px;
    }
    
    .mn-vpost-date {
        font-size: 12px;
    }
    
    .mn-vpost-navigation {
        gap: 8px;
    }
    
    .mn-vpost-nav-left {
        left: 15px;
    }
    
    .mn-vpost-nav-right {
        right: 15px;
    }
    
    .mn-vpost-arrow {
        width: 40px;
        height: 40px;
    }
    
    .mn-vpost-arrow i,
    .mn-vpost-arrow svg {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .mn-vpost-hover-arrow {
        width: 50px;
        height: 50px;
    }
    
    .mn-vpost-hover-arrow i,
    .mn-vpost-hover-arrow svg {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mn-vpost-layout-layout_1 .mn-vpost-content {
        padding: 15px;
    }
    
    .mn-vpost-layout-layout_2 .mn-vpost-col-right {
        padding: 15px;
        gap: 10px;
    }
    
    .mn-vpost-title {
        font-size: 18px;
    }
    
    .mn-vpost-excerpt {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .mn-vpost-nav-left {
        left: 10px;
    }
    
    .mn-vpost-nav-right {
        right: 10px;
    }
    
    .mn-vpost-arrow {
        width: 36px;
        height: 36px;
    }
    
    .mn-vpost-arrow i,
    .mn-vpost-arrow svg {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

/* Accessibility */
.mn-vpost-arrow:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.mn-vpost-hover-arrow:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Mobile Listing Mode - Disable carousel on mobile */
@media (max-width: 767px) {
    .mn-vpost-mobile-listing {
        overflow: visible !important;
    }
    
    .mn-vpost-mobile-listing .mn-vpost-container {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .mn-vpost-mobile-listing .mn-vpost-track {
        transform: none !important;
        transition: none !important;
        height: auto !important;
        display: flex;
        flex-direction: column;
    }
    
    .mn-vpost-mobile-listing .mn-vpost-item {
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        flex-shrink: 0;
    }
    
    /* Use gap from settings for spacing between items */
    .mn-vpost-mobile-listing .mn-vpost-track {
        gap: var(--mn-vpost-gap, 20px);
    }
    
    /* Hide navigation arrows on mobile listing */
    .mn-vpost-mobile-listing .mn-vpost-navigation {
        display: none !important;
    }
    
    /* Hide overlay gradients/shadows on mobile listing */
    .mn-vpost-mobile-listing .mn-vpost-container::before,
    .mn-vpost-mobile-listing .mn-vpost-container::after {
        display: none !important;
        content: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    /* Layout 1 adjustments for mobile listing - use slide height for image */
    
    
    .mn-vpost-mobile-listing.mn-vpost-layout-layout_1 .mn-vpost-image {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
    
    /* Layout 2 adjustments for mobile listing */
    .mn-vpost-mobile-listing.mn-vpost-layout-layout_2 .mn-vpost-item {
        flex-direction: column;
    }
    
    .mn-vpost-mobile-listing.mn-vpost-layout-layout_2 .mn-vpost-col-left,
    .mn-vpost-mobile-listing.mn-vpost-layout-layout_2 .mn-vpost-col-right {
        width: 100%;
    }
    
    .mn-vpost-mobile-listing.mn-vpost-layout-layout_2 .mn-vpost-col-left {
        height: var(--mn-vpost-image-height, 250px);
        min-height: var(--mn-vpost-image-height, 250px);
    }
    
    /* Hover arrow adjustments for mobile listing */
    .mn-vpost-mobile-listing .mn-vpost-hover-arrow {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Print Styles */
@media print {
    .mn-vpost-navigation {
        display: none;
    }
    
    .mn-vpost-hover-arrow {
        display: none;
    }
    
    .mn-vpost-item {
        opacity: 1 !important;
        transform: none !important;
        page-break-inside: avoid;
    }
}
