/* Dark navbar: override pkgdown's hardcoded bg-light class */
.navbar {
  background-color: #0E171E !important;
  --bs-navbar-color: rgba(255, 251, 242, 0.85);
  --bs-navbar-hover-color: #007EA7;
  --bs-navbar-active-color: #D96E34;
  --bs-navbar-brand-color: #FFFBF2;
  --bs-navbar-brand-hover-color: #007EA7;
  --bs-navbar-toggler-border-color: rgba(255, 251, 242, 0.2);
}

/* Code blocks: teal-tinted background (light mode) */
[data-bs-theme="light"] pre, [data-bs-theme="light"] code {
  background-color: #E8F4F8;
}

/* pkgdown inverts plot images in dark mode; maps keep their colours. */
[data-bs-theme="dark"] img.r-plt,
[data-bs-theme="dark"] pre .r-plt.img img,
[data-bs-theme="dark"] .cell-output-display img {
  filter: none;
}

/* Output images: rounded, never wider than the text column. */
img.r-plt, main table img { max-width: 100%; height: auto; border-radius: 6px; }

/* Basemap gallery grid */
.bm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1rem 0 1.5rem; }
.bm-cell { margin: 0; }
.bm-cell img { width: 100%; height: auto; border-radius: 6px; display: block; }
.bm-cell figcaption { font-size: 0.85rem; margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.bm-cell figcaption span { opacity: 0.65; }
