/**
 * plugins/themes/mjliTheme/styles/mjli-home.css (v1.6)
 *
 * Distributed under the GNU GPL v3.
 *
 * Journal homepage only (loaded by MjliThemePlugin::addPageAssets): 3D globe
 * canvas, two matching panels in the hero (metrics, journal information),
 * entrance animations, frosted header that stays visible, latest articles
 * filter, "Publishing with MJLI" progress, announcement expand.
 * Every animation is switched off for visitors who ask for reduced motion.
 */

/* ---------- Header stays visible on the homepage (desktop) ---------- */
@media (min-width: 992px) {
	.pkp_page_index.pkp_op_index .pkp_structure_head {
		position: sticky;
		top: 0;
		z-index: 60;
		background: rgba(255, 255, 255, 0.92);
		-webkit-backdrop-filter: saturate(1.4) blur(10px);
		backdrop-filter: saturate(1.4) blur(10px);
	}
}

/* ---------- Hero: 3D scene ---------- */
.mjli_hero_scene {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 0;
}

/* The globe replaces the two static rings once it is running */
.mjli_hero.mjli_has_scene:before,
.mjli_hero.mjli_has_scene:after {
	display: none;
}

/* ---------- Hero: layout with two panels ---------- */
.mjli_hero_inner {
	align-items: center;
}

.mjli_hero_copy {
	flex: 999 1 420px;
}

.mjli_hero_panels {
	flex: 1 1 640px;
	max-width: 700px;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: stretch;
}

.mjli_hero_panel {
	flex: 1 1 300px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mjli_hero_panel_caption {
	margin: 0;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #9FD65A;
}

.mjli_hero_panel .mjli_hero_metrics {
	flex: 1 1 auto;
	grid-auto-rows: 1fr;
	border-radius: 18px;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	background: rgba(255, 255, 255, 0.12);
}

.mjli_hero_panel .mjli_metric {
	min-height: 112px;
	padding: 18px 20px;
	justify-content: space-between;
	flex-direction: column;
	background: rgba(26, 53, 16, 0.82);
}

.mjli_hero_panel .mjli_hero_metrics dt {
	font-size: 12.5px;
	letter-spacing: 0.02em;
}

.mjli_hero_panel .mjli_hero_metrics dd {
	font-size: 32px;
	line-height: 1.1;
	white-space: nowrap;
}

.mjli_hero_panel .mjli_hero_info .mjli_metric {
	padding-left: 16px;
	padding-right: 16px;
}

/* Short facts stay on one line (e.g. the DOI prefix 10.32890/mjli) */
.mjli_hero_panel .mjli_hero_info dd {
	font-size: clamp(14px, 1.25vw, 17px);
	line-height: 1.25;
	white-space: nowrap;
	letter-spacing: -0.005em;
}

.mjli_hero_panel .mjli_hero_info .mjli_metric:first-child dd {
	color: #FFFFFF;
}

/* Phones and small tablets: smaller tiles so the hero stays short */
@media (max-width: 991px) {
	.mjli_hero_panels {
		gap: 20px;
	}

	.mjli_hero_panel .mjli_metric {
		min-height: 84px;
		padding: 14px 16px;
	}

	.mjli_hero_panel .mjli_hero_metrics dd {
		font-size: 26px;
	}

	.mjli_hero_panel .mjli_hero_info dd {
		font-size: 17px;
		white-space: normal;
		overflow-wrap: anywhere;
	}
}

.mjli_hero_panel_caption {
	overflow-wrap: anywhere;
}

/* ---------- Hero: entrance animation and pulsing dot ---------- */
@keyframes mjliRise {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

@keyframes mjliTitle {
	from { transform: translateY(10px); }
	to { transform: none; }
}

@keyframes mjliPulse {
	0%, 100% { opacity: 0.4; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.25); }
}

.mjli_rise {
	animation: mjliRise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: var(--mjli-d, 0s);
}

.mjli_hero_title {
	animation: mjliTitle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mjli_hero_eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mjli_hero_dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #75BA2B;
	animation: mjliPulse 2.4s ease-in-out infinite;
}

.mjli_hero .mjli_button {
	transition: transform 0.2s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}

.mjli_hero .mjli_button:hover,
.mjli_hero .mjli_button:focus {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- Latest articles: filter, rows, show all ---------- */
.mjli_toc_tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 16px 0 4px;
}

.mjli_toc_search {
	flex: 1 1 280px;
	max-width: 460px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 16px;
	border: 1px solid #C9D1BF;
	border-radius: 999px;
	background: #FFFFFF;
	color: #4F5A48;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mjli_toc_search:focus-within {
	border-color: #245C06;
	box-shadow: 0 0 0 3px rgba(117, 186, 43, 0.25);
}

.mjli_toc_search input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: #14210E;
	outline: none;
}

.mjli_toc_count {
	font-size: 14px;
	color: #4F5A48;
}

.pkp_page_index .current_issue .obj_article_summary {
	transition: background-color 0.2s ease;
	border-radius: 12px;
}

.pkp_page_index .current_issue .obj_article_summary:hover {
	background-color: #F2F6EE;
}

.mjli_toc_empty {
	margin: 16px 0 0;
	font-size: 15px;
	color: #4F5A48;
}

.mjli_toc_more {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.mjli_toc_more button,
.mjli_ann_toggle {
	min-height: 44px;
	padding: 0 24px;
	border: 1px solid #C9D1BF;
	border-radius: 999px;
	background: #FFFFFF;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #245C06;
	cursor: pointer;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mjli_toc_more button:hover,
.mjli_toc_more button:focus,
.mjli_ann_toggle:hover,
.mjli_ann_toggle:focus {
	border-color: #245C06;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(23, 61, 4, 0.12);
}

/* ---------- Publishing with MJLI: active step and progress ---------- */
.mjli_steps_list li {
	position: relative;
	overflow: hidden;
	transition: background-color 0.35s ease, border-color 0.35s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.mjli_steps_list.mjli_steps_live li {
	cursor: pointer;
}

.mjli_steps_list li:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(23, 61, 4, 0.12);
}

.mjli_step_bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: transparent;
}

.mjli_steps_list.mjli_steps_live .mjli_step_bar {
	background: #E2E6DC;
}

.mjli_step_bar:after {
	content: "";
	position: absolute;
	inset: 0;
	background: #75BA2B;
	transform: scaleX(0);
	transform-origin: left center;
}

@keyframes mjliStepBar {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

.mjli_steps_list li.mjli_step_active {
	background: #173D04;
	border-color: #245C06;
}

.mjli_steps_list li.mjli_step_active .mjli_step_title {
	color: #9FD65A;
}

.mjli_steps_list li.mjli_step_active p {
	color: #E6EFDD;
}

.mjli_steps_list li.mjli_step_active a {
	color: #FFFFFF;
}

.mjli_steps_list li.mjli_step_active .mjli_step_bar {
	background: rgba(255, 255, 255, 0.18);
}

.mjli_steps_list li.mjli_step_active .mjli_step_bar:after {
	animation: mjliStepBar 4s linear forwards;
}

.mjli_steps_list.mjli_steps_paused li.mjli_step_active .mjli_step_bar:after {
	animation: none;
	transform: scaleX(1);
}

/* ---------- Announcement: open in place ---------- */
.pkp_page_index .cmp_announcements {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pkp_page_index .cmp_announcements:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(23, 61, 4, 0.10);
}

.mjli_ann_full {
	animation: mjliRise 0.35s ease-out both;
}

.mjli_ann_toggle {
	margin-top: 14px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.mjli_rise,
	.mjli_hero_title,
	.mjli_hero_dot,
	.mjli_ann_full,
	.mjli_steps_list li.mjli_step_active .mjli_step_bar:after {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}

	.mjli_hero .mjli_button,
	.mjli_steps_list li,
	.pkp_page_index .cmp_announcements,
	.mjli_toc_more button,
	.mjli_ann_toggle {
		transition: none;
	}

	.mjli_hero .mjli_button:hover,
	.mjli_steps_list li:hover,
	.pkp_page_index .cmp_announcements:hover {
		transform: none;
	}
}
