/* =============================================
   Trustify Grid Wall Widget - v2
   Scoped to .trustify-grid to prevent bleed
   ============================================= */

.trustify-grid,
.trustify-grid *,
.trustify-grid *::before,
.trustify-grid *::after {
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  line-height: normal !important;
  border-radius: 0 !important;
  text-decoration: none !important;
  list-style: none !important;
  border: none !important;
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
  animation: none !important;
  vertical-align: baseline !important;
  font-style: normal !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  white-space: normal !important;
  max-width: none !important;
  min-width: 0 !important;
  max-height: none !important;
  min-height: 0 !important;
}

/* --- Font --- */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans Regular'),
       url('../fonts/open-sans-regular-webfont.woff2') format('woff2');
}

/* =============================================
   WIDGET CONTAINER
   ============================================= */
.trustify-grid {
  width: 100% !important;
  max-width: 880px !important;
  border-radius: 14px !important;
  background-color: #ffffff !important;
  border: 1px solid #f3f4f6 !important;
  overflow: hidden !important;
  position: relative !important;
  font-family: 'Open Sans', sans-serif !important;
  z-index: 99999 !important;
  display: block !important;
  container-type: inline-size;
  container-name: tfy-grid;
}
.trustify-grid[data-auto-width="true"] {
  max-width: none !important;
}
.trustify-grid[data-bg-transparent="true"] {
  background-color: transparent !important;
}
.trustify-grid[data-no-border="true"] {
  border: none !important;
}

/* =============================================
   HEADER  (stats left · logo right)
   ============================================= */
.trustify-grid .tfy-gw-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid #f3f4f6 !important;
  gap: 12px !important;
}

/* Left group: avg · stars · score label */
.trustify-grid .tfy-gw-header-stats {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.trustify-grid .tfy-gw-header-avg {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #2C3C4F !important;
  display: inline-block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.trustify-grid .tfy-gw-header-stars {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-wrap: nowrap !important;
}

.trustify-grid .tfy-gw-header-stars img {
  display: inline-block !important;
  position: static !important;
  float: none !important;
  height: 17px !important;
  width: auto !important;
  border: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Score label */
.trustify-grid .tfy-gw-header-score {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0179b2 !important;
  display: inline-block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Right group: count + logo */
.trustify-grid .tfy-gw-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
}

.trustify-grid .tfy-gw-header-count {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #9ca3af !important;
  display: inline-block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.trustify-grid .tfy-gw-header-logo {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  padding-left: 12px !important;
  border-left: 1px solid #f3f4f6 !important;
}

.trustify-grid .tfy-gw-header-logo img {
  display: inline-block !important;
  position: static !important;
  float: none !important;
  height: 15px !important;
  width: auto !important;
  border: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* =============================================
   MASONRY GRID  (CSS column-count)
   ============================================= */
.trustify-grid .tfy-gw-grid {
  column-count: var(--tfy-gw-cols, 3) !important;
  column-gap: 14px !important;
  padding: 20px !important;
}

/* =============================================
   CARD
   ============================================= */
.trustify-grid .tfy-gw-card {
  break-inside: avoid !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  background-color: #f9fafb !important;
  border: 1px solid #f3f4f6 !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 14px !important;
  width: 100% !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  /* Fade-in on mount */
  opacity: 0;
  transform: translateY(6px);
}

.trustify-grid .tfy-gw-card.tfy-gw-card-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.trustify-grid .tfy-gw-card:hover {
  border-color: #e5e7eb !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07) !important;
}

/* ── Card top row (author left · date right) ── */
.trustify-grid .tfy-gw-card-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.trustify-grid .tfy-gw-card-author {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #2C3C4F !important;
  text-decoration: none !important;
  cursor: pointer !important;
  display: block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.trustify-grid .tfy-gw-card-date {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #9ca3af !important;
  display: block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* ── Stars ── */
.trustify-grid .tfy-gw-card-stars {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-wrap: nowrap !important;
}

.trustify-grid .tfy-gw-card-stars img {
  display: inline-block !important;
  position: static !important;
  float: none !important;
  height: 16px !important;
  width: auto !important;
  border: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Review text ── */
.trustify-grid .tfy-gw-card-text {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
  color: #374151 !important;
  text-align: left !important;
  display: block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  word-break: break-word !important;
  white-space: normal !important;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.trustify-grid .tfy-gw-empty {
  padding: 40px 24px !important;
  font-family: 'Open Sans', sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #6b7280 !important;
  text-align: center !important;
  display: block !important;
  background: none !important;
  border: none !important;
}

/* =============================================
   RESPONSIVE  (container queries)
   ============================================= */

/* ≤ 640px → max 2 columns */
@container tfy-grid (max-width: 640px) {
  .tfy-gw-header-score,
  .tfy-gw-header-count {
    display: none !important;
  }
  .tfy-gw-header-logo {
    padding-left: 0 !important;
    border-left: none !important;
  }
  .tfy-gw-header-right {
    gap: 0 !important;
  }
  .tfy-gw-grid {
    column-count: 2 !important;
    column-gap: 10px !important;
    padding: 14px !important;
  }
  .tfy-gw-card {
    margin-bottom: 10px !important;
  }
}

/* ≤ 420px → single column */
@container tfy-grid (max-width: 420px) {
  .tfy-gw-header {
    padding: 10px 14px !important;
  }
  .tfy-gw-grid {
    column-count: 1 !important;
    padding: 12px !important;
  }
}

/* Fallback for browsers without container query support */
@media (max-width: 700px) {
  .trustify-grid .tfy-gw-header-score,
  .trustify-grid .tfy-gw-header-count {
    display: none !important;
  }
  .trustify-grid .tfy-gw-header-logo {
    padding-left: 0 !important;
    border-left: none !important;
  }
  .trustify-grid .tfy-gw-header-right {
    gap: 0 !important;
  }
  .trustify-grid .tfy-gw-grid {
    column-count: 2 !important;
    column-gap: 10px !important;
    padding: 14px !important;
  }
  .trustify-grid .tfy-gw-card {
    margin-bottom: 10px !important;
  }
}
@media (max-width: 480px) {
  .trustify-grid .tfy-gw-header {
    padding: 10px 14px !important;
  }
  .trustify-grid .tfy-gw-grid {
    column-count: 1 !important;
    padding: 12px !important;
  }
}

/* =============================================
   DARK MODE
   ============================================= */
.trustify-grid[data-mode="dark"] {
  background-color: #1F2A38 !important;
  border-color: #334155 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-header {
  border-bottom-color: #2d3f52 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-header-logo {
  border-left-color: #2d3f52 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-header-avg {
  color: #f9fafb !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-header-score {
  color: #0088FF !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-header-count {
  color: #6b7280 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-card {
  background-color: #273444 !important;
  border-color: #334155 !important;
  margin-bottom: 14px !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-card:hover {
  border-color: #3d5166 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-card-author {
  color: #f3f4f6 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-card-date {
  color: #6b7280 !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-card-text {
  color: #d1d5db !important;
}

.trustify-grid[data-mode="dark"] .tfy-gw-empty {
  color: #6b7280 !important;
}
