/* ─── 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.php: a gallery on the slider engine) ───
   Compact sizing inside a review card. The galleries' layout is
   comps/slider/frontend/assets/css/slider-gallery.css; these rules are the review card's. */

.reviewlist .cl_item .cl_gallery {
    width: 100%;
}

/* The photos' box: 4 / 3, one photo per view. */
.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 {
    align-items: center;
}

.reviewlist .cl_item .cl-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* A video without a poster (a link other than YouTube or Vimeo): a plain box under its play button. */
.reviewlist .cl_item .cl-gallery-no-poster {
    display: block;
    width: 100%;
    height: 100%;
    background: #1f2937;
}

/* The arrows' size is the review media's slider design's (its Arrows tab, 28 px by default; task
   product-gallery-on-slider-designs-12-10-2026): no size here, which could win over the design by load order.
   The full-screen button sits closer to the corner; without an icon-button design it is smaller too. */
.reviewlist .cl_item .cl-lightbox-trigger-icon {
    top: 6px;
    right: 6px;
}
.reviewlist .cl_item .cl-lightbox-trigger-icon.cl-preset-0 {
    width: 26px;
    height: 26px;
}

/* The lightbox is the shared dialog (slider-lightbox.css): no compact override for it. */

/* 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;
}
/* Initials circle (`reviewer_avatar_mode: initials`) — the same 40px box get_avatar() renders, with
   its colours from its badge design and its shape from the avatar style. */
.cl-review-avatar .cl-review-initials {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
}

/* 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
   comps/slider/frontend/assets/css/slider-gallery.css + the embedded-mini-gallery
   compact rules above 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 {
    /* The product thumbnail is a CAPTION next to the product name, not a hero. Without an
       explicit size it rendered at its intrinsic 150x150 -- nearly 4x the 40px reviewer
       avatar beside it -- and pushed the info row to 154px tall. `object-fit` alone does
       nothing here: it only decides how an image fills a box it has already been GIVEN.
       flex-shrink:0 matters too -- without it a long product name squeezed the image to
       140px on some cards and 150px on others, so the row was not even consistent.
       Structural, not settings-driven, so it lands on existing installs with no recompile;
       an admin who wants a different size sets width/height on `product_image_style`, which
       generated_css emits at higher specificity and therefore wins. */
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    object-fit: cover;
}

/* ─── 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; }
}
