/* Animal list info sheets — Teaching Zoo */

.animal-list .image-modal {
	cursor: pointer;
}

.animal-list .image-modal:focus-visible {
	outline: 2px solid var(--bs-primary, #0d47a1);
	outline-offset: 3px;
}

/*
 * Show the info glyph from first paint so cards don't flash
 * search-plus → info after the module loads.
 */
.animal-list .image-modal-icon i::before {
	content: "\f129";
	font-family: var(--fa-style-family-classic, "Font Awesome 6 Free");
	font-weight: 900;
}

/* Content-sized dialog with room from viewport edges; scroll only when needed */
.modal-dialog.animal-info-dialog {
	--bs-modal-width: calc(100vw - 5rem);
	width: calc(100vw - 5rem) !important;
	max-width: calc(100vw - 5rem) !important;
	margin: 2.5rem auto !important;
	height: auto !important;
	max-height: calc(100dvh - 5rem) !important;
	max-height: calc(100vh - 5rem) !important;
}

.modal-dialog.animal-info-dialog.modal-dialog-scrollable {
	/* Bootstrap scrollable forces full viewport height — keep content-sized */
	height: auto !important;
}

.modal-dialog.animal-info-dialog .modal-content {
	width: 100%;
	height: auto;
	max-height: calc(100dvh - 5rem);
	max-height: calc(100vh - 5rem);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.modal-dialog.animal-info-dialog .modal-header {
	flex: 0 0 auto;
}

.modal-dialog.animal-info-dialog .modal-body.animal-info-body,
.animal-list .modal-body.animal-info-body {
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	flex: 1 1 auto;
	min-height: 0;
}

@media (max-width: 767.98px) {
	.modal-dialog.animal-info-dialog {
		--bs-modal-width: calc(100vw - 1.5rem);
		width: calc(100vw - 1.5rem) !important;
		max-width: calc(100vw - 1.5rem) !important;
		margin: 0.75rem auto !important;
		max-height: calc(100dvh - 1.5rem) !important;
		max-height: calc(100vh - 1.5rem) !important;
	}

	.modal-dialog.animal-info-dialog .modal-content {
		max-height: calc(100dvh - 1.5rem);
		max-height: calc(100vh - 1.5rem);
	}
}

.animal-info-sheet {
	background: var(--bs-body-bg, #fff);
	color: var(--bs-body-color, #212529);
}

.animal-info-top {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
	.animal-info-top {
		grid-template-columns: minmax(11rem, 50%) minmax(0, 1fr);
		align-items: start;
	}
}

.animal-info-media {
	margin: 0;
	background: #0b1f33;
	overflow: hidden;
}

.animal-info-media .animal-info-photo,
.animal-list .animal-info-photo {
	display: block;
	margin: 0;
	line-height: 0;
}

.animal-info-media .animal-info-photo img,
.animal-list .animal-info-photo img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: none !important;
	object-fit: contain !important;
	object-position: center !important;
}

.animal-info-summary {
	padding: 1rem 1.15rem 1.1rem;
}

.animal-list .modal-title small,
.animal-info-dialog .modal-title small {
	font-style: italic;
	font-weight: normal;
}

.animal-info-bts {
	--animal-info-bts-line: calc(0.88rem * 1.35);
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	margin: 0 0 0.85rem;
	padding: 0.55rem 0.65rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-left: 4px solid var(--bs-warning, #ffc107);
	background: rgba(255, 193, 7, 0.12);
	font-size: 0.88rem;
	line-height: 1.35;
}

.animal-info-bts-icon {
	flex: 0 0 auto;
	/* Match first-line box height so the circle centers on line 1, not the paragraph */
	width: var(--animal-info-bts-line);
	height: var(--animal-info-bts-line);
	margin-top: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	border: 1px solid #000;
	background: var(--bs-warning, #ffc107);
	line-height: 0;
}

.animal-info-bts-icon i {
	display: block;
	line-height: 1;
	font-size: 0.68rem;
	/* Always dark on the gold circle (border color) — never inherit light text in dark mode */
	color: #000;
	--fa-primary-color: #000;
	--fa-secondary-color: #000;
	--fa-secondary-opacity: 1;
	/* Duotone glyphs sit slightly high in the em box */
	transform: translateY(0.06em);
}

.animal-info-bts-text {
	flex: 1 1 auto;
	min-width: 0;
}

.animal-info-bts-text a {
	display: inline;
	white-space: normal;
}

.animal-info-facts {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem;
	margin: 0;
}

.animal-info-fact {
	margin: 0;
	padding: 0.45rem 0.6rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0.35rem;
	background: rgba(13, 71, 161, 0.04);
}

/* Explicit gray — never --bs-secondary-color (white at SF on light surfaces) */
.animal-list .animal-info-fact dt,
.animal-info-sheet .animal-info-fact dt {
	margin: 0 0 0.1rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #4a5560;
}

.animal-info-fact dd {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.35;
	color: var(--bs-body-color, #212529);
}

.animal-info-details {
	padding: 1.1rem 1.2rem 1.35rem;
}

.animal-info-section {
	margin: 0 0 1rem;
}

.animal-info-section:last-child {
	margin-bottom: 0;
}

.animal-info-heading {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--bs-primary, #0d47a1);
}

.animal-info-section p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

[data-bs-theme="dark"] .animal-info-top {
	border-bottom-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .animal-info-fact {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .animal-list .animal-info-fact dt,
[data-bs-theme="dark"] .animal-info-sheet .animal-info-fact dt {
	color: rgba(255, 255, 255, 0.78);
}

[data-bs-theme="dark"] .animal-info-bts {
	background: rgba(255, 193, 7, 0.16);
	border-color: rgba(255, 255, 255, 0.2);
}
