/* UBC — the members page: the register as a list, in the light edition's ink and gold */

.members-head { padding: clamp(150px, 15vw, 210px) 0 clamp(40px, 5vw, 64px); }
.members-head .display { font-size: clamp(44px, 6vw, 84px); }
.members-lede { max-width: 52ch; margin-top: 24px; font-size: clamp(18px, 1.4vw, 20px); color: var(--text); }

.members-stats { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); gap: 20px clamp(40px, 6vw, 96px); margin-top: clamp(40px, 5vw, 64px); }
.members-stats div { display: flex; flex-direction: column-reverse; gap: 8px; }
.members-stats dt { font-size: 15px; font-weight: 500; color: var(--dim); }
.members-stats dd { margin: 0; font-family: var(--display); font-size: clamp(34px, 3.6vw, 52px); line-height: 1; letter-spacing: .02em; color: var(--ivory); }
.members-stats div:last-child dd { color: var(--gold); }
.members-note { max-width: 60ch; margin-top: 32px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--dim); }

.members-roster { padding-bottom: var(--section); }

/* tools: one search line and two choices, set on the same baseline */
.roster-tools { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px clamp(24px, 3vw, 48px); align-items: end; padding-top: 40px; border-top: 1px solid var(--line); }
.roster-field { display: flex; flex-direction: column; gap: 10px; }
.roster-field label { font-size: 15px; font-weight: 500; color: var(--dim); }
.roster-field input, .roster-field select {
  width: 100%; padding: 10px 0 12px; border: 0; border-bottom: 1px solid rgba(23, 22, 26, .3); border-radius: 0;
  background: transparent; font: inherit; font-size: 18px; color: var(--ivory);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.roster-field input::placeholder { color: #8C877E; }
.roster-field select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238A6A30' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 4px center / 12px 8px;
}
.roster-field input:hover, .roster-field select:hover { border-bottom-color: rgba(23, 22, 26, .55); }
.roster-field input:focus, .roster-field select:focus { outline: none; border-bottom-color: var(--gold); box-shadow: 0 1px 0 var(--gold); }
.roster-field input:focus-visible, .roster-field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.roster-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 32px 0 8px; }
.roster-count { font-size: 15px; font-weight: 500; color: var(--dim); }


/* the list itself */
.roster { width: 100%; border-collapse: collapse; }
.roster thead th { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; font-weight: 500; text-align: left; color: var(--dim); }
.roster thead th:first-child, .roster td:first-child { padding-left: 0; }
.roster tbody tr { border-bottom: 1px solid var(--line-soft); transition: background-color .3s var(--ease); animation: roster-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
.roster tbody tr:hover { background: rgba(138, 106, 48, .045); }
.roster td { padding: 16px 12px; vertical-align: middle; color: var(--text); }
.roster td.r-seat { width: 96px; font-family: var(--display); font-size: 22px; letter-spacing: .04em; color: var(--gold); }
.r-name > span:last-child { font-family: var(--serif); font-size: 20px; color: var(--ivory); transition: color .3s var(--ease); }
.r-name { display: flex; align-items: center; gap: 14px; }
.r-mark {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 500; letter-spacing: .06em; color: var(--gold);
}
.roster tbody tr:hover .r-name > span:last-child { color: var(--gold-hi); }
.r-since { width: 80px; font-variant-numeric: tabular-nums; color: var(--dim); }
.r-link { width: 1%; white-space: nowrap; text-align: right; }
.r-link a { font-size: 14px; font-weight: 500; color: var(--gold); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .3s var(--ease), color .3s; }
.r-link a::after { content: " \2192"; }
.r-link a:hover, .r-link a:focus-visible { color: var(--gold-hi); text-decoration-color: currentColor; }
@keyframes roster-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.roster-empty { padding: 48px 0; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--text); }
.roster-more { display: flex; justify-content: center; margin-top: 40px; }
.roster-more[hidden] { display: none; }

/* tablets: the search takes its own line */
@media (max-width: 1000px) {
  .roster-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .roster-search { grid-column: 1 / -1; }
}

/* phones: each member becomes a short card of three lines */
@media (max-width: 760px) {
  .members-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .members-stats div:last-child { grid-column: 1 / -1; }
  .roster-tools { grid-template-columns: minmax(0, 1fr); }
  .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .roster, .roster tbody { display: block; }
  .roster tbody tr { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 6px 12px; padding: 18px 0; }
  .roster td { padding: 0; }
  .r-name { grid-column: 1 / 3; grid-row: 1; }
  .r-seat { grid-column: 3; grid-row: 1; width: auto; align-self: center; font-size: 20px; }
  .r-sector { grid-column: 2; grid-row: 2; font-size: 15px; }
  .r-since { grid-column: 3; grid-row: 2; width: auto; text-align: right; font-size: 15px; }
  .r-city { grid-column: 2; grid-row: 3; font-size: 15px; }
  .r-link { grid-column: 3; grid-row: 3; width: auto; }
}

/* grid view: portrait cards, the picture on top and three centred lines beneath, like a board's who's-who */
.members-roster[data-view="grid"] .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.members-roster[data-view="grid"] .roster { display: block; margin-top: 24px; }
.members-roster[data-view="grid"] .roster tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 48px 28px; }
.members-roster[data-view="grid"] .roster tbody tr {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: transparent; text-align: center;
}
.members-roster[data-view="grid"] .roster tbody tr:hover { background: transparent; }
.members-roster[data-view="grid"] .roster td { padding: 0; width: auto; text-align: center; }
.members-roster[data-view="grid"] .r-name { flex-direction: column; align-items: center; align-self: stretch; gap: 22px; margin-bottom: 4px; }
/* the portrait: a real photograph when the register has one, a monogram plate until then */
.members-roster[data-view="grid"] .r-mark {
  order: -1; position: relative; overflow: hidden; width: 100%; height: auto; aspect-ratio: 9 / 10; border-radius: 0;
  background: linear-gradient(165deg, #F3EEE6 0%, #E6DDCD 100%); box-shadow: none;
  font-family: var(--display); font-size: clamp(44px, 4.4vw, 64px); font-weight: 400; letter-spacing: .06em; color: rgba(138, 106, 48, .8);
  transition: color .5s var(--ease);
}
.members-roster[data-view="grid"] .r-mark::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(23, 22, 26, .06); transition: box-shadow .5s var(--ease); }
.members-roster[data-view="grid"] .r-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 1s var(--ease); }
.members-roster[data-view="grid"] tr:hover .r-mark { color: var(--gold); }
.members-roster[data-view="grid"] tr:hover .r-mark::after { box-shadow: inset 0 0 0 1px rgba(138, 106, 48, .55); }
.members-roster[data-view="grid"] tr:hover .r-mark img { scale: 1.04; }
.members-roster[data-view="grid"] .r-name > span:last-child { font-size: 20px; line-height: 1.25; }
.members-roster[data-view="grid"] .roster td.r-seat { position: absolute; top: 12px; left: 12px; z-index: 1; width: auto; padding: 4px 9px 3px; background: rgba(255, 255, 255, .86); font-size: 15px; }
.members-roster[data-view="grid"] .r-sector { font-size: 15px; color: var(--dim); }
.members-roster[data-view="grid"] .r-city { font-size: 15px; color: var(--dim); }
.members-roster[data-view="grid"] .r-since { display: none; }
/* the whole card opens the seat; the link's words stay for screen readers */
.members-roster[data-view="grid"] .r-link { position: static; width: auto; }
.members-roster[data-view="grid"] .r-link a { position: absolute; inset: 0; z-index: 2; font-size: 0; color: transparent; text-decoration: none; }
.members-roster[data-view="grid"] .r-link a::after { content: none; }
.members-roster[data-view="grid"] .r-link a:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
@media (max-width: 760px) {
  .members-roster[data-view="grid"] .roster tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 14px; }
  .members-roster[data-view="grid"] .r-name { gap: 14px; }
  .members-roster[data-view="grid"] .r-mark { font-size: 36px; }
  .members-roster[data-view="grid"] .r-name > span:last-child { font-size: 17px; }
  .members-roster[data-view="grid"] .roster td.r-seat { top: 8px; left: 8px; font-size: 13px; padding: 3px 7px 2px; }
  .members-roster[data-view="grid"] .r-sector, .members-roster[data-view="grid"] .r-city { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .roster tbody tr { animation: none; }
  .members-roster[data-view="grid"] .r-mark img { transition: none; }
}

/* header: the members themselves behind the title, washed white from the left so the ink reads */
.members-head { position: relative; isolation: isolate; overflow: hidden; min-height: min(100svh, 820px); display: flex; flex-direction: column; justify-content: flex-end; }
.members-head > .wrap { width: 100%; }
.members-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.members-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; filter: saturate(.85); animation: members-settle 2.4s var(--ease) both; }
.members-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .9) 36%, rgba(255, 255, 255, .55) 68%, rgba(255, 255, 255, .3) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0) 72%, #FFFFFF 100%);
}
@keyframes members-settle { from { scale: 1.06; } to { scale: 1; } }
@media (max-width: 760px) {
  .members-head { min-height: 0; }
  .members-head::before { background: linear-gradient(180deg, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, .86) 50%, #FFFFFF 100%); }
}
@media (prefers-reduced-motion: reduce) { .members-media img { animation: none; } }

/* a portrait fills the monogram's circle in the list, as it fills the plate in the grid */
.r-mark { position: relative; overflow: hidden; }
.r-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* opening a card: a full-card button in the grid; the list keeps its "See seat" link */
.r-open { display: none; }
.members-roster[data-view="grid"] .r-link { display: none; }
.members-roster[data-view="grid"] .roster td.r-open { display: block; position: static; }
.members-roster[data-view="grid"] .r-open button { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 0; color: transparent; }
.members-roster[data-view="grid"] .r-open button:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
/* the card in the spotlight stays marked: a gold frame and its name in gold */
.members-roster[data-view="grid"] tr.is-active .r-mark::after { box-shadow: inset 0 0 0 3px var(--gold); }
.members-roster[data-view="grid"] tr.is-active .r-name > span:last-child { color: var(--gold-hi); }
.roster tbody tr.is-active { background: rgba(138, 106, 48, .07); }

/* spotlight */
.spot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .35s var(--ease); }
.spot[hidden] { display: none; }
.spot.is-open { opacity: 1; }
.spot-backdrop { position: absolute; inset: 0; background: rgba(23, 22, 26, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.spot-panel {
  position: relative; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); width: min(880px, 100%); max-height: calc(100svh - 48px); overflow: auto;
  background: var(--bg); box-shadow: 0 30px 80px rgba(23, 22, 26, .3);
  transform: translateY(12px) scale(.98); transition: transform .45s var(--ease);
}
.spot.is-open .spot-panel { transform: none; }
.spot-close { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ivory); cursor: pointer; }
.spot-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.4; }
.spot-close:hover { color: var(--gold); }
.spot-photo { position: relative; margin: 0; aspect-ratio: auto; min-height: 520px; background: linear-gradient(165deg, #F3EEE6 0%, #E6DDCD 100%); }
.spot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-mark { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 88px; letter-spacing: .06em; color: rgba(138, 106, 48, .8); }
.spot-mark[hidden] { display: none; }
.spot-body { display: flex; flex-direction: column; padding: 48px 44px 28px; }
.spot-seat { font-family: var(--display); font-size: 20px; letter-spacing: .04em; color: var(--gold); }
.spot-name { margin-top: 10px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 40px); line-height: 1.15; color: var(--ivory); }
.spot-facts { display: grid; gap: 16px; margin-top: 28px; }
.spot-facts dt { font-size: 14px; font-weight: 500; color: var(--dim); }
.spot-facts dd { margin: 2px 0 0; font-size: 18px; color: var(--text); }
.spot-link { align-self: flex-start; margin-top: 32px; }
.spot-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 28px; }
.spot-pos { font-size: 14px; font-weight: 500; color: var(--dim); }
.spot-nav { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--gold); cursor: pointer; transition: background-color .3s var(--ease), color .3s, border-color .3s; }
.spot-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.spot-nav:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); color: #FFFFFF; }
.spot-nav:disabled { opacity: .35; cursor: default; }
.spot-nav:focus-visible, .spot-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* moving between members: the new one slides in from the side it came from */
.spot-panel.is-from-right .spot-photo, .spot-panel.is-from-right .spot-body > :not(.spot-foot) { animation: spot-in-right .4s var(--ease) both; }
.spot-panel.is-from-left .spot-photo, .spot-panel.is-from-left .spot-body > :not(.spot-foot) { animation: spot-in-left .4s var(--ease) both; }
@keyframes spot-in-right { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes spot-in-left { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .spot { padding: 12px; }
  .spot-panel { grid-template-columns: minmax(0, 1fr); max-height: calc(100svh - 24px); }
  .spot-photo { aspect-ratio: 4 / 3.4; min-height: 0; }
  .spot-mark { font-size: 64px; }
  .spot-close { background: rgba(255, 255, 255, .9); border-radius: 50%; }
  .spot-body { padding: 24px 22px 18px; }
  .spot-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
  .spot-link { align-self: stretch; text-align: center; margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .spot, .spot-panel { transition: none; }
  .spot-panel.is-from-right .spot-photo, .spot-panel.is-from-left .spot-photo, .spot-panel .spot-body > * { animation: none; }
}

/* list rows open the same spotlight: the whole row is the button */
.roster tbody tr { position: relative; cursor: pointer; }
.roster td.r-open { display: block; position: static; width: 0; padding: 0; }
.r-open button { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 0; color: transparent; }
.r-open button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
