/* Dinos.info - shared parts of the fossil maps (dn-fossil-map.js): group markers, group labels, the colour
   fossil card (FossilCard) and the Mesozoic age bar. Approved 2026-10-12, approval sheet row 19 (DECISIONS).
   Colours are design tokens; the card's period band uses the dn-ics-period-* classes (ICS colour + label colour). */

/* ---------- markers ---------- */
.dn-fm-mk { display: block; overflow: visible; }
.dn-fm-mk .h { stroke: var(--prehistoric-slate); }
.dn-fm-mk.halo-bone .h { stroke: var(--bone-white); }
.dn-fm-mk.is-uncertain .f { fill: var(--prehistoric-slate); }
.dn-fm-mk.is-uncertain .f { stroke: var(--fm-c); }
.dn-fm-mk.is-certain .f { fill: var(--fm-c); }
.dn-fm-mk.dn-fm-unplaced.is-uncertain .f { fill: none; }
.dn-fm-theropoda { --fm-c: var(--data-theropoda); }
.dn-fm-sauropodomorpha { --fm-c: var(--data-sauropodomorpha); }
.dn-fm-ornithischia { --fm-c: var(--data-ornithischia); }
.dn-fm-early-saurischia { --fm-c: var(--data-early-saurischia); }
.dn-fm-mesozoic-birds { --fm-c: var(--data-mesozoic-birds); }
.dn-fm-unplaced { --fm-c: var(--data-unplaced); }

/* Leaflet icon: 44 x 44 hit area, the drawing centred; selected = 36 px icon on a dark disc, Sunset Orange ring */
.dn-fm-icon { background: none; border: 0; overflow: visible; }
.dn-fm-pin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.dn-fm-icon.is-sel { z-index: 900 !important; }
.dn-fm-icon.is-sel .dn-fm-pin { background: var(--prehistoric-slate); box-shadow: 0 0 0 2px var(--sunset-orange); }
.dn-fm-icon.is-sel .dn-fm-mk { width: 40px; height: 26px; }
.dn-fm-icon:focus-visible { outline: 2px solid transparent; }
.dn-fm-icon:focus-visible .dn-fm-pin { box-shadow: var(--focus-ring-dark); }
.dn-fm-icon.is-sel:focus-visible .dn-fm-pin { box-shadow: 0 0 0 2px var(--sunset-orange), 0 0 0 4px var(--prehistoric-slate), 0 0 0 6px var(--bone-white); }
.dn-fm-icon.has-label { z-index: 800 !important; }
.dn-fm-icon.is-sel.has-label { z-index: 900 !important; }
/* Clusters keep the numbered circle; the icon box is the 44 x 44 hit area around it */
.dn-fm-cl { background: none; border: 0; display: flex !important; align-items: center; justify-content: center; }

/* ---------- group labels ---------- */
.dn-fm-label { position: absolute; z-index: 1; white-space: nowrap; pointer-events: none; padding: 1px 8px 1px 7px; background: var(--prehistoric-slate); border-left: 3px solid var(--fm-c, var(--data-unplaced)); border-radius: 2px; font-family: var(--font-body); font-weight: 600; font-size: 12px; line-height: 18px; color: var(--bone-white); visibility: hidden; left: 0; top: 0; }
.dn-fm-label.g-theropoda { --fm-c: var(--data-theropoda); }
.dn-fm-label.g-sauropodomorpha { --fm-c: var(--data-sauropodomorpha); }
.dn-fm-label.g-ornithischia { --fm-c: var(--data-ornithischia); }
.dn-fm-label.g-early-saurischia { --fm-c: var(--data-early-saurischia); }
.dn-fm-label.g-mesozoic-birds { --fm-c: var(--data-mesozoic-birds); }
.dn-fm-label.g-unplaced { --fm-c: var(--data-unplaced); }
.dn-fm-label.pos-r, .dn-fm-label.pos-l, .dn-fm-label.pos-t, .dn-fm-label.pos-b { visibility: visible; }
.dn-fm-label.pos-r { left: calc(50% + 18px); top: 50%; transform: translateY(-50%); }
.dn-fm-label.pos-l { left: auto; right: calc(50% + 18px); top: 50%; transform: translateY(-50%); }
.dn-fm-label.pos-t { left: 50%; top: auto; bottom: calc(50% + 12px); transform: translateX(-50%); }
.dn-fm-label.pos-b { left: 50%; top: calc(50% + 12px); transform: translateX(-50%); }

/* ---------- key rows ---------- */
.dn-fm-key { display: inline-flex; align-items: center; gap: 8px; }
.dn-fm-key .dn-fm-mk { flex: none; width: 30px; height: 20px; }

/* ---------- Mesozoic age bar (also the Discovery Map's list view and species panel) ---------- */
.dm-mtl { position: relative; width: 100%; }
.dm-mtl .bar { position: relative; height: 10px; border-radius: 2px; overflow: visible; display: block; }
.dm-mtl .bar span { position: absolute; top: 0; bottom: 0; }
.dm-mtl .rng { position: absolute; top: -4px !important; bottom: -4px !important; min-width: 6px; border: 2px solid var(--bone-white); border-radius: 3px; box-shadow: 0 0 0 1px var(--prehistoric-slate), inset 0 0 0 1px var(--prehistoric-slate); }
.dm-mtl .rng.fuzzy { border-style: dashed; }
.dm-mtl .ends { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; line-height: 14px; color: var(--text-muted-on-dark); }
.dm-mtl .ends .dm-mtl-label { color: var(--text-on-dark); text-align: center; }
.dm-mtl.xs .bar { height: 6px; }
.dm-mtl.xs .rng { top: -3px !important; bottom: -3px !important; border-width: 1.5px; min-width: 4px; }

/* ---------- the colour fossil card ---------- */
.dn-fc, .dn-fc * { box-sizing: border-box; }
.dn-fc [hidden], .dn-fm-label[hidden] { display: none !important; }
.dn-fc { position: relative; display: flex; flex-direction: column; width: 340px; max-width: 100%; background: var(--prehistoric-slate); border: 1px solid var(--border-control-dark); border-radius: var(--radius-md); box-shadow: var(--shadow-float); overflow: hidden; color: var(--text-on-dark); font-family: var(--font-body); text-align: left; }
.fc-band { flex: none; position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 10px 48px 10px 16px; cursor: grab; touch-action: none; user-select: none; }
.fc-band.is-dragging { cursor: grabbing; }
.fc-band.is-split { flex-direction: row; padding: 0 44px 0 0; background: var(--prehistoric-slate); }
.fc-band.is-split .fc-seg { flex: 1 1 0; display: flex; align-items: center; padding: 10px 12px; min-width: 0; }
.fc-period { margin: 0; font-family: var(--font-heading); font-weight: 700; font-size: 13px; line-height: 18px; letter-spacing: .08em; text-transform: uppercase; color: inherit; }
.fc-stage { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: inherit; }
.fc-stage-line { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-on-dark); }
.fc-x { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; border-radius: var(--radius-sm); color: inherit; cursor: pointer; }
.fc-band.is-split .fc-x { color: var(--text-on-dark); }
.fc-x svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fc-x:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.fc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 14px; }
.fc-species { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fc-sp { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-dark); }
.fc-sp:first-child { padding-top: 0; }
.fc-mk { flex: none; width: 34px; display: flex; justify-content: center; }
.fc-sp-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dn-fc .fc-name { color: var(--text-on-dark); text-decoration: none; overflow-wrap: anywhere; }
.fc-name i { font-family: var(--font-name, "Barlow Semi Condensed", "Barlow Condensed", "Arial Narrow", sans-serif); font-weight: 700; font-size: 18px; line-height: 20px; overflow-wrap: break-word; }
a.fc-name:hover i { color: var(--accent-on-dark); }
a.fc-name i { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--border-control-dark); }
.fc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; line-height: 17px; color: var(--text-muted-on-dark); }
.fc-unc { display: inline-flex; align-items: center; gap: 4px; color: var(--text-on-dark); }
.fc-unc svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fc-here { font-size: 10px; line-height: 14px; padding: 1px 6px; }
.fc-more { align-self: flex-start; margin-top: -6px; min-height: 32px; padding: 0; background: none; border: 0; color: var(--accent-on-dark); font-family: var(--font-heading); font-weight: 700; font-size: 12px; letter-spacing: .04em; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fc-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.fc-facts div { display: grid; grid-template-columns: 18px 84px minmax(0, 1fr); gap: 10px; align-items: start; }
.fc-facts svg { margin-top: 2px; fill: none; stroke: var(--accent-on-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fc-facts dt { font-family: var(--font-heading); font-weight: 700; font-size: 11px; line-height: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted-on-dark); }
.fc-facts dd { margin: 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.fc-count { margin: 0; font-size: 13px; line-height: 20px; color: var(--text-on-dark); }
.fc-src { margin: 0; padding-top: 10px; border-top: 1px solid var(--line-dark); font-size: 12px; line-height: 17px; color: var(--text-muted-on-dark); }
.fc-name:focus-visible, .fc-more:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring-dark); border-radius: 2px; }

/* Card on a Leaflet map, placed by DNFossilMap.place(); a bottom sheet on phones. Below the attribution (z 1000). */
.dn-fc-anchor { position: absolute; z-index: 900; }
.dn-fc-anchor::after { content: ""; position: absolute; left: var(--fc-arrow-x, 50%); bottom: -7px; width: 12px; height: 12px; background: var(--prehistoric-slate); border-right: 1px solid var(--border-control-dark); border-bottom: 1px solid var(--border-control-dark); transform: translateX(-50%) rotate(45deg); }
.dn-fc-anchor.below::after { display: none; }
.dn-fc-anchor.free::after, .dn-fc-anchor.docked::after { display: none; }
.dn-fc-anchor.docked { left: 8px; right: 8px; }
.dn-fc-anchor.docked .dn-fc { width: auto; }
.dn-fc-anchor.docked .fc-band { cursor: auto; touch-action: auto; user-select: auto; }

@media (max-width: 760px) {
  .fc-body { gap: 10px; padding: 12px 14px; }
  .fc-name i { font-size: 17px; }
}
