/* F4g (04 §3.1): the party pages under /st: leaders (/st/rt), member lists (/st/ps/{key}) and the structure
   diagram with its zoom dialog (/st/bd). The /party hub itself uses pages/info.css (link tiles). */

/* ---------- Leaders ---------- */
.leaders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s7) var(--s6); margin: 0; padding: 0; list-style: none; }
.leader { display: grid; align-content: start; gap: var(--s2); }
.leader .ph { display: block; overflow: hidden; aspect-ratio: 3 / 4; margin-bottom: var(--s3); border-radius: var(--r-lg); background: var(--surface); }
.leader .ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med) var(--ease), opacity 400ms var(--ease); }
.leader:hover .ph img { transform: scale(1.04); }
.leader h2 { margin: 0; font-size: var(--fs-h3); overflow-wrap: anywhere; }
.leader .role { margin: 0; color: var(--blue); font-weight: 500; }
.leader .bio { margin-top: var(--s2); color: var(--ink-2); font-size: var(--fs-meta); line-height: 1.6; overflow-wrap: anywhere; }
.leader .bio > :first-child { margin-top: 0; }
.leader .bio > :last-child { margin-bottom: 0; }
.leader .bio img { max-width: 100%; height: auto; }

/* ---------- Member lists ---------- */
.roster-wrap { overflow-x: auto; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.roster { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.roster th { position: sticky; top: 0; padding: 14px 20px; background: var(--surface); color: var(--ink-2); font-size: var(--fs-meta); font-weight: 600; text-align: left; white-space: nowrap; }
.roster td { padding: 14px 20px; border-top: 1px solid var(--line); vertical-align: top; }
.roster td:first-child, .roster th:first-child { width: 1%; color: var(--ink-2); text-align: right; white-space: nowrap; }
.roster td:nth-child(4) { font-weight: 600; }
.roster tbody tr { transition: background var(--t-fast) var(--ease); }
.roster tbody tr:hover { background: var(--surface); }

/* ---------- Structure diagram + zoom ---------- */
.diagram { margin: 0; }
.diagram-open { display: block; overflow: hidden; border-radius: var(--r-lg); background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: zoom-in; }
.diagram-open img { display: block; width: 100%; height: auto; transition: transform var(--t-med) var(--ease); }
.diagram-open:hover img { transform: scale(1.015); }
.diagram figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: var(--s3); }
.diagram figcaption .ic { width: 20px; height: 20px; }

.zoom { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: var(--ink); }
.zoom:not([open]) { display: none; }
.zoom[open] { display: flex; flex-direction: column; animation: zoom-in var(--t-med) var(--ease-out); }
.zoom::backdrop { background: rgb(22 25 29 / .5); }
.zoom[open]::backdrop { animation: zoom-fade var(--t-med) var(--ease); }
.zoom-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: var(--header-h); padding: 0 var(--gutter); box-shadow: 0 1px 0 var(--line); }
.zoom-head h2 { margin: 0; font-size: 1.25rem; }
.zoom-close { display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.zoom-close:hover { background: var(--surface-2); }
.zoom-close:active { transform: scale(.94); }
.zoom-body { flex: 1; overflow: auto; overscroll-behavior: contain; }
.zoom-body img { display: block; max-width: none; width: auto; height: auto; margin: 0 auto; }
@keyframes zoom-in { from { opacity: 0; transform: scale(.98); } }
@keyframes zoom-fade { from { opacity: 0; } }

@media (max-width: 1080px) { .leaders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s4); } }
@media (max-width: 600px) {
  .roster th, .roster td { padding: 12px 14px; }
  .roster { font-size: 1rem; }
}
@media (max-width: 420px) { .leaders { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .zoom[open], .zoom[open]::backdrop { animation: none; }
  .leader:hover .ph img, .diagram-open:hover img { transform: none; }
}
