/**
 * Frontend styles for the block
 */

/* Reset some default styles */
.reviews-grid * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Masonry Grid Layout */
.reviews-grid {
    columns: 3 300px; /* Up to 3 columns, each at least 300px wide */
    column-gap: 30px; /* Changed to 30px as requested */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.review-item {
    break-inside: avoid; /* Prevent items from breaking across columns */
    display: inline-block; /* Required for proper column flow */
    width: 100%;
    margin-bottom: 20px;
}

/* Review box styling */
.ts-box {
    border-radius: 3px;
    background-color: #fff;
    padding: 12px;
    break-inside: avoid;
    page-break-inside: avoid; /* For older browsers */
    box-sizing: border-box;
    margin-bottom: 0;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.ts-box .titlerow {
    margin-bottom: 6px;
    clear: both;
}

.ts-box .titlerow::after, .ts-box .titlerow::before {
    content: " ";
    display: table;
    -webkit-flex-basis: 0;
    -ms-flex-preferred-size: 0px;
    flex-basis: 0px;
    -webkit-order: 1;
    -ms-flex-order: 1;
    order: 1;
}

.ts-box .titlerow::after {
    clear: both;
}

.ts-box .titlerow img {
    float: left;
    width: 40px;
    border-radius: 50%;
    margin-right: 8px;
}

.ts-box .titlerow img.verify {
    float: left;
    margin-right: 3px;
    border-radius: 0;
    width: 70px;
}

.ts-box .titlerow p.byline {
    color: #616770;
    margin-bottom: 2px;
    margin-top: 0 !important;
    position: relative;
}

.ts-box .titlerow p.byline.byline-has-image::after,
.ts-box .titlerow p.byline.byline-no-image::after {
    content: " ";
    display: inline-block;
    position: absolute;
    background-image: url(https://zardy.co/wp-content/uploads/2023/08/verified.png);
    background-size: 100% auto;
    background-repeat: no-repeat;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    top: 2px;
}

.ts-box .titlerow p.date {
    font-size: 12px;
    font-weight: 400;
    line-height: 16.08px;
    margin-bottom: 0px;
    margin-top: 0px;
    color: #616770;
    position: relative;
    top: -2px;
}

.ts-box .titlerow p.date span {
    position: relative;
}

.ts-box .titlerow p.byline strong {
    color: #365899;
    font-weight: 600;
}

.ts-box p {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #1d2129;
    line-height: 19.32px;
    margin-bottom: 16px;
    margin-top: 0;
}

p.review-text.no-bottom-margin {
    margin-bottom: 0;
}

p.review-text.has-bottom-margin {
    margin-bottom: 16px;
}

/* Product images grid */
.product-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
    text-align: center;
}

.product-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.product-thumb:hover {
    opacity: 0.8;
}

/* Lightbox styles */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #ddd;
}

/* General image styles */
img {
    max-width: 100%;
    height: auto;
    -ms-interpolation-mode: bicubic;
    display: inline-block;
    vertical-align: middle;
    border: 0;
}

img, img.loaded {
    transition: opacity .2s;
    opacity: 1;
}

/* Responsive design */
@media (max-width: 767px) {
    .reviews-grid {
        columns: 1; /* Single column on mobile */
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .reviews-grid {
        columns: 2; /* Two columns on tablets */
    }
} 