/* Styles for the /wildlife/ page (gallery, species catalog, map, lightbox). */

.wildlife-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1em;
}

.wl-muted {
  color: #646769;
  font-size: 0.9em;
}

#wl-map {
  height: 420px;
  border-radius: 6px;
  margin-bottom: 1.5em;
}

/* Species catalog */
.wl-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75em;
  margin-bottom: 2em;
}

.wl-card {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.4em;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.wl-card:hover,
.wl-card:focus {
  border-color: #52adc8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.wl-card.active {
  border-color: #52adc8;
  box-shadow: 0 0 0 2px rgba(82, 173, 200, 0.35);
}

.wl-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.wl-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.wl-card-body strong {
  font-size: 0.9em;
}

.wl-card-body em {
  font-size: 0.78em;
  color: #646769;
}

.wl-card-meta {
  font-size: 0.75em;
  color: #898c8e;
  text-transform: capitalize;
}

/* Filter chips */
.wl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1em;
}

.wl-chip {
  padding: 0.25em 0.9em;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.85em;
}

.wl-chip:hover {
  border-color: #52adc8;
}

.wl-chip.active {
  background: #52adc8;
  border-color: #52adc8;
  color: #fff;
}

.wl-active-species {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.5em 0.25em 0.9em;
  border-radius: 999px;
  background: #eef7fa;
  border: 1px solid #52adc8;
  font-size: 0.85em;
}

.wl-active-species button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  padding: 0 0.2em;
  color: #396e80;
}

/* Gallery grid */
.wl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75em;
}

.wl-item {
  margin: 0;
}

.wl-item[hidden] {
  display: none;
}

.wl-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #f2f2f2;
}

.wl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.wl-thumb:hover img {
  transform: scale(1.04);
}

.wl-item figcaption {
  font-size: 0.75em;
  line-height: 1.35;
  padding: 0.3em 0.15em 0;
}

.wl-item figcaption strong {
  display: block;
}

.wl-item figcaption span {
  color: #898c8e;
}

/* Lightbox */
.wl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}

.wl-lightbox[hidden] {
  display: none;
}

.wl-lightbox figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wl-lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
}

.wl-lightbox figcaption {
  color: #e8e8e8;
  font-size: 0.85em;
  text-align: center;
  padding: 0.6em 1em 0;
  max-width: 80ch;
}

.wl-lightbox figcaption em {
  color: #b8bcbe;
}

.wl-lb-close,
.wl-lb-prev,
.wl-lb-next {
  position: fixed;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 2.4em;
  height: 2.4em;
  font-size: 1.2em;
  line-height: 1;
}

.wl-lb-close:hover,
.wl-lb-prev:hover,
.wl-lb-next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.wl-lb-close {
  top: 0.6em;
  right: 0.6em;
}

.wl-lb-prev {
  left: 0.6em;
  top: 50%;
  transform: translateY(-50%);
}

.wl-lb-next {
  right: 0.6em;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 600px) {
  .wl-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5em;
  }

  .wl-catalog {
    grid-template-columns: 1fr 1fr;
  }

  .wl-card img {
    width: 48px;
    height: 48px;
  }
}
