/* Manfred Theme - Custom Styles with Dark Mode Support */

:root {
	--primary-blue: #022169;
	--primary-blue-dark: #011850;
	--primary-blue-light: #033080;
	--text-dark: #2d3748;
	--text-gray: #718096;
	--bg-light: #f7fafc;
	--bg-white: #ffffff;
	--border-light: #e2e8f0;

	/* Responsive variables */
	--gap-small: 0.5rem;
	--gap: 1rem;
	--gap-large: clamp(1.5rem, 3vw, 2rem);
	--gap-xlarge: clamp(2rem, 5vw, 3rem);
	--gap-xxlarge: clamp(3rem, 8vw, 4rem);

	--fs-small: 0.875rem;
	--fs-regular: 1rem;
	--fs-medium: clamp(1.125rem, 2vw, 1.25rem);
	--fs-large: clamp(1.5rem, 3vw, 1.875rem);
	--fs-xlarge: clamp(2rem, 4vw, 2.5rem);
	--fs-xxlarge: clamp(2.5rem, 5vw, 3rem);

	--wrap-max-width: 1200px;
}

/* Dark mode color variables */
.dark {
	--primary-blue: #4a7fc9;
	--primary-blue-dark: #3668b0;
	--primary-blue-light: #5e96e0;
	--text-dark: #e2e8f0;
	--text-gray: #a0aec0;
	--bg-light: #1a202c;
	--bg-white: #0f1419;
	--border-light: #2d3748;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	color: var(--text-dark);
	background-color: var(--bg-white);
	line-height: 1.7;
	font-size: var(--fs-regular);
}

/* Clean header styling */
header {
	background: var(--bg-white);
	background-image: url('/content/images/header.webp');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-bottom: 1px solid var(--border-light);
	padding: var(--gap-large) 0;
	position: relative;
	max-width: var(--wrap-max-width);
	margin: 0 auto;
}

header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: transparent;
	z-index: 0;
}

.dark header::before {
	background: transparent;
}

header > div {
	position: relative;
	z-index: 1;
}

header .text-2xl {
	color: var(--text-dark);
	font-weight: 600;
}

#site-logo-light {
	display: block;
}

#site-logo-dark {
	display: none;
}

.dark #site-logo-light {
	display: none;
}

.dark #site-logo-dark {
	display: block;
}

.logo-container {
	background-color: rgba(255, 255, 255, 0.55);
	border-radius: 0.5rem;
	padding: var(--gap-large);
}

.dark .logo-container {
	background-color: rgba(0, 0, 0, 0.55);
}

/* Primary color overrides */
.text-primary-500,
.hover\:text-primary-600:hover,
a {
	color: var(--primary-blue);
}

.hover\:text-primary-600:hover {
	color: var(--primary-blue-dark);
}

.bg-primary-500 {
	background-color: var(--primary-blue);
}

/* Button styling */
button, .button {
	background-color: var(--primary-blue);
	color: white;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 500;
	transition: background-color 0.3s ease;
	border: none;
	cursor: pointer;
}

#theme-toggle {
	background-color: rgba(255, 255, 255, 0.85);
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

#theme-toggle {
	background-color: rgba(2, 33, 105, 0.8);
}

.dark #theme-toggle {
	background-color: rgba(74, 127, 201, 0.8);
}

#theme-toggle svg {
	color: #ffffff;
	filter: none;
}

.dark #theme-toggle svg {
	color: #ffffff;
	filter: none;
}

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

#theme-toggle:hover {
	background-color: var(--primary-blue-dark);
}

.dark #theme-toggle:hover {
	background-color: var(--primary-blue-light);
}

/* Hero section styling */
.hero {
	padding: var(--gap-xxlarge) 0;
	text-align: center;
	background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
	max-width: var(--wrap-max-width);
	margin: 0 auto;
}

.dark .hero {
	background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.hero h1 {
	font-size: var(--fs-xlarge);
	font-weight: 700;
	color: var(--text-dark);
	margin-bottom: var(--gap);
	line-height: 1.2;
}

.hero h2 {
	font-size: var(--fs-large);
	color: var(--text-gray);
	font-weight: 400;
	margin-bottom: var(--gap-xlarge);
}

/* Features section */
.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 30vw, 280px), 1fr));
	gap: var(--gap-large);
	margin: var(--gap-xlarge) 0;
	max-width: var(--wrap-max-width);
	margin-left: auto;
	margin-right: auto;
}

.feature {
	text-align: center;
	padding: var(--gap-xlarge);
	background: var(--bg-white);
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 12px rgba(2, 33, 105, 0.15);
}

.feature-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 1.5rem;
	color: var(--primary-blue);
}

/* Testimonials */
.testimonials {
	background: var(--bg-light);
	padding: var(--gap-xxlarge) var(--gap-large);
	margin: var(--gap-xlarge) 0;
	border-radius: 0.75rem;
	max-width: var(--wrap-max-width);
	margin-left: auto;
	margin-right: auto;
}

.testimonial {
	font-style: italic;
	color: var(--text-gray);
	margin-bottom: var(--gap);
	font-size: var(--fs-medium);
}

.testimonial-author {
	font-weight: 600;
	color: var(--text-dark);
	font-style: normal;
}

.pr-6 {
	padding-right:1.5rem
}

.anchor svg {
	display:inline;
}

.toc-wrapper a, 
.related-posts a,
.recent-posts a {
	text-decoration: none;
}

.dark .toc-wrapper {
	background-color: #1a202c;
	border-color: #2d3748;
}

.toc-link a {
	display:none;
}

.toc-link:hover a{
	display:inline-block;
}

.tags a {
	margin-right: .75rem;
	color: var(--primary-blue);
	text-decoration: none;
}

.tags a:hover {
	color: var(--primary-blue-dark);
	text-decoration: underline;
}

.category a {
	margin-right: .1rem;	
}

.category {
	line-height:3.2rem;
}

.read-more {
	text-decoration:inherit;
	color: var(--primary-blue);
	font-weight: 500;
}

.read-more:hover {
	color: var(--primary-blue-dark);
}

/* Dropdown Menu Styles */
.nav-top {
	margin-top: 4.5rem;
}

.nav-top li {
	position: relative; /* Crucial for positioning the dropdown */
	display: inline-block;
    margin-left: 0.5rem;
	margin-top: 0.3rem;
	font-weight: 500;
}

/* Disable click on parent items that have dropdowns */
.nav-top > li:has(ul) > a {
	pointer-events: none;
	cursor: default;
}

.nav-top > li > a {
	display: block;
	padding: 0.5rem 1rem;
	color: #ffffff;
	background-color: rgba(2, 33, 105, 0.8);
	border-radius: 0.5rem;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.3s ease;
}

.dark .nav-top > li > a {
	background-color: rgba(74, 127, 201, 0.8);
	color: #ffffff;
}

.nav-top > li > a:hover {
	background-color: var(--primary-blue-dark);
	color: #ffffff;
}

.dark .nav-top > li > a:hover {
	background-color: var(--primary-blue-light);
	color: #ffffff;
}

/* Sub-menu container */
.nav-top ul {
	display: none; /* Hide by default */
	position: absolute;
	left: 0;
	top: 100%; /* Position right below the parent */
	background-color: transparent;
	border: none;
	border-radius: 0.5rem;
	padding: 0.5rem 0;
	min-width: 200px;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s;
	box-shadow: none;
}

/* Show on hover */
.nav-top li:hover > ul {
	display: block;
	opacity: 1;
	visibility: visible;
}

/* Sub-menu items */
.nav-top ul li {
	display: block;
	margin: 0.125rem 0;
	white-space: nowrap;
}

.nav-top ul li a {
	display: block;
	padding: 0.5rem 1rem;
	color: #ffffff;
	background-color: rgba(2, 33, 105, 0.8);
	border-radius: 0.5rem;
	transition: background-color 0.2s ease;
}

.dark .nav-top ul li a {
	background-color: rgba(74, 127, 201, 0.8);
	color: #ffffff;
}

.nav-top ul li a:hover {
	background-color: var(--primary-blue-dark);
}

.dark .nav-top ul li a:hover {
	background-color: var(--primary-blue-light);
}

.nav-mobile li{
	outline-width: 0;
	outline-style: solid;
	letter-spacing: .1em;
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 2rem;
	padding-right: 1rem;
	padding-top: .5rem;
	padding-bottom: .5rem;
	margin-bottom: 1rem;
}

.nav-mobile ul {
	display: none;
}

.nav-mobile ul li {
	font-size: 1.25rem;
	margin-left: 1.5rem;
	margin-bottom: 0.5rem;
	font-weight: 400;
}

.menu-mobile {
	display:none;
}

.menu-close svg {
	color: #ffffff !important;
}

@media (max-width: 640px) {
	.nav-top {
		display:none;
	}
	.is-menu-open .menu-mobile {
		display:block!important;
	}
	
	#theme-toggle-mobile {
		margin-left: auto;
	}
	
	.hero h1 {
		font-size: var(--fs-xlarge);
	}
	
	.hero h2 {
		font-size: var(--fs-medium);
	}

	.logo-container {
		padding: var(--gap) var(--gap-small) var(--gap) var(--gap);
	}

	.features {
		grid-template-columns: 1fr;
		gap: var(--gap);
		padding: 0 var(--gap);
	}

	.testimonials, .contact-section {
		padding: var(--gap-large) var(--gap);
		margin: var(--gap-large) var(--gap);
		border-radius: var(--gap);
	}

	footer {
		padding: var(--gap-large) var(--gap) var(--gap);
		margin-top: var(--gap-large);
	}
}

@media (max-width: 530px) {
	.logo-container {
		padding: var(--gap);
		font-size: 0.9rem;
	}

	header .text-2xl {
		font-size: var(--fs-large);
	}

	#site-logo-light, #site-logo-dark {
		max-width: 80%;
		height: auto;
	}

	.mr-3 {
		width: 100% !important;
		min-width: auto !important;
		height: auto !important;
		min-height: auto !important;
	}
}

.search-form {
	display:none;
}

.is-search-open .search-form {
	display: flex;
}

.thumbnail {
	position:relative;
	display:block;
	border-radius: 0.5rem;
	overflow: hidden;
}

.nav li > ul {
	display:none;
}

.footnotes {
	margin-top:0;
	border:none;
}

.footnotes ol {
	margin-bottom:0;
	padding-top: 1.5em;
}

.footnotes > hr {
	margin:0;
}

.thumb-icon { 
	background: rgba(2, 33, 105, 0.9); 
	color: #fff; 
	text-align: center; 
	display: block; 
	width: 32px; 
	height: 32px; 
	position: absolute; 
	bottom: 50%; 
	left: 50%; 
	margin-left: -16px; 
	margin-bottom: -16px;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.thumb-icon svg {
  margin: 1px 0 0 2px;
}

.thumbnail:hover .thumb-icon { 
	background: var(--primary-blue-dark); 
	transform: scale(1.1);
}

.recent-posts > ul {
	padding-left: 15px;
}

/* Contact section */
.contact-section {
	background: var(--bg-light);
	padding: var(--gap-xxlarge) var(--gap-large);
	border-radius: 0.75rem;
	margin: var(--gap-xlarge) 0;
	max-width: var(--wrap-max-width);
	margin-left: auto;
	margin-right: auto;
}

.contact-section h2 {
	color: var(--text-dark);
	margin-bottom: 2rem;
}

.contact-section input,
.contact-section textarea {
	width: 100%;
	padding: 0.75rem;
	margin-bottom: 1rem;
	border: 1px solid var(--border-light);
	border-radius: 0.5rem;
	font-family: inherit;
}

.contact-section input:focus,
.contact-section textarea:focus {
	outline: none;
	border-color: var(--primary-blue);
}

/* Footer */
footer {
	background: var(--bg-light);
	padding: var(--gap-xlarge) 0 var(--gap-large);
	margin-top: var(--gap-xxlarge);
	border-top: 1px solid var(--border-light);
	max-width: var(--wrap-max-width);
	margin-left: auto;
	margin-right: auto;
	width: 100%;
}

.contact__link {
	color: #111827; /* gray-900 for light mode, more black */
}

.dark .contact__link {
	color: #60a5fa; /* blue-400 for dark mode */
}

footer a {
	color: var(--text-gray);
	text-decoration: none;
}

footer a:hover {
	color: var(--primary-blue);
}

/* Container for max width */
.container {
	max-width: var(--wrap-max-width);
	margin: 0 auto;
	padding: 0 var(--gap);
}

/* Allow code to break lines */
.prose code {
	word-break: break-word;
}

.code {
	word-break: break-word;
}

.prose pre {
	white-space: pre-wrap;
}
