/*
Theme Name: Oasis Journal
Description: Shared journal theme for the Scientific Oasis network. One skeleton, per-site identity via Customizer (accent color, hero, badges, metrics).
Version: 0.1.0
Author: Scientific Oasis
Text Domain: oasis-journal
*/

:root {
	--accent: #1d4378;
	--accent-dark: #142f54;
	--accent-text: #ffffff;
	--body-bg: #f2f3f5;
	--card-bg: #ffffff;
	--text: #1f2328;
	--muted: #616a73;
	--rule: #e2e5e9;
	--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
	--font-serif: Georgia, "Noto Serif", "Times New Roman", serif;
}

* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--body-bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
}
body.oasis-serif { font-family: var(--font-serif); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }

/* ---------- Hero header ---------- */
.site-hero {
	position: relative;
	background: var(--accent-dark);
	background-size: cover;
	background-position: center;
	color: var(--accent-text);
	padding: 2.2rem 0 0;
}
.site-hero::before {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(120deg, rgba(0,0,0,.55), rgba(0,0,0,.15));
}
.site-hero > .wrap { position: relative; }
.hero-top { display: flex; justify-content: flex-end; gap: .75rem; padding-bottom: .5rem; }
.hero-top a {
	color: var(--accent-text); text-decoration: none; font-size: .85rem;
	background: rgba(255,255,255,.14); padding: .3rem .8rem; border-radius: 999px;
}
.site-title {
	margin: 0; font-size: 1.9rem; line-height: 1.2; font-weight: 700; color: var(--accent-text);
}
.site-title a { color: inherit; text-decoration: none; }
.site-tagline { margin: .3rem 0 0; font-size: .95rem; opacity: .92; }
.status-badge {
	position: absolute; right: 0; top: 3rem;
	background: rgba(255,255,255,.95); border-radius: 8px; padding: .5rem .8rem;
	display: flex; align-items: center; gap: .6rem; color: var(--text);
	text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.25); max-width: 240px;
}
.status-badge img { max-height: 44px; width: auto; }
.status-badge .status-text { font-size: .78rem; font-weight: 600; color: #b4690e; line-height: 1.3; }

/* ---------- Nav ---------- */
.site-nav { position: relative; margin-top: 1.4rem; padding: .7rem 0 1.1rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.site-nav a {
	display: inline-block; color: var(--accent-text); text-decoration: none;
	font-size: .9rem; padding: .42rem 1.05rem; border-radius: 999px;
	background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25);
}
.site-nav a:hover { background: rgba(0,0,0,.6); color: #fff; }

/* Dropdown submenus (pill nav stays single-level; children open below). */
.site-nav li { position: relative; }
.site-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: 0; z-index: 50;
	flex-direction: column; gap: 2px; min-width: 240px; max-height: 70vh; overflow-y: auto;
	background: var(--accent-dark); border-radius: 10px; padding: .45rem;
	box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { display: flex; }
.site-nav .sub-menu a { display: block; border-radius: 6px; background: transparent; border: 0; white-space: nowrap; }
.site-nav .sub-menu a:hover { background: rgba(255,255,255,.15); }
.site-nav .menu-item-has-children > a::after { content: " ▾"; font-size: .75em; }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.site-main { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; padding: 2rem 0 3rem; }
.site-main.no-rail { grid-template-columns: minmax(0, 1fr); }
.content-area { background: var(--card-bg); border: 1px solid var(--rule); border-radius: 6px; padding: 2rem 2.2rem; }

/* ---------- Left rail ---------- */
.rail-links { display: flex; flex-direction: column; gap: .55rem; margin: 0 0 1.4rem; }
.rail-links a {
	display: block; background: var(--accent); color: var(--accent-text);
	text-decoration: none; font-weight: 600; font-size: .88rem;
	padding: .6rem .9rem; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.rail-links a:hover { background: var(--accent-dark); color: #fff; }
.rail-box { background: var(--card-bg); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; margin-bottom: 1.4rem; }
.rail-box h3 {
	margin: 0; background: var(--accent); color: var(--accent-text);
	font-size: .88rem; text-align: center; padding: .55rem .8rem;
}
.rail-box .rail-body { padding: .8rem .95rem; font-size: .85rem; }
.rail-metrics p { margin: .3rem 0; }
.rail-metrics strong { font-weight: 700; }
.rail-badges { display: flex; flex-direction: column; gap: .8rem; align-items: center; padding: 1rem .8rem; }
.rail-badges a { display: block; border: 1px solid var(--rule); border-radius: 4px; padding: .45rem .7rem; background: #fff; }
.rail-badges img { max-height: 52px; width: auto; display: block; }
.submit-btn {
	display: block; text-align: center; background: var(--accent); color: var(--accent-text);
	font-weight: 700; text-decoration: none; padding: .7rem 1rem; border-radius: 6px;
}
.submit-btn:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Current issue / TOC ---------- */
.section-label {
	font-size: 1.25rem; font-weight: 700; margin: 0 0 1.2rem;
}
.issue-header { display: flex; gap: 1.6rem; margin-bottom: 2rem; }
.issue-cover img { width: 165px; border: 1px solid var(--rule); border-radius: 4px; }
.issue-meta h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.issue-meta .published { font-size: .9rem; color: var(--muted); }
.toc-section-label {
	display: flex; align-items: center; gap: .8rem; color: var(--muted);
	font-size: .95rem; margin: 2rem 0 1rem;
}
.toc-section-label::before, .toc-section-label::after { content: ""; height: 1px; background: var(--rule); flex: 1; }
.toc-article { padding: .85rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0,1fr) 70px; gap: .2rem 1rem; }
.toc-article:last-child { border-bottom: 0; }
.toc-article h3 { margin: 0; font-size: 1rem; line-height: 1.45; grid-column: 1; }
.toc-article h3 a { text-decoration: none; }
.toc-article .doi { font-size: .82rem; grid-column: 1; }
.toc-article .authors { font-size: .88rem; color: var(--muted); grid-column: 1; }
.toc-article .pages { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.toc-article .galleys { margin-top: .35rem; grid-column: 1; }
.galley-btn {
	display: inline-block; font-size: .8rem; text-decoration: none;
	border: 1px solid var(--accent); color: var(--accent);
	padding: .2rem .7rem; border-radius: 4px; margin-right: .5rem;
}
.galley-btn:hover { background: var(--accent); color: var(--accent-text); }
.view-all { margin-top: 1.6rem; font-weight: 600; }

/* ---------- Issue archive ---------- */
.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.2rem; }
.issue-card {
	border: 1px solid var(--rule); border-radius: 6px; padding: 1.1rem 1.2rem;
	background: #fff; text-decoration: none; color: var(--text);
}
.issue-card:hover { border-color: var(--accent); }
.issue-card h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--accent); }
.issue-card .published { font-size: .85rem; color: var(--muted); }
.issue-card-cover { display: block; margin: -0.2rem 0 .6rem; }
.issue-card-cover img { display: block; width: 100%; height: auto; border-radius: 4px; }

/* ---------- Article page ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumbs a { text-decoration: none; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 2.2rem; }
.article-title { font-size: 1.55rem; line-height: 1.3; margin: 0 0 1.4rem; }
.author-list { margin: 0 0 1.6rem; padding: 0; list-style: none; }
.author-list li { margin-bottom: .9rem; }
.author-list .author-name { font-weight: 700; }
.author-list .affiliation { display: block; font-size: .88rem; color: var(--muted); }
.author-list .orcid { font-size: .82rem; }
.article-section h2 { font-size: 1.1rem; margin: 1.8rem 0 .6rem; }
.article-abstract { text-align: justify; }
.keyword-list { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; list-style: none; }
.keyword-list li { background: var(--body-bg); border: 1px solid var(--rule); font-size: .82rem; padding: .18rem .65rem; border-radius: 999px; }
.article-rail .rail-box .rail-body { font-size: .88rem; }
.article-doi { word-break: break-all; }
.citations-raw { font-size: .9rem; }
.citations-raw p { margin: 0 0 .9rem; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--accent-dark); color: rgba(255,255,255,.85);
	margin-top: 2rem; padding: 1.6rem 0; font-size: .85rem;
}
.site-footer a { color: #fff; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.site-footer .footer-info {
	display: block; font-size: .85rem; line-height: 1.6;
	border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 1rem; margin-bottom: 1rem;
}
.site-footer .footer-info img { max-height: 56px; width: auto; height: auto; vertical-align: middle; margin: .2rem .4rem .2rem 0; background: #fff; border-radius: 4px; padding: 3px; }
.site-footer .footer-info p { margin: .4rem 0; }

/* ---------- Article rail: issue cover ---------- */
.article-rail .issue-cover { display: block; margin-bottom: 1.4rem; }
.article-rail .issue-cover img {
	display: block; width: 100%; height: auto; border-radius: 6px;
	border: 1px solid var(--rule); box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ---------- Article rail: license & citations ---------- */
.article-license .rail-body p, .article-citation p { font-size: .85rem; }
.citation-formats summary {
	cursor: pointer; font-weight: 600; font-size: .85rem;
	border: 1px solid var(--rule); border-radius: 6px; padding: .45rem .7rem; margin: .3rem 0;
}
.citation-formats p { border-bottom: 1px solid var(--rule); padding-bottom: .5rem; overflow-wrap: break-word; }
.citation-export { font-size: .85rem; }

/* ---------- Migrated OJS sidebar blocks ---------- */
.oasis-rail-block { margin-bottom: 1.4rem; }
.oasis-rail-block .rail-body { font-size: .85rem; line-height: 1.5; overflow-wrap: break-word; }
.oasis-rail-block img { max-width: 100%; height: auto; }
.oasis-rail-block p { margin: .4rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.site-main { grid-template-columns: 1fr; }
	.article-layout { grid-template-columns: 1fr; }
	.status-badge { position: static; margin-top: 1rem; display: inline-flex; }
}
@media (max-width: 600px) {
	.content-area { padding: 1.3rem 1.1rem; }
	.issue-header { flex-direction: column; }
	.site-title { font-size: 1.4rem; }
}
