/* ─── Reviewlist Component — Structural CSS ─── */

/* Grid layout for review cards */
.reviewlist .cl_list {
    display: grid;
    gap: 20px;
}

/* Review card base structure. Gap between elements is here (was on
   .cl-review-content wrapper before restructuring to match plist1's
   flat-children pattern). Padding is admin-controlled via review_item_style. */
.reviewlist .cl_item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* ─── Horizontal layout — review_media on the left, everything else
   stacked on the right inside a bare <div> child (matches plist1 +
   catlist horizontal). The bare wrapper inherits flex column to stack
   its contents vertically inside the row layout of .cl_item. ─── */
.reviewlist .cl_item.horizontal {
    flex-direction: row;
}

.reviewlist .cl_item.horizontal > .cl-review-media {
    max-width: 40%;
    flex-shrink: 0;
}

.reviewlist .cl_item.horizontal > div:not(.cl-review-media) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

/* ─── Embedded mini-gallery (review_media uses Gallery_cl) ───
   Compact sizing inside a review card. The shared structural CSS in
   public/assets/css/gallery.css applies first; these rules override
   for the review-card context only. */

.reviewlist .cl_item .cl_gallery {
    width: 100%;
}

.reviewlist .cl_item .cl-slides-container {
    aspect-ratio: 4 / 3;
    background: var(--cl-bg-color2, #f3f3f3);
    border-radius: 4px;
}

.reviewlist .cl_item .cl-gallery-slide.active {
    align-items: center;
}

.reviewlist .cl_item .cl-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* Smaller arrows for compact card layout */
.reviewlist .cl_item .cl-slide-arrows {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

/* Smaller lightbox icon */
.reviewlist .cl_item .cl-lightbox-trigger-icon {
    width: 26px;
    height: 26px;
    top: 6px;
    right: 6px;
}

/* Lightbox fullscreen mode is shared global behavior — no compact override
   for it (when fullscreen, we want the full viewport regardless of context). */

/* Star rating */
.cl-review-star-rating {
    display: inline-flex;
    gap: 2px;
}

.cl-review-star-rating .star {
    line-height: 1;
}

/* Reviewer block — avatar+name grouped at start, verified badge at end */
.cl-review-reviewer-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cl-review-reviewer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Reviewer avatar */
.cl-review-avatar img {
    object-fit: cover;
    display: block;
}

/* Verified badge */
.cl-review-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Review text truncation (controlled by setting) */
.cl-review-text.max-lines-1 { -webkit-line-clamp: 1; }
.cl-review-text.max-lines-2 { -webkit-line-clamp: 2; }
.cl-review-text.max-lines-3 { -webkit-line-clamp: 3; }
.cl-review-text.max-lines-1,
.cl-review-text.max-lines-2,
.cl-review-text.max-lines-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Review media — wraps the embedded `.cl_gallery` mini-gallery.
   Just a thin pass-through container that keeps `cl-block="review_media"`
   for live-preview routing. The actual gallery layout lives in
   public/assets/css/gallery.css (structural) + the embedded-mini-gallery
   compact overrides further down in this file. */
.cl-review-media {
    display: block;
}

/* Product info (standalone mode) */
.cl-review-product-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-review-product-info img {
    object-fit: cover;
}

/* Helpful count */
.cl-review-helpful {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ─── Filter — visually hide radio/checkbox inputs ─── */
.reviewlist .list-filter-display-buttons input[type="radio"],
.reviewlist .list-filter-display-buttons input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ─── Entry animations ─── */
@keyframes cl-reviewFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cl-reviewFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
