/* =========================================================
   Our Team (about-team.html) · page-only styles, prefix tm-
   Prototype options (on <html>):
     data-tm-layout       groups (default) | lead   "Core + Exec" | "Pres & VP first"
     data-tm-look         circle (default, Nov 22) | photo  "Portraits" | "Photo cards"
     data-tm-group-color  gray (default) | red      group title color
   ========================================================= */

/* ---------- Board ----------
   One list: group titles, the 13 officers and the 2 faculty advisors.
   Cards wrap in rows of --n and the last row is centered, so no group leaves one lonely card.
   (Divi: each group is its own row; the column holding the Person modules gets the class so-tm-grid.) */
.tm-board {
  --n: 5; --gap: 24px; --rgap: 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--rgap) var(--gap);
}
.tm-board > .tm-card { flex: 0 0 calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)); min-width: 0; }

/* Group titles ("Core officers", "Executive board", "Faculty advisors"): small uppercase label,
   thin rule running to the right. (Divi: Text module, H3, class so-tm-group; the rule is its ::after) */
.tm-group, .tm-break { flex: 0 0 100%; }
.tm-group {
  display: flex; align-items: center; gap: 18px; margin: 36px 0 -2px;
  font: 700 14px/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.tm-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tm-board > .tm-group:first-child,
.tm-board > .tm-group--all + .tm-group { margin-top: 0; }
body .tm-board > h3.tm-group { font-size-adjust: var(--fsa-body, none) !important; }
.tm-break { height: 0; }
/* Option tm-group-color */
[data-tm-group-color="red"] .tm-group { color: var(--red); }

/* Layouts. "Core + Exec": group titles, no break. "Pres & VP first": the pair gets its own line,
   and one "Officers" title replaces the Core / Exec titles. */
[data-tm-layout="groups"] :is(.tm-break, .tm-group--all),
[data-tm-layout="lead"] :is(.tm-group--core, .tm-group--exec) { display: none; }
/* the break adds an empty line; pulling the pair's bottom margin back keeps the spacing at one gap (+12px) */
[data-tm-layout="lead"] .tm-card--lead { margin-bottom: calc(12px - var(--rgap)); }

/* ---------- Card: shared parts (Divi: Person module, preset New - Officer, class so-officer) ---------- */
.tm-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 32px 22px 28px; border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(var(--surface) 0 88px, var(--white) 88px);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.js .tm-card.reveal.is-in:hover, .tm-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: transparent; }

/* Photo: a real headshot (img) or the placeholder silhouette (svg) */
.tm-card__photo {
  width: 120px; height: 120px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: end center;
  background: color-mix(in srgb, var(--second) 9%, var(--white));
  color: color-mix(in srgb, var(--second) 26%, var(--white));
  border: 4px solid var(--white); box-shadow: 0 0 0 1px var(--line), 0 6px 16px -8px rgba(16, 24, 40, .3);
}
.tm-card__photo svg { width: 100%; height: 100%; fill: currentColor; }
.tm-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.tm-card__body { display: flex; flex-direction: column; align-items: inherit; width: 100%; }

/* roles that wrap to 2 lines keep the names in a row aligned: reserve 2 lines; a one-line role is centered in that space */
.tm-card__role { display: flex; align-items: center; justify-content: center; min-height: 2.7em; margin: 18px 0 8px; font-size: 12.5px; font-weight: 700; line-height: 1.35; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.tm-card--adv .tm-card__role { min-height: 0; }
/* a two-word role (Treasurer Liaison) breaks after each word, so it wraps to 2 lines like the Exec roles beside it
   (Divi: extra module class so-officer--stack on that Person module) */
.tm-card--stack .tm-card__role { width: min-content; margin-inline: auto; }
.tm-card__name { margin: 0 0 4px; font: 600 21px/1.2 var(--font-head); color: var(--ink); }
body .tm-card__name { font-size-adjust: var(--fsa-head, none) !important; }
.tm-card__meta { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- President + VP as wide sideways cards (layout "Pres & VP first", both looks) ---------- */
[data-tm-layout="lead"] .tm-card--lead { --n: 2; flex-direction: row; align-items: center; text-align: left; }
[data-tm-layout="lead"] .tm-card--lead .tm-card__body { align-items: flex-start; }
[data-tm-layout="lead"] .tm-card--lead .tm-card__role { min-height: 0; margin-top: 0; justify-content: flex-start; font-size: 13px; }
[data-tm-layout="lead"] .tm-card--lead .tm-card__meta { font-size: 16px; }

/* ---------- Look 1: Photo cards ---------- */
[data-tm-look="photo"][data-tm-layout="lead"] .tm-board { --n: 4; }               /* 11 below the pair: 4 + 4 + 3 */
[data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead {
  gap: 30px; padding: 30px 34px;
  background: linear-gradient(90deg, var(--surface) 0 112px, var(--white) 112px);
}
[data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 148px; height: 148px; }
[data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__name { font-size: 27px; }

/* ---------- Look 2: Portraits (default: round photo, a card box only on hover) ---------- */
[data-tm-look="circle"] .tm-board { --rgap: 12px; }                                /* exec 9: 5 + 4; the cards' own padding adds the rest of the space */
[data-tm-look="circle"][data-tm-layout="lead"] .tm-board { --n: 6; }               /* 11: 6 + 5 */
/* no box at rest; on hover a white card lifts out around the portrait, with more room below the text than above the photo, like a normal card
   (Divi: Person module padding 20 / 12 / 30, hover background white + box shadow + move up 4px) */
[data-tm-look="circle"] .tm-card { padding: 20px 12px 30px; border: 0; border-radius: 8px; background: none; }
.js [data-tm-look="circle"] .tm-card.reveal.is-in:hover, [data-tm-look="circle"] .tm-card:hover { background: var(--white); box-shadow: var(--shadow-card); }
[data-tm-look="circle"] .tm-card__photo { width: 124px; height: 124px; border: 0; box-shadow: 0 0 0 6px var(--white), 0 0 0 7px var(--line); transition: box-shadow .3s; }
[data-tm-look="circle"] .tm-card:hover .tm-card__photo { box-shadow: 0 0 0 6px var(--white), 0 0 0 8px var(--red); }
/* role labels: tighter tracking so every Exec role ("Event Supervisor Coordinator") fits in two lines */
[data-tm-look="circle"] .tm-card__role { margin-top: 22px; letter-spacing: .1em; }
/* the pair: photo beside the text, each centered in its half of the row */
[data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead { justify-content: center; gap: 30px; }
[data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 168px; height: 168px; }
[data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__body { width: auto; }
[data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__name { font-size: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tm-card { padding-inline: 12px; }
  /* 5 narrower cards per row: tighter role labels, so "Event Supervisor Coordinator" still fits in two lines */
  .tm-card__role { font-size: 12px; letter-spacing: .08em; }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead { gap: 22px; padding: 26px; background: linear-gradient(90deg, var(--surface) 0 92px, var(--white) 92px); }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 124px; height: 124px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-board { --n: 4; }             /* 11: 4 + 4 + 3 */
}
@media (max-width: 980px) {
  .tm-board, [data-tm-look][data-tm-layout] .tm-board { --n: 3; }                                 /* exec 9: 3 + 3 + 3 */
  [data-tm-look="circle"] .tm-card__photo { width: 112px; height: 112px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 128px; height: 128px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead { gap: 22px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__name { font-size: 23px; }
  /* Photo cards: the pair goes back to upright cards, side by side */
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead { flex-direction: column; text-align: center; background: linear-gradient(var(--surface) 0 88px, var(--white) 88px); }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__body { align-items: center; }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__role { justify-content: center; margin-top: 18px; }
  /* "Core + Exec": the 4 core officers sit 2 + 2 (the break shows), at the same card width as the Exec rows */
  [data-tm-layout="groups"] .tm-break { display: block; }
  [data-tm-layout="groups"] .tm-card--lead { margin-bottom: calc(0px - var(--rgap)); }
  /* 3 per row: most Exec roles fit on one line in photo cards, so Treasurer Liaison stays on one too */
  [data-tm-look="photo"] .tm-card--stack .tm-card__role { width: auto; }
}
/* Phone */
@media (max-width: 640px) {
  .tm-board { --gap: 14px; --rgap: 14px; }
  .tm-group { margin-top: 28px; font-size: 13px; gap: 14px; }
  .tm-card--stack .tm-card__role { width: auto; margin-inline: 0; }

  /* Photo cards: one per row, photo beside the text (Divi: Person image left on phone) */
  [data-tm-look="photo"][data-tm-layout] .tm-board { --n: 1; }
  [data-tm-look="photo"] .tm-card,
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead { --n: 1; flex-direction: row; align-items: center; text-align: left; gap: 18px; padding: 18px 20px; background: var(--white); }
  [data-tm-look="photo"] .tm-card__photo { width: 76px; height: 76px; border-width: 0; box-shadow: 0 0 0 1px var(--line); }
  [data-tm-look="photo"] .tm-card__body,
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__body { align-items: flex-start; }
  [data-tm-look="photo"] .tm-card__role,
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__role { display: block; min-height: 0; margin: 0 0 6px; font-size: 12px; }
  [data-tm-look="photo"] .tm-card__name { font-size: 19px; }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead { padding: 22px 20px; border-left: 3px solid var(--red); }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 92px; height: 92px; }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__name { font-size: 22px; }
  [data-tm-look="photo"][data-tm-layout="lead"] .tm-card--lead .tm-card__meta { font-size: 15px; }

  /* Portraits: two per row, last one centered; the President and VP each get a full sideways row */
  [data-tm-look="circle"][data-tm-layout] .tm-board { --n: 2; --rgap: 4px; }
  [data-tm-look="circle"] .tm-card { padding: 16px 8px 24px; }
  [data-tm-look="circle"] .tm-card__photo { width: 104px; height: 104px; box-shadow: 0 0 0 5px var(--white), 0 0 0 6px var(--line); }
  [data-tm-look="circle"] .tm-card__role { margin-top: 16px; font-size: 11.5px; }
  [data-tm-look="circle"] .tm-card__name { font-size: 18px; }
  [data-tm-look="circle"] .tm-card__meta { font-size: 14px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead { --n: 1; justify-content: flex-start; gap: 20px; padding-left: 8px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead:first-of-type { margin-bottom: -8px; }   /* 24px between the pair */
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__photo { width: 104px; height: 104px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__role { font-size: 12px; margin-bottom: 6px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__name { font-size: 21px; }
  [data-tm-look="circle"][data-tm-layout="lead"] .tm-card--lead .tm-card__meta { font-size: 14.5px; }
}
