/**
 * Review Integration System: Core Wireframe
 * Provides structural layout and spacing for the carousel.
 */

/* Container & Layout */
.sys-reviews-carousel-container {
    width: 100%;
    margin: 2em 0;
    position: relative;
}

.review-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.review-carousel-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 1.1rem;
}

.review-carousel-header-info .biz-name {
    font-size: 1.3rem;
    line-height: 1.2;
}

.review-carousel-header-info .biz-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.review-carousel-header-info .biz-contact-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.review-carousel-header-info .biz-contact-row .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.review-carousel-header-info .biz-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Action Buttons Group */
.review-carousel-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.review-carousel-track {
    /* Overflows are handled by JS, but enforced here for stability */
    overflow: hidden;
}
/* Support for Genesis */
.entry-content .sys-reviews-carousel-container .review-carousel-track ul.review-carousel-list, .sys-reviews-carousel-container .review-carousel-track ul.review-carousel-list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Individual Slide Gutters */
ul > li.review-carousel-slide {
    padding: 0 15px; /* Creates the gap between cards */
    box-sizing: border-box;
    list-style: none !important; 
}

/* Review Card Structure */
.review-card, 
.review-card-fallback {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    background-color: #ffffff;
}

/* Header Area */
.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.review-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background-color: #eee;
    /* Centering logic for initials override */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
}

/* Avatar Initials */
.review-avatar-initial,
.review-avatar-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    line-height: 1;
}

/* Author Colors (Shared across UI) */
.avatar-author-color-1 { background-color: var(--blue, #02bfdd) !important; }
.avatar-author-color-2 { background-color: var(--pink, #d846d9) !important; }

.review-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.review-author {
    font-weight: 700;
    font-style: normal;
}

.review-badge-new {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #eee; /* Wireframe neutral background */
    margin-left: 0.5rem;
    border-radius: 2px;
}

/* Source & Date Container */
.review-source-container, 
.ris-toast-source-display { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    line-height: 1; 
    margin-bottom: 5px; 
}

.review-source-container svg, 
.ris-toast-source-display svg { 
    width: 1.2em; 
    height: 1.2em; 
    flex-shrink: 0; 
    display: inline-block; 
    fill: currentColor; 
}

.ris-source-text { 
    font-weight: 600;
}

.ris-source-separator { 
    display: inline-flex; 
    align-items: center; 
    opacity: 0.6; 
}

.review-date, .ris-source-date, .ris-source-text {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Star Rating Colors */
.review-rating {
    margin-top: 0.25rem;
}

.ris-star-rating { display: inline-flex; align-items: center; }
.ris-star-rating svg { width: 1.2em; height: 1.2em; fill: currentColor; display: inline-block; margin-right: 2px; }

.star-color-gold { color: #f1c40f; }
.star-color-blue { color: var(--blue, #02bfdd); }
.star-color-pink { color: var(--pink, #d846d9); }
.star-color-none { color: inherit; }

.review-rating svg {
    margin-right: 2px; /* Small gap between stars */
}

/* Content Body */
.review-content {
    flex-grow: 1;
    font-size: 0.95rem;
}

/* Owner Response Block */
.review-footer {
    margin-top: 1.5rem;
}

.review-reply-toggle {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.review-owner-reply {
    padding: 1rem;
    background-color: #f9f9f9;
    margin-top: 1rem;
    border-left: 3px solid #02bfdd; /* Matches theme blue */
    font-size: 0.85rem;
}

.reply-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Review Summary Shortcode */
.sys-review-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin: 1rem 0;
}

/* Navigation Arrows */
.review-carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.review-carousel-arrow {
    pointer-events: auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    color: #333;
    transition: background 0.3s ease;
}

.review-carousel-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Pagination Dots */
.review-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.review-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.review-carousel-dot.active {
    background: var(--wp--preset--color--theme-primary);
    transform: scale(1.2);
}

/* Static List View Grid */
.sys-reviews-list .review-list-grid {
    display: grid;
    gap: 30px;
    width: 100%;
}

/* Column Logic for List View */
.sys-reviews-list[data-columns="1"] .review-list-grid { grid-template-columns: 1fr; }
.sys-reviews-list[data-columns="2"] .review-list-grid { grid-template-columns: repeat(2, 1fr); }
.sys-reviews-list[data-columns="3"] .review-list-grid { grid-template-columns: repeat(3, 1fr); }
.sys-reviews-list[data-columns="4"] .review-list-grid { grid-template-columns: repeat(4, 1fr); }
.sys-reviews-list[data-columns="5"] .review-list-grid { grid-template-columns: repeat(5, 1fr); }
.sys-reviews-list[data-columns="6"] .review-list-grid { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 800px) {
    /* Hide arrows on mobile to prevent overlap with 1-column text */
    /* Users will use touch-drag/swipe instead */
    .review-carousel-arrow {
        display: none;
    }

    /* Alternatively, if you want to keep them, move them inside the padding */
    .review-carousel-controls {
        padding: 0 5px;
    }

    /* Ensure the container doesn't have horizontal scrollbars during drag */
    

    /* Reduce horizontal padding on slides so they feel more "full screen" on mobile */
    ul > li.review-carousel-slide {
        padding: 0 10px; 
    }

}
@media (max-width: 768px) {
    .sys-reviews-list .review-list-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
    .review-carousel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-carousel-header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
}
/* Masonry Mode Support */
.sys-reviews-list.masonry-mode .review-list-grid {
    display: block;
    /* Prevents columns from recalculating aggressively during mid-animation */
    column-fill: balance; 
}
.sys-reviews-list .review-list-item {
    break-inside: avoid-column;
    display: inline-block; /* Essential fix for fragmentation jank in multi-column layouts */
    width: 100%;
    backface-visibility: hidden; /* Forces hardware acceleration during the reveal */
}

/* Load More / Infinite Scroll */
.sys-reviews-list .review-list-item[data-hidden="true"] {
    display: none !important;
}

.sys-reviews-list .review-list-item.revealing {
    animation: sysFadeUp 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
    will-change: transform, opacity, filter;
}

.review-load-more-sentinel {
    height: 20px;
    width: 100%;
    margin-top: 20px;
}

@keyframes sysFadeUp {
    0% { opacity: 0; transform: translate3d(0, 60px, 0); filter: blur(10px); }
    100% { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}
.ris-view-all-container {
	text-align: center;
}