/* ---- Elected member profile (member.html), the shared letters/speeches
   lists (also on president.html) and the profile link on elected-members.html ---- */

.member {
  padding: 26px var(--px) 96px;
  background: linear-gradient(180deg, rgba(11, 79, 158, .06), transparent 460px);
}
.member__wrap { max-width: 1240px; margin: 0 auto; }
.member__back {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.member__back:hover { color: var(--blue); }
.member__status { margin: 0; padding: 80px 0; text-align: center; font-weight: 600; color: var(--muted); }

/* ---- Header card ---- */
.mp-card {
  margin-top: 8px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: start;
  background: #fff; border-radius: 22px; padding: 32px 36px 34px;
  box-shadow: 0 18px 44px rgba(20, 24, 28, .1); border-top: 4px solid var(--blue);
}
.mp-card--mla { border-top-color: var(--green); }
/* Most official portraits are 156x201; past ~210px wide they would be upscaled and go soft. */
.mp-card__photo {
  width: clamp(132px, 22vw, 208px); aspect-ratio: 156 / 201;
  border-radius: 16px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #0E7B3D, #06522A);
  box-shadow: 0 16px 34px rgba(20, 24, 28, .2);
  color: #fff; font-weight: 800; font-size: 46px;
}
.mp-card--mla .mp-card__photo--initials { background: linear-gradient(140deg, #1668C9, #073A75); }
.mp-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
.mp-card__body { min-width: 0; }
.mp-card__kicker { margin: 4px 0 0; }
[data-lang="ta"] .mp-card__kicker { font-size: 13.5px; letter-spacing: .04em; }
.mp-card__name {
  margin: 10px 0 0; font-weight: 800; font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.08; letter-spacing: -.5px; overflow-wrap: break-word; text-wrap: balance;
}
[data-lang="ta"] .mp-card__name { line-height: 1.3; letter-spacing: 0; }
.mp-card__role { margin: 10px 0 0; font-size: 16.5px; font-weight: 600; line-height: 1.5; color: var(--body); }
.mp-card__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 14px; border-radius: 999px; line-height: 1.45;
  font-size: 13px; font-weight: 700; color: var(--blue-deep);
  background: rgba(11, 79, 158, .07); border: 1px solid rgba(11, 79, 158, .18);
}
.mp-chip--place { color: var(--green); background: rgba(14, 123, 61, .07); border-color: rgba(14, 123, 61, .25); }
.mp-chip__ico { width: 14px; height: 14px; flex: none; }

.mp-card__cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px 32px;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(20, 24, 28, .08);
}
.mp-block { min-width: 0; }
.mp-label {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--kicker);
}
[data-lang="ta"] .mp-label { font-size: 13.5px; letter-spacing: .04em; }
.mp-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mp-links li { max-width: 100%; }
.mp-link {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-height: 44px;
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid rgba(20, 24, 28, .16);
  color: var(--ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  transition: border-color .2s, color .2s;
}
.mp-link:hover { border-color: var(--blue); color: var(--blue); }
.mp-link--email > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.mp-link__ico { width: 16px; height: 16px; flex: none; color: var(--blue); }
.mp-none { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.mp-soc { min-height: 44px; max-width: 100%; }
.mp-soc__name { font-weight: 800; }
.mp-soc__handle { min-width: 0; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.mp-card__official { margin-top: 24px; }
/* also beats .lead-btn's white focus ring, which vanishes on these white cards */
.member a:focus-visible, .mp-photo:focus-visible { outline: 3px solid var(--blue2); outline-offset: 3px; }
.member__back:focus-visible { border-radius: 4px; }

/* ---- Letters / speeches / photos ---- */
.mp-secs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.mp-sec--photos { grid-column: 1 / -1; }

.mwork {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 14px 36px rgba(20, 24, 28, .08);
}
.mwork__title {
  margin: 0; padding: 16px 22px; display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 17.5px; line-height: 1.35;
}
.mwork__ico {
  flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 12px;
  background: rgba(11, 79, 158, .08); color: var(--blue);
}
.mwork__empty {
  margin: 0; padding: 30px 22px; text-align: center;
  border-top: 1px solid rgba(20, 24, 28, .07); background: rgba(20, 24, 28, .035);
  color: var(--muted); font-size: 14.5px; font-weight: 600; line-height: 1.6;
}
.mwork__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(20, 24, 28, .07); }
.mwork__item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title go" "date go";
  align-items: center; gap: 2px 16px; padding: 13px 22px;
}
.mwork__item + .mwork__item { border-top: 1px solid rgba(20, 24, 28, .06); }
.mwork__item-title { grid-area: title; font-weight: 700; font-size: 14.5px; line-height: 1.5; overflow-wrap: break-word; }
.mwork__date { grid-area: date; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.mwork__go {
  grid-area: go; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid rgba(20, 24, 28, .16); color: var(--ink);
  font-size: 13px; font-weight: 800; transition: border-color .2s, color .2s;
}
.mwork__go:hover { border-color: var(--blue); color: var(--blue); }
.mwork__go:focus-visible { outline: 3px solid var(--blue2); outline-offset: 2px; }
.mwork__item[hidden] { display: none; }
.mwork__meta { grid-area: date; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; }
.mwork__type {
  padding: 2px 9px; border-radius: 999px; background: rgba(11, 79, 158, .08); color: var(--blue);
  font-size: 12px; font-weight: 700; line-height: 1.6;
}
.mwork__size { font-size: 12.5px; color: var(--muted); }
.mwork__more {
  display: block; width: 100%; padding: 13px 22px; cursor: pointer;
  border: 0; border-top: 1px solid rgba(20, 24, 28, .07); background: rgba(11, 79, 158, .04);
  color: var(--blue); font: inherit; font-size: 14px; font-weight: 800;
}
.mwork__more:hover { background: rgba(11, 79, 158, .08); }
.mwork__more:focus-visible { outline: 3px solid var(--blue2); outline-offset: -3px; }

.mp-photos {
  list-style: none; margin: 0; padding: 18px 22px 22px; border-top: 1px solid rgba(20, 24, 28, .07);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px;
}
.mp-photo {
  display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 12px;
  overflow: hidden; cursor: zoom-in; background: rgba(20, 24, 28, .06);
}
.mp-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mp-photo:hover img { transform: scale(1.04); }

/* ---- Not found / could not load ---- */
.mp-missing {
  margin-top: 8px; padding: 56px 24px; text-align: center;
  background: #fff; border-radius: 22px; box-shadow: 0 18px 44px rgba(20, 24, 28, .1);
}
.mp-missing__title { margin: 0; font-weight: 800; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; }
.mp-missing__text { margin: 12px auto 0; max-width: 560px; font-size: 16px; line-height: 1.65; color: var(--body); }
.mp-missing__go { margin-top: 24px; }

/* ---- Photo viewer ---- */
body.mem-lb-open { overflow: hidden; }
.mem-lb {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 10, 12, .94); color: #fff;
}
.mem-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.mem-lb::backdrop { background: rgba(8, 10, 12, .6); }
.mem-lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.mem-lb__count { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.mem-lb__btn {
  min-width: 46px; min-height: 46px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 26px; line-height: 1; transition: background .2s;
}
.mem-lb__btn:hover { background: rgba(255, 255, 255, .2); }
.mem-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mem-lb__btn[hidden] { display: none; }
.mem-lb__fig {
  margin: 0; min-height: 0; padding: 0 76px 18px;
  display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 12px;
}
.mem-lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.mem-lb__cap { max-width: 760px; text-align: center; font-size: 14.5px; line-height: 1.6; color: #D8DCE0; }
.mem-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.mem-lb__nav--prev { left: 14px; }
.mem-lb__nav--next { right: 14px; }

/* ---- elected-members.html: a profile link at the foot of each card ---- */
.leader-card__profile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; min-height: 46px; padding: 10px 18px;
  border-top: 1px solid rgba(20, 24, 28, .08);
  font-size: 13.5px; font-weight: 800; color: var(--blue);
  transition: background .2s, color .2s;
}
.leader-card__profile:hover { background: rgba(11, 79, 158, .05); color: var(--blue-deep); }
.leader-card__profile:focus-visible { outline: 3px solid var(--blue2); outline-offset: -3px; border-radius: 0 0 16px 16px; }
/* a card with no phone or email would otherwise run the role into the link */
.leader-card__role:has(+ .leader-card__profile) { margin-bottom: 16px; }

@media (max-width: 860px) {
  .mp-secs { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .member { padding-top: 14px; padding-bottom: 72px; }
  .mp-card { grid-template-columns: 1fr; gap: 20px; padding: 22px 18px 24px; border-radius: 18px; }
  .mp-card__photo { width: 140px; font-size: 38px; }
  .mp-card__role { font-size: 15.5px; }
  .mp-card__official { width: 100%; }
  .mwork__title { padding: 14px 16px; font-size: 16.5px; }
  .mwork__item { padding: 13px 16px; }
  .mwork__empty { padding: 24px 16px; }
  .mp-photos { padding: 14px 16px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mem-lb__fig { padding: 0 10px 84px; }
  .mem-lb__nav { top: auto; bottom: 18px; transform: none; }
  .mem-lb__nav--prev { left: calc(50% - 58px); }
  .mem-lb__nav--next { right: calc(50% - 58px); }
}
@media (max-width: 420px) {
  .mwork__item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "date" "go"; }
  .mwork__go { justify-self: start; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-photo img, .mp-photo:hover img { transition: none; transform: none; }
}
