/*
Theme Name: The Word
Theme URI: https://the-word.news
Author: Organization for Accessible Journalism
Description: Custom theme for The Word.
Version: 2026
Text Domain: the-word
*/

:root {
	--color-primary: #014e5f;
	--color-accent: #14819f;
	--color-hover: #026f86;
	--color-base: #ffffff;
	--color-text: #000;
	--color-heading: #0d1b1f;
	--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;
}

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 {
	padding: 0;
	margin: 60px 0;
}

.button, button {
	background-color: var(--color-primary);
	background: var(--color-primary);
}

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

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

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

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;
	display: flex;
}

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

.custom-logo {
	width: auto;
	max-height: 50px;
}

.site-tagline-bar {
	text-align: center;
	padding: 0.6em 1.5em;
	background: var(--color-primary);
}

.site-tagline {
	max-width: var(--content-width);
	margin: 0 auto;
	font-family: var(--font-body);
	font-size: 0.9rem;
	color: #fff;
	font-weight: 500;
}

.main-navigation {
	display: flex;
	align-items: center;
}

.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;
	}
	.search-form {
		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;
}

.single-post h1 {
	margin-top: 0;
}

body .tb__tab-content {
	background: none;
}

/* Sidebar */

.content-inner.has-sidebar {
	display: flex;
	gap: 3em;
	align-items: flex-start;
	flex-wrap: wrap;
}

.single-entry-main {
	flex: 1 1 0;
	min-width: 0;
}

.single-entry-sidebar {
	flex: 0 0 320px;
}

.single-entry-sidebar .widget {
	margin-bottom: 2em;
	padding-bottom: 2em;
	border-bottom: 1px solid var(--color-border);
}

.single-entry-sidebar .widget:last-child {
	border-bottom: none;
}

.single-entry-sidebar .widget-title {
	font-size: 1.15rem;
	margin-top: 0;
	margin-bottom: 0.75em;
}

.single-entry-main .wp-block-column:empty {
	display: none;
}

@media (max-width: 782px) {
	.content-inner.has-sidebar {
		flex-direction: column;
	}
	.single-entry-sidebar {
		max-width: 100%;
	}
}

/* Force post-content Gutenberg columns to stack when a sidebar is present */

.single-entry-main .wp-block-columns {
	flex-wrap: wrap;
}

.single-entry-main .wp-block-column {
	flex-basis: 100% !important;
}

/* 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);
}

/* 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 ul li {
	padding: 5px 0;
}

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

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

.footer-tagline {
	font-size: 0.9rem;
	color: var(--color-primary);
	margin: 0 0 1em;
}

.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 svg {
	color: #645604;
}

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

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

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

.footer-oaj-logo {
	max-width: 220px;
	margin: 0.5em 0;
}

.footer-oaj-description {
	font-size: 0.85rem;
	margin: 0.5em 0;
}

.footer-sponsors {
	max-width: var(--content-width);
	margin: 2em auto 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5em;
	padding-top: 2em;
	border-top: 1px solid var(--color-border);
}

.footer-sponsor-badge {
	width: 150px;
	height: auto;
}

.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);
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
	:root {
		--color-base: #14181b;
		--color-text: #f0f0f0;
		--color-heading: #f5f5f5;
		--color-border: rgba(255, 255, 255, 0.15);
		--color-primary: #4fb8d6;
		--color-hover: #7dd3e0;
		--color-accent: #4fb8d6;
		--color-focus: #7fb4ff;
	}

	.site-header,
	.site-footer {
		background: #1c2226;
	}

	.menu-toggle {
		background: #fff;
	}

	.skip-link,
	.site-tagline,
	.search-form button,
	.instant-search-panel a.is-active,
	.instant-search-panel a:hover,
	.footer-patron-button {
		color: #0d1416;
	}

	.search-form input[type="search"] {
		background: #1e2327;
		color: var(--color-text);
	}

	.search-form input[type="search"]::placeholder {
		color: #9aa0a6;
	}

	.instant-search-panel {
		background: #1e2327;
		border-color: #3a4046;
	}

	.instant-search-panel a:hover {
		background: var(--color-primary);
	}

	.single-entry-sidebar .widget {
		border-bottom-color: var(--color-border);
	}

	.footer-icon-link svg {
		color: #d9c96a;
	}

	img {
		filter: brightness(0.9);
	}

	body .tb__tab-label {
		background: #333;
	}
}