/*
Theme Name: OAJ Style
Theme URI: https://styleguide.accessiblejournalism.org/
Author: Organization for Accessible Journalism
Description: Minimal custom theme for the OAJ Style and Accessibility Guide.
Version: 2026
Text Domain: oaj-style
*/

:root {
	--color-brand: #2e8b57;
	--color-primary: #2a7f50;
	--color-hover: #228833;
	--color-base: #f7fff7;
	--color-text: #000;
	--color-heading: #171f17;
	--color-border: rgba(0, 0, 0, 0.15);
	--color-focus: #0b3d91;
	--font-body: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-heading: "Maitree", Georgia, "Times New Roman", serif;
	--content-width: 1200px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--color-base);
	color: var(--color-text);
	font-family: var(--font-body);
	line-height: 1.6;
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	color: var(--color-heading);
	line-height: 1.2;
}

.is-layout-flex > :is(p) {
	margin: 0 0 15px;
}

a {
	color: var(--color-primary);
	text-decoration: underline;
}

a:hover {
	color: var(--color-hover);
	text-decoration: underline dashed;
}

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

hr {
	margin: 2em 0 !important;
}

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

.skip-links {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1000;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--color-primary);
	color: #fff;
	padding: 0.5em 1em;
}

.skip-link:focus {
	top: 0;
	position: fixed;
}

.skip-link:nth-of-type(2):focus {
	left: 160px;
}

.skip-link:nth-of-type(3):focus {
	left: 320px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* Header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--color-border);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.header-inner {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 0.75em 1.5em;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5em;
	flex-wrap: wrap;
}

.site-branding a {
	text-decoration: none;
}

.site-branding img {
	width: auto;
	max-height: 70px;
}

.site-title {
	font-family: var(--font-heading);
	font-size: 1.5rem;
	color: var(--color-heading);
}

.header-nav-search {
	display: flex;
	align-items: center;
	gap: 1.5em;
	flex-wrap: wrap;
}

.main-navigation ul {
	list-style: none;
	display: flex;
	gap: 1.25em;
	margin: 0;
	padding: 0;
}

.main-navigation a {
	text-decoration: none;
	color: var(--color-heading);
	font-weight: 500;
}

.main-navigation a:hover {
	color: var(--color-primary);
}

.menu-toggle {
	display: none;
	background: none;
	border: 2px solid var(--color-primary);
	border-radius: 4px;
	padding: 0.4em 0.8em;
	cursor: pointer;
}

@media (max-width: 700px) {
	.menu-toggle {
		display: inline-block;
	}
	.main-navigation ul {
		display: none;
		flex-direction: column;
		gap: 0.75em;
		width: 100%;
		padding-top: 0.75em;
	}
	.main-navigation ul.is-open {
		display: flex;
	}
	.header-nav-search {
		width: 100%;
	}
}

/* Search form */

.search-form {
	position: relative;
	display: flex;
	align-items: center;
}

.search-form input[type="search"] {
	border: 2px solid var(--color-primary);
	border-radius: 4px 0 0 4px;
	padding: 0.5em 0.8em;
	font-family: inherit;
	font-size: 1rem;
	min-width: 200px;
	height: 44px;
}

.search-form button {
	border: 2px solid var(--color-primary);
	border-left: none;
	border-radius: 0 4px 4px 0;
	background: var(--color-primary);
	color: #fff;
	padding: 0.5em 0.7em;
	cursor: pointer;
	display: flex;
	align-items: center;
	height: 44px;
	margin-left: -1px;
}

.search-form button:hover {
	background: var(--color-hover);
	border-color: var(--color-hover);
}

.instant-search-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 200;
	margin-top: 4px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	max-height: 60vh;
	overflow-y: auto;
}

.instant-search-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.instant-search-panel a {
	display: block;
	padding: 0.6em 0.8em;
	text-decoration: none;
	color: inherit;
}

.instant-search-panel a.is-active,
.instant-search-panel a:hover {
	background: var(--color-primary);
	color: #fff;
	text-decoration: none;
}

.instant-search-panel a.is-active {
	outline: 3px solid var(--color-focus);
	outline-offset: -3px;
}

.instant-search-title {
	display: block;
	font-weight: 600;
}

.instant-search-excerpt {
	display: block;
	font-size: 0.85em;
	opacity: 0.8;
}

.instant-search-empty {
	margin: 0;
	padding: 0.6em 0.8em;
}

/* Content */

.content-inner {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 2em 1.5em;
}

.page-title {
	font-size: 2.5rem;
	margin-bottom: 1em;
}

/* Front page */

.front-columns {
	display: flex;
	gap: 3em;
	flex-wrap: wrap;
}

.front-col {
	flex: 1 1 320px;
}

details {
	border: 2px solid var(--color-primary);
	border-radius: 6px;
	padding: 1em 1.5em;
}

details summary {
	font-family: var(--font-heading);
	font-size: 1.25rem;
	cursor: pointer;
	color: var(--color-primary);
}

.chapter-list {
	columns: 3;
	column-gap: 2em;
	list-style: none;
	margin: 1em 0 0;
	padding: 0;
}

.chapter-list li {
	break-inside: avoid;
	margin-bottom: 0.5em;
}

.chapter-list a {
	text-decoration: none;
}

.chapter-list a:hover {
	text-decoration: underline;
}

/* Breadcrumbs */

.breadcrumbs {
	font-size: 0.9rem;
	margin-bottom: 1.5em;
}

.breadcrumbs a {
	text-decoration: none;
}

.breadcrumbs a:hover {
	text-decoration: underline;
}

.breadcrumbs span[aria-hidden] {
	margin: 0 0.4em;
	color: var(--color-border);
}

/* Legacy hard-coded breadcrumbs in post content */

.breadcrumb {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 1.5em;
	padding: 0;
	font-size: 0.9rem;
}

.breadcrumb li {
	display: inline;
}

.breadcrumb li a {
	text-decoration: none;
}

.breadcrumb li a:hover {
	text-decoration: underline;
}

.breadcrumb li + li::before {
	content: "/";
	margin: 0 0.4em;
	color: var(--color-border);
}

/* Glossary / category listing */

.glossary-list {
	columns: 2;
	column-gap: 2em;
	list-style: none;
	margin: 0;
	padding: 0;
}

.glossary-list li {
	break-inside: avoid;
	margin-bottom: 1em;
	border-bottom: 1px dotted var(--color-border);
	padding-bottom: 0.75em;
}

.glossary-excerpt {
	margin: 0.35em 0 0;
	font-size: 0.9rem;
	color: var(--color-heading);
}

.glossary-list a {
	text-decoration: none;
	font-weight: 500;
}

.glossary-list a:hover {
	text-decoration: underline;
}

@media (max-width: 600px) {
	.glossary-list,
	.chapter-list {
		columns: 1;
	}
}

/* Footer */

.site-footer {
	position: relative;
	background: #fff;
	border-top: 1px solid var(--color-border);
	margin-top: 3em;
	padding: 2.5em 1.5em 3em;
}

.footer-columns {
	max-width: var(--content-width);
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 2em;
}

.footer-col {
	flex: 1 1 260px;
}

.footer-col nav ul {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

.footer-col nav a {
	text-decoration: none;
	color: var(--color-heading);
}

.footer-col nav a:hover {
	color: var(--color-primary);
}

#menu-footer-menu, #menu-footer-menu li {
	display: inline-block;
	list-style: none;
	padding: 0;
	margin: 0 10px 5px 0;
}

.footer-icons {
	margin-bottom: 0.75em;
}

.footer-icon-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	text-decoration: none;
	color: var(--color-heading);
}

.footer-icon-link:hover {
	color: var(--color-hover);
}

.footer-copyright {
	margin: 0 0 0.5em;
}

address {
	font-style: normal;
	line-height: 1.6;
}

.back-to-top {
	position: absolute;
	right: 1.5em;
	bottom: 1em;
	text-decoration: none;
	font-size: 1.5rem;
	color: var(--color-primary);
}

.back-to-top:hover {
	color: var(--color-hover);
}