/* Dinos.info - species gallery ([dn_species_gallery], includes/species-gallery.php; the Classification section's
   right column). Core 0.14.2, Ben 2026-10-14 (brief next-prompt-species-page-2026-10-14-evening, item 3). Tokens and the
   v3 picture treatment only (16:10 frame, the corner tag, the label line under the picture; layout3.css).
   Without JavaScript the slides stack as a list, every picture and credit visible; species-gallery.js (and the page's
   dn-js class, set in the head) show one slide at a time. Every slide is as tall as the tallest (the track stretches
   them), so moving between pictures never moves the page. */

.dn-sg { position: relative; min-width: 0; width: 100%; }   /* full width even in a flex column with align-items: start, so a long thumbnail strip scrolls instead of widening the gallery */
.dn-sg-view { position: relative; }
.dn-sg-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.dn-sg-slide { margin: 0; padding: 0; min-width: 0; list-style: none; }
.dn-sg-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.dn-sg-pic { position: relative; flex: none; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line-dark); background: #1d1f22; }
.dn-sg-pic img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; margin: 0; }
/* fossil photos are shown whole (never cropped), on the frame's dark ground */
.dn-sg-slide.is-photo .dn-sg-pic img { object-fit: contain; }
.dn-sg-open { position: absolute; inset: 0; display: block; cursor: zoom-in; }
.dn-sg-open:focus-visible { outline: 2px solid transparent; box-shadow: inset 0 0 0 3px var(--action); }
.dn-sg-tag { position: absolute; left: 10px; bottom: 10px; z-index: 1; pointer-events: none; font-size: 12px; line-height: 16px; color: var(--bone-white); background: #121417d9; padding: 3px 8px; border-radius: var(--radius-sm); }

/* The credit line wraps under the picture at every width: block flow, nothing clipped or laid over it (item 4). */
.dn-sg-cap { display: block; min-width: 0; margin: 0; font-size: 12px; line-height: 18px; color: var(--text-muted-on-dark); overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.dn-sg-cap > span { display: block; }
.dn-sg-cap > span + span { margin-top: 2px; }
.dn-sg-cap > a { display: inline-block; margin: 4px 16px 0 0; }
.dn-sg-cap a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dn-sg-cap a:hover { color: var(--accent-on-dark); }
.dn-sg-cap a:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring-dark); border-radius: 2px; }
.dn-sg-il, .dn-sg-what { color: var(--text-on-dark); }
.dn-sg-cap > .dn-sg-il { display: flex; gap: 6px; align-items: flex-start; }
.dn-sg-il svg { flex: none; width: 12px; height: 12px; margin-top: 3px; fill: var(--action); }

/* One slide at a time (JavaScript on) */
.dn-js .dn-sg .dn-sg-view, .dn-sg.is-ready .dn-sg-view { overflow: hidden; touch-action: pan-y; }
.dn-js .dn-sg .dn-sg-track, .dn-sg.is-ready .dn-sg-track { display: flex; gap: 0; align-items: stretch; transition: transform .35s ease; }
.dn-js .dn-sg .dn-sg-slide, .dn-sg.is-ready .dn-sg-slide { flex: 0 0 100%; }
.dn-sg.is-dragging .dn-sg-track { transition: none; }
.dn-sg.is-dragging .dn-sg-open { cursor: grabbing; }

/* Controls: hidden without JavaScript (the list shows every picture) */
.dn-sg-ctl, .dn-sg-thumbs { display: none; }
.dn-js .dn-sg .dn-sg-ctl, .dn-sg.is-ready .dn-sg-ctl { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.dn-sg-prev, .dn-sg-next, .dn-sg-play { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; margin: 0; padding: 0; border-radius: 20px; border: 1px solid var(--line-dark); background: var(--surface-dark-raised); color: var(--text-on-dark); cursor: pointer; }
.dn-sg-play { padding: 0 14px; font: 700 12px/1 var(--font-heading); letter-spacing: .06em; text-transform: uppercase; }
.dn-sg-prev:hover, .dn-sg-next:hover, .dn-sg-play:hover { border-color: var(--action); color: var(--accent-on-dark); }
.dn-sg-prev[aria-disabled="true"], .dn-sg-next[aria-disabled="true"] { opacity: .4; cursor: default; border-color: var(--line-dark); color: var(--text-on-dark); }
.dn-sg-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.dn-sg-dot { position: relative; width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.dn-sg-dot::before { content: ""; position: absolute; left: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ffffff40; }
.dn-sg-dot:hover::before { background: var(--fossil-stone); }
.dn-sg-dot[aria-current="true"]::before { background: var(--action); left: 7px; top: 7px; width: 10px; height: 10px; }
.dn-js .dn-sg .dn-sg-thumbs, .dn-sg.is-ready .dn-sg-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 2px; }
.dn-sg-thumb { flex: none; width: 72px; height: 45px; margin: 0; padding: 0; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); overflow: hidden; background: #1d1f22; cursor: pointer; opacity: .7; }
.dn-sg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dn-sg-thumb[aria-current="true"] { opacity: 1; border-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
.dn-sg-prev:focus-visible, .dn-sg-next:focus-visible, .dn-sg-play:focus-visible, .dn-sg-dot:focus-visible, .dn-sg-thumb:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring-dark); }

/* Reduced motion: no slide animation (and no autoplay, species-gallery.js) */
@media (prefers-reduced-motion: reduce) {
  .dn-sg .dn-sg-track, .dn-js .dn-sg .dn-sg-track, .dn-sg.is-ready .dn-sg-track { transition: none; }
}
