/* species-writeup.js. Sits at the bottom of a species card or lightbox. It inherits the host's text colour and uses
   translucent fills, so it reads on the dark card, the lightbox and the feed alike without a second palette. */
.swu { --swu-size: 12px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--swu-size); line-height: 1.6; font-weight: 400; text-align: left; text-transform: none; letter-spacing: 0;
  color: rgba(255,255,255,.88); -webkit-text-size-adjust: 100%; }
.swu-chip { display: inline-block; margin: 0 0 8px; padding: 3px 9px; border-radius: 999px; font-size: .84em; line-height: 1.3;
  font-weight: 500; letter-spacing: .02em; white-space: nowrap; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); }
.swu-chip[data-tone="calm"] { background: rgba(140,190,150,.16); border-color: rgba(140,190,150,.38); color: #d3ecd8; }
.swu-chip[data-tone="watch"] { background: rgba(214,196,120,.16); border-color: rgba(214,196,120,.4); color: #efe3b4; }
.swu-chip[data-tone="warm"] { background: rgba(236,150,84,.2); border-color: rgba(236,150,84,.55); color: #ffd2a6; }
.swu-chip[data-tone="quiet"] { color: rgba(255,255,255,.76); }
.swu-p { margin: 0; font: inherit; color: inherit; max-width: 62ch; overflow-wrap: anywhere; }
.swu-src { margin: 9px 0 0; font-size: .88em; color: rgba(255,255,255,.72); }
.swu-src > summary { display: inline-block; cursor: pointer; padding: 5px 0; list-style: none; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.35); min-height: 24px; }
.swu-src > summary::-webkit-details-marker { display: none; }
.swu-src > summary::after { content: ' +'; }
.swu-src[open] > summary::after { content: ' \2212'; }
.swu-src ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.swu-src li { margin: 0; padding: 0; }
.swu-src a { display: inline-block; padding: 4px 0; color: rgba(255,255,255,.88); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-color: rgba(255,255,255,.35); overflow-wrap: anywhere; }
.swu-src a:hover, .swu-src a:focus-visible { color: #fff; text-decoration-color: currentColor; }
.swu-src summary:focus-visible, .swu-src a:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

/* the map card: a 9.5-11 px panel, so the paragraph sits at its own scale */
#cardSpecies .swu { --swu-size: 11.5px; }
#cardSpecies figure[data-sw] { cursor: pointer; }
#cardSpecies figure[data-sw]:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }
#cardSpecies figure[data-sw][aria-expanded="true"] img { box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
#cardSpecies .swu-hint { margin-top: 6px; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }

/* the gallery lightbox: a band under the caption, scrolls on its own so a long paragraph never pushes the picture away */
#viewer .vwu { flex: none; width: 100%; max-width: 1500px; margin: 0 auto; max-height: 38vh; overflow-y: auto;
  padding: 0 clamp(16px,4vw,48px) calc(14px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
#viewer .vwu .swu { font-family: var(--ui, inherit); --swu-size: 14px; margin-top: 0; max-width: 760px; }
@media (max-width: 640px) { #viewer .vwu .swu { --swu-size: 13px; } #viewer .vwu { max-height: 42vh; } }

/* the board's expanded tile and the feed card */
.bs-vi .swu { --swu-size: 12.5px; }
.card .swu { --swu-size: 13px; margin-top: 14px; pointer-events: auto; }
@media (prefers-reduced-motion: no-preference) { .swu { animation: swu-in .22s ease-out both; } }
@keyframes swu-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* the feed: opens over the card, the way the real photograph does (references.css .refbox) */
.card > .swbox { position: absolute; left: 10px; right: 10px; top: 72px; z-index: 6; max-height: min(72vh, 560px); overflow: auto;
  padding: 16px 16px 14px; background: rgba(6,8,11,.94); border-radius: 14px; }
.card > .swbox[hidden] { display: none; }
.card > .swbox .swu { margin: 0; padding: 0; border-top: 0; }

/* in the map card the button bar is sticky at the bottom: leave room for it when the write-up scrolls into view */
#cardSpecies .swbox { scroll-margin-bottom: 84px; }
