/* Biodiversity challenge page. Builds on ../styles.css (colors, fonts, buttons). */

.bc-inner { max-width: var(--max); margin: 0 auto; }
.bc-hero { padding: clamp(3.5rem, 7vw, 7rem) clamp(1.25rem, 6vw, 6rem); background: var(--forest); color: white; }
.bc-hero .section-kicker { color: #ef8c67; }
.bc-hero h1 { max-width: 16em; margin: 0; font-family: var(--serif); font-size: clamp(2.5rem, 5.2vw, 5.4rem); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
.bc-lede { max-width: 640px; margin: 1.6rem 0 0; color: rgba(255,255,255,.74); font-size: clamp(1rem, 1.4vw, 1.2rem); }
.bc-stats { margin: clamp(2.5rem, 5vw, 4.5rem) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.22); }
.bc-stats > div { padding: 1.6rem 1rem 0 0; display: flex; flex-direction: column; }
.bc-stats > div + div { padding-left: clamp(.9rem, 2.5vw, 2.2rem); border-left: 1px solid rgba(255,255,255,.22); }
.bc-stats dd { margin: 0; font-family: var(--serif); font-size: clamp(3rem, 10vw, 9.5rem); letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; }
.bc-stats dt { margin-top: .7rem; color: rgba(255,255,255,.7); font-size: clamp(.62rem, 1vw, .8rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.bc-actions { margin-top: 2.6rem; display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.bc-updated { margin: 1.6rem 0 0; color: rgba(255,255,255,.6); font-size: .78rem; }
.bc-updated.is-error { padding: .8rem 1rem; background: rgba(255,255,255,.1); border-left: 3px solid var(--orange-bright); color: white; font-size: .92rem; }

.bc-section { padding: clamp(3.5rem, 7vw, 7rem) clamp(1.25rem, 6vw, 6rem); }
.bc-bright { background: var(--paper-bright); }
.bc-sage { background: #dce5d6; }
.bc-paper { background: var(--paper); }
.bc-heading { margin-bottom: clamp(1.8rem, 3.5vw, 3rem); display: flex; align-items: end; justify-content: space-between; gap: 1rem 3rem; flex-wrap: wrap; }
.bc-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 4rem); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.bc-heading p { max-width: 520px; margin: 0 0 .3rem; color: rgba(23,33,26,.7); }
.bc-status { grid-column: 1 / -1; padding: 1.5rem 0; color: rgba(23,33,26,.62); font-family: var(--serif); font-style: italic; list-style: none; }
.bc-credit { margin: 2.5rem 0 0; color: rgba(23,33,26,.62); font-size: .78rem; }

.bc-cards, .bc-wanted, .bc-board { margin: 0; padding: 0; list-style: none; }
.bc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.8rem); }
.bc-card { min-width: 0; display: flex; flex-direction: column; }
.bc-card a, .bc-wanted a { display: contents; color: inherit; text-decoration: none; }
.bc-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sage); }
.bc-photo-empty { display: grid; place-items: center; color: rgba(23,33,26,.45); font-size: .75rem; }
.bc-card-copy { padding-top: .8rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .8rem; align-items: start; }
.bc-name { margin: 0; font-family: var(--serif); font-size: clamp(1.1rem, 1.5vw, 1.45rem); line-height: 1.15; overflow-wrap: break-word; }
.bc-sci { margin: .25rem 0 0; color: rgba(23,33,26,.66); font-size: .86rem; font-style: italic; }
.bc-meta { margin: .25rem 0 0; color: rgba(23,33,26,.66); font-size: .8rem; }
.bc-count { grid-row: span 2; color: var(--orange); font-family: var(--serif); font-size: clamp(1.7rem, 2.4vw, 2.4rem); line-height: 1; text-align: right; }
.bc-count small { display: block; margin-top: .3rem; color: rgba(23,33,26,.6); font-family: var(--sans); font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.bc-leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 6rem); }
.bc-leaders h3 { margin: 0 0 .8rem; color: var(--orange); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.bc-board { border-top: 1px solid var(--line); }
.bc-board li:not(.bc-status) { padding: .9rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.6rem 3rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.bc-rank { color: var(--orange); font-family: var(--serif); font-style: italic; }
.bc-avatar { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; background: var(--forest); color: white; display: grid; place-items: center; font-family: var(--serif); font-size: 1.3rem; }
.bc-board .bc-name small { display: block; margin-top: .2rem; color: rgba(23,33,26,.6); font-family: var(--sans); font-size: .72rem; }
.bc-score { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }

.bc-wanted { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0 clamp(1.2rem, 2.5vw, 2.5rem); border-top: 1px solid var(--line); }
.bc-wanted li:not(.bc-status) { min-width: 0; padding: .8rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.7rem 4.5rem minmax(0, 1fr); gap: .9rem; align-items: center; }
.bc-wanted .bc-photo { width: 4.5rem; height: 4.5rem; aspect-ratio: auto; }
.bc-wanted .bc-name { font-size: 1.12rem; }
.bc-wanted .bc-meta strong { color: var(--ink); }
.bc-hint { margin: .3rem 0 0; color: var(--orange); font-size: .78rem; font-weight: 700; line-height: 1.35; }

@media (max-width: 980px) {
  .bc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .bc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-leaders { grid-template-columns: 1fr; }
  .bc-card-copy { grid-template-columns: 1fr; }
  .bc-count { grid-row: auto; margin-top: .4rem; text-align: left; }
  .bc-count small { display: inline; margin-left: .3rem; }
  .bc-board li:not(.bc-status) { grid-template-columns: 1.3rem 2.4rem minmax(0, 1fr) auto; gap: .7rem; }
  .bc-avatar { width: 2.4rem; height: 2.4rem; }
}

/* Compact layout. Only applies while <html> in index.html has class="bc-compact";
   remove that class to switch all of this off (challenge.js also shows longer lists again). */
html.bc-compact .bc-hero { padding-top: clamp(2rem, 3.5vw, 3.2rem); padding-bottom: clamp(2rem, 3.5vw, 3.2rem); }
html.bc-compact .bc-hero h1 { max-width: none; font-size: clamp(1.9rem, 3.2vw, 3.1rem); line-height: 1.05; text-wrap: balance; }
html.bc-compact .bc-lede { max-width: none; margin-top: 1rem; font-size: 1rem; text-wrap: balance; }
html.bc-compact .bc-stats { margin-top: clamp(1.4rem, 2.5vw, 2.2rem); }
html.bc-compact .bc-stats > div { padding-top: 1rem; }
html.bc-compact .bc-stats dd { font-size: clamp(2.4rem, 5vw, 4.6rem); }
html.bc-compact .bc-stats dt { margin-top: .4rem; }
html.bc-compact .bc-actions { margin-top: 1.5rem; }
html.bc-compact .bc-updated { margin-top: 1rem; }

html.bc-compact .bc-section { padding-top: clamp(2rem, 3.2vw, 3rem); padding-bottom: clamp(2rem, 3.2vw, 3rem); }
html.bc-compact .bc-heading { margin-bottom: clamp(1rem, 1.6vw, 1.4rem); }
html.bc-compact .bc-heading h2 { font-size: clamp(1.6rem, 2.4vw, 2.3rem); }
html.bc-compact .bc-heading p { max-width: 560px; margin-bottom: 0; font-size: .9rem; }
html.bc-compact .bc-credit { margin-top: 1.5rem; }

html.bc-compact .bc-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.8rem, 1.4vw, 1.2rem); }
html.bc-compact .bc-card-copy { padding-top: .55rem; grid-template-columns: 1fr; }
html.bc-compact .bc-cards-recent .bc-card > a > div { padding-top: .55rem !important; }
html.bc-compact .bc-name { font-size: 1.05rem; }
html.bc-compact .bc-sci { margin-top: .15rem; font-size: .8rem; }
html.bc-compact .bc-meta { margin-top: .15rem; font-size: .76rem; }
html.bc-compact .bc-count { grid-row: auto; margin-top: .3rem; font-size: 1.35rem; text-align: left; }
html.bc-compact .bc-count small { display: inline; margin-left: .3rem; }

html.bc-compact .bc-leaders { gap: clamp(1.5rem, 4vw, 4rem); }
html.bc-compact .bc-leaders h3 { margin-bottom: .5rem; }
html.bc-compact .bc-board li:not(.bc-status) { padding: .5rem 0; grid-template-columns: 1.3rem 2.2rem minmax(0, 1fr) auto; gap: .8rem; }
html.bc-compact .bc-avatar { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
html.bc-compact .bc-board .bc-name small { display: inline; margin: 0 0 0 .5rem; }
html.bc-compact .bc-score { font-size: 1.6rem; }

html.bc-compact .bc-wanted { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 0 clamp(1rem, 2vw, 2rem); }
html.bc-compact .bc-wanted li:not(.bc-status) { padding: .5rem 0; grid-template-columns: 1.4rem 3.2rem minmax(0, 1fr); gap: .7rem; }
html.bc-compact .bc-wanted .bc-photo { width: 3.2rem; height: 3.2rem; }
html.bc-compact .bc-wanted .bc-name { font-size: 1rem; }
html.bc-compact .bc-hint { margin-top: .2rem; font-size: .72rem; }

@media (max-width: 980px) {
  html.bc-compact .bc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  html.bc-compact .bc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
