/**
 * Committees page — scoped under .watl-committees.
 * Tokens are redeclared locally as hex, matching the convention used by
 * rules.css / complaint.css. Do NOT switch these to the global var(--red).
 */
.watl-committees {
  --red: #C0392B;
  --tan: #C8A24A;
  --dark: #14181F;
  --cream: #F7F4EE;
  --line: #E3DDD2;
  --muted: #6B6357;
  /* Mirrors the global --mid token so .committee__desc matches the council
     card description (.gb-council-role) exactly. */
  --mid: #5A6370;

  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 20px 64px;
}

/* ---------- section ---------- */
.watl-committees .committee {
  border-bottom: 1px solid var(--line);
}
.watl-committees .committee:first-child {
  border-top: 1px solid var(--line);
}

.watl-committees .committee__head {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.watl-committees .committee__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 4px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--dark);
}
.watl-committees .committee__toggle:hover .committee__name,
.watl-committees .committee__toggle:focus-visible .committee__name {
  color: var(--red);
}
.watl-committees .committee__toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.watl-committees .committee__name {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: .02em;
  line-height: 1.05;
  transition: color .18s ease;
}

.watl-committees .committee__subtitle {
  display: block;
  margin-top: 6px;
  max-width: 62ch;
  font-family: Barlow, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.watl-committees .committee__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.watl-committees .committee__count {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.watl-committees .committee__chev {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.watl-committees .committee__toggle[aria-expanded="true"] .committee__chev {
  transform: rotate(-135deg);
}

/* ---------- panel ---------- */
.watl-committees .committee__panel {
  padding: 4px 0 34px;
}
.watl-committees .committee__panel[hidden] {
  display: none;
}

.watl-committees .committee__empty {
  margin: 0;
  padding: 4px 0 8px;
  font-family: Barlow, system-ui, sans-serif;
  color: var(--muted);
}

/* Chairs sit on their own full-width row above the grid. */
.watl-committees .committee__chairs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px dashed var(--line);
}

/* Committee blurb, between the chair row and the member grid.
   Type matches .gb-council-role on the Council page: Barlow 14/1.6, --mid.
   Selector is deliberately over-qualified: the legacy `.watl-page .page-body p`
   rule (15.5px/1.75) otherwise wins the cascade on font-size and line-height. */
.watl-committees .committee__panel p.committee__desc {
  max-width: 760px;
  margin: 0 auto 26px;
  font-family: Barlow, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.6;
  color: var(--mid);
  text-align: center;
}
/* No chair row above it — the panel's own 4px top padding is too tight. */
.watl-committees .committee__panel > p.committee__desc:first-child {
  margin-top: 10px;
}

/* Flex, not grid: grid's justify-content centres the whole track set but leaves
   a partially filled LAST row pinned to the leading tracks. Fixed-basis flex
   items wrap the same way and centre every row, including the last. */
.watl-committees .committee__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 20px;
}
.watl-committees .committee__grid .cnode {
  flex: 0 0 150px;
}

/* ---------- person node ---------- */
.watl-committees .cnode {
  text-align: center;
}
.watl-committees .committee__chairs .cnode {
  flex: 0 0 168px;
}

.watl-committees .cnode__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--cream);
  line-height: 0;
}
.watl-committees .committee__chairs .cnode__photo {
  box-shadow: 0 0 0 3px var(--tan);
}

/* Absolutely positioned + !important for the same reason as .gb-council-photo img:
   the legacy `.watl-page .page-body img{margin:24px auto}` rule otherwise offsets
   this image and exposes a strip of the cream circle background above it. The
   transform (object-position + scale) set inline by watltheme_committee_node()
   still applies — position:absolute doesn't disturb it. */
.watl-committees .cnode__photo img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  margin: 0 !important;
}

.watl-committees .cnode__ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #E9E3D8, #D8D0C2);
}

.watl-committees .cnode__name {
  margin: 12px 0 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 17px;
  letter-spacing: .03em;
  line-height: 1.2;
  color: var(--dark);
}

.watl-committees .cnode__role {
  margin: 3px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  color: var(--red);
}

/* Briefly mark the committee a deep-link landed on. */
.watl-committees .committee.is-targeted .committee__name {
  color: var(--red);
}

@media (max-width: 600px) {
  .watl-committees { padding: 4px 16px 48px; }
  .watl-committees .committee__toggle { padding: 20px 2px; gap: 12px; }
  .watl-committees .committee__count { display: none; }
  .watl-committees .committee__grid { gap: 22px 14px; }
  .watl-committees .committee__grid .cnode { flex: 0 0 118px; }
  .watl-committees .committee__chairs { gap: 20px; }
  .watl-committees .committee__chairs .cnode { flex: 0 0 132px; }
}

@media (prefers-reduced-motion: reduce) {
  .watl-committees .committee__chev,
  .watl-committees .committee__name { transition: none; }
}
