/* ============================================================
   Masonry Layout
   ============================================================ */
.grwp-layout-masonry .grwp-masonry-wrap {
  columns: 3;
  column-gap: 18px;
}
.grwp-layout-masonry .grwp-masonry-card {
  break-inside: avoid;
  margin-bottom: 18px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--grwp-border);
  border-radius: var(--grwp-radius);
  padding: 20px;
  box-shadow: var(--grwp-card-shadow);
  transition: transform var(--grwp-transition), box-shadow var(--grwp-transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.grwp-layout-masonry .grwp-masonry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.11);
}

/* Review Text - at top */
.grwp-layout-masonry .grwp-masonry-review-text {
  font-size: 14px;
  color: var(--grwp-text-light);
  margin: 0;
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-align: center;
  width: 100%;
}

.grwp-layout-masonry .grwp-masonry-review-text.grwp-no-text {
  font-style: italic;
  color: var(--grwp-text-light);
}

/* Stars & Verified Badge */
.grwp-layout-masonry .grwp-masonry-stars {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.grwp-layout-masonry .grwp-star {
  color: #d1d5db;
  font-size: 15px;
  line-height: 1;
}

.grwp-layout-masonry .grwp-star.filled {
  color: var(--grwp-star-color);
}

.grwp-layout-masonry .grwp-verified-badge {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: help;
  outline: none;
}

.grwp-layout-masonry .grwp-verified-badge::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--grwp-transition);
  z-index: 5;
}

.grwp-layout-masonry .grwp-verified-badge::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #111111 transparent transparent transparent;
  opacity: 0;
  transition: opacity var(--grwp-transition);
}

.grwp-layout-masonry .grwp-verified-badge:hover::before,
.grwp-layout-masonry .grwp-verified-badge:hover::after,
.grwp-layout-masonry .grwp-verified-badge:focus-visible::before,
.grwp-layout-masonry .grwp-verified-badge:focus-visible::after {
  opacity: 1;
}

/* Date/Time */
.grwp-layout-masonry .grwp-masonry-time {
  font-size: 12px;
  color: var(--grwp-text-light);
  line-height: 1;
  text-align: center;
}

/* Author Name */
.grwp-layout-masonry .grwp-masonry-author-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--grwp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
}

/* Author Avatar - at bottom */
.grwp-layout-masonry .grwp-masonry-avatar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.grwp-layout-masonry .grwp-masonry-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.grwp-layout-masonry .grwp-masonry-avatar.grwp-reviewer-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

@media (max-width: 900px) {
  .grwp-layout-masonry .grwp-masonry-wrap {
    columns: 2;
  }
}

@media (max-width: 560px) {
  .grwp-layout-masonry .grwp-masonry-wrap {
    columns: 1;
  }
}
