/* SF Bird Records Blocks. Uses the Sandbach Flashes theme colours when they're there. */
.sfbrb-records, .sfbrb-details, .sfbrb-charts, .sfbrb-mapbox {
	--sfbrb-text: var(--sc-text, #1f2328);
	--sfbrb-muted: var(--sc-muted, #5b636e);
	--sfbrb-surface: var(--sc-surface, #f5f6f7);
	--sfbrb-border: var(--sc-border, #dfe2e5);
	--sfbrb-accent: var(--sc-accent, #2f6f4e);
	--sfbrb-accent-text: var(--sc-accent-text, #fff);
	--sfbrb-radius: var(--sc-radius, 6px);
	--sfbrb-mega: #c62828;
	--sfbrb-pencil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4z'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
}
.sfbrb-records .screen-reader-text, .sfbrb-details .screen-reader-text, .sfbrb-charts .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* Period buttons */
.sfbrb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1rem; }
.sfbrb-toolbar .sfbrb-periods { margin: 0; }
.sfbrb-periods { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
/* With a sort or view switch: period buttons on top, then the count on the left and the switches on the right. */
.sfbrb-records.has-controls .sfbrb-toolbar { display: block; margin-bottom: 1.25rem; }
.sfbrb-records.has-controls .sfbrb-periods { margin: 0 0 1rem; }
.sfbrb-toolbar__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 1rem; border-top: 1px solid var(--sfbrb-border); }
.sfbrb-records.has-controls .sfbrb-periods + .sfbrb-toolbar__bar { margin-top: 0; }
.sfbrb-toolbar__bar:first-child { padding-top: 0; border-top: 0; }
.sfbrb-toolbar .sfbrb-toolbar__summary { margin: 0; }
.sfbrb-toolbar__controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-left: auto; }
.sfbrb-toolbar__controls .sfbrb-views { margin-left: 0; }
.sfbrb-records.has-controls .sfbrb-records__body > .sfbrb-summary { display: none; }
@media (max-width: 600px) {
	.sfbrb-toolbar__controls { margin-left: 0; width: 100%; justify-content: space-between; gap: .5rem; }
	.sfbrb-toolbar__controls .sfbrb-view { padding: .35rem .65rem; }
}
.sfbrb-views { display: inline-flex; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--sfbrb-border); padding: 3px; gap: 2px; margin-left: auto; }
.sfbrb-view { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--sfbrb-muted); text-decoration: none; line-height: 1.2; }
.sfbrb-view svg { width: 16px; height: 16px; }
.sfbrb-view:hover { color: var(--sfbrb-text); }
.sfbrb-view.is-active { background: var(--sfbrb-surface); color: var(--sfbrb-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.sfbrb-view:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-period {
	display: inline-block; padding: .45rem .95rem; border-radius: 999px; font-weight: 600; font-size: .95rem; line-height: 1.3;
	text-decoration: none; color: var(--sfbrb-accent); background: transparent; box-shadow: inset 0 0 0 2px var(--sfbrb-accent);
	transition: background-color .15s, color .15s;
}
.sfbrb-period:hover, .sfbrb-period:focus-visible { background: var(--sfbrb-surface); }
.sfbrb-period.is-active { background: var(--sfbrb-accent); color: var(--sfbrb-accent-text); }
.sfbrb-period:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }

/* Phone dropdown for the periods */
.sfbrb-period-select { display: none; }
.sfbrb-period-select label { display: block; margin: 0 0 .35rem; font-size: .85rem; font-weight: 600; color: var(--sfbrb-muted); }
.sfbrb-period-select select {
	width: 100%; padding: .65rem 2.5rem .65rem 1rem; border: 2px solid var(--sfbrb-accent); border-radius: 999px; font: inherit; font-weight: 600;
	color: var(--sfbrb-accent); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%232f6f4e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1rem center / 16px;
	-webkit-appearance: none; appearance: none; cursor: pointer;
}
.sfbrb-period-select select:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-period-select button { margin-top: .5rem; }
/* The periods are a dropdown on every screen size. */
.sfbrb-toolbar .sfbrb-periods { display: none; }
.sfbrb-period-select { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; margin: 0; }
.sfbrb-period-select label { margin: 0; }
.sfbrb-period-select select { width: auto; min-width: 12rem; padding-top: .5rem; padding-bottom: .5rem; }
@media (min-width: 601px) {
	/* One row: dropdown, then the count, then the switches on the right. */
	.sfbrb-records.has-controls .sfbrb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
	.sfbrb-records.has-controls .sfbrb-toolbar__bar { flex: 1 1 auto; padding-top: 0; border-top: 0; }
}
@media (max-width: 600px) {
	.sfbrb-period-select { display: block; flex: 1 1 100%; }
	.sfbrb-period-select label { margin: 0 0 .35rem; }
	.sfbrb-period-select select { width: 100%; padding-top: .65rem; padding-bottom: .65rem; }
	.sfbrb-records.has-controls .sfbrb-period-select { margin: 0 0 1rem; }
}

.sfbrb-records__body { transition: opacity .15s; }
.sfbrb-records.is-loading .sfbrb-records__body { opacity: .45; pointer-events: none; }
.sfbrb-summary { margin: 0 0 .75rem; color: var(--sfbrb-muted); font-size: .95rem; }
.sfbrb-summary:empty { display: none; }
.sfbrb-empty { padding: 1.25rem; background: var(--sfbrb-surface); border-radius: var(--sfbrb-radius); margin: 0; }
.sfbrb-muted { color: var(--sfbrb-muted); }
.sfbrb-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 1.5rem 0 0; }
.sfbrb-pager__count { margin: 0; color: var(--sfbrb-muted); font-size: .9rem; }
.sfbrb-pager__links { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.sfbrb-pager__link { display: inline-flex; align-items: center; justify-content: center; gap: .3em; min-width: 2.5rem; height: 2.5rem; padding: 0 .75rem; border: 1px solid var(--sfbrb-border); border-radius: 999px; color: inherit; text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1; }
a.sfbrb-pager__link:hover, a.sfbrb-pager__link:focus-visible { background: var(--sfbrb-surface); }
a.sfbrb-pager__link:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-pager__link.is-current { background: var(--sfbrb-accent); border-color: var(--sfbrb-accent); color: var(--sfbrb-accent-text); }
.sfbrb-pager__link.is-disabled { opacity: .4; }
.sfbrb-pager__gap { padding: 0 .2rem; color: var(--sfbrb-muted); }
@media (max-width: 600px) {
	.sfbrb-pager { justify-content: center; }
	.sfbrb-pager__count { width: 100%; text-align: center; }
	.sfbrb-pager__links { gap: .25rem; justify-content: center; }
	.sfbrb-pager__link { min-width: 2.15rem; height: 2.15rem; padding: 0 .4rem; font-size: .85rem; }
	.sfbrb-pager__gap { padding: 0; }
	.sfbrb-pager__prev, .sfbrb-pager__next { font-size: 0; gap: 0; padding: 0; width: 2.15rem; }
	.sfbrb-pager__prev span, .sfbrb-pager__next span { font-size: 1.1rem; }
	.sfbrb-pager__link.is-disabled, .sfbrb-pager__num--far { display: none; }
}

/* Rarity badges */
.sfbrb-badge {
	display: inline-block; vertical-align: middle; padding: .1em .5em; margin-left: .35em; border-radius: 3px;
	font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.6;
	background: #eef0f2; color: #1d2327;
}
.sfbrb-badge--county { background: #fcf0d6; color: #6b4a00; }
.sfbrb-badge--national { background: #fbe0d0; color: #8a2c00; }
.sfbrb-badge--mega { background: var(--sfbrb-mega); color: #fff; }

/* List */
.sfbrb-table { width: 100%; border-collapse: collapse; margin: 0; font-size: .95rem; }
.sfbrb-table th, .sfbrb-table td { border: 0; border-bottom: 1px solid var(--sfbrb-border); padding: .6rem .5rem; vertical-align: middle; text-align: left; }
/* Column headings: a tinted bar with the accent colour underneath. */
.sfbrb-table thead th { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--sfbrb-accent); background: var(--sfbrb-surface); background: color-mix(in srgb, var(--sfbrb-accent) 9%, var(--sc-bg, #fff)); border-bottom: 2px solid var(--sfbrb-accent); padding-top: .75rem; padding-bottom: .75rem; white-space: nowrap; }
.sfbrb-table thead th:first-child { border-top-left-radius: var(--sfbrb-radius); padding-left: .85rem; }
.sfbrb-table thead th:last-child { border-top-right-radius: var(--sfbrb-radius); padding-right: .85rem; }
.sfbrb-table tbody td:first-child { padding-left: .85rem; }
.sfbrb-table tbody td:last-child { padding-right: .85rem; }
.sfbrb-table tbody tr:not(.sfbrb-row--mega):hover { background: var(--sfbrb-surface); }
/* The list sits on a white card with the same soft shadow as the other blocks. */
.sfbrb-table { border-collapse: separate; border-spacing: 0; background: var(--sc-bg, #fff); border: 1px solid var(--sfbrb-border); border-radius: var(--sfbrb-radius); box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10); }
.sfbrb-table tbody tr:last-child td { border-bottom: 0; }
.sfbrb-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--sfbrb-radius); }
.sfbrb-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--sfbrb-radius); }
/* "Map" button beside the place. */
.sfbrb-where { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.sfbrb-map-btn { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border: 1px solid var(--sfbrb-accent); border-radius: 999px; color: var(--sfbrb-accent); background: transparent; font-size: .75rem; font-weight: 600; line-height: 1.4; text-decoration: none; white-space: nowrap; vertical-align: middle; }
.sfbrb-map-btn:hover, .sfbrb-map-btn:focus-visible { background: var(--sfbrb-accent); color: var(--sfbrb-accent-text); }
.sfbrb-map-btn:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-card__facts .sfbrb-map-btn { margin-left: .35rem; }
/* Pop-up map */
.sfbrb-mapbox { width: min(720px, 94vw); padding: 0; border: 0; border-radius: calc(var(--sfbrb-radius) * 2); background: var(--sc-bg, #fff); color: var(--sfbrb-text); box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45); overflow: hidden; }
.sfbrb-mapbox::backdrop { background: rgba(10, 12, 14, .6); }
.sfbrb-mapbox__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .75rem; }
.sfbrb-mapbox__title { margin: 0; font-size: 1.15rem; }
.sfbrb-mapbox__place { margin: .15rem 0 0; color: var(--sfbrb-muted); font-size: .9rem; }
.sfbrb-mapbox__close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; filter: none; width: 40px; height: 40px; border: 1px solid var(--sfbrb-border); border-radius: 50%; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0; }
.sfbrb-mapbox__close:hover { background: var(--sfbrb-surface); color: inherit; }
.sfbrb-mapbox__close:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-mapbox__map { height: min(60vh, 440px); background: var(--sfbrb-surface); }
.sfbrb-mapbox__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin: 0; padding: .75rem 1.25rem; font-size: .85rem; color: var(--sfbrb-muted); }
.sfbrb-mapbox__osm { font-weight: 600; }
.sfbrb-col-photo { width: 64px; }
.sfbrb-col-photo img { display: block; width: 56px; height: 56px; max-width: none; object-fit: cover; border-radius: var(--sfbrb-radius); }
.sfbrb-col-more { text-align: right !important; white-space: nowrap; }
.sfbrb-species { font-weight: 600; }
a.sfbrb-species { text-decoration: none; color: var(--sfbrb-text); }
a.sfbrb-species:hover { color: var(--sfbrb-accent); text-decoration: underline; }
.sfbrb-sci { display: block; font-style: italic; font-size: .85rem; color: var(--sfbrb-muted); }
.sfbrb-row--mega { background: #fff5f5; }
.sfbrb-more-info.button { padding: .4rem .85rem; font-size: .875rem; }
/* 1.45.1: an arrow after "More info" that slides on hover, like the blog cards. */
.sfbrb-more-info.button::after { content: "\2192"; display: inline-block; margin-left: .35em; transition: transform .2s ease; }
.sfbrb-more-info.button:hover::after, .sfbrb-more-info.button:focus-visible::after, .sfbrb-row:hover .sfbrb-more-info.button::after, .sfbrb-card:hover .sfbrb-more-info.button::after { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .sfbrb-more-info.button::after { transition: none; } }
/* Edit (administrators and editors only) */
.sfbrb-edit { display: inline-block; padding: .35rem .8rem; margin-right: .4rem; border-radius: var(--sfbrb-radius); box-shadow: inset 0 0 0 2px var(--sfbrb-accent); color: var(--sfbrb-accent); font-size: .875rem; font-weight: 600; line-height: 1.5; text-decoration: none; vertical-align: middle; }
.sfbrb-edit:hover { background: var(--sfbrb-accent); color: var(--sfbrb-accent-text); }
.sfbrb-edit:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-card__actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.sfbrb-card__actions .sfbrb-edit { margin-right: 0; }
@media (max-width: 720px) {
	/* Phones: one compact row per sighting. Photo | name (+ Latin) | arrow, then place · date underneath. */
	.sfbrb-table thead { display: none; }
	.sfbrb-table, .sfbrb-table tbody { display: block; width: 100%; }
	.sfbrb-table { overflow: hidden; }
	.sfbrb-table tr { padding-left: .75rem !important; padding-right: .75rem !important; }
	.sfbrb-table tbody tr:last-child { border-bottom: 0; }
	.sfbrb-table tr { display: grid; grid-template-columns: 48px minmax(0, max-content) max-content auto; grid-template-areas: "photo name name more" "photo where when more"; column-gap: .6rem; row-gap: .15rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--sfbrb-border); }
	.sfbrb-table tr:not(:has(.sfbrb-col-photo)) { grid-template-columns: minmax(0, max-content) max-content auto; grid-template-areas: "name name more" "where when more"; }
	.sfbrb-table td { display: block; border: 0; padding: 0 !important; min-width: 0; }
	.sfbrb-table td.sfbrb-col-photo { grid-area: photo; align-self: start; }
	.sfbrb-col-photo img { width: 48px; height: 48px; }
	/* contain: the name never widens the place and date columns under it. */
	.sfbrb-table td.sfbrb-col-species { grid-area: name; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; contain: inline-size; }
	.sfbrb-table td.sfbrb-col-species .sfbrb-sci { display: inline; margin-left: .35rem; font-size: .8rem; }
	.sfbrb-table td.sfbrb-col-where { grid-area: where; font-size: .85rem; color: var(--sfbrb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.sfbrb-table td.sfbrb-col-where + td { grid-area: when; font-size: .85rem; color: var(--sfbrb-muted); white-space: nowrap; }
	.sfbrb-table td.sfbrb-col-where + td { margin-left: -.35rem; }
	.sfbrb-table td.sfbrb-col-where + td::before { content: "· "; }
	.sfbrb-table td.sfbrb-col-where + td + td:not(.sfbrb-col-more) { display: none; }
	.sfbrb-table td.sfbrb-col-more { grid-area: more; display: flex; align-items: center; justify-content: flex-end; gap: .3rem; text-align: right !important; }
	.sfbrb-table td.sfbrb-col-count { display: none; }
	/* The place shortens with "…" but its map pin stays in view. */
	.sfbrb-table .sfbrb-where { display: flex; flex-wrap: nowrap; align-items: center; gap: 0; min-width: 0; }
	.sfbrb-table .sfbrb-where > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
	.sfbrb-table .sfbrb-where .sfbrb-map-btn { flex: 0 0 auto; }
	/* Map: just the pin. */
	.sfbrb-where .sfbrb-map-btn { margin-left: .15rem; padding: .2rem; font-size: 0; gap: 0; border-color: transparent; }
	.sfbrb-where .sfbrb-map-btn svg { width: 16px; height: 16px; }
	/* More info: a round arrow button. */
	.sfbrb-table .sfbrb-more-info.button { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
	.sfbrb-table .sfbrb-more-info.button::after { content: ""; width: 8px; height: 8px; margin-left: 0; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateX(-2px) rotate(45deg); }
	.sfbrb-table .sfbrb-more-info.button:hover::after, .sfbrb-table .sfbrb-more-info.button:focus-visible::after, .sfbrb-table .sfbrb-row:hover .sfbrb-more-info.button::after { transform: translateX(0) rotate(45deg); }
	/* Edit (1.43.3): a round pencil button matching the arrow, so it no longer covers the date. */
	.sfbrb-table .sfbrb-edit { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; margin: 0; padding: 0; border-radius: 50%; font-size: 0; line-height: 1; }
	.sfbrb-table .sfbrb-edit::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--sfbrb-pencil) center / contain no-repeat; mask: var(--sfbrb-pencil) center / contain no-repeat; }
	.sfbrb-table tbody tr:not(.sfbrb-row--mega):hover { background: none; }
}

/* Cards */
.sfbrb-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(var(--sfbrb-cols, 4), minmax(0, 1fr)); }
.sfbrb-cards--cols-2 { --sfbrb-cols: 2; }
.sfbrb-cards--cols-3 { --sfbrb-cols: 3; }
.sfbrb-cards--cols-4 { --sfbrb-cols: 4; }
.sfbrb-cards--cols-5 { --sfbrb-cols: 5; }
.sfbrb-cards--cols-6 { --sfbrb-cols: 6; }
@media (max-width: 1023px) {
	.sfbrb-cards--cols-4, .sfbrb-cards--cols-5, .sfbrb-cards--cols-6 { --sfbrb-cols: 3; }
}
@media (max-width: 767px) {
	.sfbrb-cards { --sfbrb-cols: 2 !important; gap: .85rem; }
}
@media (max-width: 479px) {
	.sfbrb-cards--cols-2, .sfbrb-cards--cols-3 { --sfbrb-cols: 1 !important; }
}
.sfbrb-card { display: flex; flex-direction: column; border: 1px solid var(--sfbrb-border); border-radius: var(--sfbrb-radius); overflow: hidden; background: var(--sc-bg, #fff); box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10); }
.sfbrb-card--mega { border-color: var(--sfbrb-mega); box-shadow: 0 0 0 1px var(--sfbrb-mega), 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10); }
/* Every card's photo is the same 4:3 box, cropped to fit. */
.sfbrb-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sfbrb-surface); display: flex; align-items: center; justify-content: center; color: var(--sfbrb-border); }
.sfbrb-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.sfbrb-card__credit { position: absolute; right: .4rem; bottom: .4rem; padding: .1rem .4rem; border-radius: 3px; font-size: .7rem; background: rgba(0, 0, 0, .55); color: #fff; }
@media (max-width: 479px) {
	.sfbrb-cards:not(.sfbrb-cards--cols-2):not(.sfbrb-cards--cols-3) .sfbrb-card__body { padding: .6rem .7rem .75rem; }
	.sfbrb-cards:not(.sfbrb-cards--cols-2):not(.sfbrb-cards--cols-3) .sfbrb-card__facts { font-size: .8rem; }
}
.sfbrb-card__body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.sfbrb-card__body .sfbrb-badge { margin-left: 0; align-self: flex-start; }
.sfbrb-card__title { font-size: 1.1rem; margin: 0; }
.sfbrb-card__title a { color: inherit; text-decoration: none; }
.sfbrb-card__title a:hover { color: var(--sfbrb-accent); text-decoration: underline; }
.sfbrb-card__facts { list-style: none; margin: 0 0 .5rem; padding: 0; font-size: .9rem; }
.sfbrb-card__body > .sfbrb-more-info { margin-top: auto; align-self: flex-start; }
.sfbrb-label { color: var(--sfbrb-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; margin-right: .25rem; }

/* Details */
.sfbrb-back { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--sfbrb-border); }
.sfbrb-back a { text-decoration: none; font-weight: 600; }
/* The details page opens with a hero like the theme's Hero block. */
.sfbrb-hero { padding: 0; margin: 0 0 2rem; }
.sfbrb-hero--plain .cb-hero__slider { background: var(--sfbrb-accent); }
.sfbrb-hero .cb-hero__inner { max-width: 40rem; }
.sfbrb-hero__note { margin: 0 0 .4rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .85); }
.sfbrb-details__title .sfbrb-badge { font-size: .8rem; vertical-align: middle; }
.sfbrb-hero .sfbrb-details__sci { margin: 0; color: rgba(255, 255, 255, .85); }
.sfbrb-hero .sfbrb-details__lede { margin: .35rem 0 0; color: #fff; font-weight: 600; }
/* Sections sit in white panels with the same shadow as the other blocks. */
.sfbrb-details .sfbrb-facts, .sfbrb-details .sfbrb-section {
	background: var(--sc-bg, #fff); border: 1px solid var(--sfbrb-border); border-radius: var(--sfbrb-radius);
	box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10);
}
.sfbrb-details .sfbrb-section { padding: clamp(1.25rem, 3vw, 2rem); }
.sfbrb-details .sfbrb-facts { padding: .25rem 1.25rem; }
.sfbrb-details .sfbrb-facts__row:last-child { border-bottom: 0; }
.sfbrb-details .sfbrb-photo img, .sfbrb-details .sfbrb-map { box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10); }
.sfbrb-details__grid { display: grid; gap: 1.5rem; }
@media (min-width: 860px) {
	.sfbrb-details__grid--map { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
	.sfbrb-details__side { position: sticky; top: 1rem; }
}
.sfbrb-photo { margin: 0 0 1.25rem; }
.sfbrb-photo img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: cover; border-radius: var(--sfbrb-radius); }
.sfbrb-photo figcaption, .sfbrb-gallery figcaption { font-size: .8rem; color: var(--sfbrb-muted); margin-top: .35rem; overflow-wrap: anywhere; }
.sfbrb-facts { margin: 0; border-top: 1px solid var(--sfbrb-border); }
.sfbrb-facts__row { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--sfbrb-border); }
.sfbrb-facts dt { font-weight: 600; color: var(--sfbrb-muted); }
.sfbrb-facts dd { margin: 0; }
.sfbrb-map { height: 340px; border-radius: var(--sfbrb-radius); border: 1px solid var(--sfbrb-border); background: var(--sfbrb-surface); z-index: 0; }
.sfbrb-map img { max-width: none !important; }
.sfbrb-map__links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .875rem; margin: .5rem 0 0; color: var(--sfbrb-muted); }
.sfbrb-section { margin-top: 2.25rem; }
.sfbrb-section h3 { margin: 0 0 .75rem; }
.sfbrb-section h4 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.sfbrb-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.sfbrb-chips li a, .sfbrb-chips li { display: inline-block; }
.sfbrb-chips li a, .sfbrb-chips li:not(:has(a)) { padding: .3rem .7rem; border-radius: 999px; background: var(--sfbrb-surface); text-decoration: none; font-size: .9rem; }
.sfbrb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.sfbrb-stats > div { background: var(--sfbrb-surface); border-radius: var(--sfbrb-radius); padding: .75rem 1rem; }
.sfbrb-stats dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sfbrb-muted); }
.sfbrb-stats dd { margin: .2rem 0 0; font-weight: 600; }
/* Other recent records: a grid of outline buttons. */
.sfbrb-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sfbrb-recent li { margin: 0; }
.sfbrb-species-records > p:last-child { margin: 1.25rem 0 0; }
.sfbrb-recent__item { display: flex; flex-direction: column; gap: .15rem; height: 100%; box-sizing: border-box; padding: .65rem 1rem; border-radius: var(--sfbrb-radius); box-shadow: inset 0 0 0 2px var(--sfbrb-accent); color: var(--sfbrb-text); text-decoration: none; line-height: 1.35; transition: background-color .15s, color .15s; }
.sfbrb-recent__date { font-weight: 700; color: var(--sfbrb-accent); }
.sfbrb-recent__meta { font-size: .875rem; color: var(--sfbrb-muted); }
a.sfbrb-recent__item:hover, a.sfbrb-recent__item:focus-visible { background: var(--sfbrb-accent); color: var(--sfbrb-accent-text); }
a.sfbrb-recent__item:hover .sfbrb-recent__date, a.sfbrb-recent__item:hover .sfbrb-recent__meta,
a.sfbrb-recent__item:focus-visible .sfbrb-recent__date, a.sfbrb-recent__item:focus-visible .sfbrb-recent__meta { color: inherit; }
a.sfbrb-recent__item:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sfbrb-gallery figure { margin: 0; }
.sfbrb-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: var(--sfbrb-radius); background: var(--sfbrb-surface); }
.sfbrb-gallery a:focus-visible img { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
.sfbrb-wiki__text { max-width: none; }
.sfbrb-gallery--wiki { margin-top: 1rem; }
.sfbrb-wiki__source { font-size: .8rem; color: var(--sfbrb-muted); margin-top: 1rem; }

/* Lightbox */
.sfbrb-lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.sfbrb-lightbox::backdrop { background: rgba(10, 12, 14, .88); }
.sfbrb-lightbox img { display: block; max-width: 92vw; max-height: 82vh; width: auto; height: auto; margin: 0 auto; border-radius: 4px; }
.sfbrb-lightbox p { color: #f1f1f1; text-align: center; font-size: .9rem; margin: .6rem auto 0; max-width: 70ch; }
.sfbrb-lightbox button { position: fixed; background: rgba(0, 0, 0, .55); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; line-height: 1; padding: 0; cursor: pointer; }
.sfbrb-lightbox__close { top: 12px; right: 12px; }
.sfbrb-lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.sfbrb-lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }

/* Patch charts: bar charts in panels like the other blocks. One colour (the theme
   green) as each chart has a single series; numbers and labels stay in text colours. */
.sfbrb-charts { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.sfbrb-chart { margin: 0; padding: clamp(1.25rem, 3vw, 1.75rem); background: var(--sc-bg, #fff); border: 1px solid var(--sfbrb-border); border-radius: var(--sfbrb-radius); box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28), 0 3px 8px rgba(15, 23, 42, .10); min-width: 0; }
.sfbrb-chart__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.sfbrb-chart__title { margin: 0; font-size: 1.15rem; }
.sfbrb-chart__sub { margin: .2rem 0 1.25rem; font-size: .875rem; color: var(--sfbrb-muted); }
.sfbrb-chart__pick[hidden], .sfbrb-chart__panel[hidden] { display: none !important; }
/* Year dropdown: a smaller version of the records block's period dropdown. */
.sfbrb-chart__pick select {
	padding: .35rem 2.1rem .35rem .85rem; border: 2px solid var(--sfbrb-accent); border-radius: 999px; font: inherit; font-size: .85rem; font-weight: 600;
	color: var(--sfbrb-accent); background: var(--sc-bg, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%232f6f4e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .75rem center / 14px;
	-webkit-appearance: none; appearance: none; cursor: pointer; max-width: 100%;
}
.sfbrb-chart__pick select:focus-visible { outline: 3px solid var(--sfbrb-accent); outline-offset: 2px; }
/* Upright bars (months, years). */
.sfbrb-cols { position: relative; height: 220px; margin: 0 0 1.75rem 2.25rem; }
.sfbrb-cols__grid { position: absolute; inset: 0; border-bottom: 1px solid var(--sfbrb-muted); }
.sfbrb-cols__line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--sfbrb-border); }
.sfbrb-cols__line span { position: absolute; right: calc(100% + .4rem); top: -.55rem; font-size: .7rem; line-height: 1; color: var(--sfbrb-muted); white-space: nowrap; }
.sfbrb-cols__bars { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr)); gap: 2px; align-items: end; }
.sfbrb-cols__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.sfbrb-cols__bar { display: block; height: var(--h, 0); width: min(70%, 34px); background: var(--sfbrb-accent); border-radius: 4px 4px 0 0; transition: filter .15s; }
.sfbrb-cols__label { position: absolute; top: calc(100% + .35rem); left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--sfbrb-muted); white-space: nowrap; }
.sfbrb-cols__tip { position: absolute; z-index: 2; bottom: calc(var(--h, 0%) + 6px); left: 50%; transform: translateX(-50%); padding: .35rem .6rem; border-radius: 4px; background: var(--sfbrb-text); color: #fff; font-size: .8rem; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.sfbrb-cols__col:first-child .sfbrb-cols__tip, .sfbrb-cols__col:nth-child(2) .sfbrb-cols__tip { left: 0; transform: none; }
.sfbrb-cols__col:last-child .sfbrb-cols__tip, .sfbrb-cols__col:nth-last-child(2) .sfbrb-cols__tip { left: auto; right: 0; transform: none; }
.sfbrb-cols__line--zero { border-top: 0; }
.sfbrb-cols__col:hover .sfbrb-cols__bar, .sfbrb-cols__col:focus-visible .sfbrb-cols__bar, .sfbrb-cols__col.is-active .sfbrb-cols__bar { filter: brightness(.82); }
/* .is-active is set by a tap, as phones don't hover and a tap doesn't count as :focus-visible. */
.sfbrb-cols__col:hover .sfbrb-cols__tip, .sfbrb-cols__col:focus-visible .sfbrb-cols__tip, .sfbrb-cols__col.is-active .sfbrb-cols__tip { opacity: 1; visibility: visible; }
@media (hover: none) { .sfbrb-cols__col { cursor: pointer; -webkit-tap-highlight-color: transparent; } }
.sfbrb-cols__col:focus-visible .sfbrb-cols__bar { outline: 2px solid var(--sfbrb-text); outline-offset: 2px; }
/* Sideways bars (species, places), each with its number at the end. */
.sfbrb-hbars { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.sfbrb-hbars li { display: grid; grid-template-columns: minmax(7rem, 38%) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.sfbrb-hbars__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfbrb-hbars__name a { color: inherit; text-decoration: none; }
.sfbrb-hbars__name a:hover { text-decoration: underline; color: var(--sfbrb-accent); }
.sfbrb-hbars__track { display: block; height: 14px; }
.sfbrb-hbars__bar { display: block; height: 100%; background: var(--sfbrb-accent); border-radius: 0 4px 4px 0; }
.sfbrb-hbars__value { min-width: 2.5ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
/* The same numbers as a table. */
.sfbrb-chart__empty { margin: 0; padding: 1.5rem 0; color: var(--sfbrb-muted); font-size: .9rem; }
.sfbrb-chart__table summary { cursor: pointer; font-size: .85rem; color: var(--sfbrb-accent); font-weight: 600; }
.sfbrb-chart__table table { width: 100%; margin-top: .6rem; border-collapse: collapse; font-size: .875rem; }
.sfbrb-chart__table th, .sfbrb-chart__table td { padding: .3rem .4rem; border-bottom: 1px solid var(--sfbrb-border); text-align: left; font-weight: 400; }
.sfbrb-chart__table thead th { font-weight: 600; color: var(--sfbrb-muted); }
.sfbrb-chart__table td { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
	.sfbrb-cols { height: 180px; margin-left: 1.9rem; }
	.sfbrb-cols__label { font-size: .62rem; }
	.sfbrb-hbars li { grid-template-columns: minmax(6rem, 42%) 1fr auto; font-size: .85rem; }
}
