/* =============================================
   TEAM ACCORDION — shared by Core Team & Management Team
   Row of profile cards → click a card's arrow → one full-width
   biography panel opens below the current row (accordion).
   Only one open at a time. (Markup is rendered by
   assets/js/team-accordion.js from an inline data array.)
   ============================================= */

.tm-section {
  padding: 90px 20px 110px;
  background: linear-gradient(180deg, #ffffff 0%, #faf6f1 100%);
}

.tm-container {
  max-width: 1260px;
  margin: 0 auto;
}

/* ===== Heading ===== */
.tm-head {
  text-align: center;
  margin-bottom: 52px;
}

.tm-pill {
  display: inline-block;
  padding: 7px 20px;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 18px;
}

.tm-head h2 {
  font-size: 42px;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1.15;
  margin: 0;
}

.tm-head h2 span {
  color: var(--maroon);
}

.tm-head .tm-line {
  width: 60px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  margin: 18px auto 0;
}

/* ===== Card grid — centred flex so any count stays balanced
   (2 cards for Core Team, 5 for Management Team). Column count is
   fixed per breakpoint via the card's flex-basis. ===== */
.tm-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 22px;
}

/* ===== Card (5 per row on desktop) ===== */
.tm-card {
  flex: 0 0 calc((100% - 88px) / 5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(212, 148, 58, 0.14);
  border-radius: 20px;
  padding: 32px 22px 26px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 30px rgba(40, 12, 26, 0.06);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}
.tm-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(139, 26, 74, 0.14);
  border-color: rgba(212, 148, 58, 0.32);
}
.tm-card.is-active {
  border-color: var(--maroon);
  box-shadow: 0 22px 48px rgba(139, 26, 74, 0.18);
}
.tm-card:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 3px;
}

.tm-photo {
  width: 130px;
  height: 134px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(40, 12, 26, 0.16);
  background: #ded9d4;
  flex-shrink: 0;
}
.tm-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.5s ease;
}
.tm-card:hover .tm-photo img {
  transform: scale(1.05);
}

.tm-info {
  margin-top: 16px;
}
.tm-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 3px;
  line-height: 1.3;
}
.tm-desig {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--gold-dark);
  text-transform: uppercase;
}

/* Down arrow / expand icon — pinned to the bottom */
.tm-arrow {
  margin-top: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon-tint);
  color: var(--maroon);
  margin-top: 18px;
  transition:
    transform 0.42s cubic-bezier(0.2, 0.7, 0.3, 1),
    background 0.3s ease,
    color 0.3s ease;
}
.tm-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tm-card:hover .tm-arrow {
  background: var(--maroon);
  color: #fff;
}
.tm-card.is-active .tm-arrow {
  background: var(--maroon);
  color: #fff;
  transform: rotate(180deg);
}

/* ===== Full-width accordion panel ===== */
.tm-panel {
  flex: 0 0 100%;
  width: 100%;
  overflow: hidden;
  height: 0;
  /* height is animated inline by JS; this drives the smooth open/close */
  transition: height 0.42s cubic-bezier(0.25, 0.8, 0.35, 1);
  will-change: height;
}
.tm-panel-inner {
  background: linear-gradient(150deg, #ffffff 0%, #faf3ec 100%);
  border: 1px solid rgba(212, 148, 58, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(40, 12, 26, 0.10);
  padding: 34px;
}

.tm-panel-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 34px;
  align-items: start;
}
.tm-panel-media {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(40, 12, 26, 0.16);
  background: #ded9d4;
}
.tm-panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  aspect-ratio: 1 / 1.05;
}
.tm-panel-text h3 {
  font-size: 26px;
  font-weight: 800;
  color: var(--charcoal);
  margin: 0 0 4px;
}
.tm-panel-role {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 16px;
}
.tm-panel-text p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--charcoal-light);
  margin: 0 0 12px;
  text-align: justify;
}
.tm-panel-text h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 18px 0 12px;
}
.tm-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 26px;
}
.tm-highlights li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--charcoal-light);
}
.tm-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--maroon));
}
.tm-vision {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: var(--maroon-tint);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  font-style: italic;
  color: var(--charcoal);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .tm-panel { transition: none; }
  .tm-arrow { transition: background 0.3s ease, color 0.3s ease; }
  .tm-card { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
}

/* ===== Responsive ===== */
/* Tablet — 3 per row; panel still spans the full width below the row */
@media (max-width: 1024px) {
  .tm-card { flex-basis: calc((100% - 44px) / 3); }
  .tm-head h2 { font-size: 34px; }
}

/* Small tablet — 2 per row; panel stacks image over text */
@media (max-width: 760px) {
  .tm-card { flex-basis: calc((100% - 22px) / 2); }
  .tm-panel-grid { grid-template-columns: 1fr; gap: 22px; }
  .tm-panel-media { max-width: 220px; margin: 0 auto; }
  .tm-highlights { grid-template-columns: 1fr; }
}

/* Mobile — single card per row; bio opens directly below the tapped card */
@media (max-width: 520px) {
  .tm-section { padding: 60px 16px 70px; }
  .tm-grid { max-width: 380px; margin: 0 auto; }
  .tm-card {
    flex-basis: 100%;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    padding: 18px;
  }
  .tm-photo { width: 92px; height: 96px; }
  .tm-info { margin-top: 0; flex: 1; }
  .tm-arrow { margin: 0; }
  .tm-head h2 { font-size: 27px; }
  .tm-panel-inner { padding: 24px; }
}
