/* =========================================================
   Worksonics — Reviews page styles (reviews.html only)
   ========================================================= */

/* =========================================================
   HERO — "Trusted by leaders"
   Like the home hero, the background (a wall of client portraits
   instead of the video) starts at the very top, behind the glass
   header, under a dark green shade. Portraits keep their original
   proportions; text follows the site pattern (eyebrow, heading, text), centred.
   Wall pattern (9 columns): 2 tall | short+tall | tall | short |
   tall | short | tall | short+tall | 2 tall — tiles hang from the top.
   ========================================================= */
.ws-rh {
  --gap: 12px;
  --rate-half: 100px;   /* half the ratings strip height: the part that sits inside the hero */
  --col: calc((100vw - 8 * var(--gap)) / 9);
  --tall: calc(var(--col) / 0.82);   /* original portrait proportion */
  --short: calc(var(--col) * 0.87);
  position: relative;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text-on-dark);
  background: var(--color-dark);
  isolation: isolate;
}

/* ---------- Background: portrait wall ---------- */
.ws-rh__wall {
  position: absolute;
  inset: 0 0 auto;
  z-index: -2;
  height: calc(var(--tall) * 2 + var(--gap));
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: var(--gap);
  overflow: hidden;
}
/* background motion (the "video"): columns breathe up and down out of step */
.ws-rh__col { display: flex; flex-direction: column; gap: var(--gap); animation: ws-rh-drift 9s ease-in-out infinite alternate; }
.ws-rh__col:nth-child(even) { animation-delay: -4.5s; }
.ws-rh__col:nth-child(3n) { animation-duration: 11s; }
@keyframes ws-rh-drift { from { transform: translateY(-18px); } to { transform: translateY(10px); } }

.ws-rh__tile { position: relative; display: block; flex: none; overflow: hidden; background: var(--color-dark-raised); }
/* green tint over each portrait — fades away on hover (same idea as the home industries rows) */
.ws-rh__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 43, 38, 0.35), rgba(6, 43, 38, 0.7));
  transition: opacity var(--dur-fill) var(--ease);
}
/* brand gradient frame appears on hover (dark top-left → lime bottom-right) */
.ws-rh__tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.35) 50%, var(--color-accent) 100%);   /* same as .ws-gb--on-dark */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-fill) var(--ease);
}
.ws-rh__tile--tall { height: var(--tall); }
.ws-rh__tile--short { height: var(--short); }
.ws-rh .ws-rh__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter var(--dur-fill) var(--ease), transform var(--dur-fill) var(--ease);
}
.ws-rh__tile:hover::after { opacity: 0; }
.ws-rh__tile:hover::before { opacity: 1; }
.ws-rh .ws-rh__tile:hover img { filter: none; transform: scale(1.05); }

/* Same shade as the home hero: solid on the left behind the text,
   fading to the right, bottom fade, lime glow bottom-right */
.ws-rh__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;   /* lets the portraits underneath react to hover */
  background:
    var(--glow-corner),
    radial-gradient(ellipse 50% 45% at 50% 72%, rgba(6, 43, 38, 0.95), transparent 75%),
    linear-gradient(0deg, rgba(6, 43, 38, 0.95) 0%, rgba(6, 43, 38, 0) 45%);
}

/* ---------- First screen ---------- */
.ws-rh__content {
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: calc(var(--rate-half) + var(--space-8));
  text-align: center;
  pointer-events: none;
}
.ws-rh__content > * { pointer-events: auto; }
.ws-rh__eyebrow { color: var(--color-accent); }
.ws-rh__title {
  max-width: 700px;
  margin: 0 0 var(--space-5);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text-on-dark);
}
.ws-rh__desc { max-width: 520px; margin: 0 auto; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-on-dark-muted); }

/* =========================================================
   RATINGS STRIP — sits on the hero's bottom edge: half in the
   dark hero, half over the light section below
   ========================================================= */
.ws-rate {
  position: relative;
  z-index: 5;
  margin-top: -100px;           /* = --rate-half: top half overlaps the hero */
  font-family: var(--font);
  background: linear-gradient(180deg, transparent 50%, var(--color-bg) 50%);   /* bottom half sits on the light section */
}
.ws-rate__panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(10, 58, 51, 0.92), rgba(6, 43, 38, 0.96));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg);
}
.ws-rate__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
  padding: var(--space-6) var(--space-5);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-on-dark);
  transition: background-color var(--dur-fill) var(--ease), border-color var(--dur-fill) var(--ease), transform var(--dur-fill) var(--ease);
}
.ws-rate__card + .ws-rate__card::before {     /* vertical divider between cards */
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-8) / 2 - 1px);
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: var(--line-on-dark);
}
.ws-rate__card:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--color-accent); transform: translateY(-3px); }

.ws-rate__logo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 64px;
}
.ws-rate .ws-rate__logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 64px; }
.ws-rate__body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ws-rate__top { display: flex; align-items: center; gap: var(--space-4); }
.ws-rate__score { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: 1; letter-spacing: var(--ls-heading); color: var(--text-on-dark); }
.ws-rate__meta { display: flex; flex-direction: column; gap: 4px; }
.ws-rate__stars { display: flex; gap: 2px; }
.ws-rate__stars svg { width: 18px; height: 18px; fill: var(--color-accent); }
.ws-rate__count { font-size: var(--fs-small); color: var(--text-on-dark-muted); }
.ws-rate__link { align-self: flex-start; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.06em; }
.ws-rate__link .ws-icon { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .ws-rh__col { animation: none; }
}

/* =========================================================
   REVIEWS LIST — light section (the 60%)
   Grid rhythm, repeating every 5 reviews:
     row A: one coloured review (2 columns) + one simple review
     row B: three simple reviews
   JS marks every 5th visible review as coloured (.is-feat),
   so the rhythm holds after filtering.
   ========================================================= */
.ws-rvl {
  padding: var(--space-8) 0 var(--space-9);
  font-family: var(--font);
  background: var(--color-bg);
}
.ws-rvl__head { max-width: 760px; margin: 0 auto var(--space-7); text-align: center; }
.ws-rvl__eyebrow { color: var(--link); }
.ws-rvl__title { margin: 0 0 var(--space-4); font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); color: var(--text-on-light); text-wrap: balance; }
.ws-rvl__sub { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-on-light-muted); }

/* filters */
.ws-rvf { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-bottom: var(--space-7); }
.ws-rvf__btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--line-on-light);
  background: transparent;
  font-family: var(--font); font-size: var(--fs-button); font-weight: var(--fw-button); letter-spacing: var(--ls-button); text-transform: var(--tt-button);
  color: var(--text-on-light);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.ws-rvf__btn span { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-on-light-muted); transition: color var(--dur-fast) var(--ease); }
.ws-rvf__btn:focus { background: transparent; color: var(--text-on-light); }
.ws-rvf__btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-dark); }
.ws-rvf__btn:hover span { color: var(--color-dark); }
.ws-rvf__btn.is-active, .ws-rvf__btn.is-active:focus { background: var(--color-dark); border-color: var(--color-dark); color: var(--text-on-dark); }
.ws-rvf__btn.is-active span { color: var(--color-accent); }

/* grid */
.ws-rvl__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); align-items: stretch; }

/* ---------- simple review ---------- */
.ws-rv {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-6);
  background: #fff;
  border: 1px solid var(--line-on-light);
  box-shadow: var(--shadow-sm);
  color: var(--text-on-light);
  transition: transform var(--dur-fill) var(--ease), box-shadow var(--dur-fill) var(--ease), border-color var(--dur-fill) var(--ease);
}
.ws-rv[hidden] { display: none; }
.ws-rv:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-dark); }

.ws-rv__mark { position: absolute; top: var(--space-6); right: var(--space-6); width: 36px; height: 36px; fill: rgba(6, 43, 38, 0.08); transition: fill var(--dur-fill) var(--ease); }
.ws-rv:hover .ws-rv__mark { fill: var(--color-accent); }

.ws-rv__head { display: flex; align-items: center; gap: var(--space-4); padding-right: 48px; }
.ws-rvl .ws-rv__avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.ws-rv__who { display: flex; flex-direction: column; min-width: 0; }
.ws-rv__name { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.ws-rv__company { font-size: var(--fs-small); color: var(--text-on-light-muted); }
.ws-rvl .ws-rv__src { flex: none; width: 20px; height: 20px; margin-left: auto; }

.ws-rv__meta { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-4) 0 var(--space-3); }
.ws-rv__stars { display: flex; gap: 2px; }
.ws-rv__stars svg { width: 16px; height: 16px; fill: var(--warning); }
.ws-rv__date { font-size: var(--fs-small); color: var(--text-on-light-muted); }

.ws-rv__text { margin: 0 0 var(--space-5); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-on-light); }
.ws-rv__text p { margin: 0 0 var(--space-3); }
.ws-rv__text p:last-child { margin-bottom: 0; }
/* 4 lines, then "Read more" expands the full review */
.ws-rv__text:not(.is-open) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}
.ws-rv__text:not(.is-open) p { display: inline; }
.ws-rv__text:not(.is-open) p + p::before { content: " "; }

.ws-rv__toggle {
  align-self: flex-start;
  margin: calc(var(--space-3) - var(--space-5)) 0 var(--space-5);
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font); font-size: var(--fs-small); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--link);
  cursor: pointer;
}
.ws-rv__toggle[hidden] { display: none; }
.ws-rv__toggle:hover, .ws-rv__toggle:focus { background: none; color: var(--color-dark); text-decoration: underline; text-underline-offset: 4px; }

.ws-rv__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line-on-light); }
.ws-rv__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ws-rv__tags li { padding: 4px 10px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.04em; background: rgba(6, 43, 38, 0.06); color: var(--text-on-light); }
.ws-rv__link { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--link); text-decoration: none; }
.ws-rv__link .ws-icon { width: 14px; height: 14px; }
.ws-rv__link:hover { color: var(--color-dark); }

/* ---------- coloured review: spans two columns ---------- */
.ws-rv.is-feat {
  grid-column: span 2;
  padding: var(--space-7) var(--space-8);
  background:
    radial-gradient(ellipse 60% 70% at 100% 100%, rgba(207, 245, 90, 0.16), transparent 65%),
    linear-gradient(135deg, var(--color-dark-raised), var(--color-dark));
  border-color: transparent;
  color: var(--text-on-dark);
}
.ws-rv.is-feat:hover { border-color: var(--color-accent); box-shadow: var(--shadow-lg); }
.ws-rv.is-feat .ws-rv__mark { top: var(--space-6); right: var(--space-8); width: 64px; height: 64px; fill: var(--color-accent); opacity: 0.9; }
.ws-rv.is-feat .ws-rv__head { padding-right: 80px; }
.ws-rv.is-feat .ws-rv__company,
.ws-rv.is-feat .ws-rv__date { color: var(--text-on-dark-muted); }
.ws-rv.is-feat .ws-rv__stars svg { fill: var(--color-accent); }
.ws-rv.is-feat .ws-rv__text { font-size: var(--fs-eyebrow); line-height: 1.6; color: var(--text-on-dark); }
.ws-rv.is-feat .ws-rv__toggle { color: var(--color-accent); }
.ws-rv.is-feat .ws-rv__toggle:hover, .ws-rv.is-feat .ws-rv__toggle:focus { color: #fff; }
.ws-rv.is-feat .ws-rv__foot { border-top-color: var(--line-on-dark); }
.ws-rv.is-feat .ws-rv__tags li { background: rgba(255, 255, 255, 0.08); color: var(--text-on-dark); }
.ws-rv.is-feat .ws-rv__link { color: var(--color-accent); }
.ws-rv.is-feat .ws-rv__link:hover { color: #fff; }
.ws-rvl .ws-rv.is-feat .ws-rv__src { filter: brightness(0) invert(1); }

.ws-rvl__more { display: flex; justify-content: center; margin-top: var(--space-7); }
.ws-rvl__more[hidden] { display: none; }

/* =========================================================
   Tablet (≤ 1024px) and mobile (≤ 767px)
   ========================================================= */
@media (max-width: 1024px) {
  /* portrait wall: 5 columns, so the faces stay a readable size */
  .ws-rh { --col: calc((100vw - 4 * var(--gap)) / 5); }
  .ws-rh__wall { grid-template-columns: repeat(5, 1fr); }
  .ws-rh__col:nth-child(n+6) { display: none; }
  .ws-rate__panel { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .ws-rate { margin-top: -60px; }
  .ws-rh__content { padding-bottom: calc(60px + var(--space-8)); }
  .ws-rvl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
}
@media (max-width: 767px) {
  .ws-rh { --gap: 8px; --col: calc((100vw - 2 * var(--gap)) / 3); }
  .ws-rh__wall { grid-template-columns: repeat(3, 1fr); }
  .ws-rh__col:nth-child(n+4) { display: none; }
  .ws-rh__content { min-height: 560px; }
  .ws-rate__card { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-5); }
  .ws-rate__top { flex-wrap: wrap; }
  .ws-rvl__grid { grid-template-columns: minmax(0, 1fr); }
  .ws-rv.is-feat { grid-column: auto; padding: var(--space-6) var(--space-5); }
  .ws-rv.is-feat .ws-rv__mark { right: var(--space-5); width: 44px; height: 44px; }
}
