/* =========================
   FILTERS (reference-style pill)
   ========================= */

.tg-wrapper{
  text-align: center;
  background: transparent;
}

.tg-filters{
  display: inline-flex;          /* content-width pill */
  justify-content: center;
  align-items: stretch;
  gap: 0;
  margin: 0 auto 40px;
  background: #3f2b78;
  border-radius: 999px;
  overflow: hidden;
}

.tg-filter{
  border: 0;
  background: transparent;
  color: #fff;
  padding: 18px 42px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.tg-filter + .tg-filter{
  border-left: 1px solid rgba(255,255,255,.18);
}

.tg-filter.is-active{
  background: #ff7a5c;
  color: #fff;
}

/* Clean focus (no ugly theme outline, still accessible) */
.tg-filter:focus,
.tg-filter:active{
  outline: none;
  box-shadow: none;
}

.tg-filter:focus-visible{
  outline: 2px solid rgba(255,255,255,.75);
  outline-offset: -2px;
  box-shadow: none;
}

/* =========================
   FILTER CHANGE ANIMATION
   Elementor-like: exit -> enter (sequenced)
   Uses classes: tg-exit, tg-hidden, tg-enter
   ========================= */

.tg-card{
  will-change: opacity, transform;
  text-align: center;
}

/* EXIT: shrink almost to zero + fade out */
.tg-card.tg-exit{
  opacity: 0;
  transform: scale(0.01);
  transition: opacity 420ms cubic-bezier(.4,0,.2,1),
              transform 420ms cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

/* When fully hidden, remove from grid layout */
.tg-card.tg-hidden{
  display: none;
}

/* ENTER: start from “almost nothing”, scale up + fade in */
.tg-card.tg-enter{
  animation: tgEnter 650ms cubic-bezier(.16,1,.3,1) both;
}

@keyframes tgEnter{
  0%   { opacity: 0; transform: scale(0.01); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .tg-card,
  .tg-card.tg-enter{
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


/* =========================
   GRID / LAYOUT (true 4-col)
   ========================= */

.tg-grid{
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 40px 36px;
  align-items: start;
}

@media (min-width: 600px){
  .tg-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px){
  .tg-grid{ grid-template-columns: repeat(4, 1fr); }
}

/* =========================
   PHOTO (square, borderless)
   ========================= */

.tg-photo{
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background: transparent;
}

.tg-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* orange accent bar under photo */
.tg-photo::after{
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 72px;
  height: 8px;
  background: #ff7a5c;
}

/* =========================
   TYPOGRAPHY + HOVER NAME EFFECT
   ========================= */

.tg-name{
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.15;
  color: #3f2b78;

  display: inline-block;
  transform-origin: center;
  transition: transform 160ms ease, color 160ms ease;
}

.tg-name a{
  color: inherit;
  text-decoration: none;
}

.tg-description{
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: rgba(63,43,120,.72);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;

  transition: transform 160ms ease;
}

/* Hover specifically over the name */
.tg-name:hover{
  transform: scale(1.12);
  color: #ff7a5c;
}

/* Push description down while name is hovered */
.tg-name:hover + .tg-description{
  transform: translateY(4px);
}

/* Keyboard accessibility (if name is a link) */
.tg-name:focus-within{
  transform: scale(1.12);
  color: #ff7a5c;
}

.tg-name:focus-within + .tg-description{
  transform: translateY(4px);
}
