:root { color-scheme: light dark; }

body {
  font-family: system-ui, sans-serif;
  line-height: 1.4;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

a { color: LinkText; }

/* index header: "wetland.io" reuses the .crumb style/position; tagline under it */
p.tagline { font-size: .9rem; opacity: .8; margin: 0 0 1rem; }

/* Search / filter / sort bar — plain controls, no buttons */
nav.controls { margin: 0 0 1.25rem; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
nav.controls #search { font: inherit; padding: .15rem .4rem; }
nav.controls select { font: inherit; padding: .15rem .25rem; }
.sort a { margin-right: .9rem; text-decoration: none; color: inherit; opacity: .55; }
.sort a:last-child { margin-right: 0; }
.sort a:hover { opacity: 1; }
.sort a.active { opacity: 1; font-weight: 600; }

/* Masonry. No-JS fallback = CSS columns. With JS the gallery gets .masonry and
   items are distributed into flex columns row-first (first row fills first). */
.gallery { column-width: 250px; column-gap: 14px; }
.gallery.masonry { column-width: auto; display: flex; align-items: flex-start; gap: 14px; }
.gallery.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 560px) {
  .gallery { column-width: auto; column-count: 2; column-gap: 10px; }
  .gallery.masonry, .gallery.masonry .col { gap: 10px; }
}
.work {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 14px;
  text-decoration: none;
  color: inherit;
}
.gallery.masonry .work { margin: 0; }
.work figure { margin: 0; }
.work img { width: 100%; height: auto; display: block; }
.work figcaption { padding: .25rem 0 0; font-size: .85rem; }
.work figcaption small { display: block; opacity: .6; }

/* Video tile play marker (no animation) */
.work .play { position: relative; }
.work .play::after {
  content: "\25B6";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,.8);
}

/* Detail page */
nav.crumb { font-size: .9rem; margin: 0 0 1rem; opacity: .8; }
/* keep the image within a typical browser window — no full-page scroll for tall images */
.detail img { max-width: 100%; max-height: 80vh; width: auto; height: auto; display: block; }
.detail .embed { position: relative; padding-top: 56.25%; }
.detail .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; font-size: .9rem; margin: 1rem 0; }
.detail dt { opacity: .6; }
.detail dd { margin: 0; }
.detail .desc { max-width: 60ch; }
nav.prevnext { margin-top: 2rem; font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; }
