/**
 * REABMS theme: the structure (loaded before reabms.css, which has the look).
 *
 * Loaded after the OJS default theme's stylesheet. It holds no colour and no
 * font: only the grid, the masthead's mechanics, and resets of the parent
 * theme's traps (fixed 728/952/1160px widths, clearfix pseudo-elements that
 * become flex and grid items, the vertical rules drawn beside the main column,
 * the dropdowns parked at left:-9999px). reabms.css supplies the look, through
 * the custom properties named here.
 *
 * Ported from the signed-off mockups (journals/reabms/mockups/assets/
 * reabms-base.css, frozen 2026-11-07); this file is the source from now on.
 *
 *   --rb-wrap   the widest a row gets          --rb-gut   the side gutter
 *   --rb-side   the sidebar's width             --rb-gap   the gap beside it
 */

:root {
	--rb-wrap: 1240px;
	--rb-gut: clamp(16px, 3vw, 32px);
	--rb-side: 300px;
	--rb-gap: clamp(32px, 4vw, 64px);
}

html {
	font-size: 100%;
}

body {
	margin: 0;
	-webkit-text-size-adjust: 100%;
	overflow-wrap: break-word;
}

.pkp_structure_page {
	overflow-x: clip;
}

img {
	max-width: 100%;
	height: auto;
}

/* One container for every row. */
.rb-util,
.pkp_head_wrapper,
.has_site_logo .pkp_head_wrapper,
.rb-opening_inner,
.pkp_structure_content,
.pkp_structure_footer {
	box-sizing: border-box;
	width: auto;
	max-width: var(--rb-wrap);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rb-gut);
	padding-right: var(--rb-gut);
}

/* Boxes made flex or grid below: the parent's clearfix pseudo-elements would
   become items in them. */
:is(.pkp_head_wrapper, .has_site_logo .pkp_head_wrapper, .pkp_site_name_wrapper,
	.pkp_navigation_primary_wrapper, .pkp_navigation_user, .pkp_structure_content,
	.pkp_structure_footer, .pkp_structure_main, .obj_article_summary,
	.obj_issue_toc .heading, .obj_article_details .row, .cmp_form .buttons)::before,
:is(.pkp_head_wrapper, .has_site_logo .pkp_head_wrapper, .pkp_site_name_wrapper,
	.pkp_navigation_primary_wrapper, .pkp_navigation_user, .pkp_structure_content,
	.pkp_structure_footer, .pkp_structure_main, .obj_article_summary,
	.obj_issue_toc .heading, .obj_article_details .row, .cmp_form .buttons)::after {
	content: none;
}

.rb-icon {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* --- Masthead mechanics ---------------------------------------------------- */

.pkp_structure_head {
	position: relative;
	z-index: 20;
	border: 0;
}

.rb-util {
	display: flex;
	justify-content: flex-end;
}

.rb-util .pkp_navigation_user_wrapper {
	position: static;
	transform: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.rb-util .pkp_navigation_user.pkp_navigation_user {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0; /* the parent's rule above the user menu, a faint line on the band */
	list-style: none;
}

.rb-util .pkp_navigation_user > li {
	display: block;
}

.pkp_site_name_wrapper,
.pkp_navigation_primary_wrapper {
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
}

.pkp_site_name {
	position: static;
	width: auto;
	padding: 0;
	overflow: visible;
	white-space: normal;
	font-size: inherit;
}

.pkp_site_name .is_img {
	display: block;
	margin: 0;
}

.pkp_site_name .is_img img {
	display: block;
	width: auto;
	max-height: none;
}

@media (min-width: 992px) {
	.pkp_head_wrapper,
	.has_site_logo .pkp_head_wrapper {
		display: flex;
		align-items: center;
		gap: 24px;
	}

	.pkp_site_nav_toggle {
		display: none;
	}

	/* The parent's phone z-index (9999) still stacks a static flex item. */
	.pkp_site_nav_menu {
		z-index: auto;
		display: flex;
		align-items: center;
		width: auto;
		margin-left: auto;
		padding: 0;
		background: transparent;
	}

	.pkp_navigation_primary_wrapper {
		display: flex;
		align-items: center;
	}

	.pkp_navigation_primary {
		display: flex;
		max-width: none;
	}

	.pkp_navigation_primary > li > a {
		display: flex;
		align-items: center;
		min-height: 44px;
		box-sizing: border-box;
	}

	/* Open on hover and on keyboard focus anywhere inside the item. */
	.pkp_structure_head .pkp_nav_list ul {
		display: none;
		left: 0;
		width: auto;
		min-width: 250px;
		border-radius: 0;
	}

	.pkp_structure_head .pkp_nav_list > li:is(:hover, :focus-within) > ul {
		display: block;
		left: 0;
	}

	.pkp_structure_head .pkp_navigation_search_wrapper {
		float: none;
		margin: 0;
		padding: 0;
		border: 0;
	}

	.pkp_structure_head .pkp_navigation_search_wrapper a {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		min-height: 44px;
		box-sizing: border-box;
	}
}

/* Phones and tablets: the logo and the menu button. OJS's main.js opens the
   menu (pkp_site_nav_menu--isOpen). */
@media (max-width: 991.98px) {
	.pkp_head_wrapper,
	.has_site_logo .pkp_head_wrapper {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.pkp_site_name_wrapper {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		width: 100%;
	}

	.pkp_site_nav_toggle {
		position: relative;
		order: 2;
		flex: none;
		width: 44px;
		height: 44px;
		background: transparent;
		box-shadow: none;
		cursor: pointer;
	}

	.pkp_site_nav_toggle > span {
		width: 22px;
		height: 16px;
		border-bottom-width: 2px;
	}

	.pkp_site_nav_toggle > span::before,
	.pkp_site_nav_toggle > span::after {
		height: 2px;
	}

	.pkp_site_nav_toggle > span::after {
		top: 7px;
	}

	.pkp_site_nav_menu {
		position: static;
		width: 100%;
		padding: 0;
		background: transparent;
	}
}

/* --- Columns ------------------------------------------------------------------ */

.pkp_structure_content {
	padding-top: 0;
}

.pkp_structure_main {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

.pkp_structure_main::before,
.pkp_structure_main::after {
	content: none;
}

.pkp_structure_sidebar {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

/* Pages without the sidebar: the main column takes the whole row (the parent
   centres and caps a lone main column). */
@media (min-width: 992px) {
	.pkp_structure_main:first-child:last-child {
		margin: 0;
	}
}

@media (min-width: 992px) {
	.pkp_structure_content.has_sidebar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) var(--rb-side);
		column-gap: var(--rb-gap);
		align-items: start;
	}
}

.pkp_block {
	margin: 0;
	padding: 0;
}

/* --- The homepage opening ----------------------------------------------------- */

.rb-hero_facts {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* --- The parent's homepage, issue and article layout, neutralised --------------- */

/* Homepage announcements: the parent floats them into 65/35 columns, draws
   rules with pseudo-elements and hides the heading. */
.pkp_page_index .homepage_about {
	padding: 0;
}

.pkp_page_index .homepage_about h2 {
	margin-top: 0;
}

.pkp_page_index .cmp_announcements {
	margin: 0;
	border: 0;
}

.pkp_page_index .cmp_announcements::before,
.pkp_page_index .cmp_announcements::after,
.pkp_page_index .cmp_announcements > .obj_announcement_summary::before,
.pkp_page_index .cmp_announcements .more::before {
	content: none;
}

.pkp_page_index .cmp_announcements > .obj_announcement_summary,
.pkp_page_index .cmp_announcements .more,
.pkp_page_index .cmp_announcements .more .obj_announcement_summary {
	float: none;
	width: auto;
	padding: 0;
}

.pkp_page_index .cmp_announcements > h2 {
	position: static !important;
	left: auto;
	clip: auto;
}

.obj_announcement_summary .date::before {
	content: none;
	display: none;
}

.obj_announcement_summary .read_more,
.pkp_page_index .current_issue .read_more {
	padding-right: 0;
	margin-bottom: 0;
	line-height: inherit;
}

.pkp_page_index .current_issue .current_issue_title {
	margin: 0;
	font-weight: inherit;
}

/* The issue's contents. */
.obj_issue_toc .galleys,
.obj_issue_toc .section {
	margin: 0;
	padding: 0;
}

.obj_issue_toc .galleys::before,
.obj_issue_toc .section::before {
	content: none;
}

.obj_issue_toc .galleys > h2,
.obj_issue_toc .section > h2,
.obj_issue_toc .galleys > h3,
.obj_issue_toc .section > h3 {
	display: block;
	position: static;
	left: auto;
	padding: 0;
	background: none;
}

.obj_issue_toc .sections:not(:first-child) {
	margin-top: 0;
}

.cmp_article_list > li {
	margin-bottom: 0;
}

.cmp_article_list > li::before,
.cmp_article_list > li::after {
	content: none;
}

.obj_article_summary .meta {
	position: static;
	padding-top: 0;
}

.obj_article_summary .authors {
	padding-right: 0;
}

.obj_article_summary .pages {
	position: static;
	line-height: inherit;
}

/* The article: the parent's fixed 352/428/560px columns and negative margins. */
.obj_article_details .row {
	margin: 0;
	border: 0;
}

.obj_article_details .main_entry,
.obj_article_details .entry_details {
	float: none;
	width: auto;
	margin: 0;
	border: 0;
}

.obj_article_details .item,
.obj_article_details .entry_details .item {
	margin: 0;
	padding: 0;
	border: 0;
}

.obj_article_details .authors .affiliation {
	color: inherit;
	font-size: inherit;
}

/* --- Reading pages -------------------------------------------------------------- */

.obj_article_summary {
	position: relative;
}

.obj_article_summary > .title a::before {
	/* The parent stretches the title link over the whole summary; keep the
	   galley link clickable on its own. */
	content: none;
}

.obj_article_details .row {
	margin: 0;
}

.obj_article_details :is(.main_entry, .entry_details) {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

@media (min-width: 768px) {
	.obj_article_details .row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(13rem, 15.5rem);
		column-gap: clamp(28px, 3vw, 48px);
		align-items: start;
	}
}

.obj_article_details .item {
	margin: 0;
	padding: 0;
}

.obj_article_details .entry_details .item {
	margin: 0;
	border: 0;
}

/* Mockup pages carry no main.js: keep the citation formats list closed. */
.citation_formats_list[aria-hidden="true"] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
