/*
 * Path: /wp-content/themes/sml-theme/assets/css/reviews.css
 * Description: Google Reviews styling (grid + carousel layout).
 * Version: 1.1.0
 */

.sml-gr{
  margin: 0;
}

.sml-gr__header{
  display:flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(var(--sml-ink-rgb), 0.08);
}

.sml-gr__title{
  margin: 0;
  font-family: var(--sml-font-ui);
  font-weight: var(--sml-w-semibold);
  letter-spacing: -0.02em;
  font-size: 18px;
}

.sml-gr__summary{
  display:flex;
  align-items:center;
  gap: 10px;
  white-space: nowrap;
}

.sml-gr__stars{ display:inline-flex; gap: 2px; }

.sml-gr__star{ font-size: 14px; line-height: 1; }
.sml-gr__star--full,
.sml-gr__star--half{ color: rgba(67,130,57,0.95); }
.sml-gr__star--empty{ color: rgba(var(--sml-ink-rgb), 0.20); }

.sml-gr__meta{
  display:inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--sml-font-ui);
}

.sml-gr__avg{ font-weight: var(--sml-w-heavy); }
.sml-gr__count{ color: rgba(var(--sml-ink-rgb), 0.60); }

.sml-gr__grid{
  margin-top: 16px;
  display:grid;
  gap: 14px;
}

/* Default grid */
.sml-gr--grid .sml-gr__grid,
.sml-gr__grid[data-layout="grid"]{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px){
  .sml-gr--grid .sml-gr__grid,
  .sml-gr__grid[data-layout="grid"]{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px){
  .sml-gr--grid .sml-gr__grid,
  .sml-gr__grid[data-layout="grid"]{ grid-template-columns: 1fr; }
}

/* Carousel layout (horizontal scroll, no library) */
.sml-gr--carousel .sml-gr__grid,
.sml-gr__grid[data-layout="carousel"]{
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 420px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.sml-gr--carousel .sml-gr__grid::-webkit-scrollbar{ height: 10px; }
.sml-gr--carousel .sml-gr__grid::-webkit-scrollbar-thumb{ background: rgba(var(--sml-ink-rgb), 0.18); border-radius: 999px; }

.sml-gr--carousel .sml-gr__card{ scroll-snap-align: start; }

.sml-gr__card{
  border-radius: 22px;
  border: 1px solid rgba(var(--sml-ink-rgb), 0.10);
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(67,130,57,0.08), transparent 60%),
    rgba(var(--sml-surface-rgb), 0.92);
  box-shadow: var(--sml-shadow-sm);
  padding: 16px;
  position: relative;
  overflow:hidden;
}

.sml-gr__card::before{
  content:"";
  position:absolute;
  inset:0;
  background: url("../img/noise.png") repeat;
  opacity: 0.05;
  pointer-events:none;
}

.sml-gr__card > *{ position: relative; }

.sml-gr__card-top{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sml-gr__author{
  font-family: var(--sml-font-ui);
  font-weight: var(--sml-w-semibold);
  letter-spacing: -0.01em;
}

.sml-gr__rating{ display:inline-flex; gap: 2px; }

.sml-gr__date{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(var(--sml-ink-rgb), 0.56);
}

.sml-gr__text{
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(var(--sml-ink-rgb), 0.78);
}

@media (hover:hover) and (pointer:fine){
  .sml-gr__card{ transition: transform var(--sml-dur-3) var(--sml-ease-out), box-shadow var(--sml-dur-3) var(--sml-ease-out), border-color var(--sml-dur-3) var(--sml-ease-out); }
  .sml-gr__card:hover{
    transform: translateY(-2px);
    box-shadow: var(--sml-shadow-md);
    border-color: rgba(var(--sml-ink-rgb), 0.16);
  }
}

/* Error box */
.sml-gr-error{
  border-radius: 18px;
  border: 1px solid rgba(190, 20, 30, 0.22);
  background: rgba(190, 20, 30, 0.06);
  padding: 14px;
}

.sml-code{
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.06);
  overflow:auto;
}

@media (max-width: 640px){
  .sml-gr__header{ flex-direction: column; align-items: flex-start; }
}
