/* Public pages beyond the basics in site.css: how it works, badges, species and regions. */

/* --- Navigation and shared pieces --------------------------------------------------------------- */
:root {
  --color-primary-soft: #e3efe6;
  --color-grey-soft: #eceee8;
  --color-grey-mark: #c5cbc0;
}
.site-header { flex-wrap: wrap; }
.button-secondary { background: var(--color-surface); color: var(--color-primary); border: 1px solid var(--color-primary); }
.button-secondary:hover { background: var(--color-primary-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.muted { color: var(--color-muted); }
.section-lead { color: var(--color-muted); max-width: 720px; margin: 0 0 16px; }
.link-button { background: none; border: 0; padding: 0; color: var(--color-primary); font: inherit; text-decoration: underline; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
main > section { margin-bottom: 40px; }
main > section > h2 { font-size: 24px; margin: 0 0 8px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--color-grey-soft); color: var(--color-muted); }
.tag-warn { background: #fdf1d8; color: #8a5a00; }
.cta { margin-top: 24px; }

/* --- Badge hexagon (same colours as the app) ------------------------------------------------------ */
.badge-hex { display: inline-block; flex: none; }
.badge-hex .hex { fill: var(--color-grey-soft); transition: fill 0.4s; }
.badge-hex .frame { fill: none; stroke: var(--color-grey-mark); stroke-width: 4; stroke-linejoin: round; transition: stroke 0.4s; }
.badge-hex .art { opacity: 0.4; transition: opacity 0.4s; }
.badge-hex.earned .art { opacity: 1; }
.badge-hex.earned .frame { stroke: var(--color-primary); }
.badge-hex .icon { color: var(--color-grey-mark); transition: color 0.4s; }
.badge-hex .dot { fill: var(--color-grey-mark); transition: fill 0.4s; }
.badge-hex.earned .hex { fill: var(--color-primary-soft); }
.badge-hex.earned .icon { color: var(--color-primary); }
.badge-hex .dot.on { fill: var(--color-primary); }

/* --- How it works (one woodpecker through all steps, drawn like the album cards of the app) ------- */
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* Six steps: three columns on wide screens, two or one on narrower ones. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  counter-reset: step;
}
.how-steps li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  counter-increment: step;
}
.how-steps h3 { font-size: 16px; margin: 12px 14px 2px; }
.how-steps h3::before { content: counter(step) ". "; color: var(--color-primary); }
.how-steps p { margin: 0 14px 14px; color: var(--color-muted); font-size: 14px; line-height: 1.45; }
.how-scene { position: relative; display: grid; aspect-ratio: 4 / 3; background: var(--color-grey-soft); }
.how-icon { width: 1em; height: 1em; flex: none; }

/* A picture as on the album cards: grey and faded until collected. */
.how-picture { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--color-grey-soft); }
.how-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; filter: grayscale(1) contrast(0.85) brightness(1.1); opacity: 0.3; }
.how-picture.collected { background: var(--color-primary-soft); }
.how-picture.collected img { filter: none; opacity: 1; }
.how-silhouette { width: 45%; height: auto; color: var(--color-grey-mark); stroke-width: 1.5; }
.how-picture.collected .how-silhouette { color: var(--color-primary); }

/* Upload: what the app reads from the photo and what it removes. */
.how-chips { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.how-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  font-size: 12px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}

/* Naming: the species search of the app over the photo. */
.how-search {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
  font-size: 13px;
  overflow: hidden;
}
.how-input { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-bottom: 1px solid var(--color-border); color: var(--color-muted); }
.how-option { padding: 5px 9px 5px 28px; background: var(--color-primary-soft); font-weight: 600; }
.how-caret { display: inline-block; width: 1px; height: 13px; margin-left: -5px; background: var(--color-text); animation: caret 1s steps(1) infinite; }
@keyframes caret {
  50% { opacity: 0; }
}

/* Album: a few cards of the woodpecker group. */
.how-album { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; padding: 8px; background: var(--color-bg); }
.how-album .how-picture { border-radius: 6px; border: 1px solid var(--color-border); }

/* Sharing: the rating summary and a comment, as under a photo in the feed. */
.how-social { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.how-star { color: #eab308; fill: currentColor; }
.how-comment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}
.how-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 11px;
  font-weight: 700;
}

/* Albums: a profile with its album, as other members see it. */
.how-profile { grid-template-rows: auto 1fr; gap: 8px; padding: 10px; background: var(--color-bg); }
.how-profile-head { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.35; }
.how-avatar-large { width: 36px; height: 36px; font-size: 17px; }
.how-numbers { color: var(--color-muted); font-size: 12px; }
.how-profile .how-level { font-size: 11px; padding: 0 7px; }
.how-profile-album { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 5px; }
.how-profile-album .how-picture { border-radius: 5px; border: 1px solid var(--color-border); }

/* Reward: the woodpecker badge and the level it adds to. */
.how-reward { place-content: center; justify-items: center; gap: 4px; background: var(--color-primary-soft); }
.how-level { padding: 1px 10px; border-radius: 999px; background: var(--color-primary); color: var(--color-on-primary); font-size: 13px; font-weight: 700; }

/* --- Badges -------------------------------------------------------------------------------------- */
.badge-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 12px 8px;
  color: inherit;
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.35;
}
.badge-chip:hover { border-color: var(--color-primary); }
.badge-chip .muted { font-size: 12px; }
.badge-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.badge-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  scroll-margin-top: 16px;
}
.badge-card:target { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-soft); }
.badge-card h3 { font-size: 16px; margin: 0; }
.badge-card h3 a { color: inherit; }
.badge-card p { margin: 2px 0 6px; font-size: 14px; }
.tiers { margin: 0; padding-left: 20px; font-size: 13px; }

/* --- Species and regions -------------------------------------------------------------------------- */
.page-public { margin-top: 16px; }
.page-public h2 { font-size: 20px; margin: 28px 0 8px; }
.crumbs { font-size: 14px; margin: 0 0 4px; color: var(--color-muted); }
.scientific { font-style: italic; }
.page-public > .scientific { margin: -12px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.notice-box { background: #fdf6e7; border: 1px solid #f0d9a8; border-radius: var(--radius); padding: 10px 14px; }
.group-index { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.species-group { scroll-margin-top: 16px; }
.species-list { list-style: none; padding: 0; margin: 0; columns: 2 260px; column-gap: 24px; }
.species-list li { break-inside: avoid; padding: 2px 0; }
.species-list .scientific { font-size: 13px; margin-left: 4px; }
.species-inline { margin: 0 0 8px; }
.region-list { list-style: none; padding: 0; margin: 0; columns: 3 200px; column-gap: 24px; font-size: 15px; }
.region-list li { break-inside: avoid; }
.region-list li.active a { font-weight: 700; }
.region-stats { display: flex; flex-wrap: wrap; gap: 24px; font-size: 18px; margin: 0; }
.region-stats strong { font-size: 28px; color: var(--color-primary); }
