/* ==========================================================================
   SpringHaven bio popup (colorbox) overrides
   Loaded AFTER /js/addons/colorbox/colorbox.css.
   Pairs with the ".bio-link" colorbox init in the staff pages.

   Geometry is pinned here with the viewport and !important. `max-height`
   overrides colorbox's inline heights (which are unreliable in this build),
   so the box is always capped to the screen with the content scrolling
   inside it. The box is re-centered with fixed positioning, and colorbox's
   decorative border frame is replaced with a simple shadow.
   ========================================================================== */

/* Lock the underlying page scroll while a bio popup is open. */
html.cbox-open,
body.cbox-open { overflow: hidden !important; }

/* Replace the theme1 border-image frame with a plain shadowed panel. */
#cboxTopLeft, #cboxTopCenter, #cboxTopRight,
#cboxBottomLeft, #cboxBottomCenter, #cboxBottomRight,
#cboxMiddleLeft, #cboxMiddleRight { display: none !important; }

/* Center the popup and cap its height to the viewport (max popup height). */
#colorbox {
	position: fixed !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	width: 750px !important;
	max-width: 94vw !important;
	max-height: 90vh !important;
	min-height: 30vh;                 /* min popup height by screen */
	overflow: hidden !important;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 44px rgba(0, 0, 0, 0.35);
}

#cboxWrapper {
	width: 100% !important;
	max-height: 90vh !important;
	background: #fff;
	border-radius: 6px;
}

#cboxContent {
	width: 100% !important;
	max-height: 90vh !important;
	background: #fff;
	overflow: visible !important;
	border-radius: 6px;
}

/* Scroll container: cap height, scroll internally, leave room for the close. */
#cboxLoadedContent {
	width: 100% !important;
	max-height: calc(90vh - 66px) !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 60px !important;   /* gap so content clears the close button */
}

/* Breathing room lives on the bio content element itself. */
#cboxLoadedContent > * {
	box-sizing: border-box;
	margin: 0 !important;
	padding: 36px 32px !important;    /* extra top & bottom padding on content */
}

/* Close: brand-green button with an inline X icon, set apart from content. */
#cboxClose {
	bottom: 15px !important;
	right: 20px !important;
	display: inline-flex !important;
	align-items: center;
	gap: 7px;
	width: auto !important;
	height: auto !important;
	padding: 8px 15px !important;
	background: #465C04 !important;
	color: #fff !important;
	font: 600 15px/1 proxima-nova, Arial, sans-serif !important;
	border: 0;
	border-radius: 4px;
	text-indent: 0;
	white-space: nowrap;
	cursor: pointer;
	z-index: 2;
}
#cboxClose:hover,
#cboxClose:focus { background: #5f7d0a !important; color: #fff !important; }

#cboxClose .cbox-x {
	font-size: 20px;
	font-weight: 700;
	line-height: 0;
	position: relative;
	top: 1px;
}

/* Mobile: use more of the screen, a little more room, tighter close inset. */
@media (max-width: 767px) {
	#colorbox { max-width: 94vw !important; max-height: 88vh !important; }
	#cboxWrapper, #cboxContent { max-height: 88vh !important; }
	#cboxLoadedContent {
		max-height: calc(88vh - 62px) !important;
		margin-bottom: 58px !important;
	}
	#cboxLoadedContent > * { padding: 30px 20px !important; }
	#cboxClose { bottom: 12px !important; right: 14px !important; }
}
