/* =====================================================
   Testimonials Grid — testimonials-grid.css
   ===================================================== */

:root {
  --tg-gap: 20px;
  --tg-charcoal: #1c1c1c;
  --tg-warm-mid: #c8b89a;
}

/* ── WRAPPER ── */
.tg-wrapper {
  --tg-cols: 3;
  --tg-rows: 2;
  --tg-grid-w: min(90vw, 2400px);
  --tg-grid-h: calc(var(--tg-grid-w) * var(--tg-rows) / var(--tg-cols));
  --tg-cell-w: calc(
    (var(--tg-grid-w) - var(--tg-gap) * (var(--tg-cols) - 1)) / var(--tg-cols)
  );
  --tg-cell-h: calc(
    (var(--tg-grid-h) - var(--tg-gap) * (var(--tg-rows) - 1)) / var(--tg-rows)
  );

  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-family: inherit;
  padding: 0 0px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .tg-wrapper {
    --tg-grid-w: min(92vw, 900px);
  }
}

/* ── GRID WRAP ── */
.tg-grid-wrap {
  position: relative;
  width: var(--tg-grid-w);
  height: var(--tg-grid-h);
}

.tg-grid {
  display: grid;
  grid-template-columns: repeat(var(--tg-cols), var(--tg-cell-w));
  grid-template-rows: repeat(var(--tg-rows), var(--tg-cell-h));
  gap: var(--tg-gap);
  width: 100%;
  height: 100%;
}

/* ── THUMBNAIL ── */
.tg-thumb {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--tg-charcoal);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.tg-thumb:hover {
  transform: scale(1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0);
  z-index: 1;
}

.tg-thumb img,
.tg-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-thumb-placeholder {
  background: #333;
}

/* Dual gradient UI layer */
.tg-thumb-ui {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, transparent 45%),
    linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
}

/* Logo — top left */
.tg-thumb-logo {
  align-self: flex-start;
  height: 20px;
  display: flex;
  align-items: center;
}

.tg-logo-img {
  height: 100%;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.tg-logo-mark {
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Name + company — bottom right */
.tg-thumb-info {
  align-self: flex-end;
  text-align: right;
  line-height: 1.25;
}

.tg-thumb-person {
  font-size: 0.6rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tg-thumb-company {
  font-size: 0.55rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.04em;
}

/* Play hint — centre */
.tg-play-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.tg-play-hint svg {
  fill: #fff;
  width: 12px;
  height: 12px;
  margin-left: 2px;
}
.tg-thumb:hover .tg-play-hint {
  opacity: 1;
}

/* ── EXPANDED CARD ── */
.tg-expanded-card {
  position: absolute;
  background: var(--tg-charcoal);
  z-index: 100;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition:
    top 0.55s cubic-bezier(0.77, 0, 0.175, 1),
    left 0.55s cubic-bezier(0.77, 0, 0.175, 1),
    width 0.55s cubic-bezier(0.77, 0, 0.175, 1),
    height 0.55s cubic-bezier(0.77, 0, 0.175, 1);
}

.tg-expanded-card.tg-visible {
  display: flex;
}

/* Blurred poster bg */
.tg-card-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  filter: blur(18px) brightness(0.35);
  transform: scale(1);
  transition: opacity 0.35s ease 0.25s;
  pointer-events: none;
}

.tg-expanded-card.tg-open .tg-card-poster {
  opacity: 1;
}

/* Video — natural aspect ratio, centred */
.tg-card-video {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: #000;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0);
}

.tg-card-video.tg-active {
  opacity: 1;
}

/* Close button */
.tg-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7) rotate(-90deg);
  transition:
    opacity 0.25s ease 0.4s,
    transform 0.25s ease 0.4s,
    background 0.2s;
  z-index: 10;
}

.tg-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}
.tg-expanded-card.tg-open .tg-close-btn {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.tg-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tg-grid.tg-has-open .tg-thumb {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* ── ATTR ── */
.tg-attr {
  font-size: 0.75rem;
  color: var(--tg-warm-mid);
  letter-spacing: 0.04em;
  opacity: 0.6;
}

/* ── MOBILE STRIP + MODAL: hidden on desktop ── */
.tg-strip-wrap {
  display: none;
}
.tg-mobile-modal {
  display: none;
}

/* ══════════════════════════════
   MOBILE  ≤ 600px
══════════════════════════════ */
@media (max-width: 600px) {
  .tg-wrapper {
    padding: 0;
    gap: 10px;
    align-items: stretch;
  }

  .tg-attr {
    padding: 0 20px;
    align-self: center;
  }

  .tg-grid-wrap {
    display: none !important;
  }

  .tg-strip-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    overflow: hidden;
  }

  .tg-strip {
    display: flex;
    flex-direction: row;
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 4px 16px 8px;
  }

  .tg-strip::-webkit-scrollbar {
    display: none;
  }

  .tg-strip-thumb {
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: 30vw;
    width: 30vw;
    height: 30vw;
    scroll-snap-align: start;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--tg-charcoal);
  }

  .tg-strip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
  }

  .tg-strip-thumb .tg-play-hint {
    opacity: 1;
    width: 24px;
    height: 24px;
  }
  .tg-strip-thumb .tg-play-hint svg {
    width: 9px;
    height: 9px;
  }

  .tg-strip-thumb .tg-thumb-logo {
    height: 14px;
  }
  .tg-strip-thumb .tg-logo-mark {
    height: 14px;
    font-size: 0.45rem;
  }
  .tg-strip-thumb .tg-thumb-ui {
    padding: 5px;
  }
  .tg-strip-thumb .tg-thumb-person {
    font-size: 0.45rem;
  }
  .tg-strip-thumb .tg-thumb-company {
    font-size: 0.4rem;
  }

  .tg-strip-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-bottom: 4px;
  }

  .tg-strip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tg-warm-mid);
    opacity: 0.3;
    transition: opacity 0.2s;
  }

  .tg-strip-dot.tg-active {
    opacity: 1;
  }

  /* Mobile modal */
  .tg-mobile-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--tg-charcoal);
    z-index: 99999;
    flex-direction: column;
  }

  .tg-mobile-modal.tg-visible {
    display: flex !important;
  }

  .tg-mobile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .tg-mobile-modal-name {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tg-warm-mid);
  }

  .tg-mobile-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .tg-mobile-close svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
  }

  .tg-mobile-modal-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
  }

  .tg-mobile-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) brightness(0.35);
    transform: scale(1.08);
    display: block;
    pointer-events: none;
  }

  .tg-mobile-video {
    position: relative;
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    background: #000;
  }
}
