/* ─── Tri-image Carousel ─── */

.tri-carousel {
  display: flex;
  align-items: stretch;
  gap: 9rem;
  height: 70vh;
  min-height: 300px;
  width: 100%;
  padding-right: 8rem;
}

/* ─── Left: horizontal image row ─── */
.tri-left {
  flex: 2;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 21px;
  overflow: visible;
  clip-path: inset(0 0 -100vh 0);
}

.tri-item {
  flex: 1;
  height: 40%;
  min-width: 0;
  overflow: visible;
  cursor: pointer;
  position: relative;
  transition:
    height 1.1s cubic-bezier(0.7, 0, 0.3, 1),
    flex-grow 1.1s cubic-bezier(0.7, 0, 0.3, 1);
}

.tri-item-img {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tri-item-label {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  border-top: 1.5px solid rgba(62, 43, 47, 0.65);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.65s ease;
  pointer-events: none;
  z-index: 2;
}

.tri-item:not(.active):hover .tri-item-label {
  clip-path: inset(0 0% 0 0);
}

.tri-label-role,
.tri-label-name {
  color: #3e2b2f;
  margin: 0;
  white-space: nowrap;
  line-height: 1;
}

.tri-label-role {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: rgba(62, 43, 47, 0.65);
  text-transform: uppercase;
}

.tri-label-name {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tri-item.active {
  flex-grow: 1.6;
  height: 100%;
}

.tri-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
  filter: brightness(0.7);
  transition: filter 0.35s ease;
}

.tri-item.active img,
.tri-item:hover img {
  filter: brightness(1);
}

.tri-social-link {
  text-decoration: none;
}

.tri-social-link:hover {
  text-decoration: underline;
}

/* ─── Right: text panels ─── */
.tri-right {
  flex: 1;
  min-width: 0;
  position: relative;
}

.tri-panel {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.tri-panel.active {
  opacity: 1;
  pointer-events: auto;
}

.tri-panel-header {
  position: absolute;
  width: 100%;
  top: 33.33%;
  transform: translateY(-100%);
}

.tri-panel > p {
  position: absolute;
  width: 100%;
  top: 33.33%;
  margin-top: 1rem;
}

/* ─── Mobile track: hidden on desktop ─── */
.tri-mobile-track {
  display: none;
}

/* ─── Responsive: tablet + phone (< 1000px) ─── */
@media (max-width: 1040px) {
  .tri-carousel {
    height: auto;
    padding-right: 0;
    display: block;
  }

  .tri-left,
  .tri-right {
    display: none;
  }

  .tri-mobile-track {
    display: flex;
    flex-direction: row;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    height: 80vw;
    gap: 1rem;
    width: 100vw;
    margin-left: -3.5vw;
  }

  .tri-mobile-track::-webkit-scrollbar {
    display: none;
  }

  .tri-mobile-slide {
    flex: none;
    width: 93%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    opacity: 0.4;
    transition: opacity 0.4s ease;
  }

  .tri-mobile-slide.active {
    opacity: 1;
  }

  .tri-mobile-img {
    flex: none;
    width: 42%;
    height: 100%;
    overflow: hidden;
  }

  .tri-mobile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
  }

  .tri-mobile-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.25rem 1.25rem 1.25rem 0;
  }
}

/* ─── margin correction: grid.css padding jumps to 9% at 768px ─── */
@media (max-width: 768px) {
  .tri-mobile-track {
    margin-left: -9vw;
  }
}

/* ─── Phone (< 600px) ─── */
@media (max-width: 599px) {
  .tri-mobile-track {
    height: auto;
    gap: 0.75rem;
  }

  .tri-mobile-slide {
    flex-direction: column;
    align-items: stretch;
    width: 87%;
    height: auto;
    gap: 0;
  }

  .tri-mobile-img {
    width: 100%;
    flex: none;
    height: auto;
    aspect-ratio: 3/4;
  }

  .tri-mobile-text {
    flex: none;
    padding: 0.9rem 0.75rem;
    justify-content: flex-start;
    gap: 0.35rem;
  }
}
