/* People & Families directory cards v4
   Fixed card dimensions, unclipped copy, compact portrait header. */

.people-grid{
  align-items:stretch;
  grid-auto-rows:360px;
}

.people-card{
  height:100%;
  min-width:0;
  position:relative;
  box-sizing:border-box;
  padding:16px 16px 60px!important;
  overflow:hidden!important;
  display:flex;
  flex-direction:column;
}

.people-card .person-card-copy{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
}

/* Portrait cards: compact identity block beside portrait, then full-width biography. */
.people-card.has-portrait{
  display:grid!important;
  grid-template-columns:84px minmax(0,1fr)!important;
  grid-auto-flow:row;
  column-gap:13px!important;
  row-gap:0!important;
  align-content:start;
  align-items:start;
}

.people-card.has-portrait .person-card-copy{
  display:contents;
}

.people-card .person-thumb{
  grid-column:1;
  grid-row:1 / span 4;
  width:84px!important;
  height:105px!important;
  aspect-ratio:4/5;
  border-radius:12px!important;
  object-fit:cover;
  object-position:center top;
  background:#eee7dc;
}

.people-card.has-portrait .people-origin,
.people-card.has-portrait h2,
.people-card.has-portrait .people-dates,
.people-card.has-portrait h3{
  grid-column:2;
  min-width:0;
}

.people-origin{
  font-size:7.5px!important;
  line-height:1.2!important;
  letter-spacing:.095em;
  min-height:0!important;
  margin:0 0 3px!important;
}

.people-card h2{
  font-size:22px!important;
  line-height:1.04!important;
  letter-spacing:-.35px;
  margin:1px 0 3px!important;
  min-height:0!important;
  display:block!important;
  overflow:visible!important;
  -webkit-line-clamp:unset!important;
}

.people-dates{
  font-size:9px!important;
  line-height:1.25!important;
  min-height:0!important;
  margin:0!important;
}

.people-card h3{
  font-size:10.5px!important;
  line-height:1.3!important;
  margin:4px 0 0!important;
  min-height:0!important;
  display:block!important;
  overflow:visible!important;
  -webkit-line-clamp:unset!important;
  color:#3f5265;
}

body.site-heritage .people-card p{
  font-size:10.6px!important;
  line-height:1.48!important;
  margin:8px 0 0!important;
  display:block!important;
  overflow:visible!important;
  -webkit-line-clamp:unset!important;
  color:#64707b;
}

.people-card.has-portrait p,
.people-card.has-portrait .people-city,
.people-card.has-portrait .people-sites{
  grid-column:1 / -1;
}

.people-city,
.people-sites{
  margin-top:7px!important;
  font-size:9px!important;
  line-height:1.2!important;
  padding-top:6px!important;
  border-top:1px solid #ece3d5;
  min-width:0;
}

.people-city small,
.people-sites small{
  margin:0 0 3px!important;
  font-size:6.8px!important;
  line-height:1.2!important;
  letter-spacing:1px;
}

.people-city b{
  font-size:9.5px!important;
  line-height:1.2!important;
}

.people-sites{
  display:flex;
  gap:4px!important;
  flex-wrap:wrap;
  max-height:none!important;
  overflow:visible!important;
}

.people-sites small{
  flex-basis:100%;
}

.people-sites a{
  min-height:0!important;
  padding:4px 7px!important;
  font-size:7.5px!important;
  line-height:1.15!important;
}

/* Permanent action rail: same card size, no content/action overlap. */
.people-card-actions{
  position:absolute;
  inset-inline:16px;
  bottom:14px;
  margin:0!important;
  padding-top:8px;
  min-height:31px;
  border-top:1px solid #ece3d5;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between;
  flex-wrap:nowrap!important;
  gap:8px!important;
  background:linear-gradient(to bottom,rgba(255,253,250,0),#fffdfa 24%);
  z-index:2;
}

.people-card-actions .people-source{
  display:inline-flex!important;
  align-items:center;
  min-width:0;
  margin:0!important;
  padding:0!important;
  min-height:0!important;
  font-size:9px!important;
  line-height:1.2!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.people-card-actions .people-source:first-child{
  color:var(--navy)!important;
  font-weight:900!important;
  flex:0 0 auto;
}

.people-card-actions .people-source:last-child:not(:first-child){
  color:#756344!important;
  flex:0 1 auto;
  text-align:end;
}

/* If a remote portrait fails, collapse cleanly to the normal text card. */
@supports selector(.people-card:has(.person-thumb)){
  .people-card.has-portrait:not(:has(.person-thumb)){
    display:flex!important;
  }
}

/* Slight density adjustment only for unusually long biographies; wording is untouched. */
body.site-heritage .people-card.bio-long p{
  font-size:10.1px!important;
  line-height:1.43!important;
}

@media (max-width:1050px){
  .people-grid{grid-auto-rows:350px}
  .people-card{padding-bottom:58px!important}
  .people-card.has-portrait{grid-template-columns:82px minmax(0,1fr)!important;column-gap:12px!important}
  .people-card .person-thumb{width:82px!important;height:102px!important}
}

@media (max-width:760px){
  .people-grid{grid-auto-rows:324px}
  .people-card{padding:14px 14px 55px!important}
  .people-card.has-portrait{
    grid-template-columns:72px minmax(0,1fr)!important;
    column-gap:11px!important;
  }
  .people-card .person-thumb{
    width:72px!important;
    height:90px!important;
    border-radius:11px!important;
  }
  .people-origin{font-size:7px!important;margin-bottom:2px!important}
  .people-card h2{font-size:20px!important;line-height:1.03!important;margin-bottom:2px!important}
  .people-dates{font-size:8.5px!important}
  .people-card h3{font-size:10px!important;line-height:1.25!important;margin-top:3px!important}
  body.site-heritage .people-card p{font-size:10.3px!important;line-height:1.4!important;margin-top:6px!important}
  body.site-heritage .people-card.bio-long p{font-size:9.9px!important;line-height:1.36!important}
  .people-city,.people-sites{margin-top:5px!important;padding-top:5px!important}
  .people-card-actions{inset-inline:14px;bottom:12px;min-height:29px;padding-top:7px;gap:6px!important}
  .people-card-actions .people-source{font-size:9px!important}
}

@media (max-width:390px){
  .people-grid{grid-auto-rows:318px}
  .people-card{padding:13px 13px 53px!important}
  .people-card.has-portrait{grid-template-columns:68px minmax(0,1fr)!important;column-gap:10px!important}
  .people-card .person-thumb{width:68px!important;height:85px!important}
  .people-card h2{font-size:19px!important}
  body.site-heritage .people-card p{font-size:10px!important;line-height:1.36!important}
  body.site-heritage .people-card.bio-long p{font-size:9.7px!important;line-height:1.32!important}
  .people-card-actions{inset-inline:13px;bottom:11px}
  .people-card-actions .people-source{font-size:8.7px!important}
}
