/*
Theme Name: Gospeljuice
Theme URI: https://gospeljuice.net
Author: Gospeljuice
Author URI: https://gospeljuice.net
Description: A fast, minimalist, mobile-first, SEO-ready theme for the Gospeljuice gospel music blog. White background with black and orange accents, list-style archives, no sidebars and a beautified WordPress audio player.
Version: 1.2.1
Requires at least: 6.3
Tested up to: 6.8
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: gospeljuice
Tags: blog, one-column, custom-menu, custom-logo, featured-images, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	--gj-orange: #ff6a00;
	--gj-orange-text: #c24e00; /* AA-contrast orange for text on white */
	--gj-black: #0a0a0a;
	--gj-text: #1b1b1b;
	--gj-muted: #5f6368;
	--gj-line: #ececec;
	--gj-soft: #f6f6f6;
	--gj-radius: 10px;
	--gj-wrap: 800px;
	--gj-gutter: 16px;
	--gj-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: #fff;
	color: var(--gj-text);
	font: 400 1rem/1.6 var(--gj-font);
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

img, video, iframe, svg { max-width: 100%; }
img, video { height: auto; }
img { display: block; }

a { color: var(--gj-orange-text); text-underline-offset: 3px; }
a:hover { color: var(--gj-black); }

:focus-visible { outline: 3px solid var(--gj-orange); outline-offset: 2px; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--gj-black); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed !important;
	top: 8px; left: 8px; z-index: 1000;
	width: auto; height: auto; margin: 0; clip: auto;
	padding: .75rem 1rem;
	background: var(--gj-black); color: #fff;
	border-radius: 6px; text-decoration: none;
}

.wrap {
	width: 100%;
	max-width: calc(var(--gj-wrap) + var(--gj-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gj-gutter);
}

/* ==========================================================================
   3. Header & navigation
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--gj-black);
	color: #fff;
	border-bottom: 3px solid var(--gj-orange);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
/* Below 601px the admin bar scrolls away, so the sticky header must not keep a 46px offset. */
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 1rem;
	min-height: 58px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -.03em;
	color: #fff;
	text-decoration: none;
	padding-block: .5rem;
}
.brand::before {
	content: "";
	width: .7rem; height: .7rem;
	background: var(--gj-orange);
	border-radius: 50%;
}
.brand:hover { color: var(--gj-orange); }
.custom-logo-link { display: inline-flex; padding-block: .4rem; }
.custom-logo { width: auto; max-height: 44px; }

.nav-toggle {
	appearance: none;
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}
.js .nav-toggle { display: inline-flex; }

.header-actions { display: flex; align-items: center; margin-right: -10px; }

/* Search toggle: hidden without JS (the panel is then always visible). */
.search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	color: #fff;
}
.js .search-toggle { display: inline-flex; }
.search-toggle:hover,
.search-toggle[aria-expanded="true"] { color: var(--gj-orange); }
.search-toggle svg {
	width: 22px; height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.header-search { flex: 0 0 100%; padding-bottom: .9rem; }
.js .header-search { display: none; }
.js .header-search.is-open { display: block; }

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 22px; height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: transform .2s, background-color .2s, top .2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); background: var(--gj-orange); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); background: var(--gj-orange); }

.primary-nav { flex: 0 0 100%; }
.js .primary-nav { display: none; }
.js .primary-nav.is-open { display: block; }

.primary-nav ul { list-style: none; margin: 0; padding: 0 0 .5rem; }
.primary-nav a {
	display: block;
	padding: .85rem 0;
	border-top: 1px solid rgba(255, 255, 255, .14);
	font-weight: 700;
	color: #fff;
	text-decoration: none;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current_page_item > a { color: var(--gj-orange); }

@media (min-width: 782px) {
	.nav-toggle,
	.js .nav-toggle { display: none; }
	.site-header__inner > :first-child { margin-right: auto; }
	.primary-nav,
	.js .primary-nav { display: block; flex: 0 1 auto; order: 1; }
	.header-actions { order: 2; margin-left: 1rem; }
	.header-search { order: 3; }
	.primary-nav ul { display: flex; gap: 1.5rem; padding: 0; }
	.primary-nav a {
		padding: .5rem 0;
		border-top: 0;
		border-bottom: 3px solid transparent;
		font-size: .95rem;
	}
	.primary-nav a:hover,
	.primary-nav .current-menu-item > a,
	.primary-nav .current_page_item > a { border-bottom-color: var(--gj-orange); }
}

/* ==========================================================================
   4. Archive header & list
   ========================================================================== */
.archive-header {
	padding: 1.5rem 0 1.1rem;
	border-bottom: 1px solid var(--gj-line);
}
.archive-header__title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 800;
	letter-spacing: -.02em;
}
.archive-header__title::after {
	content: "";
	display: block;
	width: 48px; height: 4px;
	margin-top: .6rem;
	background: var(--gj-orange);
	border-radius: 2px;
}
.archive-header__desc { margin-top: .7rem; color: var(--gj-muted); max-width: 60ch; }
.archive-header__desc p { margin: 0 0 .5em; }
.archive-header--notitle .archive-header__desc { margin-top: 0; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list > li { border-bottom: 1px solid var(--gj-line); }

.post-item {
	display: flex;
	align-items: flex-start;
	gap: .9rem;
	padding: 1rem 0;
}
.post-item__thumb {
	flex: 0 0 120px;
	width: 120px;
	aspect-ratio: 3 / 2;
	display: block;
	overflow: hidden;
	background: var(--gj-soft);
	border-radius: 8px;
}
.post-item__thumb { text-decoration: none; }
.post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--gj-black) 55%, var(--gj-orange));
	color: #fff;
	font-size: 2rem;
}

.post-item__body { flex: 1; min-width: 0; }
.post-item__title { margin: 0 0 .35rem; font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.post-item__title a { color: var(--gj-black); text-decoration: none; }
.post-item__title a:hover { color: var(--gj-orange-text); }
.post-item__excerpt { display: none; margin: 0 0 .5rem; color: var(--gj-muted); }

.meta { font-size: .78rem; color: var(--gj-muted); }
.meta a { text-decoration: none; }
.meta__cat {
	color: var(--gj-orange-text);
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.meta__sep { margin-inline: .35em; }

@media (min-width: 640px) {
	.archive-header { padding-top: 2.25rem; }
	.archive-header__title { font-size: 2.2rem; }
	.post-item { gap: 1.25rem; padding: 1.25rem 0; }
	.post-item__thumb { flex-basis: 240px; width: 240px; border-radius: var(--gj-radius); }
	.post-item__title { font-size: 1.3rem; }
	.post-item__excerpt {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.meta { font-size: .82rem; }
	.meta__cat { font-size: .7rem; }
}

/* ==========================================================================
   5. Pagination
   ========================================================================== */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .4rem;
	margin: 1.75rem 0 0;
}
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px; height: 44px;
	padding: 0 .85rem;
	border: 1px solid var(--gj-line);
	border-radius: 8px;
	color: var(--gj-black);
	font-weight: 600;
	text-decoration: none;
}
a.page-numbers:hover { border-color: var(--gj-orange); color: var(--gj-orange-text); }
.page-numbers.current { background: var(--gj-black); border-color: var(--gj-black); color: #fff; }
.page-numbers.dots { border: 0; }

/* ==========================================================================
   6. Single post & page
   ========================================================================== */
.single, .page-article { padding-top: 1.25rem; }

.entry-header { margin-bottom: 1rem; }
.single .entry-header { text-align: center; }
.entry-eyebrow {
	display: inline-block;
	margin-bottom: .5rem;
	color: var(--gj-orange-text);
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
}
.entry-title {
	margin: 0 0 .6rem;
	font-size: 1.85rem;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.15;
}

.entry-hero { margin: 1rem calc(var(--gj-gutter) * -1) 1.5rem; background: var(--gj-soft); }
.entry-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.entry-content { font-size: 1.0625rem; line-height: 1.75; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content h2 { margin-top: 1.8em; font-size: 1.5rem; }
.entry-content h3 { margin-top: 1.6em; font-size: 1.25rem; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-bottom: .6em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin-inline: 0;
	padding: .25rem 0 .25rem 1.1rem;
	border-left: 4px solid var(--gj-orange);
	font-size: 1.1em;
	font-style: italic;
}
.entry-content cite { font-size: .85em; font-style: normal; color: var(--gj-muted); }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption,
.wp-caption-text { margin-top: .5rem; font-size: .85rem; color: var(--gj-muted); text-align: center; }
.entry-content hr { border: 0; border-top: 1px solid var(--gj-line); margin-block: 2em; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .6rem; border: 1px solid var(--gj-line); text-align: left; }
.entry-content th { background: var(--gj-soft); }
.entry-content pre { overflow-x: auto; padding: 1rem; background: var(--gj-soft); border-radius: 8px; font-size: .9rem; }
.entry-content code { font-size: .9em; }
.entry-content .wp-block-button__link { background: var(--gj-orange); color: var(--gj-black); font-weight: 700; }
.entry-content iframe { max-width: 100%; }
.entry-content .alignleft { float: left; margin: .25em 1.25em .5em 0; }
.entry-content .alignright { float: right; margin: .25em 0 .5em 1.25em; }
.entry-content .aligncenter { margin-inline: auto; text-align: center; }
.entry-content .aligncenter img { margin-inline: auto; }
.entry-content::after { content: ""; display: table; clear: both; }

.entry-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.entry-tags a {
	padding: .3rem .75rem;
	background: var(--gj-soft);
	border-radius: 999px;
	color: var(--gj-black);
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
}
.entry-tags a:hover { background: var(--gj-orange); }

@media (min-width: 640px) {
	.single, .page-article { padding-top: 2rem; }
	.single .entry-header { text-align: left; }
	.entry-title { font-size: 2.6rem; }
	.entry-hero { margin-inline: 0; border-radius: 14px; overflow: hidden; }
	.entry-content { font-size: 1.125rem; }
	.entry-content h2 { font-size: 1.75rem; }
}

/* ==========================================================================
   7. Audio player (WP [audio] shortcode and Audio block)
   White container (same as the page) holding a dark controls bar, with orange
   buttons and accents. Full width: bleeds to the screen edges on mobile.
   main.js swaps the native controls for the bar; without JS the native
   player shows in dark mode inside the same white container.
   ========================================================================== */
.entry-content .gj-audio,
.entry-content .wp-block-audio {
	margin: 1.5rem 0;
	padding: .4rem;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	color: var(--gj-text);
}

/* Native fallback. WP prints visibility:hidden inline for MediaElement, so override it. */
.entry-content .gj-audio audio,
.entry-content .wp-block-audio audio {
	display: block;
	width: 100%;
	height: 56px;
	border-radius: 8px;
	visibility: visible !important;
	color-scheme: dark;
	accent-color: var(--gj-orange);
}
.entry-content .gj-audio audio.gj-enhanced,
.entry-content .wp-block-audio audio.gj-enhanced { display: none; }

.entry-content .wp-block-audio figcaption {
	margin: .5rem 0 0;
	padding-inline: .4rem;
	color: var(--gj-muted);
	font-size: .85rem;
	text-align: left;
}

/* Dark controls bar */
.gj-player {
	display: flex;
	align-items: center;
	gap: .6rem;
	min-height: 56px;
	padding: .5rem .75rem;
	background: var(--gj-black);
	border-radius: 8px;
	color: #fff;
}
.gj-play {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--gj-orange);
	border: 0;
	border-radius: 50%;
	color: var(--gj-black);
	cursor: pointer;
	transition: transform .15s, background-color .15s;
}
.gj-play:hover { background: #ff8533; }
.gj-play:active { transform: scale(.94); }
.gj-play svg { width: 20px; height: 20px; fill: currentColor; }
.gj-play .i-pause { display: none; }
.gj-play.is-playing .i-play { display: none; }
.gj-play.is-playing .i-pause { display: block; }

.gj-cur,
.gj-dur {
	flex: none;
	min-width: 2.7em;
	color: #e6e6e6;
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
}
.gj-dur { text-align: right; }

.gj-seek {
	--p: 0%;
	flex: 1;
	min-width: 0;
	height: 24px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.gj-seek:disabled { opacity: .55; cursor: default; }
.gj-seek::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(to right, var(--gj-orange) var(--p), #3a3a3a var(--p));
}
.gj-seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: var(--gj-orange);
	box-shadow: 0 0 0 3px var(--gj-black);
}
.gj-seek::-moz-range-track { height: 6px; border-radius: 999px; background: #3a3a3a; }
.gj-seek::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gj-orange); }
.gj-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gj-orange); }

.gj-mute {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-right: -.4rem;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--gj-orange);
	cursor: pointer;
}
.gj-mute:hover { color: #ff8533; }
.gj-mute svg { width: 22px; height: 22px; fill: currentColor; }
.gj-mute .i-muted { display: none; }
.gj-mute.is-muted .i-vol { display: none; }
.gj-mute.is-muted .i-muted { display: block; }

/* ==========================================================================
   8. Related posts, empty state, 404, search form
   ========================================================================== */
.related { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 3px solid var(--gj-black); }
.related__title { margin: 0 0 .25rem; font-size: 1.3rem; font-weight: 800; }
.related .post-list > li:last-child { border-bottom: 0; }

.empty { padding: 2rem 0; }

.search-form { display: flex; gap: .5rem; max-width: 460px; margin-top: 1rem; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; height: 46px;
	padding: 0 .9rem;
	border: 2px solid var(--gj-line);
	border-radius: 8px;
	font: inherit;
}
.search-field:focus { border-color: var(--gj-orange); outline: 0; }
.search-submit {
	height: 46px;
	padding: 0 1.1rem;
	background: var(--gj-orange);
	border: 0;
	border-radius: 8px;
	color: var(--gj-black);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.search-submit:hover { background: var(--gj-black); color: #fff; }

/* Dark contexts (header panel, footer) */
.site-header .search-form,
.site-footer .search-form { max-width: none; margin: 0; }
.site-header .search-field,
.site-footer .search-field { background: #1a1a1a; border-color: #333; color: #fff; }
.site-header .search-field::placeholder,
.site-footer .search-field::placeholder { color: #9b9b9b; }
.site-header .search-field:focus,
.site-footer .search-field:focus { border-color: var(--gj-orange); }
.site-header .search-submit:hover,
.site-footer .search-submit:hover { background: #fff; color: var(--gj-black); }
.footer-search { max-width: 460px; margin: 1rem 0 0; }

/* Live search page */
.search-form--live { max-width: none; }
.live-status { min-height: 1.5em; margin: .75rem 0 0; color: var(--gj-muted); font-size: .9rem; }
.live-results { transition: opacity .15s; }
.live-results.is-loading { opacity: .45; }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
	margin-top: 3rem;
	padding: 2rem 0 2.25rem;
	background: var(--gj-black);
	border-top: 3px solid var(--gj-orange);
	color: #b9b9b9;
	font-size: .9rem;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gj-orange); }
.site-footer__brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0; padding: 0; list-style: none; }
.site-footer__text { margin: 1rem 0 0; }

/* ==========================================================================
   10. Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
@media print {
	.site-header, .site-footer, .related, .entry-tags, .pagination { display: none; }
}
