/*
Theme Name: Research Job Board
Theme URI: https://example.com/research-job-board
Author: Your Name
Author URI: https://example.com
Description: A clean job board theme for research positions. Lists standard WordPress posts as cards with their categories, and builds the sidebar filters (keywords, category, tags, job type) from the site's own tags and categories.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: research-job-board
*/

/* ==========================================================================
   1. Tokens + base
   ========================================================================== */

:root {
	--rjb-bg: #F8FAFC;
	--rjb-surface: #FFFFFF;
	--rjb-border: #E2E8F0;
	--rjb-border-strong: #CBD5E1;
	--rjb-text: #0F172A;
	--rjb-text-soft: #334155;
	--rjb-slate: #475569;
	--rjb-muted: #64748B;
	--rjb-chip: #F1F5F9;
	--rjb-accent: #0F766E;
	--rjb-accent-ink: #115E59;
	--rjb-accent-soft: #CCFBF1;
	--rjb-danger: #E11D48;
	--rjb-radius: 8px;
	--rjb-radius-card: 10px;
	--rjb-radius-sm: 6px;
	--rjb-shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.08);
	--rjb-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--rjb-bg);
	color: var(--rjb-text);
	font-family: var(--rjb-font);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, p, ul, ol {
	margin: 0;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

:focus-visible {
	outline: 2px solid var(--rjb-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100;
	width: auto;
	height: auto;
	margin: 0;
	padding: 10px 16px;
	clip: auto;
	background: var(--rjb-surface);
	border-radius: var(--rjb-radius-sm);
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
}

.rjb-icon {
	flex: none;
}

/* ==========================================================================
   2. Site header + global container
   ========================================================================== */

.rjb-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.rjb-site-header {
	background: var(--rjb-surface);
	border-bottom: 1px solid var(--rjb-border);
}

.rjb-site-header__inner {
	display: flex;
	align-items: center;
	min-height: 64px;
}

.rjb-site-title {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--rjb-text);
}

.rjb-site-header .custom-logo-link {
	display: inline-flex;
}

.rjb-site-header .custom-logo {
	display: block;
	width: auto;
	max-height: 40px;
}

.rjb-page {
	padding: 32px 0 80px;
}

/* ==========================================================================
   3. Header bar above the listings
   ========================================================================== */

.rjb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 16px;
	min-height: 40px;
	margin-bottom: 20px;
}

.rjb-title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.rjb-count {
	display: inline-block;
	padding: 2px 10px;
	background: var(--rjb-accent-soft);
	border-radius: 999px;
	color: var(--rjb-accent-ink);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	white-space: nowrap;
}

.rjb-topbar__tools {
	display: flex;
	align-items: center;
	gap: 16px;
}

.rjb-pager-count {
	color: var(--rjb-muted);
	font-size: 14px;
	white-space: nowrap;
}

/* Sort dropdown */

.rjb-sort {
	position: relative;
}

.rjb-sort__btn {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 14px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border-strong);
	border-radius: var(--rjb-radius-sm);
	color: var(--rjb-text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.rjb-sort__btn:hover,
.rjb-sort__btn[aria-expanded="true"] {
	border-color: var(--rjb-accent);
}

.rjb-sort__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 20;
	min-width: 160px;
	padding: 4px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.rjb-sort__menu[hidden] {
	display: none;
}

.rjb-sort__menu a {
	display: block;
	padding: 8px 12px;
	border-radius: 4px;
	color: var(--rjb-text-soft);
	font-size: 14px;
}

.rjb-sort__menu a:hover {
	background: var(--rjb-bg);
	color: var(--rjb-text);
}

.rjb-sort__menu a[aria-current="true"] {
	color: var(--rjb-accent-ink);
	font-weight: 600;
}

/* ==========================================================================
   4. Two-column grid
   ========================================================================== */

.rjb-layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.rjb-sidebar {
	position: sticky;
	top: 24px;
}

.admin-bar .rjb-sidebar {
	top: 56px;
}

.rjb-main {
	min-width: 0;
}

/* ==========================================================================
   5. Filter sidebar
   ========================================================================== */

.rjb-filters {
	padding: 20px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius);
}

.rjb-field {
	margin-bottom: 18px;
}

.rjb-label {
	display: block;
	margin-bottom: 6px;
	color: var(--rjb-text-soft);
	font-size: 13px;
	font-weight: 600;
}

.rjb-input,
.rjb-select {
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 12px;
	background-color: var(--rjb-surface);
	border: 1px solid var(--rjb-border-strong);
	border-radius: var(--rjb-radius-sm);
	color: var(--rjb-text);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rjb-input::placeholder {
	color: #94A3B8;
}

.rjb-input:focus,
.rjb-select:focus {
	outline: none;
	border-color: var(--rjb-accent);
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.rjb-select {
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* Groups: Job Tags / Job Type */

.rjb-group {
	min-width: 0;
	margin: 0 0 18px;
	padding: 18px 0 0;
	border: 0;
	border-top: 1px solid var(--rjb-border);
}

.rjb-group__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin-bottom: 8px;
	padding: 0;
	color: var(--rjb-text-soft);
	font-size: 13px;
	font-weight: 600;
}

.rjb-group--collapsible > summary {
	cursor: pointer;
	list-style: none;
}

.rjb-group--collapsible > summary::-webkit-details-marker {
	display: none;
}

.rjb-group--collapsible .rjb-icon {
	color: var(--rjb-muted);
	transition: transform 0.15s ease;
}

.rjb-group--collapsible[open] .rjb-icon {
	transform: rotate(180deg);
}

.rjb-empty-note {
	color: var(--rjb-muted);
	font-size: 13px;
}

/* Custom checkboxes */

.rjb-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	color: var(--rjb-text-soft);
	font-size: 14px;
	cursor: pointer;
}

.rjb-check input {
	position: absolute;
	top: 50%;
	left: 0;
	width: 18px;
	height: 18px;
	margin: -9px 0 0;
	opacity: 0;
	cursor: pointer;
}

.rjb-check__box {
	display: grid;
	place-items: center;
	flex: none;
	width: 18px;
	height: 18px;
	background: var(--rjb-surface);
	border: 1.5px solid var(--rjb-border-strong);
	border-radius: 4px;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.rjb-check__box::after {
	content: "";
	width: 5px;
	height: 9px;
	border: solid #FFFFFF;
	border-width: 0 2px 2px 0;
	opacity: 0;
	transform: translateY(-1px) rotate(45deg);
	transition: opacity 0.1s ease;
}

.rjb-check:hover .rjb-check__box {
	border-color: var(--rjb-accent);
}

.rjb-check input:checked + .rjb-check__box {
	background: var(--rjb-accent);
	border-color: var(--rjb-accent);
}

.rjb-check input:checked + .rjb-check__box::after {
	opacity: 1;
}

.rjb-check input:focus-visible + .rjb-check__box {
	outline: 2px solid var(--rjb-accent);
	outline-offset: 2px;
}

.rjb-check__count {
	color: var(--rjb-muted);
}

/* Actions */

.rjb-filters__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 18px;
	border-top: 1px solid var(--rjb-border);
}

.rjb-btn {
	height: 40px;
	padding: 0 18px;
	background: var(--rjb-accent);
	border: 0;
	border-radius: var(--rjb-radius-sm);
	color: #FFFFFF;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.rjb-btn:hover {
	background: var(--rjb-accent-ink);
}

.rjb-reset {
	color: var(--rjb-muted);
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rjb-reset:hover {
	color: var(--rjb-text);
}

/* ==========================================================================
   6. Listing cards
   ========================================================================== */

.rjb-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 16px;
	padding: 20px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius-card);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.rjb-card:hover {
	border-color: var(--rjb-border-strong);
	box-shadow: var(--rjb-shadow-hover);
}

.rjb-card:focus-within {
	border-color: var(--rjb-accent);
}

/* Logo: 60 x 60 rounded box (the 80x80 crop scales down crisply) */

.rjb-card__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 60px;
	height: 60px;
	overflow: hidden;
	background: var(--rjb-chip);
	border: 1px solid var(--rjb-border);
	border-radius: 12px;
	color: var(--rjb-muted);
}

.rjb-card__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Content stack */

.rjb-card__body {
	flex: 1;
	min-width: 0;
}

.rjb-card__title {
	padding-right: 84px; /* room for the status text */
	color: var(--rjb-text);
	font-size: 18px;
	line-height: 1.35;
	font-weight: 700;
}

.rjb-card__link {
	transition: color 0.15s ease;
}

.rjb-card__link:hover {
	color: var(--rjb-accent);
}

/* Stretched link: the whole card opens the job. */
.rjb-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--rjb-radius-card);
}

/* Category pills (above the stretched link) */

.rjb-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	padding-right: 44px; /* keeps pills clear of the save button */
}

.rjb-tags--single {
	margin-top: 12px;
	padding-right: 0;
}

.rjb-tag {
	position: relative;
	z-index: 2;
	display: inline-block;
	padding: 2px 10px;
	background: var(--rjb-chip);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius-sm);
	color: var(--rjb-text-soft);
	font-size: 12px;
	line-height: 1.6;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.rjb-tag:hover {
	border-color: var(--rjb-accent);
	color: var(--rjb-accent-ink);
}

/* Top-right status text */

.rjb-card__status {
	position: absolute;
	top: 20px;
	right: 20px;
	color: var(--rjb-muted);
	font-size: 13px;
	line-height: 1.4;
	white-space: nowrap;
}

.rjb-card__status--new {
	color: var(--rjb-accent-ink);
	font-weight: 600;
}

/* Bottom-right save button */

.rjb-save {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--rjb-muted);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rjb-save:hover {
	background: #FFF1F2;
	color: var(--rjb-danger);
	transform: scale(1.06);
}

.rjb-save[aria-pressed="true"] {
	color: var(--rjb-danger);
}

.rjb-save[aria-pressed="true"] .rjb-icon {
	fill: currentColor;
}

/* Empty state */

.rjb-empty {
	padding: 40px 20px;
	background: var(--rjb-surface);
	border: 1px dashed var(--rjb-border-strong);
	border-radius: var(--rjb-radius-card);
	color: var(--rjb-muted);
	text-align: center;
}

.rjb-empty__title {
	margin-bottom: 4px;
	color: var(--rjb-text);
	font-size: 16px;
	font-weight: 600;
}

.rjb-empty a {
	color: var(--rjb-accent-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ==========================================================================
   7. Pagination (the_posts_pagination)
   ========================================================================== */

.pagination {
	margin-top: 24px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius-sm);
	color: var(--rjb-text-soft);
	font-size: 14px;
	transition: border-color 0.15s ease;
}

.pagination a.page-numbers:hover {
	border-color: var(--rjb-accent);
}

.pagination .page-numbers.current {
	background: var(--rjb-accent);
	border-color: var(--rjb-accent);
	color: #FFFFFF;
	font-weight: 600;
}

.pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent;
}

/* ==========================================================================
   8. Single job, pages and generic entries
   ========================================================================== */

.rjb-single,
.rjb-entries {
	max-width: 760px;
}

.rjb-back {
	display: inline-block;
	margin-bottom: 16px;
	color: var(--rjb-muted);
	font-size: 14px;
}

.rjb-back:hover {
	color: var(--rjb-text);
}

.rjb-single__title {
	font-size: 28px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.rjb-single .rjb-single__image {
	margin-top: 20px;
}

.rjb-single__content {
	margin-top: 24px;
	padding: 24px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius-card);
	color: var(--rjb-text-soft);
	line-height: 1.7;
}

.rjb-single__content > * + * {
	margin-top: 1em;
}

.rjb-single__content a {
	color: var(--rjb-accent-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rjb-single__content h2,
.rjb-single__content h3 {
	color: var(--rjb-text);
	line-height: 1.3;
}

.rjb-single__content ul,
.rjb-single__content ol {
	padding-left: 1.25em;
	list-style: revert;
}

.rjb-entry {
	margin-bottom: 16px;
	padding: 20px;
	background: var(--rjb-surface);
	border: 1px solid var(--rjb-border);
	border-radius: var(--rjb-radius-card);
}

.rjb-entry__title {
	font-size: 18px;
	font-weight: 700;
}

.rjb-entry__title a:hover {
	color: var(--rjb-accent);
}

.rjb-entry__excerpt {
	margin-top: 6px;
	color: var(--rjb-slate);
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */

/* Tablet: slimmer sidebar */
@media (max-width: 1024px) {
	.rjb-layout {
		grid-template-columns: 240px minmax(0, 1fr);
		gap: 20px;
	}
}

/* Small tablet and below: stack the columns */
@media (max-width: 820px) {
	.rjb-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.rjb-sidebar,
	.admin-bar .rjb-sidebar {
		position: static;
	}

	.rjb-page {
		padding-top: 24px;
	}
}

/* Mobile */
@media (max-width: 520px) {
	.rjb-container {
		padding: 0 14px;
	}

	.rjb-title {
		font-size: 20px;
	}

	.rjb-topbar__tools {
		width: 100%;
		justify-content: space-between;
	}

	.rjb-card {
		gap: 12px;
		padding: 44px 16px 16px; /* the top strip holds the status text */
	}

	.rjb-card__status {
		top: 14px;
		right: 16px;
	}

	.rjb-card__title {
		padding-right: 0;
		font-size: 17px;
	}

	.rjb-single__title {
		font-size: 22px;
	}

	.rjb-single__content {
		padding: 18px;
	}
}

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