/**
 * BiologicaPress — modal layer (fade, overlay, Open Access panel).
 *
 * @package BiologicaPress
 */

/* Fade in/out (no layout shift — modal is position:fixed) */
.ba-modal:not([hidden]) {
	display: flex !important;
}

.ba-modal {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease;
}

.ba-modal.ba-modal--open {
	opacity: 1;
	pointer-events: auto;
}

.ba-modal__backdrop {
	background: rgba(15, 23, 42, 0.62);
	opacity: 0;
	transition: opacity 0.22s ease;
}

.ba-modal.ba-modal--open .ba-modal__backdrop {
	opacity: 1;
}

.ba-modal__panel {
	transform: translateY(10px) scale(0.99);
	opacity: 0;
	transition: transform 0.22s ease, opacity 0.22s ease;
	box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.ba-modal.ba-modal--open .ba-modal__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* Open Access panel — MDPI-style academic copy */
.ba-oa-modal__panel {
	border-radius: 2px;
}

.ba-oa-modal__body {
	padding: 1.1rem 1.15rem 1.25rem;
}

.ba-oa-modal__lead {
	margin: 0 0 0.75rem;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.55;
	color: #0f172a;
}

.ba-oa-modal__p {
	margin: 0 0 0.65rem;
	font-size: 13px;
	line-height: 1.65;
	color: #475569;
}

.ba-oa-modal__p:last-child {
	margin-bottom: 0;
}

/* Single-article OA badge as modal trigger */
.ba-badge--oa-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0.35rem 0.55rem;
	font-family: inherit;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.2;
	cursor: pointer;
	border-radius: 1px;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ba-badge--oa-trigger:hover,
.ba-badge--oa-trigger:focus-visible {
	outline: none;
}

.ba-content-area--article .ba-article__badges--reader .ba-badge--oa-trigger {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.ba-content-area--article .ba-article__badges--reader .ba-badge--oa-trigger:hover,
.ba-content-area--article .ba-article__badges--reader .ba-badge--oa-trigger:focus-visible {
	background: #dcfce7;
	border-color: #86efac;
	color: #14532d;
}

@media (max-width: 639px) {
	.ba-modal {
		padding: 0.75rem;
		align-items: flex-end;
	}

	.ba-modal__panel--medium {
		max-width: 100%;
		max-height: 85vh;
		border-radius: 2px 2px 0 0;
	}

	.ba-oa-modal__lead {
		font-size: 13px;
	}

	.ba-oa-modal__p {
		font-size: 12.5px;
	}
}
