/**
 * In-Lore Mode Styles (Nimbuspire Mode)
 * Fantasy-themed styling with parchment textures and mystical aesthetics
 * 
 * Attribution: D&D styling elements inspired by Homebrewery
 * (https://github.com/naturalcrit/homebrewery) - MIT License
 * Adapted for WordPress block theme compatibility
 */

/* ===========================
 * COLOR PALETTE (D&D-inspired)
 * =========================== */
body.content-mode-in-lore {
	/* Homebrewery PHB Color Scheme */
	--phb-parchment: #EEE5CE;
	--phb-accent-green: #E0E5C1;
	--phb-gold: #C0AD6A;
	--phb-maroon: #9C2B1B;
	--phb-dark-maroon: #58180D;
	--phb-light-parchment: #F2E5B5;
	--phb-brown: #766649;
	--phb-stain-brown: #BBAD82;
	
	/* Apply parchment background */
	background-color: var(--phb-parchment);
	color: #1E293B;
	line-height: 1.4;
}

/* Hide page title on homepage */
body.home.content-mode-in-lore .entry-title,
body.home.content-mode-in-lore .wp-block-post-title {
	display: none;
}

/* ===========================
 * TYPOGRAPHY (D&D Style)
 * =========================== */

/* Fallback fonts (Google Fonts alternatives to proprietary D&D fonts) */
body.content-mode-in-lore {
	font-family: 'Libre Baskerville', 'Merriweather', Georgia, serif;
	font-size: 0.95em;
	letter-spacing: 0.01em;
}

body.content-mode-in-lore h1,
body.content-mode-in-lore h2,
body.content-mode-in-lore h3,
body.content-mode-in-lore h4 {
	font-family: 'Cinzel', 'Crimson Text', Georgia, serif;
	font-variant: small-caps;
	color: var(--phb-dark-maroon);
	font-weight: bold;
	letter-spacing: 0.05em;
}

body.content-mode-in-lore h1 {
	font-size: 2.2em;
	column-span: all;
	text-shadow: 1px 1px 2px rgba(88, 24, 13, 0.3);
	margin-bottom: 0.5em;
	border-bottom: 2px solid var(--phb-gold);
	padding-bottom: 0.3em;
}

body.content-mode-in-lore h2 {
	border-bottom: 2px solid var(--phb-gold);
	padding-bottom: 0.2em;
}

body.content-mode-in-lore h3 {
	border-bottom: 1px solid var(--phb-gold);
	padding-bottom: 0.15em;
}

/* Drop Cap - First letter after H1 */
body.content-mode-in-lore h1 + p::first-letter {
	float: left;
	font-family: 'Cinzel', serif;
	font-size: 4.5em;
	line-height: 0.85em;
	margin-top: 0.05em;
	margin-right: 0.05em;
	margin-bottom: -0.1em;
	color: var(--phb-dark-maroon);
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* First line after H1 in small caps */
body.content-mode-in-lore h1 + p::first-line {
	font-variant: small-caps;
	font-weight: 600;
	font-size: 1.1em;
}

body.content-mode-in-lore h2 {
	font-size: 1.6em;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

body.content-mode-in-lore h3 {
	font-size: 1.3em;
	border-bottom: 2px solid var(--phb-gold);
	padding-bottom: 0.2em;
	margin-top: 1.2em;
	margin-bottom: 0.5em;
}

body.content-mode-in-lore h4 {
	font-size: 1.1em;
	margin-top: 1em;
	margin-bottom: 0.3em;
}

body.content-mode-in-lore h5 {
	font-family: 'Inter', sans-serif;
	font-variant: small-caps;
	font-size: 0.95em;
	font-weight: 800;
	color: var(--phb-dark-maroon);
	margin-top: 0.8em;
	margin-bottom: 0.3em;
	letter-spacing: 0.05em;
}

/* ===========================
 * DECORATIVE ELEMENTS
 * =========================== */

/* Horizontal Rules - Decorative */
body.content-mode-in-lore hr {
	visibility: visible;
	border: none;
	height: 3px;
	background: linear-gradient(to right, 
		transparent, 
		var(--phb-maroon) 10%, 
		var(--phb-gold) 50%, 
		var(--phb-maroon) 90%, 
		transparent
	);
	margin: 1.5rem 0;
	opacity: 0.6;
}

/* ===========================
 * QUOTE BLOCKS / NOTES (D&D Style)
 * =========================== */
body.content-mode-in-lore blockquote {
	background: var(--phb-accent-green);
	border-left: 4px solid var(--phb-gold);
	border-right: 4px solid var(--phb-gold);
	padding: 1rem 1.5rem;
	margin: 1.5rem 0;
	font-style: italic;
	color: #2C1810;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	page-break-inside: avoid;
}

body.content-mode-in-lore blockquote p {
	margin: 0.5em 0;
}

body.content-mode-in-lore blockquote p:first-child {
	margin-top: 0;
}

body.content-mode-in-lore blockquote p:last-child {
	margin-bottom: 0;
}

body.content-mode-in-lore blockquote cite {
	font-family: 'Cinzel', serif;
	font-style: normal;
	font-weight: 600;
	color: var(--phb-dark-maroon);
	display: block;
	margin-top: 0.8rem;
	text-align: right;
	font-size: 0.9em;
}

/* ===========================
 * TABLES (D&D Style)
 * =========================== */
body.content-mode-in-lore table {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
	background: var(--phb-light-parchment);
	font-family: 'Inter', sans-serif;
	font-size: 0.9em;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body.content-mode-in-lore table thead {
	background: var(--phb-dark-maroon);
	color: #FFFFFF;
	font-variant: small-caps;
	font-weight: bold;
	letter-spacing: 0.05em;
}

body.content-mode-in-lore table th {
	padding: 0.6rem 0.8rem;
	text-align: left;
	border-bottom: 2px solid var(--phb-gold);
}

body.content-mode-in-lore table td {
	padding: 0.5rem 0.8rem;
	border-bottom: 1px solid #D4C4A8;
}

body.content-mode-in-lore table tbody tr:nth-child(odd) {
	background: rgba(255, 255, 255, 0.3);
}

body.content-mode-in-lore table tbody tr:hover {
	background: rgba(192, 173, 106, 0.2);
}

/* ===========================
 * LISTS (Custom Markers)
 * =========================== */
body.content-mode-in-lore ul {
	list-style: none;
	padding-left: 1.5rem;
	margin-bottom: 1rem;
}

/* Cloud bullet points for content lists only (not navigation menus) */
body.content-mode-in-lore article ul li,
body.content-mode-in-lore .entry-content ul li,
body.content-mode-in-lore .wp-block-post-content ul li {
	position: relative;
	padding-left: 0.5rem;
	margin-bottom: 0.4rem;
}

body.content-mode-in-lore article ul li::before,
body.content-mode-in-lore .entry-content ul li::before,
body.content-mode-in-lore .wp-block-post-content ul li::before {
	content: '☁';
	position: absolute;
	left: -1.2rem;
	color: var(--phb-maroon);
	font-weight: bold;
}

/* Explicitly remove cloud bullets from navigation menus */
body.content-mode-in-lore .site-header ul li::before,
body.content-mode-in-lore nav ul li::before,
body.content-mode-in-lore .top-bar-navigation ul li::before,
body.content-mode-in-lore .main-navigation ul li::before,
body.content-mode-in-lore .secondary-navigation ul li::before {
	content: none !important;
}

body.content-mode-in-lore ol {
	padding-left: 2rem;
	margin-bottom: 1rem;
}

body.content-mode-in-lore ol li {
	margin-bottom: 0.4rem;
	padding-left: 0.3rem;
}

/* ===========================
 * MONSTER STAT BLOCKS / INFO BOXES
 * =========================== */

/* General stat block / info box styling */
body.content-mode-in-lore .wp-block-group.is-style-stat-block,
body.content-mode-in-lore .monster,
body.content-mode-in-lore .stat-block {
	background: var(--phb-light-parchment);
	border: 2px solid var(--phb-brown);
	border-radius: 4px;
	padding: 1rem 1.5rem;
	margin: 1.5rem 0;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	page-break-inside: avoid;
}

body.content-mode-in-lore .monster h3,
body.content-mode-in-lore .stat-block h3 {
	font-family: 'Libre Baskerville', serif;
	font-size: 1.4em;
	color: var(--phb-dark-maroon);
	margin: 0 0 0.3rem 0;
	border-bottom: 1px solid var(--phb-maroon);
	padding-bottom: 0.3rem;
	font-variant: normal;
}

body.content-mode-in-lore .monster p,
body.content-mode-in-lore .stat-block p {
	margin: 0.3rem 0;
	font-size: 0.9em;
	line-height: 1.3;
}

/* ===========================
 * BUTTONS & CALL-TO-ACTIONS
 * =========================== */
body.content-mode-in-lore .wp-block-button__link {
	background: linear-gradient(135deg, var(--phb-maroon) 0%, var(--phb-dark-maroon) 100%);
	border: 2px solid var(--phb-gold);
	border-radius: 4px;
	padding: 12px 24px;
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-variant: small-caps;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
	transition: all 0.3s ease;
	box-shadow: 0 4px 8px rgba(156, 43, 27, 0.3);
}

body.content-mode-in-lore .wp-block-button__link:hover {
	background: linear-gradient(135deg, var(--phb-dark-maroon) 0%, var(--phb-maroon) 100%);
	border-color: #FFF;
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(156, 43, 27, 0.4);
}

/* ===========================
 * IMAGES & MEDIA
 * =========================== */
body.content-mode-in-lore img {
	border: 3px solid var(--phb-brown);
	border-radius: 2px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	margin: 1rem 0;
}

body.content-mode-in-lore figure {
	margin: 1.5rem 0;
}

body.content-mode-in-lore figcaption {
	font-family: 'Inter', sans-serif;
	font-size: 0.85em;
	font-style: italic;
	color: var(--phb-brown);
	text-align: center;
	margin-top: 0.5rem;
}

/* ===========================
 * SPECIAL CONTENT BOXES
 * =========================== */
body.content-mode-in-lore .wp-block-group.is-style-featured {
	background: linear-gradient(135deg, 
		rgba(192, 173, 106, 0.1) 0%, 
		rgba(156, 43, 27, 0.05) 100%
	);
	border: 3px double var(--phb-gold);
	border-radius: 8px;
	padding: 1.5rem 2rem;
	margin: 2rem 0;
	box-shadow: inset 0 0 20px rgba(192, 173, 106, 0.15),
	            0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===========================
 * HEADER & NAVIGATION
 * =========================== */
body.content-mode-in-lore .wp-block-site-title a {
	font-family: 'Cinzel', serif;
	font-weight: 800;
	font-size: 1.8rem;
	color: var(--phb-dark-maroon);
	text-decoration: none;
	text-shadow: 2px 2px 4px rgba(88, 24, 13, 0.2);
	letter-spacing: 0.05em;
}

body.content-mode-in-lore .wp-block-navigation a {
	font-family: 'Cinzel', serif;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.9rem;
	color: var(--phb-dark-maroon);
	transition: color 0.2s ease;
}

body.content-mode-in-lore .wp-block-navigation a:hover {
	color: var(--phb-maroon);
}

/* ===========================
 * FOOTER
 * =========================== */
body.content-mode-in-lore footer {
	border-top: 3px solid var(--phb-gold);
	background: linear-gradient(to bottom, 
		transparent, 
		rgba(192, 173, 106, 0.05)
	);
	padding-top: 2rem;
	margin-top: 3rem;
}

/* ===========================
 * HOMEBREWERY EMBEDDED CONTENT
 * =========================== */

/* Compatibility with Homebrewery-generated HTML */
body.content-mode-in-lore .phb,
body.content-mode-in-lore .page {
	background: transparent;
	font-family: inherit;
}

/* Preserve Homebrewery class styles */
body.content-mode-in-lore .descriptive,
body.content-mode-in-lore .note,
body.content-mode-in-lore .classTable,
body.content-mode-in-lore .monster {
	/* Let Homebrewery's own styles apply */
	all: revert;
}

/* ===========================
 * ACCESSIBILITY
 * =========================== */
body.content-mode-in-lore a:focus,
body.content-mode-in-lore button:focus {
	outline: 3px solid var(--phb-maroon);
	outline-offset: 3px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
	body.content-mode-in-lore {
		--phb-parchment: #FFFEF0;
		--phb-dark-maroon: #000000;
	}
	
	body.content-mode-in-lore h1,
	body.content-mode-in-lore h2,
	body.content-mode-in-lore h3 {
		color: #000000;
	}
}

/* ===========================
 * PRINT STYLES
 * =========================== */
@media print {
	body.content-mode-in-lore {
		background: white;
	}
	
	body.content-mode-in-lore .mode-indicator {
		display: none;
	}
	
	body.content-mode-in-lore blockquote,
	body.content-mode-in-lore .wp-block-group.is-style-featured {
		page-break-inside: avoid;
	}
}

/* ===========================
 * ATTRIBUTION
 * =========================== */
/* 
 * Styling inspired by Homebrewery (https://github.com/naturalcrit/homebrewery)
 * Licensed under MIT License
 * 
 * Original Homebrewery credits:
 * - Create authentic looking D&D homebrews using only markdown
 * - https://homebrewery.naturalcrit.com/
 * 
 * Nubimancy WordPress theme adaptation:
 * - Adapted for WordPress block theme
 * - Modified for dual-mode content system
 * - Enhanced for cloud technology education content
 */

/* ===========================
 * POST TEMPLATE LIST STYLING
 * =========================== */
/* Remove list styling from WordPress post template */
body.content-mode-in-lore .wp-block-post-template {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

body.content-mode-in-lore .wp-block-post-template > li {
	list-style: none;
}

/* ============================================================
   D&D THEMED 3-TIER STICKY NAVIGATION
   Fantasy-themed navigation structure matching BC's 3-tier system
   ============================================================ */

/* Ensure body and html allow sticky positioning */
/* CRITICAL: Do NOT set overflow-y on body - it creates a new scrolling context that breaks sticky! */
body.content-mode-in-lore {
    overflow-x: hidden; /* Prevent horizontal scroll from full-width header */
    /* overflow-y: Let browser default handle vertical scroll for sticky to work */
}

/* Ensure wp-site-blocks doesn't interfere with sticky */
body.content-mode-in-lore .wp-site-blocks {
    overflow: visible !important;
    padding-top: 0;
}

/* CRITICAL: wp-block-template-part wrapper for HEADER ONLY - THIS is what needs to be sticky! */
/* Target only the header template part, not sidebar or footer */
body.content-mode-in-lore .wp-site-blocks > .wp-block-template-part:first-child {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    overflow: visible !important; /* Needed for navigation dropdowns */
    width: 100vw !important; /* Full viewport width */
    margin-left: -24px !important; /* Break out of body padding */
    margin-right: -24px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Site Header Container - full width, break out of constraints */
/* Higher specificity to override WordPress inline style */
body.content-mode-in-lore .site-header.wp-block-group {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important; /* Full width of parent (which is 100vw) */
    max-width: none !important; /* Override WordPress constraint */
    position: static !important; /* NOT sticky - parent wp-block-template-part is sticky */
    overflow: visible !important; /* Critical for dropdowns */
}

/* Override WordPress layout constraints on header */
body.content-mode-in-lore .site-header.is-layout-constrained {
    max-width: none !important;
    overflow: visible !important;
}

body.content-mode-in-lore .site-header > * {
    max-width: none !important;
}

/* Remove default WordPress block margins from all navigation elements */
body.content-mode-in-lore .site-header .wp-block-group,
body.content-mode-in-lore .site-header .wp-block-navigation,
body.content-mode-in-lore .site-header nav,
body.content-mode-in-lore .top-bar-tier,
body.content-mode-in-lore .main-nav-tier,
body.content-mode-in-lore .secondary-nav-tier {
    margin: 0 !important;
}

/* Remove list styling from navigation menus */
body.content-mode-in-lore .site-header ul,
body.content-mode-in-lore .top-bar-navigation ul,
body.content-mode-in-lore .main-navigation ul,
body.content-mode-in-lore .secondary-navigation ul,
body.content-mode-in-lore .wp-block-navigation__container {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* TIER 1: Top Bar (D&D Dark Parchment Style) */
body.content-mode-in-lore .top-bar-tier {
    background: linear-gradient(to bottom, #2d2416 0%, #3a2f1f 100%);
    color: var(--phb-gold);
    height: 48px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 2px solid var(--phb-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Site Branding in Top Bar */
body.content-mode-in-lore .top-bar-tier .site-branding {
    margin: 0;
}

body.content-mode-in-lore .top-bar-tier .wp-block-site-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 48px;
    font-family: 'MrEavesSmallCaps', 'Palatino Linotype', serif;
    letter-spacing: 1px;
}

body.content-mode-in-lore .top-bar-tier .wp-block-site-title a {
    color: var(--phb-gold);
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: color 0.3s ease;
}

body.content-mode-in-lore .top-bar-tier .wp-block-site-title a:hover {
    color: #e0c897;
}

/* Top Bar Navigation (Icon shortcuts) */
body.content-mode-in-lore .top-bar-navigation {
    margin: 0;
}

body.content-mode-in-lore .top-bar-navigation .wp-block-navigation__container,
body.content-mode-in-lore .top-bar-navigation ul {
    gap: 0;
    display: flex;
    flex-direction: row;
}

body.content-mode-in-lore .top-bar-navigation .wp-block-navigation-item,
body.content-mode-in-lore .top-bar-navigation .menu-item {
    margin: 0;
}

/* Traditional menu support */
body.content-mode-in-lore .top-bar-navigation .menu-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    min-height: 48px;
    min-width: 48px;
    padding: 0;
    color: var(--phb-gold);
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(192,173,106,0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
    text-decoration: none;
}

body.content-mode-in-lore .top-bar-navigation .menu-item a:hover {
    background-color: rgba(0,0,0,0.4);
    border-color: var(--phb-gold);
    box-shadow: 0 0 8px rgba(192,173,106,0.4);
}

body.content-mode-in-lore .top-bar-navigation .menu-item a:focus {
    border-color: var(--phb-gold);
    outline: none;
}

/* Icon-only menu items */
body.content-mode-in-lore .top-bar-navigation .menu-item.icon-only a {
    font-size: 0; /* Hide text */
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-only a::before {
    font-size: 20px;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands";
    font-weight: 400;
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-github a::before {
    content: "\f09b";
    font-family: "Font Awesome 6 Brands";
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-twitter a::before {
    content: "\e61b";
    font-family: "Font Awesome 6 Brands";
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-linkedin a::before {
    content: "\f08c";
    font-family: "Font Awesome 6 Brands";
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-youtube a::before {
    content: "\f167";
    font-family: "Font Awesome 6 Brands";
}

body.content-mode-in-lore .top-bar-navigation .menu-item.icon-email a::before {
    content: "\f0e0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Block editor navigation (legacy support) */
body.content-mode-in-lore .top-bar-navigation .wp-block-navigation-item__content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    color: var(--phb-gold);
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(192,173,106,0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
}

body.content-mode-in-lore .top-bar-navigation .wp-block-navigation-item__content:hover {
    background-color: rgba(0,0,0,0.4);
    border-color: var(--phb-gold);
    box-shadow: 0 0 8px rgba(192,173,106,0.4);
}

/* TIER 2: Main Navigation Bar (Parchment Style) */
body.content-mode-in-lore .main-nav-tier {
    background: linear-gradient(to bottom, #faf5e6 0%, #f0e9d5 100%);
    min-height: 50px;
    width: 100%;
    border-bottom: 2px solid var(--phb-gold);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
}

body.content-mode-in-lore .main-navigation {
    margin: 0;
    width: 100%;
    max-width: var(--wp--style--global--content-size, 840px);
    padding: 0 16px;
}

body.content-mode-in-lore .main-navigation .wp-block-navigation__container {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    align-items: center;
    list-style: none;
}

/* Traditional menu support */
body.content-mode-in-lore .main-navigation .menu {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    align-items: center;
}

body.content-mode-in-lore .main-navigation .menu-item {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* First menu item - Special styling (like company/site name) */
body.content-mode-in-lore .main-navigation .menu-item:first-child a {
    display: block;
    padding: 12px 4px 12px 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--phb-dark-maroon);
    font-family: 'Cinzel', 'Crimson Text', Georgia, serif;
    font-variant: small-caps;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    line-height: 26px;
}

body.content-mode-in-lore .main-navigation .menu-item:first-child a:hover {
    background: linear-gradient(to bottom, rgba(192,173,106,0.15) 0%, rgba(192,173,106,0.25) 100%);
}

/* Page separator after first item */
body.content-mode-in-lore .main-navigation .menu-item:first-child::after {
    content: '';
    display: block;
    width: 1px;
    height: 24px;
    background-color: var(--phb-gold);
    margin-left: 12px;
    margin-right: 12px;
    align-self: center;
}

/* Remaining menu items - Standard styling */
body.content-mode-in-lore .main-navigation .menu-item:not(:first-child) a {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    color: #58180d;
    font-family: 'MrEavesSmallCaps', 'Palatino Linotype', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    line-height: 26px;
}

body.content-mode-in-lore .main-navigation .menu-item a:hover {
    background: linear-gradient(to bottom, rgba(192,173,106,0.15) 0%, rgba(192,173,106,0.25) 100%);
}

body.content-mode-in-lore .main-navigation .menu-item a:focus {
    outline: 2px solid var(--phb-gold);
    outline-offset: -2px;
}

/* Submenu styling */
body.content-mode-in-lore .main-navigation .menu-item-has-children {
    position: relative;
}

body.content-mode-in-lore .main-navigation .submenu-toggle {
    background: none;
    border: none;
    padding: 8px 4px;
    margin-left: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    align-self: center;
    height: 20px;
    width: 16px;
    outline: none;
}

body.content-mode-in-lore .main-navigation .submenu-toggle:focus {
    outline: none;
}

body.content-mode-in-lore .main-navigation .submenu-toggle:hover {
    background: none;
}

body.content-mode-in-lore .main-navigation .submenu-toggle .submenu-icon {
    display: block;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #58180d;
    margin-bottom: -2px;
}

body.content-mode-in-lore .main-navigation .submenu-open .submenu-toggle {
    transform: rotate(180deg);
}

body.content-mode-in-lore .main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(to bottom, #faf5e6 0%, #f0e9d5 100%);
    border: 2px solid var(--phb-gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    min-width: 200px;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

body.content-mode-in-lore .main-navigation .sub-menu .menu-item {
    margin: 0;
    display: block;
}

body.content-mode-in-lore .main-navigation .sub-menu .menu-item::after {
    display: none; /* No separator in submenus */
}

body.content-mode-in-lore .main-navigation .sub-menu .menu-item a {
    padding: 8px 16px !important;
    font-size: 14px;
    color: #58180d;
    display: block;
    white-space: nowrap;
}

body.content-mode-in-lore .main-navigation .sub-menu .menu-item a:hover {
    background: rgba(192,173,106,0.3);
}

/* Block editor navigation (legacy support) */
body.content-mode-in-lore .main-navigation .wp-block-navigation-item {
    margin: 0;
}

body.content-mode-in-lore .main-navigation .wp-block-navigation-item__content {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #58180d;
    font-family: 'MrEavesSmallCaps', 'Palatino Linotype', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 0;
    line-height: 26px;
    border-bottom: 2px solid transparent;
}

body.content-mode-in-lore .main-navigation .wp-block-navigation-item__content:hover {
    background: linear-gradient(to bottom, rgba(192,173,106,0.15) 0%, rgba(192,173,106,0.25) 100%);
    border-bottom-color: var(--phb-gold);
    text-decoration: none;
}

/* TIER 3: Secondary Navigation Bar (Subtle Parchment) */
body.content-mode-in-lore .secondary-nav-tier {
    background: linear-gradient(to bottom, #f8f3e3 0%, #f0e9d5 100%);
    width: 100%;
    border-top: 1px solid rgba(192,173,106,0.4);
    border-bottom: 1px solid rgba(192,173,106,0.4);
    padding: 0;
    display: flex;
    justify-content: center;
}

body.content-mode-in-lore .secondary-navigation {
    margin: 0;
    width: 100%;
    max-width: var(--wp--style--global--content-size, 840px);
    padding: 8px 16px;
}

/* Traditional menu styles (wp_nav_menu) */
body.content-mode-in-lore .secondary-navigation .menu {
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

body.content-mode-in-lore .secondary-navigation .menu-item {
    margin: 0;
}

body.content-mode-in-lore .secondary-navigation .menu-item a {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    color: #58180d;
    font-family: 'BookInsanity', 'Palatino Linotype', serif;
    transition: all 0.3s ease;
    border-radius: 3px;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
}

body.content-mode-in-lore .secondary-navigation .menu-item a:hover {
    background-color: rgba(192,173,106,0.2);
    border-color: var(--phb-gold);
    color: #58180d;
    text-decoration: none;
}

body.content-mode-in-lore .secondary-navigation .menu-item a:focus {
    outline: 2px solid var(--phb-gold);
    outline-offset: -2px;
}

/* Block editor navigation (legacy support) */
body.content-mode-in-lore .secondary-navigation .wp-block-navigation__container {
    gap: 8px;
    padding: 0;
}

body.content-mode-in-lore .secondary-navigation .wp-block-navigation-item {
    margin: 0;
}

body.content-mode-in-lore .secondary-navigation .wp-block-navigation-item__content {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    color: #58180d;
    font-family: 'BookInsanity', 'Palatino Linotype', serif;
    transition: all 0.3s ease;
    border-radius: 3px;
    border: 1px solid transparent;
}

body.content-mode-in-lore .secondary-navigation .wp-block-navigation-item__content:hover {
    background-color: rgba(192,173,106,0.2);
    border-color: var(--phb-gold);
    color: #58180d;
    text-decoration: none;
}

/* Content spacing adjustment for sticky headers */
body.content-mode-in-lore .wp-site-blocks {
    padding-top: 0;
}

/* ============================================================
   D&D LORE CODEX - Right Sidebar Widget Area
   Fantasy-themed "Codex" mimicking ancient tome with parchment styling
   ============================================================ */

/* Page layout with Lore Codex */
body.content-mode-in-lore .bc-page-with-factboxes {
    padding-top: 24px;
}

body.content-mode-in-lore .bc-content-factbox-layout {
    gap: 24px !important;
}

/* Lore Codex Sidebar Container */
body.content-mode-in-lore .bc-factbox-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px; /* More spacing for D&D aesthetic */
}

/* Lore Codex Title */
body.content-mode-in-lore .bc-factbox-title {
    font-size: 20px !important;
    font-weight: bold !important;
    color: var(--phb-dark-maroon) !important;
    font-family: 'Cinzel', 'Crimson Text', Georgia, serif !important;
    font-variant: small-caps !important;
    letter-spacing: 1px;
    margin: 0 0 12px 0 !important;
    padding: 0 0 8px 0;
    border-bottom: 2px solid var(--phb-gold);
}

/* Individual Lore Codex Entry - Parchment card styling */
body.content-mode-in-lore .bc-factbox {
    background: linear-gradient(to bottom, #faf5e6 0%, #f0e9d5 100%);
    border: 2px solid var(--phb-gold);
    border-radius: 4px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Lore Codex Header - Fantasy styling */
body.content-mode-in-lore .bc-factbox-header {
    background: linear-gradient(to bottom, rgba(192,173,106,0.15) 0%, rgba(192,173,106,0.25) 100%);
    color: var(--phb-dark-maroon) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    font-family: 'Cinzel', 'Crimson Text', Georgia, serif !important;
    font-variant: small-caps !important;
    letter-spacing: 0.5px;
    padding: 10px 14px !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--phb-gold);
    cursor: default;
}

/* Lore Codex Content */
body.content-mode-in-lore .bc-factbox-content {
    padding: 14px;
    font-size: 14px;
    color: #1E293B;
    margin: 0;
    font-family: 'Libre Baskerville', 'Merriweather', Georgia, serif;
    line-height: 1.4;
}

/* Lore Codex with no header (direct content) */
body.content-mode-in-lore .bc-factbox > *:first-child:not(.bc-factbox-header) {
    padding: 14px;
}

/* Lore Codex Navigation Links */
body.content-mode-in-lore .bc-factbox-nav {
    padding: 4px 0;
}

body.content-mode-in-lore .bc-factbox-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.content-mode-in-lore .bc-factbox-nav li {
    margin: 0;
}

body.content-mode-in-lore .bc-factbox-nav a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--phb-maroon);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

body.content-mode-in-lore .bc-factbox-nav a:hover {
    background-color: rgba(192,173,106,0.2);
    border-left-color: var(--phb-gold);
    text-decoration: none;
}

/* Lore Codex Data Fields (key-value pairs) */
body.content-mode-in-lore .bc-factbox .bc-field-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(192,173,106,0.3);
    font-size: 14px;
}

body.content-mode-in-lore .bc-factbox .bc-field-row:last-child {
    border-bottom: none;
}

body.content-mode-in-lore .bc-factbox .bc-field-label {
    color: var(--phb-brown);
    font-weight: 600;
    font-variant: small-caps;
}

body.content-mode-in-lore .bc-factbox .bc-field-value {
    color: #1E293B;
    font-weight: 400;
    text-align: right;
}

/* Lore Codex Lists */
body.content-mode-in-lore .bc-factbox ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.content-mode-in-lore .bc-factbox li {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(192,173,106,0.2);
    font-size: 14px;
}

body.content-mode-in-lore .bc-factbox li:last-child {
    border-bottom: none;
}

/* Lore Codex with Image */
body.content-mode-in-lore .bc-factbox img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 0;
    margin: 0;
}

body.content-mode-in-lore .bc-factbox .wp-block-image {
    margin: 0;
}

/* Lore Codex Buttons */
body.content-mode-in-lore .bc-factbox .wp-block-button {
    margin: 10px 14px;
}

body.content-mode-in-lore .bc-factbox .wp-block-button__link {
    font-size: 14px;
    padding: 8px 16px;
    width: 100%;
    text-align: center;
    background-color: var(--phb-maroon);
    color: var(--phb-light-parchment);
    border-radius: 3px;
    font-family: 'MrEavesSmallCaps', 'Palatino Linotype', serif;
    font-variant: small-caps;
}

body.content-mode-in-lore .bc-factbox .wp-block-button__link:hover {
    background-color: var(--phb-dark-maroon);
}

/* ============================================================
   D&D CHAPTER INDEX - Table of Contents
   Fantasy-themed "Chapter Index" with decorative styling
   ============================================================ */

/* Chapter Index Container */
body.content-mode-in-lore .bc-toc-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* H1 Chapter Header - Full width, ornamental */
body.content-mode-in-lore .bc-toc-group {
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--phb-dark-maroon);
    font-family: 'Cinzel', 'Crimson Text', Georgia, serif;
    font-variant: small-caps;
    letter-spacing: 0.5px;
    background: linear-gradient(to bottom, rgba(192,173,106,0.15) 0%, rgba(192,173,106,0.25) 100%);
    border-bottom: 1px solid var(--phb-gold);
}

/* H2 Chapter Row - Two columns with word count */
body.content-mode-in-lore .bc-toc-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(192,173,106,0.2);
    align-items: center;
    transition: background-color 0.3s ease;
}

body.content-mode-in-lore .bc-toc-row:hover {
    background-color: rgba(192,173,106,0.15);
}

body.content-mode-in-lore .bc-toc-row:last-child {
    border-bottom: none;
}

/* TOC Label - H2 section text */
body.content-mode-in-lore .bc-toc-label {
    font-size: 14px;
    font-weight: 400;
    color: #1E293B;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* TOC Value - Word count link */
body.content-mode-in-lore .bc-toc-value {
    text-align: right;
    white-space: nowrap;
}

body.content-mode-in-lore .bc-toc-value a {
    font-size: 14px;
    font-weight: 400;
    color: var(--phb-maroon);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.content-mode-in-lore .bc-toc-value a:hover {
    color: var(--phb-gold);
    text-decoration: none;
}

/* TOC Arrow - Fantasy decoration */
body.content-mode-in-lore .bc-toc-arrow {
    font-size: 12px;
    display: inline-block;
    transition: transform 0.3s ease;
}

body.content-mode-in-lore .bc-toc-value a:hover .bc-toc-arrow {
    transform: translateX(3px);
}

/* Responsive D&D Navigation */
@media (max-width: 768px) {
    /* Stack navigation more compactly on mobile */
    body.content-mode-in-lore .main-navigation .menu-item a,
    body.content-mode-in-lore .main-navigation .wp-block-navigation-item__content,
    body.content-mode-in-lore .secondary-navigation .menu-item a,
    body.content-mode-in-lore .secondary-navigation .wp-block-navigation-item__content {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    body.content-mode-in-lore .top-bar-tier .wp-block-site-title {
        font-size: 16px;
    }
    
    /* Hide Lore Codex on mobile - saves screen space for narrative flow */
    body.content-mode-in-lore .bc-factbox-area {
        display: none !important;
    }
    
    /* Expand main content to full width when sidebar is hidden */
    body.content-mode-in-lore .bc-main-content-area {
        flex-basis: 100% !important;
        width: 100% !important;
    }
}
