/**
 * Bullhorn Alert System
 * Fully self-contained styles, prefixed to avoid theme conflicts.
 */

/* ----------------------------------------------------------------
   Reset & shared
   ---------------------------------------------------------------- */
.bullhorn-modal-overlay,
.bullhorn-modal,
.bullhorn-modal *:not(.wp-block-buttons):not(.wp-block-button):not(.wp-block-button__link):not(.wp-element-button),
.bullhorn-tophat,
.bullhorn-tophat *,
.bullhorn-pill,
.bullhorn-pill * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------------
   Modal
   ---------------------------------------------------------------- */
.bullhorn-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.35s ease, background 0.35s ease, visibility 0.35s ease;
	padding: 20px;
}

.bullhorn-modal-overlay.bullhorn-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.55);
}

.bullhorn-modal {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	border-radius: 14px;
	line-height: 1.55;
	box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
	transform: scale(0.92) translateY(16px);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bullhorn-modal-overlay.bullhorn-active .bullhorn-modal {
	transform: scale(1) translateY(0);
}

/* Extra top space when there's no hero image */
.bullhorn-modal--no-image {
	padding-top: 8px;
}

/* Close button */
.bullhorn-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: none;
	background: rgba(0, 0, 0, 0.08);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	transition: background 0.2s ease;
	z-index: 2;
	padding: 0;
}

.bullhorn-modal-close:hover,
.bullhorn-modal-close:focus-visible {
	background: rgba(0, 0, 0, 0.16);
	outline: none;
}

/* Hero image */
.bullhorn-modal-image {
	border-radius: 14px 14px 0 0;
	overflow: hidden;
	line-height: 0;
}

.bullhorn-modal-image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 260px;
	object-fit: cover;
}

/* Content */
.bullhorn-modal-content {
	padding: 24px 28px 8px;
	font-size: 15px;
}

.bullhorn-modal-content > *:first-child {
	margin-top: 0;
}

.bullhorn-modal-content > *:last-child {
	margin-bottom: 0;
}

.bullhorn-modal-content a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Buttons — rendered as native wp-block-button, we only style the wrapper */
.bullhorn-modal-buttons {
	padding: 16px 28px 28px;
}

/* ----------------------------------------------------------------
   Top Hat
   ---------------------------------------------------------------- */
.bullhorn-tophat {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999998;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-100%);
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease, visibility 0.45s ease;
}

.bullhorn-tophat.bullhorn-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

/* Respect WP admin bar */
.admin-bar .bullhorn-tophat {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .bullhorn-tophat {
		top: 46px;
	}
}

.bullhorn-tophat-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 11px 20px;
	max-width: 1200px;
	margin: 0 auto;
}

.bullhorn-tophat-text {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
}

.bullhorn-tophat-link {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	margin-left: 6px;
	white-space: nowrap;
}

.bullhorn-tophat-link:hover {
	opacity: 0.85;
}

.bullhorn-tophat-close {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease;
}

.bullhorn-tophat-close:hover,
.bullhorn-tophat-close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

/* Push page content down so the bar doesn't cover it */
body.bullhorn-tophat-visible {
	transition: padding-top 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------------------
   Pill (shortcode)
   ---------------------------------------------------------------- */
.bullhorn-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	line-height: 1.4;
	vertical-align: middle;
	transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

a.bullhorn-pill:hover {
	opacity: 0.9;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	text-decoration: none;
	color: inherit;
}

a.bullhorn-pill:active {
	transform: translateY(0);
	box-shadow: none;
}

.bullhorn-pill-label {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: rgba(255, 255, 255, 0.22);
	line-height: 1.5;
}

/* When a label badge is present, tighten the left side so the badge
   sits flush with the pill's vertical padding (no extra gap). */
.bullhorn-pill--has-label {
	padding-left: 5px;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media screen and (max-width: 480px) {
	.bullhorn-modal-overlay {
		padding: 12px;
		align-items: flex-end;
	}

	.bullhorn-modal {
		max-width: 100%;
		max-height: 80vh;
		border-radius: 14px 14px 0 0;
	}

	.bullhorn-modal-content {
		padding: 20px 20px 8px;
	}

	.bullhorn-modal-buttons {
		padding: 12px 20px 24px;
	}

	.bullhorn-tophat-inner {
		padding: 10px 14px;
		gap: 10px;
	}

	.bullhorn-tophat-text {
		font-size: 13px;
		text-align: left;
	}
}
