/**
 * Protocol Theme Styles
 * Built by Richard Seddon for SeddCo (https://sedd.co)
 * Bryan Johnson Protocol website
 */

/* ==========================================================================
   Variables & Base Styles
   ========================================================================== */

:root {
	/* Colors - matching original site */
	--primary-color: #000000;
	--secondary-color: #ffffff;
	--text-color: #000000;
	--bg-color: #ffffff;
	--link-color: #000000;
	--link-hover-color: #666666;
	--border-color: #e0e0e0;
	
	/* Typography - EXACT original Protocol site fonts from Cargo CDN */
	--font-mono: "Monument Grotesk Mono", 'Courier New', monospace;
	--font-condensed: "D-DIN Condensed", Arial Narrow, sans-serif;
	--font-stanley: "Stanley", serif;
	--font-optician: "Optician Sans", sans-serif;
	--font-size-base: 16px;
	--line-height-base: 1.6;
	
	/* Spacing */
	--spacing-xs: 0.5rem;
	--spacing-sm: 1rem;
	--spacing-md: 2rem;
	--spacing-lg: 3rem;
	--spacing-xl: 4rem;
	
	/* Layout - Desktop: 15% sidebar, 85% content */
	--sidebar-width: 15%;
	--content-width: 85%;
	--sidebar-padding: 1.5rem;
	--content-padding: 2.9rem;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
	box-sizing: border-box;
}

body {
	font-family: var(--font-condensed), Arial Narrow, sans-serif;
	font-size: 1.3rem;
	line-height: 1.3;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.75);
	background-color: var(--bg-color);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Monospace font for code and specific elements */
code, pre, .font-mono {
	font-family: var(--font-mono);
}

/* Typography - EXACT MATCH TO ORIGINAL SITE */

/* Body content (bodycopy) - D-DIN Condensed */
body, .protocol-content, .entry-content {
	font-family: var(--font-condensed), Arial Narrow, sans-serif;
	font-size: 1.3rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.75);
	line-height: 1.3;
}

/* H1 - EXACT MATCH to protocol.bryanjohnson.com */
h1 {
	font-family: "Stanley", Icons;
	font-style: normal;
	font-weight: normal;
	padding: 0;
	margin: 0;
	font-size: 2.8rem;
	line-height: 1.1;
	color: rgba(0, 0, 0, 0.75);
}

/* Sidebar H1 - slightly smaller (2.5rem) */
#sidebar-menu h1, .sidebar-title {
	font-size: 2.5rem;
	font-family: "Stanley", Icons;
	font-weight: normal;
	font-style: normal;
}

/* H2 - Stanley font (matching original site) */
h2 {
	font-family: "Stanley", Icons;
	font-style: normal;
	font-weight: normal;
	padding: 0;
	margin: 0;
	margin-bottom: var(--spacing-md);
	font-size: 2.8rem;
	line-height: 1.1;
	color: rgba(0, 0, 0, 0.75);
}

/* H3, H4, H5, H6 */
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

h3, h4, h5, h6 {
	font-weight: 400;
	line-height: 1.2;
	margin-bottom: var(--spacing-sm);
	color: rgba(0, 0, 0, 0.75);
}

p {
	margin-bottom: var(--spacing-sm);
}

a {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
	transition: opacity 0.2s ease;
}

a:hover,
a:focus {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
	opacity: 0.7;
}

a:active {
	opacity: 0.7;
}

/* Base image styling - only max-width to prevent overflow, not forced 100% */
img {
	max-width: 100%;
	height: auto;
}

/* ==========================================================================
   Layout - LEFT SIDEBAR + RIGHT CONTENT (EXACT MATCH)
   ========================================================================== */

#page {
	min-height: 100vh;
	display: flex;
	flex-direction: row;
	position: relative;
}

/* Left Sidebar - Fixed, 300px width */
.protocol-sidebar {
	width: 300px;
	min-width: 300px;
	max-width: 300px;
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	background-color: var(--bg-color);
	overflow-y: auto;
	overflow-x: hidden;
	padding: var(--sidebar-padding);
	z-index: 100;
	box-sizing: border-box;
	box-shadow: 1px 0px 15px rgba(0, 0, 0, 0.1);
	/* Hide scrollbar but keep scrolling functionality */
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.protocol-sidebar::-webkit-scrollbar {
	display: none;
}

.sidebar-content {
	width: 100%;
}

.sidebar-title {
	font-family: 'DM Sans', var(--font-primary), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 2.5rem;
	line-height: 1.1;
	font-weight: normal;
	color: rgba(0, 0, 0, 0.75);
	margin: 0;
	padding: 0;
	margin-bottom: 0;
}

.sidebar-title a {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: none;
}

.sidebar-title a:hover {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: none;
}

.sidebar-title strong {
	font-weight: normal;
}

.sidebar-subtitle {
	font-family: var(--font-primary), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.3rem;
	line-height: 1.4;
	font-weight: normal;
	color: rgba(0, 0, 0, 0.6);
	margin: 0.5rem 0 0 0;
	padding: 0;
}

.sidebar-menu {
	margin-top: 1rem;
}

/* Sidebar bottom widget area */
.sidebar-bottom-widgets {
	margin-top: 1rem;
}

.sidebar-bottom-widgets .widget {
	margin-bottom: 1.5rem;
}

.sidebar-bottom-widgets .widget:last-child {
	margin-bottom: 0;
}

.sidebar-bottom-widgets .widget-title {
	font-family: var(--font-primary), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.3rem;
	line-height: 1.3;
	font-weight: normal;
	color: rgba(0, 0, 0, 0.75);
	margin: 0 0 0.75rem 0;
	padding: 0;
}

.sidebar-bottom-widgets .widget,
.sidebar-bottom-widgets .widget * {
	font-family: var(--font-condensed), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.3rem;
	line-height: 1.3rem;
	color: rgba(0, 0, 0, 0.75);
}

.sidebar-bottom-widgets .widget a {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: none;
	transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.sidebar-bottom-widgets .widget a:hover,
.sidebar-bottom-widgets .widget a:focus {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
	opacity: 0.7;
}

/* Section dividers (SPA) */
.protocol-section-divider {
	border: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.2);
	margin: 1.5rem 0;
	padding: 0;
	width: 100%;
}

/* Sidebar menu dividers */
.sidebar-menu-divider {
	border: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.2);
	margin: 1.5rem 0;
	padding: 0;
	width: 100%;
}

/* Remove borders from sidebar menus - using hr dividers only */
.sidebar-menu-primary,
.sidebar-menu-1,
.sidebar-menu-2,
.sidebar-menu-3,
.sidebar-menu-4 {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

.sidebar-nav {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	align-content: flex-start;
	gap: 0;
	line-height: 1.5rem;
}

.sidebar-nav li {
	margin-bottom: 0;
	flex: 0 0 100%;
	min-width: 0;
	display: block;
	line-height: 1.3rem;
}

/* Simplified inline menu items - display inline */
.sidebar-nav li.menu-item-inline,
.sidebar-nav li.menu-item-inline-start,
.sidebar-nav li.menu-item-inline-end,
.sidebar-nav .sub-menu li.menu-item-inline,
.sidebar-nav .sub-menu li.menu-item-inline-start,
.sidebar-nav .sub-menu li.menu-item-inline-end {
	flex: 0 0 auto !important;
	display: inline-block !important;
	width: auto !important;
	vertical-align: baseline !important;
	line-height: 1.3rem !important;
	margin-bottom: 0 !important;
	padding: 0.25rem 0 !important;
}

/* menu-item-inline-end fills remaining space */
.sidebar-nav li.menu-item-inline-end,
.sidebar-nav .sub-menu li.menu-item-inline-end {
	flex: 1 0 auto !important;
}

/* Break element to force new line */
.sidebar-nav .menu-item-break,
.sidebar-nav .sub-menu .menu-item-break {
	flex-basis: 100% !important;
	width: 100% !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	display: block !important;
	visibility: hidden !important;
}

.sidebar-nav a {
	display: block;
	color: rgba(0, 0, 0, 0.75);
	text-decoration: none;
	padding: 0.25rem 0;
	transition: opacity 0.2s ease, text-decoration 0.2s ease;
	font-family: var(--font-condensed), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.3rem;
	line-height: 1.3rem;
}

/* Make links inline for inline menu items, but keep same padding as regular items */
.sidebar-nav li.menu-item-inline a,
.sidebar-nav li.menu-item-inline-end a,
.sidebar-nav li.menu-item-inline-start a,
.sidebar-nav .sub-menu li.menu-item-inline a,
.sidebar-nav .sub-menu li.menu-item-inline-end a,
.sidebar-nav .sub-menu li.menu-item-inline-start a {
	display: inline !important;
	padding: 0.25rem 0 !important;
	line-height: 1.3rem !important;
	vertical-align: baseline !important;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
	opacity: 0.7;
}

.sidebar-nav .current-menu-item > a {
	color: rgba(0, 0, 0, 0.4);
	font-weight: bold;
}

.sidebar-nav .sub-menu {
	list-style: none;
	padding-left: 1rem;
	margin: 0;
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: baseline !important;
	align-content: flex-start !important;
	gap: 0;
	line-height: 1.5rem;
}

/* Old separator rules using > selector removed - separators now handled by JavaScript */

/* Style for JavaScript-inserted separators */
.sidebar-nav .menu-item-separator {
	color: rgba(0, 0, 0, 0.5);
	margin: 0 0.15rem;
	font-weight: normal;
	display: inline !important;
	white-space: pre;
	line-height: 1.3rem;
	font-size: 1.3rem;
	vertical-align: baseline;
	pointer-events: none;
	padding: 0;
}

/* Old link rules using > selector removed - using new rules above instead */

/* Main Content Area - right side */
.protocol-content {
	width: calc(100% - 300px);
	margin-left: 300px;
	padding: 0;
	min-height: 100vh;
	box-sizing: border-box;
	background-color: var(--bg-color);
}

.protocol-content-inner {
	width: 100%;
}

/* SPA Content Container - Single Page Application */
.protocol-spa-content {
	width: 100%;
	max-width: 1600px;
	margin: 0;
	padding: 0;
}

.protocol-section {
	width: 100%;
	min-height: 5vh; /* Each section minimum height */
	padding: var(--content-padding);
	padding-bottom: var(--spacing-lg);
	scroll-margin-top: 20px; /* Offset for smooth scrolling anchor links */
}

.protocol-section:first-child {
	padding-top: var(--content-padding);
}

#primary {
	width: calc(100% - 300px);
	margin-left: 300px;
	padding: 0;
	min-height: 100vh;
	box-sizing: border-box;
	background-color: var(--bg-color);
	position: relative; /* Ensure proper positioning */
	overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Ensure content sections stay in place */
.protocol-section {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	position: relative;
	clear: both;
}

/* Fix for content shifting under sidebar */
.protocol-section .container-fluid,
.protocol-section .row,
.protocol-section .col-12 {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
	box-sizing: border-box;
}

/* Content typography */
.protocol-content .entry-content,
.protocol-content-inner {
	font-family: var(--font-condensed), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.3rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.75);
	line-height: 1.3;
}

.protocol-content h1 {
	font-family: 'DM Sans', var(--font-primary), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 2.8rem;
	line-height: 1.1;
	font-weight: normal;
	color: rgba(0, 0, 0, 0.75);
	margin: 0;
	padding: 0;
}

.protocol-content h2 {
	font-family: "Stanley", Icons;
	font-style: normal;
	font-weight: normal;
	padding: 0;
	margin: 0;
	margin-bottom: var(--spacing-md);
	font-size: 2.8rem;
	line-height: 1.1;
	color: rgba(0, 0, 0, 0.75);
}

.protocol-content a {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
}

.protocol-content a:hover {
	opacity: 0.7;
}

/* Blockquote styling */
.protocol-content blockquote {
	margin: 0;
	padding: 0 0 0 1em;
}

/* HR styling */
hr {
	background: rgba(127, 127, 127, 0.2);
	border: 0;
	height: 1px;
	display: block;
	margin: 1rem 0;
}

/* List styling */
ul, ol {
	margin: 0;
	padding: 0 0 0 1em;
}

.protocol-content ul,
.protocol-content ol {
	margin: 0;
	padding: 0 0 0 1em;
}

.protocol-content li {
	margin-bottom: 0.5rem;
}

/* Small text - Monument Grotesk Mono */
small {
	display: inline-block;
	font-size: 1.2rem;
	line-height: 1.3;
	font-family: var(--font-mono), 'Courier New', monospace;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.25);
}

/* Apply to elements with data-predefined-style for exact matching */
[data-predefined-style="true"] bodycopy,
bodycopy,
.protocol-content bodycopy {
	font-family: var(--font-condensed), Arial Narrow, sans-serif;
	font-size: 1.3rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.75);
	line-height: 1.3;
}

[data-predefined-style="true"] h1,
h1 {
	font-family: var(--font-stanley), serif;
	font-size: 2.8rem;
	line-height: 1.1;
	font-weight: normal;
	color: rgba(0, 0, 0, 0.75);
}

[data-predefined-style="true"] h2,
h2 {
	font-family: var(--font-optician), sans-serif;
	font-size: 2rem;
	line-height: 1.2;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.75);
}

[data-predefined-style="true"] small,
small {
	font-size: 1.2rem;
	font-family: var(--font-mono), 'Courier New', monospace;
	line-height: 1.3;
	color: rgba(0, 0, 0, 0.25);
}

/* Image styling - Only apply forced width to img-fluid class */
.protocol-content img.img-fluid,
.entry-content img.img-fluid,
.wp-block-image img.img-fluid,
/* When img-fluid is on the figure container, apply to the img inside */
.wp-block-image.img-fluid img,
figure.img-fluid img {
	max-width: 100% !important;
	width: 100% !important;
	height: auto !important;
	display: block;
	float: none;
	margin: 0;
	border: 0;
	padding: 0;
}

/* Base image styling in content - no forced width, centering, or margins */
.protocol-content img,
.entry-content img,
.wp-block-image img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0;
	border: 0;
	padding: 0;
}

/* ==========================================================================
   Lazy Loading & Image Transitions (matching original site)
   ========================================================================== */

/* Initial state for lazy-loaded images */
.protocol-image-lazy {
	opacity: 0;
	transition: opacity 0.6s ease-in-out;
	will-change: opacity;
}

/* Fade-in animation when image loads */
.protocol-image-loaded {
	opacity: 0;
}

.protocol-image-fade-in {
	opacity: 1;
}

/* Ensure images don't cause layout shift - but don't force width */
.protocol-image-lazy,
.protocol-image-loaded,
.protocol-image-fade-in {
	display: block;
	max-width: 100%;
	height: auto;
}

/* WordPress block styling */
.wp-block-image {
	margin: 1.5rem 0;
	text-align: center;
}

.wp-block-image figure {
	margin: 0;
}

.wp-block-paragraph {
	margin-bottom: 1rem;
}

.wp-block-heading {
	margin-top: 2rem;
	margin-bottom: 1rem;
}

/* Strong/Bold styling */
b, strong {
	font-weight: bolder;
}

/* ==========================================================================
   Content Styles
   ========================================================================== */

.protocol-content .container {
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-header {
	margin-bottom: var(--spacing-md);
}

.entry-title {
	font-size: 2.5rem;
	font-weight: 600;
	margin-bottom: var(--spacing-sm);
}

.entry-title a {
	color: var(--primary-color);
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--link-hover-color);
	text-decoration: underline;
}

.entry-meta {
	font-size: 0.875rem;
	color: #666;
	margin-bottom: var(--spacing-sm);
}

.entry-content {
	margin-bottom: var(--spacing-md);
}

.entry-content p {
	margin-bottom: var(--spacing-sm);
}

.entry-content img {
	margin: var(--spacing-md) 0;
}

.entry-content ul,
.entry-content ol {
	margin-bottom: var(--spacing-sm);
	padding-left: var(--spacing-md);
}

.entry-content li {
	margin-bottom: 0.5rem;
}

.post-thumbnail {
	margin-bottom: var(--spacing-md);
}

.post-thumbnail img {
	width: 100%;
	height: auto;
}

.entry-footer {
	font-size: 0.875rem;
	color: #666;
	padding-top: var(--spacing-sm);
	border-top: 1px solid var(--border-color);
	margin-top: var(--spacing-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.protocol-footer,
.site-footer {
	background-color: var(--bg-color);
	border-top: 1px solid var(--border-color);
	padding: var(--spacing-md) 0;
	margin-top: var(--spacing-xl);
	width: 100%;
	clear: both;
}

.protocol-footer .container-fluid {
	max-width: 1600px;
	margin: 0 auto;
	padding-left: var(--content-padding);
	padding-right: var(--content-padding);
}

/* Footer Widgets */
.footer-widgets {
	margin-bottom: var(--spacing-md);
}

.footer-column {
	margin-bottom: var(--spacing-sm);
}

.footer-column .widget {
	margin-bottom: var(--spacing-sm);
}

.footer-column .widget-title {
	font-family: var(--font-stanley);
	font-size: 1.5rem;
	font-weight: normal;
	margin-bottom: var(--spacing-sm);
	color: var(--text-color);
}

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

.footer-column .widget ul li {
	margin-bottom: 0.5rem;
}

.footer-column .widget a {
	color: var(--link-color);
	text-decoration: none;
}

.footer-column .widget a:hover {
	color: var(--link-hover-color);
	text-decoration: underline;
}

/* Footer Copyright */
.footer-copyright {
	padding-top: var(--spacing-sm);
	border-top: 1px solid var(--border-color);
	margin-top: var(--spacing-sm);
	text-align: center;
	font-size: 0.875rem;
	color: var(--text-color);
	opacity: 0.75;
}

.footer-copyright p {
	margin: 0;
}

.site-info {
	text-align: center;
	font-size: 0.875rem;
	color: #666;
}

/* Footer Responsive */
@media (max-width: 768px) {
	.protocol-footer .container-fluid {
		padding-left: var(--spacing-sm);
		padding-right: var(--spacing-sm);
	}
	
	.footer-column {
		margin-bottom: var(--spacing-md);
	}
}

/* ==========================================================================
   Utilities
   ========================================================================== */

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

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	left: -9999px;
	position: absolute;
	top: -9999px;
}

.skip-link:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 6px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 7px;
	width: auto;
	z-index: 100000;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile Menu Toggle Button - Hidden on desktop */
.mobile-menu-toggle {
	display: none;
	position: fixed;
	top: 1rem;
	right: 1rem;
	left: auto;
	z-index: 103; /* Above mobile menu */
	background: rgba(255, 255, 255, 0.2); /* 80% transparent white */
	border: 2px solid rgba(0, 0, 0, 0.75);
	padding: 0.75rem;
	cursor: pointer;
	width: 50px;
	height: 50px;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 5px;
	transition: all 0.3s ease;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	/* Ensure button is fully visible and not covered */
	margin-right: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	overflow: visible; /* Allow X icon to extend beyond button bounds */
}

.mobile-menu-toggle:hover {
	background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle:focus {
	outline: 2px solid rgba(0, 0, 0, 0.75);
	outline-offset: 2px;
}

.menu-toggle-icon {
	display: block;
	width: 24px;
	height: 18px;
	position: relative;
	overflow: visible; /* Allow rotated spans to extend beyond icon bounds */
}

.menu-toggle-icon span:nth-child(1) {
	top: 0;
}

.menu-toggle-icon span:nth-child(2) {
	top: 50%;
	transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
}

.menu-toggle-icon span:nth-child(3) {
	bottom: 0;
}

.menu-toggle-icon span {
	display: block;
	width: 100%;
	height: 2px;
	background: rgba(0, 0, 0, 0.75);
	transition: all 0.3s ease;
	transform-origin: center center;
	-webkit-transform-origin: center center;
	position: absolute;
	left: 0;
	right: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
	-webkit-transform: translateY(-50%) rotate(45deg);
	transform-origin: center center;
	-webkit-transform-origin: center center;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
	opacity: 0;
	transform: translateY(-50%) scaleX(0);
	-webkit-transform: translateY(-50%) scaleX(0);
}

.mobile-menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
	bottom: auto;
	top: 50%;
	transform: translateY(-50%) rotate(-45deg);
	-webkit-transform: translateY(-50%) rotate(-45deg);
	transform-origin: center center;
	-webkit-transform-origin: center center;
}

/* Mobile Menu Backdrop - Removed */

@media (max-width: 992px) {
	/* On tablets and below, make sidebar collapsible */
	.mobile-menu-toggle {
		display: flex;
	}
	
	.protocol-sidebar {
		transform: translateX(-100%);
		transition: transform 0.3s ease, backdrop-filter 0.3s ease;
		z-index: 102; /* Below toggle button */
		width: calc(80% - 70px) !important; /* Mobile sidebar width minus space for toggle button (50px + 20px margin) */
		min-width: 300px !important; /* Minimum width for mobile sidebar */
		max-width: 300px !important; /* Maximum width for mobile sidebar */
		background-color: rgba(255, 255, 255, 0.25) !important; /* 75% transparent (25% opacity) */
		/* Optimize rendering to reduce jitter */
		will-change: transform, backdrop-filter;
		transform: translateX(-100%) translateZ(0); /* Force hardware acceleration */
		-webkit-transform: translateX(-100%) translateZ(0);
		/* Start with no blur, will transition smoothly */
		backdrop-filter: blur(0px);
		-webkit-backdrop-filter: blur(0px);
	}
	
	.protocol-sidebar.mobile-open {
		transform: translateX(0) translateZ(0);
		-webkit-transform: translateX(0) translateZ(0);
		/* Blur transitions smoothly during menu opening */
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
	}
	
	.protocol-sidebar.mobile-open {
		transform: translateX(0);
	}
	
	.protocol-content {
		width: 100%;
		margin-left: 0;
		padding: 0;
	}
	
	.protocol-spa-content {
		padding: 0;
	}
	
	.protocol-section {
		padding: var(--spacing-sm);
		padding-bottom: var(--spacing-lg);
	}
	
	#primary {
		width: 100%;
		margin-left: 0;
		padding: 0;
	}
}

@media (max-width: 768px) {
	:root {
		--font-size-base: 14px;
		--content-padding: 1rem;
		--sidebar-padding: 1rem;
	}
	
	h1 { font-size: 2rem; }
	h2 {
		font-family: "Stanley", Icons;
		font-style: normal;
		font-weight: normal;
		font-size: 1.75rem;
		line-height: 1.1;
		color: rgba(0, 0, 0, 0.75);
		margin: 0;
		padding: 0;
	}
	h3 { font-size: 1.5rem; }
	
	.entry-title {
		font-size: 2rem;
	}
	
	.sidebar-title {
		font-size: 1.75rem;
	}
}

@media (max-width: 576px) {
	h1 { font-size: 1.75rem; }
	h2 {
		font-family: "Stanley", Icons;
		font-style: normal;
		font-weight: normal;
		font-size: 1.5rem;
		line-height: 1.1;
		color: rgba(0, 0, 0, 0.75);
		margin: 0;
		padding: 0;
	}
	h3 { font-size: 1.25rem; }
	
	.entry-title {
		font-size: 1.75rem;
	}
	
	.sidebar-title {
		font-size: 1.5rem;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.site-header,
	.site-footer,
	.navbar,
	.navbar-toggler {
		display: none;
	}
	
	body {
		font-size: 12pt;
		line-height: 1.5;
	}
	
	.entry-content {
		page-break-inside: avoid;
	}
}

/* ==========================================================================
   WordPress Blocks with Bootstrap Responsive
   ========================================================================== */

/* Responsive Images - Bootstrap compatible */
.entry-content img.img-fluid,
.protocol-content img.img-fluid,
.wp-block-image img.img-fluid,
/* When img-fluid is on the figure container, apply to the img inside */
.wp-block-image.img-fluid img,
figure.img-fluid img {
	width: 100%;
	height: auto;
}

/* WordPress Block to Bootstrap 5.3 Mapping */
.wp-block-paragraph {
	margin-bottom: 1rem;
}

.wp-block-heading {
	margin-top: 2rem;
	margin-bottom: 1rem;
}

/* Core/Columns → Bootstrap Grid */
.wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 2rem;
}

.wp-block-column {
	flex: 1;
	min-width: 0;
}

@media (max-width: 768px) {
	.wp-block-columns {
		flex-direction: column;
	}
	
	.wp-block-column {
		flex: 1 1 100%;
	}
}

/* Core/Group → Bootstrap Container */
.wp-block-group {
	margin-bottom: 2rem;
}

.wp-block-group__inner-container {
	width: 100%;
}

/* Core/Image → Bootstrap Responsive Image */
.wp-block-image {
	margin: 1.5rem 0;
}

.wp-block-image figure {
	margin: 0;
	text-align: center;
}

.wp-block-image img {
	max-width: 100%;
	height: auto;
	border-radius: 0;
}

/* Only force 100% width when img-fluid class is present */
.wp-block-image img.img-fluid,
/* When img-fluid is on the figure container, apply to the img inside */
.wp-block-image.img-fluid img,
figure.img-fluid img {
	width: 100%;
}

/* Core/Gallery → Bootstrap Grid */
.wp-block-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 2rem 0;
}

.wp-block-gallery .wp-block-image {
	margin: 0;
}

/* Core/Quote → Bootstrap Blockquote */
.wp-block-quote {
	border-left: 4px solid rgba(0, 0, 0, 0.2);
	padding-left: 1rem;
	margin: 2rem 0;
	font-style: italic;
}

/* Core/List → Bootstrap List */
.wp-block-list {
	margin: 1rem 0;
	padding-left: 1.5rem;
}

/* Core/Button → Bootstrap Button */
.wp-block-button {
	margin: 1rem 0;
}

.wp-block-button__link {
	display: inline-block;
	padding: 0.5rem 1rem;
	text-decoration: none;
	border: 1px solid rgba(0, 0, 0, 0.75);
	color: rgba(0, 0, 0, 0.75);
	transition: opacity 0.2s ease;
}

.wp-block-button__link:hover {
	opacity: 0.7;
	text-decoration: none;
}

/* ==========================================================================
   Bootstrap Display Classes Override
   ========================================================================== */

/* Display-1 - 7rem font size (for first H1 on site) */
/* Higher specificity to override Bootstrap */
body .display-1,
.protocol-content .display-1,
.protocol-section .display-1,
.entry-content .display-1,
#primary .display-1,
.display-1 {
	font-family: "Stanley", Icons !important;
	font-size: 7rem !important;
	line-height: 1.1 !important;
	font-weight: normal !important;
	font-style: normal !important;
	color: rgba(0, 0, 0, 0.75) !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Display-2 - same as display-1 but 5rem base size */
body .display-2,
.protocol-content .display-2,
.protocol-section .display-2,
.entry-content .display-2,
#primary .display-2,
.display-2 {
	font-family: "Stanley", Icons !important;
	font-size: 5rem !important;
	line-height: 1.1 !important;
	font-weight: normal !important;
	font-style: normal !important;
	color: rgba(0, 0, 0, 0.75) !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Display-1 responsive styles - must come after desktop rule */
@media (max-width: 768px) {
	body .display-1,
	.protocol-content .display-1,
	.protocol-section .display-1,
	.entry-content .display-1,
	#primary .display-1,
	.display-1 {
		font-size: 3rem !important;
		line-height: 1.1 !important;
	}
}

@media (max-width: 576px) {
	body .display-1,
	.protocol-content .display-1,
	.protocol-section .display-1,
	.entry-content .display-1,
	#primary .display-1,
	.display-1 {
		font-size: 2.5rem !important;
		line-height: 1.1 !important;
	}
}

/* Display-2 responsive styles - matches display-1 breakpoints */
@media (max-width: 768px) {
	body .display-2,
	.protocol-content .display-2,
	.protocol-section .display-2,
	.entry-content .display-2,
	#primary .display-2,
	.display-2 {
		font-size: 3rem !important;
		line-height: 1.1 !important;
	}
}

@media (max-width: 576px) {
	body .display-2,
	.protocol-content .display-2,
	.protocol-section .display-2,
	.entry-content .display-2,
	#primary .display-2,
	.display-2 {
		font-size: 2.5rem !important;
		line-height: 1.1 !important;
	}
}

/* WordPress Block Editor styles with Bootstrap */
.wp-block-group {
	margin-bottom: var(--spacing-md);
}

.wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md);
}

.wp-block-column {
	flex: 1;
	min-width: 0;
}

/* Responsive image blocks - duplicate removed, see above */

/* Responsive containers */
.protocol-content .wp-block-group__inner-container,
.entry-content .wp-block-group__inner-container {
	max-width: 100%;
	padding-left: 15px;
	padding-right: 15px;
}

/* Bootstrap responsive utilities for content */
/* Separator between pages and posts */
.protocol-pages-posts-separator {
	background: rgba(127, 127, 127, 0.2);
	border: 0;
	height: 1px;
	display: block;
	margin: var(--spacing-lg) 0;
	width: 100%;
}

/* Blog Posts Section */
#blog-posts {
	margin-top: var(--spacing-lg);
	padding-top: var(--spacing-lg);
}

.blog-posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	margin-top: 2rem;
}

.blog-post-item {
	border-bottom: 1px solid rgba(127, 127, 127, 0.1);
	padding-bottom: 1.5rem;
}

.blog-post-item .entry-title {
	font-family: var(--font-stanley), serif;
	font-size: 2rem;
	line-height: 1.2;
	font-weight: 400;
	margin-bottom: 0.5rem;
}

.blog-post-item .entry-title a {
	color: rgba(0, 0, 0, 0.75);
	text-decoration: none;
}

.blog-post-item .entry-title a:hover {
	opacity: 0.7;
	text-decoration: underline;
}

.blog-post-item .entry-meta {
	font-family: var(--font-mono), 'Courier New', monospace;
	font-size: 1rem;
	color: rgba(0, 0, 0, 0.5);
	margin-bottom: 1rem;
}

.blog-post-item .entry-content {
	font-family: var(--font-condensed), Arial Narrow, sans-serif;
	font-size: 1.3rem;
	line-height: 1.3;
}

.blog-post-item .read-more {
	font-family: var(--font-condensed), Arial Narrow, sans-serif;
	color: rgba(0, 0, 0, 0.75);
	text-decoration: underline;
}

.blog-post-item .read-more:hover {
	opacity: 0.7;
}

@media (max-width: 768px) {
	.wp-block-columns {
		flex-direction: column;
	}
	
	.wp-block-column {
		flex: 1 1 100%;
	}
	
	.entry-content {
		padding: var(--spacing-sm) !important;
	}
	
	.protocol-section {
		padding: var(--spacing-sm) !important;
	}
	
	.blog-posts-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}

