/* Component Styles */

/* Navigation
--------------------------------------------- */
.main-navigation {
	display: block;
	width: 100%;
}

.main-navigation ul {
	display: none;
	list-style: none;
	margin: 0;
	padding-left: 0;
}

.main-navigation ul ul {
	box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
	float: left;
	position: absolute;
	top: 100%;
	left: -999em;
	z-index: 99999;
}

.main-navigation ul ul ul {
	left: -999em;
	top: 0;
}

.main-navigation ul ul li:hover > ul,
.main-navigation ul ul li.focus > ul {
	display: block;
	left: auto;
}

.main-navigation ul ul a {
	width: 200px;
}

.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
	left: auto;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	text-decoration: none;
}

/* Small menu. */
.menu-toggle,
.main-navigation.toggled ul {
	display: block;
}

@media screen and (min-width: 37.5em) {

	.menu-toggle {
		display: none;
	}

	.main-navigation ul {
		display: flex;
	}
}

.site-main .comment-navigation,
.site-main
.posts-navigation,
.site-main
.post-navigation {
	margin: 0 0 1.5em;
}

.comment-navigation .nav-links,
.posts-navigation .nav-links,
.post-navigation .nav-links {
	display: flex;
}

.comment-navigation .nav-previous,
.posts-navigation .nav-previous,
.post-navigation .nav-previous {
	flex: 1 0 50%;
}

.comment-navigation .nav-next,
.posts-navigation .nav-next,
.post-navigation .nav-next {
	text-align: end;
	flex: 1 0 50%;
}

/* Table of Contents Separator */
.toc-separator {
    border-top: 1px solid #ccc; /* Light gray line */
    margin: 10px 0; /* Space above and below the separator */
    list-style: none; /* Remove bullet point */
    height: 0; /* Ensure it's just a line */
    padding: 0; /* Remove padding */
}

.toc-comments-item {
    text-align: center; /* Center the "Comments" link */
}

.table-of-contents .toc-comments-item a {
    color: #ffffff !important; /* Change "Comments" text to white, using !important for higher specificity */
}

/* Posts and pages
--------------------------------------------- */
.sticky {
	display: block;
}

.post,
.page {
	margin: 0 0 1.5em;
}

.updated:not(.published) {
	display: none;
}

.page-header {
    margin-top: 20px; /* Add space between the header and the "BLOG" title */
}

.page-content,
.entry-content,
.entry-summary {
	margin: 1.5em 0 0;
}

.page-links {
	clear: both;
	margin: 0 0 1.5em;
}

/* Comments
--------------------------------------------- */
.comment-content a {
	word-wrap: break-word;
}

.bypostauthor {
	display: block;
}

.avatar {
    border-radius: 50%;
}

/* Ensure comment form fields are visible */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    display: block !important;
    visibility: visible !important;
}

/* Clear floats for comment list and respond form to prevent layout issues */
.comments-area .comment-list,
.comments-area #respond {
    clear: both;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    display: block !important;
    visibility: visible !important;
}


/* Widgets
--------------------------------------------- */
.widget {
	margin: 0 0 1.5em;
}

.widget select {
	max-width: 100%;
}

/* Media
--------------------------------------------- */
.page-content .wp-smiley,
.entry-content .wp-smiley,
.comment-content .wp-smiley {
	border: none;
	margin-bottom: 0;
	margin-top: 0;
	padding: 0;
}

/* Make sure logo link wraps around logo image. */
.custom-logo-link {
	display: inline-block;
}

/* Captions
--------------------------------------------- */
.wp-caption {
	margin-bottom: 1.5em;
	max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption .wp-caption-text {
	margin: 0.8075em 0;
}

.wp-caption-text {
	text-align: center;
}

/* Galleries
--------------------------------------------- */
.gallery {
	margin-bottom: 1.5em;
	display: grid;
	grid-gap: 1.5em;
}

.gallery-item {
	display: inline-block;
	text-align: center;
	width: 100%;
}

.gallery-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
	grid-template-columns: repeat(6, 1fr);
}

.gallery-columns-7 {
	grid-template-columns: repeat(7, 1fr);
}

.gallery-columns-8 {
	grid-template-columns: repeat(8, 1fr);
}

.gallery-columns-9 {
	grid-template-columns: repeat(9, 1fr);
}

.gallery-caption {
	display: block;
}

/* Comments Separator */
.comments-separator {
    border-top: 1px solid #3c3f45; /* Darker gray line */
    margin: 30px 0; /* Space above and below the separator */
}

/* Floating Navigation Styles */
.main-navigation-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(18, 18, 18, 0.7); /* Semi-transparent dark background */
    backdrop-filter: blur(10px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the nav items */
    gap: 10px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.admin-bar .main-navigation-custom {
    top: 32px;
}

.main-navigation-custom.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Subtle shadow */
}

.main-navigation-custom .nav-close-button {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background for the X button */
    color: #ffffff;
    border: none;
    border-radius: 50%; /* Make it a circle */
    width: 50px; /* Fixed width */
    height: 50px; /* Fixed height */
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-right: 15px; /* Space between X button and nav items */
}

.main-navigation-custom .nav-close-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.main-navigation-custom .nav-container {
    display: flex;
    gap: 10px; /* Space between navigation items */
    justify-content: center;
    align-items: center;
}

.main-navigation-custom .nav-item {
    color: #ffffff; /* White text */
    text-decoration: none;
    padding: 12px 15px; /* Padding for individual items */
    font-size: 1.3em;
    font-weight: 500;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
    border-radius: 25px; /* More rounded buttons for each item */
    background-color: transparent; /* Default transparent background */
}

.main-navigation-custom .nav-item:hover,
.main-navigation-custom .nav-item.active { /* Added active class for current page */
    color: rgb(255, 255, 255); /* Faint Matrix Green on hover/active */
    background-color: rgba(15, 84, 15, 0.268); /* Very faint green background on hover/active */
}

.main-navigation-custom .nav-item:active {
    transform: translateY(0); /* Reset on click */
}

.main-navigation-custom .nav-item:focus {
    outline: none; /* Remove dotted outline on focus */
}

/* Submenu styles */
.nav-item-has-submenu {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-item-has-submenu .submenu {
    display: flex; /* Always flex for horizontal layout */
    gap: 10px;
    max-width: 0; /* Start with 0 width */
    overflow: hidden; /* Hide overflow */
    transition: max-width 0.3s ease-out, opacity 0.3s ease-out, margin-left 0.3s ease-out; /* Animate width, opacity, and margin-left */
    opacity: 0;
    white-space: nowrap; /* Prevent wrapping */
    margin-left: 0; /* No initial margin */
}

.nav-item-has-submenu.active .submenu {
    max-width: 500px; /* Increased to ensure smooth transition for varying content */
    opacity: 1;
    margin-left: 5px; /* Space between "Home" and sub-menu items */
}

.nav-item-has-submenu .submenu .nav-item {
    padding: 2px 0; /* Minimal padding, essentially text links */
    font-size: 0.8em; /* Even smaller font size */
    background-color: transparent; /* Ensure no background */
    color: #888888; /* Very subdued text color */
    margin-left: 10px; /* Further increased indent */
    border-radius: 0; /* No rounded corners */
    text-align: left; /* Align text to the left */
    transition: color 0.3s ease; /* Only transition color on hover */
}

.nav-item-has-submenu .submenu .nav-item:hover {
    background-color: transparent; /* No background on hover */
    color: #ffffff; /* White text on hover for better visibility */
}

/* Hide the default WordPress navigation */
.main-navigation {
    display: none;
}

@media (prefers-color-scheme: dark) {
  .icon {
    filter: invert(1);
  }
}