/*
Theme Name: JSG Custom Theme
Theme URI: https://jasonshaffer.net
Author: Jason Shaffer Group
Author URI: https://jasonshaffer.net
Description: Hybrid theme for JSG — native WordPress header, footer, menus, and fonts, with per-page raw HTML canvases. Paste complete page HTML into any page while keeping global site chrome editable in one place.
Version: 1.3.0
Requires at least: 6.0
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: jsg-custom-theme
*/

/* =========================================================
   1. DESIGN TOKENS — global font & color swaps happen here.
   Pasted pages can (and should) reference these variables.
   ========================================================= */
:root {
	--jsg-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--jsg-font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	--jsg-color-bg: #ffffff;
	--jsg-color-text: #1a1a2e;
	--jsg-color-muted: #5f6b7a;
	--jsg-color-accent: #2563eb;
	--jsg-color-accent-hover: #1d4ed8;

	--jsg-header-bg: #ffffff;
	--jsg-header-text: #1a1a2e;
	--jsg-footer-bg: #0f172a;
	--jsg-footer-text: #cbd5e1;

	--jsg-container: 1160px;
}

/* =========================================================
   2. BASE — intentionally light so pasted pages aren't fought
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

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

a {
	color: var(--jsg-color-accent);
}

a:hover {
	color: var(--jsg-color-accent-hover);
}

.jsg-container {
	max-width: var(--jsg-container);
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
}

.jsg-main {
	min-height: 50vh;
}

/* Accessibility helpers */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal !important;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	clip: auto;
	padding: 12px 20px;
	background: var(--jsg-color-accent);
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
}

/* =========================================================
   3. HEADER + NAV
   ========================================================= */
.jsg-header {
	background: var(--jsg-header-bg);
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	position: relative;
	z-index: 100;
}

.jsg-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 72px;
}

.jsg-site-title {
	font-family: var(--jsg-font-heading);
	font-size: 1.3rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--jsg-header-text);
	text-decoration: none;
}

.custom-logo {
	max-height: 48px;
	width: auto;
	display: block;
}

.jsg-menu {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jsg-menu a {
	display: block;
	padding: 10px 14px;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--jsg-header-text);
	text-decoration: none;
	border-radius: 8px;
	transition: background 0.15s ease, color 0.15s ease;
}

.jsg-menu a:hover,
.jsg-menu .current-menu-item > a,
.jsg-menu .current_page_item > a {
	color: var(--jsg-color-accent);
	background: rgba(37, 99, 235, 0.08);
}

/* Dropdowns (desktop) */
.jsg-menu li {
	position: relative;
}

.jsg-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	display: none;
	flex-direction: column;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 8px;
	background: var(--jsg-header-bg);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.jsg-menu li:hover > .sub-menu,
.jsg-menu li:focus-within > .sub-menu {
	display: flex;
}

/* Mobile toggle (hidden on desktop) */
.jsg-nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	padding: 10px;
	background: none;
	border: 0;
	cursor: pointer;
}

.jsg-nav-toggle-bar {
	width: 22px;
	height: 2px;
	background: var(--jsg-header-text);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 899px) {
	.jsg-nav-toggle {
		display: flex;
	}

	.jsg-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--jsg-header-bg);
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
		box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
		padding: 12px 24px 20px;
	}

	body.jsg-nav-open .jsg-nav {
		display: block;
	}

	body.jsg-nav-open .jsg-nav-toggle-bar:nth-child(2) {
		transform: translateY(7px) rotate(45deg);
	}

	body.jsg-nav-open .jsg-nav-toggle-bar:nth-child(3) {
		opacity: 0;
	}

	body.jsg-nav-open .jsg-nav-toggle-bar:nth-child(4) {
		transform: translateY(-7px) rotate(-45deg);
	}

	.jsg-menu {
		flex-direction: column;
		align-items: stretch;
	}

	.jsg-menu .sub-menu {
		position: static;
		display: flex;
		border: 0;
		box-shadow: none;
		padding: 0 0 0 16px;
	}
}

/* =========================================================
   4. FOOTER
   ========================================================= */
.jsg-footer {
	background: var(--jsg-footer-bg);
	color: var(--jsg-footer-text);
	margin-top: 0;
}

.jsg-footer-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding-top: 40px;
	padding-bottom: 40px;
	text-align: center;
}

.jsg-footer-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jsg-footer-menu a {
	color: var(--jsg-footer-text);
	text-decoration: none;
	font-size: 0.92rem;
}

.jsg-footer-menu a:hover {
	color: #ffffff;
}

.jsg-copyright {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.7;
}

/* =========================================================
   5. REGULAR EDITOR PAGES / POSTS ONLY
   (scoped so raw HTML pages are untouched)
   ========================================================= */
.jsg-page,
.jsg-archive {
	padding-top: 56px;
	padding-bottom: 72px;
}

.jsg-page-title {
	font-family: var(--jsg-font-heading);
	font-size: 2.4rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 8px;
}

.jsg-post-meta {
	color: var(--jsg-color-muted);
	margin: 0 0 24px;
}

.jsg-entry-content {
	font-size: 1.05rem;
	max-width: 760px;
}

.jsg-entry-content h2,
.jsg-entry-content h3 {
	font-family: var(--jsg-font-heading);
	letter-spacing: -0.01em;
	margin-top: 2em;
}

.jsg-entry-content .alignwide {
	max-width: var(--jsg-container);
}

.jsg-entry-content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

.jsg-archive-item {
	padding: 24px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.jsg-archive-title {
	margin: 0 0 6px;
}

.jsg-archive-title a {
	color: var(--jsg-color-text);
	text-decoration: none;
}

.jsg-archive-title a:hover {
	color: var(--jsg-color-accent);
}
