@charset "UTF-8";

/* ==========================================================================
   Rubber Jellyfish — theme.css
   Design tokens, base typography, site chrome (header / nav / footer) and the
   templates the theme renders itself (blog index, single post, archive, 404).

   Page CONTENT styles live in pages.css. Keep the two apart.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------
   Colours are derived, not invented:
     --rj-blue   sampled from rj-logo-512.png (rgb 0 95 197)
     --rj-green  the accent already in use on the donation section
   Every text/background pairing below meets WCAG 2.2 AA (4.5:1 body, 3:1 large).
   -------------------------------------------------------------------------- */

:root {
	/* Brand */
	--rj-blue: #005fc5;
	--rj-blue-dark: #004592;
	--rj-blue-darker: #003570;
	--rj-navy: #0e2033;
	--rj-navy-soft: #17304a;
	--rj-amber: #e07b25;
	--rj-amber-light: #f5a04a;
	/* --rj-amber is a 2.99:1 pairing with white, so it is used for rules,
	   markers and fills only. Amber TEXT on a light ground uses this darker
	   tone instead: 5.6:1 on white, 5.1:1 on the sand band. */
	--rj-amber-text: #a0530a;
	--rj-green: #a2c037;
	--rj-green-dark: #5f7315;

	/* Neutrals */
	--rj-ink: #16202b;
	--rj-ink-soft: #45535f;
	--rj-line: #dfe3e8;
	--rj-sand: #f6f3ee;
	--rj-mist: #eef3f7;
	--rj-white: #ffffff;

	/* Text on dark grounds */
	--rj-on-dark: #ffffff;
	--rj-on-dark-soft: #cfdae6;

	/* Type */
	--rj-font-display: "Lora", Georgia, "Times New Roman", serif;
	--rj-font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Fluid type scale — clamp(min, preferred, max) */
	--rj-step--1: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
	--rj-step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	--rj-step-1: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
	--rj-step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);
	--rj-step-3: clamp(1.875rem, 1.5rem + 1.6vw, 2.875rem);
	--rj-step-4: clamp(2.25rem, 1.6rem + 2.9vw, 4.25rem);

	/* Spacing */
	--rj-space-xs: 0.5rem;
	--rj-space-sm: 1rem;
	--rj-space-md: 1.75rem;
	--rj-space-lg: 3rem;
	--rj-space-xl: clamp(3.5rem, 2rem + 6vw, 7rem);

	/* Layout */
	--rj-measure: 68ch;
	--rj-container: 1180px;
	--rj-container-narrow: 820px;
	--rj-radius: 4px;
	--rj-radius-lg: 8px;

	/* Effects */
	--rj-shadow-sm: 0 1px 3px rgba(14, 32, 51, 0.1), 0 6px 16px rgba(14, 32, 51, 0.07);
	--rj-shadow-md: 0 2px 6px rgba(14, 32, 51, 0.11), 0 18px 40px rgba(14, 32, 51, 0.13);
	--rj-veil: linear-gradient(180deg, rgba(9, 22, 38, 0.62) 0%, rgba(9, 22, 38, 0.78) 100%);
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Sticky header height, so in-page anchors are not hidden beneath it
	   (WCAG 2.4.11 Focus Not Obscured). */
	scroll-padding-top: 6rem;
}

body {
	margin: 0;
	background: var(--rj-white);
	color: var(--rj-ink);
	font-family: var(--rj-font-body);
	font-size: var(--rj-step-0);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--rj-space-sm);
	font-family: var(--rj-font-display);
	font-weight: 600;
	line-height: 1.18;
	letter-spacing: -0.01em;
	text-wrap: balance;
	color: var(--rj-navy);
}

h1 { font-size: var(--rj-step-4); }
h2 { font-size: var(--rj-step-3); }
h3 { font-size: var(--rj-step-2); }
h4 { font-size: var(--rj-step-1); }

p,
ul,
ol,
blockquote,
figure,
table {
	margin: 0 0 var(--rj-space-md);
}

p:last-child,
ul:last-child,
ol:last-child {
	margin-bottom: 0;
}

a {
	color: var(--rj-blue-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--rj-blue-darker);
	text-decoration-thickness: 2px;
}

strong {
	font-weight: 700;
}

img,
picture,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
	display: block;
}

blockquote {
	margin-inline: 0;
	padding: var(--rj-space-sm) 0 var(--rj-space-sm) var(--rj-space-md);
	border-left: 4px solid var(--rj-amber);
	font-family: var(--rj-font-display);
	font-size: var(--rj-step-1);
	font-style: italic;
	line-height: 1.45;
	color: var(--rj-navy);
}

blockquote p:last-child {
	margin-bottom: 0;
}

hr {
	height: 1px;
	margin: var(--rj-space-lg) 0;
	border: 0;
	background: var(--rj-line);
}

code,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--rj-line);
	text-align: left;
}

th {
	font-weight: 700;
	color: var(--rj-navy);
}

/* --------------------------------------------------------------------------
   3. Focus, skip link, screen-reader text
   --------------------------------------------------------------------------
   WCAG 2.2 adds 2.4.11 (Focus Not Obscured) and 2.4.13 (Focus Appearance).
   A solid 3px ring with a 2px offset clears both, and the white outer ring
   keeps it visible on dark photographic grounds too.
   -------------------------------------------------------------------------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--rj-blue);
	outline-offset: 2px;
	border-radius: 2px;
}

.rj-on-dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.rj-section--dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.rj-section--photo :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--rj-white);
	box-shadow: 0 0 0 6px rgba(9, 22, 38, 0.55);
}

.rj-skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 999;
	padding: 0.75rem 1.25rem;
	background: var(--rj-navy);
	color: var(--rj-white);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-120%);
}

.rj-skip-link:focus {
	transform: translateY(0);
	color: var(--rj-white);
}

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

.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	clip-path: none;
	white-space: normal;
}

/* --------------------------------------------------------------------------
   4. Layout helpers
   -------------------------------------------------------------------------- */

.rj-container {
	width: min(100% - 2.5rem, var(--rj-container));
	margin-inline: auto;
}

/* Usable on its own, not only as a modifier of .rj-container — page markup
   applies it standalone, so it carries its own centring. */
.rj-container--narrow {
	width: min(100% - 2.5rem, var(--rj-container-narrow));
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   5. Site header and navigation
   -------------------------------------------------------------------------- */

.rj-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--rj-white);
	border-bottom: 1px solid var(--rj-line);
}

.rj-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--rj-space-md);
	min-height: 4.5rem;
	padding-block: 0.6rem;
}

.rj-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	/* Shrinkable, not fixed: the full brand lock-up plus the menu button is
	   wider than a 375px viewport, and a non-shrinking brand pushes the button
	   off the edge and gives the whole page a horizontal scrollbar. */
	min-width: 0;
	text-decoration: none;
	color: var(--rj-navy);
}

.rj-brand__mark {
	width: 46px;
	height: 46px;
	border-radius: 50%;
}

.rj-brand__name {
	font-family: var(--rj-font-display);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.015em;
}

.rj-brand__tagline {
	display: block;
	font-family: var(--rj-font-body);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rj-ink-soft);
}

/* Mobile toggle — hidden above the breakpoint by the media query below. */
.rj-nav-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 44px;
	padding: 0.5rem 0.9rem;
	background: var(--rj-white);
	border: 1px solid var(--rj-line);
	border-radius: var(--rj-radius);
	color: var(--rj-navy);
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	cursor: pointer;
}

.rj-nav-toggle__bars {
	position: relative;
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
}

.rj-nav-toggle__bars::before,
.rj-nav-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
	width: 18px;
	height: 2px;
	background: currentColor;
}

.rj-nav-toggle__bars::before { top: -6px; }
.rj-nav-toggle__bars::after { top: 6px; }

.rj-nav-toggle[aria-expanded="true"] .rj-nav-toggle__bars {
	background: transparent;
}

.rj-nav-toggle[aria-expanded="true"] .rj-nav-toggle__bars::before {
	top: 0;
	transform: rotate(45deg);
}

.rj-nav-toggle[aria-expanded="true"] .rj-nav-toggle__bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.rj-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rj-nav__list a {
	display: block;
	padding: 0.6rem 0.75rem;
	color: var(--rj-navy);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--rj-radius);
}

.rj-nav__list a:hover {
	background: var(--rj-mist);
	color: var(--rj-blue-dark);
}

/* Current page: an underline as well as colour, so the state is not
   communicated by colour alone (WCAG 1.4.1 Use of Color). */
.rj-nav__list .current-menu-item > a,
.rj-nav__list .current_page_item > a,
.rj-nav__list .current-menu-ancestor > a,
.rj-nav__list .current_page_ancestor > a {
	color: var(--rj-blue-dark);
	box-shadow: inset 0 -3px 0 var(--rj-amber);
}

/* Sub-menus */
.rj-nav__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rj-nav__cta .rj-nav__cta-link,
.rj-nav__list .rj-menu-cta > a {
	padding: 0.65rem 1.25rem;
	background: var(--rj-blue);
	color: var(--rj-white);
	border-radius: var(--rj-radius);
	box-shadow: none;
}

.rj-nav__cta .rj-nav__cta-link:hover,
.rj-nav__list .rj-menu-cta > a:hover {
	background: var(--rj-blue-dark);
	color: var(--rj-white);
}

@media (min-width: 62.5em) {

	.rj-nav-toggle {
		display: none;
	}

	.rj-nav {
		display: block !important;
	}

	.rj-nav__list > li {
		position: relative;
	}

	.rj-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 15rem;
		padding: 0.4rem;
		background: var(--rj-white);
		border: 1px solid var(--rj-line);
		border-radius: var(--rj-radius);
		box-shadow: var(--rj-shadow-sm);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.15s ease;
	}

	.rj-nav__list > li:hover > .sub-menu,
	.rj-nav__list > li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
	}
}

/* On the narrowest phones the tagline is what tips the header over the edge.
   The brand name alone still identifies the site. */
@media (max-width: 30em) {

	.rj-brand__tagline {
		display: none;
	}

	.rj-brand__name {
		font-size: 1.05rem;
	}

	.rj-brand__mark {
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 62.4375em) {

	.rj-nav {
		display: none;
		width: 100%;
		order: 3;
		padding-block: var(--rj-space-sm);
		border-top: 1px solid var(--rj-line);
	}

	.rj-nav.is-open {
		display: block;
	}

	.rj-nav__list {
		display: block;
	}

	.rj-nav__list a {
		padding: 0.85rem 0.5rem;
		font-size: 1.05rem;
		border-bottom: 1px solid var(--rj-line);
		border-radius: 0;
	}

	.rj-nav__list .sub-menu a {
		padding-left: 1.75rem;
		font-size: 1rem;
		font-weight: 400;
	}

	.rj-nav__list .rj-menu-cta > a {
		margin-top: 0.75rem;
		text-align: center;
		border-bottom: 0;
		border-radius: var(--rj-radius);
	}
}

/* --------------------------------------------------------------------------
   6. Site footer
   -------------------------------------------------------------------------- */

.rj-footer {
	padding-block: var(--rj-space-xl) var(--rj-space-lg);
	background: var(--rj-navy);
	color: var(--rj-on-dark-soft);
}

.rj-footer a {
	color: var(--rj-white);
	text-decoration: none;
}

.rj-footer a:hover {
	color: var(--rj-amber-light);
	text-decoration: underline;
}

.rj-footer__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--rj-space-lg);
	padding-bottom: var(--rj-space-lg);
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.rj-footer__brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: var(--rj-space-sm);
	color: var(--rj-white);
	text-decoration: none;
}

.rj-footer__brand img {
	width: 52px;
	height: 52px;
	border-radius: 50%;
}

.rj-footer__brand span {
	font-family: var(--rj-font-display);
	font-size: 1.15rem;
	font-weight: 700;
}

.rj-footer h2 {
	margin-bottom: var(--rj-space-sm);
	color: var(--rj-white);
	font-family: var(--rj-font-body);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.rj-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rj-footer li {
	margin-bottom: 0.55rem;
}

.rj-footer li a {
	display: inline-block;
	padding-block: 0.15rem;
}

.rj-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: var(--rj-space-sm);
	padding: 0;
	list-style: none;
}

.rj-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 50%;
}

.rj-footer__social a:hover {
	background: var(--rj-blue);
}

.rj-footer__social svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.rj-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--rj-space-sm);
	padding-top: var(--rj-space-md);
	font-size: var(--rj-step--1);
}

.rj-footer__legal ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rj-space-md);
}

.rj-footer__legal li {
	margin: 0;
}

/* --------------------------------------------------------------------------
   7. Theme-rendered templates — blog index, archive, single, search, 404
   --------------------------------------------------------------------------
   These are the only screens the theme draws itself. Everything else is page
   content written in the editor against pages.css.
   -------------------------------------------------------------------------- */

.rj-main {
	display: block;
}

.rj-archive {
	padding-block: var(--rj-space-xl);
}

.rj-archive__intro {
	max-width: var(--rj-measure);
	margin-bottom: var(--rj-space-lg);
	font-size: var(--rj-step-1);
	color: var(--rj-ink-soft);
}

.rj-post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
	gap: var(--rj-space-md);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rj-post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--rj-white);
	border: 1px solid var(--rj-line);
	border-radius: var(--rj-radius-lg);
}

.rj-post-card__thumb img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.rj-post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--rj-space-md);
}

.rj-post-card__date {
	margin-bottom: 0.45rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--rj-amber-text);
}

.rj-post-card__title {
	margin-bottom: 0.6rem;
	font-size: var(--rj-step-1);
}

.rj-post-card__title a {
	color: var(--rj-navy);
	text-decoration: none;
}

.rj-post-card__title a:hover {
	color: var(--rj-blue-dark);
	text-decoration: underline;
}

.rj-post-card__excerpt {
	flex: 1;
	margin-bottom: var(--rj-space-sm);
	color: var(--rj-ink-soft);
}

/* Single post */
.rj-entry {
	padding-block: var(--rj-space-xl);
}

.rj-entry__header {
	max-width: var(--rj-measure);
	margin-bottom: var(--rj-space-lg);
}

.rj-entry__meta {
	margin-bottom: 0.6rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rj-amber-text);
}

.rj-entry__thumb {
	margin-bottom: var(--rj-space-lg);
	border-radius: var(--rj-radius-lg);
	overflow: hidden;
}

.rj-entry__content {
	max-width: var(--rj-measure);
}

.rj-entry__content h2 { font-size: var(--rj-step-2); margin-top: var(--rj-space-lg); }
.rj-entry__content h3 { font-size: var(--rj-step-1); margin-top: var(--rj-space-md); }

.rj-entry__content figure {
	margin-inline: 0;
}

.rj-entry__content figcaption {
	margin-top: 0.5rem;
	font-size: var(--rj-step--1);
	color: var(--rj-ink-soft);
}

.rj-entry__content .byline {
	font-style: italic;
	color: var(--rj-ink-soft);
}

/* Pagination */
.rj-pagination {
	margin-top: var(--rj-space-lg);
	padding-top: var(--rj-space-md);
	border-top: 1px solid var(--rj-line);
}

.rj-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.5rem;
	border-radius: var(--rj-radius);
	text-decoration: none;
	font-weight: 600;
}

.rj-pagination .page-numbers:hover {
	background: var(--rj-mist);
}

.rj-pagination .current {
	background: var(--rj-navy);
	color: var(--rj-white);
}

/* Search form */
.rj-search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 28rem;
}

.rj-search-form input[type="search"] {
	flex: 1;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--rj-line);
	border-radius: var(--rj-radius);
	font: inherit;
	color: var(--rj-ink);
}

/* Page fallback: a page with no rj- markup still reads well. */
.rj-page-default {
	padding-block: var(--rj-space-xl);
}

.rj-page-default > .rj-container > * {
	max-width: var(--rj-measure);
}

/* WordPress core alignment and caption classes. */
.alignleft {
	float: left;
	margin: 0 var(--rj-space-md) var(--rj-space-sm) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--rj-space-sm) var(--rj-space-md);
}

.aligncenter {
	margin-inline: auto;
}

.alignwide,
.alignfull {
	max-width: 100%;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: var(--rj-step--1);
	color: var(--rj-ink-soft);
}

/* --------------------------------------------------------------------------
   8. Motion preference
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------------
   9. Print
   -------------------------------------------------------------------------- */

@media print {

	.rj-header,
	.rj-footer,
	.rj-nav-toggle,
	.rj-skip-link {
		display: none;
	}

	body {
		color: #000;
		font-size: 11pt;
	}

	a::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		word-break: break-all;
	}
}
