/*
 * Overrides on top of avian.css (the upstream look). The upstream is a JS SPA
 * that animates a sliding pill behind the active tab; we server-render, so we
 * hide that pill and give the active link the raised-pill look directly. The
 * nav items are links, not buttons, so we mirror the button styling onto <a>.
 */

.seg-pill { display: none !important; }

/* Window picker (top) — links styled like the upstream buttons. */
.top .window-pick a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.18em;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.top .window-pick a:hover { color: var(--ink); }
.top .window-pick a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* Bottom view slider — same treatment. */
.slider a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.2em;
  padding: 11px 24px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.slider a:hover { color: var(--ink); }
.slider a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* Atlas sort + scope controls — links styled like the upstream icon buttons. */
.atlas-sort a, .atlas-scope a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.16em;
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.atlas-sort a:hover, .atlas-scope a:hover { color: var(--ink); }
.atlas-sort a[aria-current="true"], .atlas-scope a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* The upstream sizes timeline squares in px via JS; we drive width as a % of
   the column, so aspect-ratio keeps them square. */
.stats-tl-square { aspect-ratio: 1; }

/* English gloss beside the Irish name in the stats side-lists. */
.stats-side .gloss {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.82em;
  margin-left: 6px;
}

/* In the web view the birds sit on the page; only the Inky screenshot needs the
   cream paper ground, so hide it here (the bare /panel has no CSS, keeps it). */
.gcollage .collage__bg { display: none; }

/* Collage web view: centre our 800x480 SVG panel in the available space. */
.gcollage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Caption pill — matches the parent: a centred, drop-shadowed pill that's blank
   until a bird is hovered/tapped, naming that one bird and its windowed count. */
.collage-tip {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 18px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  font: italic 15px/1.3 Baskerville, "Hoefler Text", "EB Garamond", Georgia, serif;
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.collage-tip[aria-hidden="false"] { opacity: 1; }
.collage-tip .ct-name { font-style: normal; font-weight: 600; }
.collage-tip .ct-n { font-style: normal; font-weight: 700; }
.collage-tip .ct-w { color: var(--ink-soft); }
.gcollage svg {
  width: auto;
  height: auto;
  max-width: min(100%, 1600px);
  max-height: 100%;
}

/* Species detail modal — avian.css styles the shell (#detail-modal, .modal-card,
   .modal-stats, …); these fill the gaps for our bilingual, audio-free panel. */
body.modal-open { overflow: hidden; }
.modal-info .common {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
/* Recordings: no audio yet, so a plain two-column row (when · confidence)
   instead of the parent's play-button grid. */
.modal-recordings li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 10px; border-radius: 6px;
  background: var(--paper); box-shadow: var(--edge);
}
.modal-recordings .rec-when { color: var(--ink); }
.modal-recordings .rec-when small {
  margin-left: 8px; color: var(--ink-soft);
  font-size: 11px; letter-spacing: 0.02em;
}
.modal-recordings .rec-conf {
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
  font-size: 12px; font-weight: 600;
}

/* Stats page — a clean bar chart + side lists. (Replaces the parent's
   JS-driven editorial timeline, which didn't survive the static port: its
   bars rendered zero-height inside zero-width columns.) Species rows open
   the detail modal, like the collage and atlas. */
.view#v1 { overflow-y: auto; }
.stats2 {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 56px;
  max-width: 1080px; width: 100%; margin: 0 auto;
  align-items: start;
}
@media (max-width: 820px) { .stats2 { grid-template-columns: 1fr; gap: 36px; } }
.stats2 h3 {
  font: 700 10px ui-monospace, Menlo, monospace; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink);
  border-left: 2px solid var(--accent); padding-left: 10px; margin: 0 0 2px;
}
.stats2 small {
  display: block; font: 9px ui-monospace, Menlo, monospace; color: var(--ink-soft);
  letter-spacing: 0.06em; margin: 0 0 14px 12px;
}

/* Horizontal bars — bilingual name, proportional bar, count. */
.barlist { list-style: none; margin: 0; padding: 0; }
.barlist-row {
  display: grid; grid-template-columns: minmax(110px, 1.05fr) minmax(0, 2fr) auto;
  gap: 16px; align-items: center;
  padding: 5px 0; text-decoration: none; color: inherit;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}
.barlist-name .com { display: block; font: 600 13.5px/1.2 ui-serif, Georgia, serif; color: var(--ink); }
.barlist-name .sci { display: block; font-style: italic; font-size: 10.5px; color: var(--ink-soft); }
.barlist-track {
  height: 12px; background: var(--paper-2); border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.barlist-fill {
  display: block; height: 100%; min-width: 3px;
  background: var(--ink); border-radius: 999px;
  transition: background 140ms ease, width 320ms cubic-bezier(.2, .7, .3, 1);
}
.barlist-row:hover .barlist-fill { background: var(--accent); }
.barlist-ct {
  font: 11.5px ui-monospace, Menlo, monospace; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right;
}

/* Side lists — By Period, First Detections. */
.stats2-side .grp + .grp { margin-top: 26px; }
.stats2-side .rows { list-style: none; margin: 0; padding: 0; }
.stats2-side .row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline;
  padding: 4px 0; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  text-decoration: none; color: inherit;
  font: 12.5px/1.3 ui-serif, Georgia, serif;
}
a.row:hover { background: var(--paper-2); }
.stats2-side .gloss { font-style: italic; color: var(--ink-soft); font-size: 11px; margin-left: 6px; }
.stats2-side .ct { font: 11px ui-monospace, Menlo, monospace; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stats2-side .yr { font: 10px ui-monospace, Menlo, monospace; color: var(--accent-2); letter-spacing: 0.04em; }

/* Bilingual description toggle — English ⇄ Gaeilge, shown only when the Irish
   Wikipedia article exists. */
.desc-langs { margin: 14px 0 0; }
.lang-toggle {
  display: inline-flex; gap: 2px; margin-bottom: 8px;
  padding: 2px; border-radius: 999px; background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.lang-toggle button {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 12px; border-radius: 999px;
  font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.lang-toggle button[aria-current="true"] {
  color: var(--ink); background: var(--paper); box-shadow: var(--edge);
}
.lang-toggle button:hover { color: var(--ink); }
.desc-langs .desc { margin-top: 0; }

/* Atlas cards are links (they open the detail modal) — drop the anchor underline
   and inherit ink colour so they read as cards, not hyperlinks. */
a.bird-card { text-decoration: none; color: inherit; }

/* Atlas cards: flat to suit the bold linocut prints. The soft drop-shadow was
   tuned for the old watercolour art; under hard black keylines it reads as
   clutter, so drop it for a clean hairline that lifts only slightly on hover. */
.atlas-grid .bird-card {
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.atlas-grid .bird-card:hover {
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.26);
  transform: translateY(-1px);
}
