/**
 * Remote Village Posts - Carousel Card Styles
 * @version 1.0.1
 *
 * Uses unique rv-posts- prefix to avoid conflicts with existing carousel classes
 * Leverages existing CSS variables from nimbin-village.css
 */

/* Container - Horizontal scrollable layout */
.rv-posts-container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.rv-posts-container::-webkit-scrollbar {
    display: none;
}

/* Carousel wrapper for arrow navigation */
.rv-carousel-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.rv-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: none; /* JS sets to flex — must NOT be !important */
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: box-shadow 0.2s;
    color: #333;
}

.rv-carousel-arrow:hover {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}

.rv-carousel-arrow--left { left: 8px; }
.rv-carousel-arrow--right { right: 8px; }

@media (hover: none), (pointer: coarse) {
    .rv-carousel-arrow { display: none !important; }
}

/* Item - Individual card wrapper */
.rv-posts-item {
    flex: 0 0 auto;
    width: 320px;
    max-width: 90vw;
    scroll-snap-align: start;
}

/* Card - The clickable card */
.rv-posts-card {
    display: flex !important;
    flex-direction: column !important;
    background: var(--base-color, #fff) !important;
    border-radius: var(--border-radius-med, 16px) !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    text-decoration: none !important;
    color: inherit !important;
    height: 100% !important;
    min-height: 0 !important;
    position: relative !important;
}

.rv-posts-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Featured Image */
.rv-posts-card-image {
    width: 100% !important;
    height: 200px !important;
    background-size: cover !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    background-color: #f5f5f5 !important;
    flex-shrink: 0 !important;
    min-height: 200px !important;
    max-height: 200px !important;
}

.rv-posts-card-image-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Content Area */
.rv-posts-card-body {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    position: relative !important;
}

/* Author Name */
.rv-posts-card-author {
    font-size: 14px;
    color: var(--primary-color, #00786f);
    margin: 0;
    font-weight: 400;
}

/* Post Title */
.rv-posts-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Categories */
.rv-posts-card-categories {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.rv-posts-card-categories a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rv-posts-card-categories a:hover {
    color: var(--primary-color, #00786f);
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rv-posts-container {
        gap: 16px;
        padding: 16px 0;
    }

    .rv-posts-item {
        width: 280px;
        max-width: 88vw;
    }

    .rv-posts-card-image {
        height: 180px;
    }

    .rv-posts-card-body {
        padding: 16px;
    }

    .rv-posts-card-title {
        font-size: 18px;
    }
}

/* Small Mobile — 1.1 cards visible */
@media (max-width: 480px) {
    .rv-posts-container {
        gap: 16px;
        padding: 16px 0;
    }

    .rv-posts-item {
        width: calc(91% - 16px);
        max-width: none;
    }

    .rv-posts-card-image {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }
}
