/*!
Theme Name: Cosmictech
Theme URI: https://sourabhmourya.com/cosmictech
Author: Sourabh
Author URI: https://sourabhmourya.com/
Description: Cosmictech is a premium, modern WordPress theme designed for creative agencies, tech startups, and digital portfoliosIt features a modern light aesthetic, smooth animations, and is built on Bootstrap 5.3.8.
Version: 1.0.2
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: cosmictech
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, light-mode, portfolio, agency, bootstrap
*/

/*--------------------------------------------------------------
# Root Variables & Theme Colors
--------------------------------------------------------------*/
:root {
	--cosmic-bg: #ffffff;
	--cosmic-surface: #f8f9fa;
	--cosmic-primary: #1c17fe;
	--cosmic-secondary: #8b5cf6;
	--cosmic-accent: #1c17fe;
	--cosmic-text: #334155;
	--cosmic-text-muted: #64748b;
	--cosmic-border: #e2e8f0;
	/* Typography handled dynamically via inc/dynamic-style.php */
	--font-primary: 'Poppins', sans-serif;
	--font-heading: 'Poppins', sans-serif;
	--cosmic-loader-height: 3px;
}

/*--------------------------------------------------------------
# Base Styles
--------------------------------------------------------------*/
body {
	background-color: var(--cosmic-bg);
	color: var(--cosmic-text);
	font-family: var(--font-primary);
	font-weight: var(--font-primary-weight, 400);
	font-style: var(--font-primary-style, normal);
	line-height: 1.6;
	overflow-x: hidden;
	font-size: 16px;
	/* Global font size */
}

p {
	/* 	font-size: 16px; */
	margin-bottom: 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	color: #0f172a;
	/* font-weight: var(--font-heading-weight, 600); */
	font-style: var(--font-heading-style, normal);
	margin-bottom: 1rem;
	letter-spacing: -0.01em;
}

h1 {
	font-size: 2rem;
}

h2 {
	font-size: 1.75rem;
}

h3 {
	font-size: 1.5rem;
}

h4 {
	font-size: 1.25rem;
}

h5 {
	font-size: 1.1rem;
}

h6 {
	font-size: 1rem;
}

a {
	color: var(--cosmic-primary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.elementor-widget-icon-list ul {
	list-style: none;
	padding-left: 0;
}

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

/*--------------------------------------------------------------
# Layout & Components
--------------------------------------------------------------*/
.container {
	max-width: 1200px;
}

/* Header */
.site-header {
	background-color: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--cosmic-border);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.site-branding .site-title a {
	background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	font-weight: 800;
	font-size: 1.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.site-description {
	color: var(--cosmic-text-muted);
	font-size: 0.9rem;
}

/* Navigation */
.navbar-nav .nav-link {
	color: var(--cosmic-text) !important;
	font-weight: 500;
	padding: 0.5rem 1rem !important;
	/* Reduced reduced spacing */
	position: relative;
	transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
	color: var(--cosmic-primary) !important;
}

.dropdown-menu {
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	/* Keeping radius for standard dropdowns as it looks better usually, unless requested otherwise */
	box-shadow: none;
	display: none;
	/* Hidden by default - prevents white space in layout */
	visibility: hidden;
	opacity: 0;
	transform: translateY(10px);
	transition: all 0.2s ease-in-out;
	margin-top: 8px !important;
	/* 8px Gap as requested */
	padding-top: 10px;
	/* Internal spacing instead */
	/* clip-path removed to allow 3rd level menu visibility */
}

/* Pseudo-bridge to connect nav item to dropdown */
.dropdown-menu::before {
	content: "";
	position: absolute;
	top: -20px;
	/* Extend upward to meet the nav link */
	left: 0;
	width: 100%;
	height: 20px;
	background: transparent;
}

/* 3rd Level Menu */
.dropdown-menu .dropdown-menu {
	left: 100%;
	top: 0;
	margin-top: 0 !important;
	margin-left: 0;
}

/* Desktop Hover Support */
@media (min-width: 992px) {
	.navbar-nav .dropdown:hover>.dropdown-menu {
		display: block;
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
		margin-top: 8px !important;
	}

	/* Support for 3rd level hover */
	.dropdown-menu .dropdown-submenu:hover>.dropdown-menu {
		display: block;
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
	}

	/* Dropdown Submenu Arrow */
	.dropdown-menu .dropdown-toggle::after {
		transform: rotate(-90deg);
		position: absolute;
		right: 1rem;
		top: 50%;
		margin-top: -2px;
	}
}

/* Force Font Awesome for Brand Icons */
.fa-brands,
.fab {
	font-family: "Font Awesome 6 Brands" !important;
	font-weight: 400 !important;
}

.bio-name {
	font-weight: 400 !important;
}

.dropdown-item {
	color: var(--cosmic-text);
	padding: 0.7rem 1.5rem;
	transition: all 0.2s ease;
	position: relative;
	/* For submenu positioning */
}

.dropdown-item:hover {
	background-color: var(--cosmic-surface);
	color: var(--cosmic-primary);
	padding-left: 1.8rem;
	/* Slide effect */
}

/* Footer */
/* Footer */
.site-footer {
	background-color: #000000;
	/* Pure black as requested */
	border-top: 1px solid #333333;
	/* Darker border */
	padding: 3rem 0;
	color: #cbd5e1;
	/* Light gray text */
	clear: both;
}

.comments-area {
	clear: both;
}

/* .site-footer headings color removed to allow Redux override */

.site-footer a {
	color: #e2e8f0;
	/* Light text for links */
}

.site-footer a:hover {
	color: var(--cosmic-primary);
}

/*--------------------------------------------------------------
# WordPress Core & Widgets
--------------------------------------------------------------*/
.widget {
	margin-bottom: 1.5rem;
	background: #ffffff;
	padding: 1.5rem;
	border-radius: 12px;
	border: 1px solid var(--cosmic-border);
	box-shadow: none;
}

.widget-title {
	font-size: 1.25rem;
	border-bottom: 2px solid var(--cosmic-border);
	padding-bottom: 0.75rem;
	margin-bottom: 1.25rem;
	color: #0f172a;
}

/* Specific Widget List Styles (Categories, Archives, etc.) */
.widget ul,
.widget ol {
	list-style: none;
	padding-left: 0;
	margin-bottom: 0;
}

.widget li {
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid transparent;
	/* Prepare for potential hover border */
}

/* Remove border from last item */
.widget li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.widget li a {
	color: var(--cosmic-text);
	/* Standard text color */
	font-weight: 400;
	transition: all 0.2s ease;
	display: block;
	/* Make the whole area clickable/hoverable */
}

.widget li a:hover {
	color: var(--cosmic-primary);
	/* Primary color on hover */
	padding-left: 5px;
	/* Slight movement on hover */
}

/* Cards / Posts */
/* .post,
.page {
	margin-bottom: 3rem;
} */

.entry-title {
	font-size: 1.75rem;
	margin-bottom: 1rem;
	color: #0f172a;
}

.entry-content,
.entry-content p {
	font-size: 1.1rem;
	color: var(--cosmic-text);
	line-height: 1.6 !important;
}

/* Buttons */
.btn-primary,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
	background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 50px;
	font-weight: 600;
	color: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
	display: inline-block;
	text-align: center;
}

.btn-primary:hover,
button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
	color: #fff;
}

/* Forms */
input,
textarea,
select {
	background-color: #ffffff;
	border: 1px solid var(--cosmic-border);
	color: var(--cosmic-text);
	padding: 0.75rem;
	border-radius: 8px;
	width: 100%;
}

input:focus,
textarea:focus {
	outline: none;
	border-color: var(--cosmic-primary);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.comment-form-cookies-consent {
	display: flex !important;
	align-items: center;
	gap: 10px;
}

.comment-form-cookies-consent input[type="checkbox"] {
	width: auto !important;
	margin-bottom: 0;
}

.comment-form-cookies-consent label {
	margin-bottom: 0;
}

/*--------------------------------------------------------------
# Mega Menu Styles
--------------------------------------------------------------*/
/* Allow full width dropdown */
/* Allow full width dropdown */
.navbar-nav .nav-item.has-mega-menu {
	position: static;
}

/* Ensure the mega menu can expand beyond its containers in the builder */
.site-header-builder .navbar,
.site-header-builder .container-fluid,
.site-header-builder .elementor-widget-container,
.site-header-builder .elementor-section,
.site-header-builder .elementor-container,
.site-header-builder .elementor-column,
.site-header-builder .elementor-widget-wrap,
.site-header-builder .elementor-element,
.site-header-builder .e-con,
.site-header-builder .e-con-inner,
.site-header-builder .e-container,
.site-header-builder .widget-container,
.elementor-editor-active .navbar,
.elementor-editor-active .container-fluid,
.elementor-editor-active .container {
	position: static !important;
	transform: none !important;
	/* Prevent transform from creating a new containing block */
}

/* Fix Mega Menu in Elementor Editor (General) */
.elementor-editor-active.single-cosmictech_header .elementor-section,
.elementor-editor-active.single-cosmictech_header .elementor-column,
.elementor-editor-active.single-cosmictech_header .elementor-widget-wrap,
.elementor-editor-active.single-cosmictech_header .elementor-widget-container,
.elementor-editor-active.single-cosmictech_header .elementor-widget,
.elementor-editor-active.single-cosmictech_header .elementor-element,
.elementor-editor-active.single-cosmictech_header .e-con,
.elementor-editor-active.single-cosmictech_header .e-con-inner,
.elementor-editor-active.single-cosmictech_header .e-container {
	position: static !important;
	transform: none !important;
	overflow: visible !important;
}

/* Mega Menu Container */
/* Mega Menu Container */
.mega-menu-container.dropdown-menu {
	width: 100vw !important;
	position: absolute !important;
	left: 50% !important;
	right: auto !important;
	transform: translateX(-50%) translateY(10px) !important;
	/* Start slightly lower */
	/* User-requested fine-tuning */
	padding: 0;
	margin-top: 8px !important;
	/* 8px Gap for Megamenu */
	border: 1px solid #e5e7eb;
	border-radius: 0;
	box-shadow: none;
	/* Attractive shadow */
	background-color: #ffffff;
	overflow: visible;
	/* Changed to visible so sub-elements or shadows aren't cut, though usually hidden is safer for mega menus, let's keep it visible for now if needed */
	/* Clean edges */
	visibility: hidden;
	opacity: 0;
	transition: all 0.3s ease-in-out;
	z-index: 9999;
	clip-path: none;
	/* Reset standard dropdown clip path if different */
}

/* Neutralize Mega Menu Styles in Editor to let JS take full control of positioning */
.elementor-editor-active .nav-item.has-mega-menu .mega-menu-container.dropdown-menu {
	left: 0 !important;
	right: 0 !important;
	width: 100vw !important;
	transform: none !important;
	margin: 0 !important;
}

/* Ensure visibility only on hover in editor */
.elementor-editor-active .nav-item.has-mega-menu:hover>.mega-menu-container.dropdown-menu {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Mega Menu Active State */
.navbar-nav .nav-item.has-mega-menu:hover>.mega-menu-container.dropdown-menu {
	display: block !important;
	visibility: visible;
	opacity: 1;
}

/* 3rd Level Menu Fix for Last 2 Items */
/* 3rd Level Menu Fix for Last 2 Items */
.navbar-nav>.nav-item:nth-last-child(-n+2) .dropdown-menu .dropdown-menu,
.dropdown-menu .dropdown-menu.opens-left {
	left: auto;
	right: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Animation */
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Ensure Elementor content fits */
.mega-menu-content {
	width: 100%;
}

.mega-menu-content .elementor-section {
	width: 100%;
}


/* Ensure dropdown arrow is visible for Mega Menu items */
.has-mega-menu>.dropdown-toggle::after {
	display: inline-block;
	margin-left: 0.255em;
	vertical-align: 0.255em;
	content: "";
	border-top: 0.3em solid;
	border-right: 0.3em solid transparent;
	border-bottom: 0;
	border-left: 0.3em solid transparent;
}

/* Removed old hover rule as it is now handled in the main navigation block above */

/* Modern Blog Card Changes */
/* Modern Blog List View Changes */
.blog-post.card {
	border: none !important;
	/* Only bottom border removed as requested */
	box-shadow: none !important;
	background: transparent !important;
	/* Transparent background */
	border-radius: 0 !important;
	overflow: visible;
	padding: 0 !important;
	/* Remove padding */
	padding-bottom: 1rem !important;
	/* Reduced bottom spacing as requested */
	margin-bottom: 1rem !important;
	/* Reduced Margin for spacing between items */
}

/* Remove border from last item in the list */
.site-main .row>div:last-child .blog-post.card {
	border-bottom: none !important;
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Sticky Sidebar */
.sidebar-wrapper {
	position: sticky;
	top: 5rem;
	/* Top offset */
	z-index: 10;
}

/* Constrained Layout for Full Width 1-Column */
.narrow-layout {
	max-width: 1000px !important;
	width: 100% !important;
	flex: 0 0 auto !important;
	width: 100% !important;
	flex: 0 0 auto !important;
	/* Prevent unexpected growing */
}

/* Constrained Layout for Single Post Full Width */
.single-narrow-layout {
	max-width: 900px !important;
	width: 100% !important;
	flex: 0 0 auto !important;
	margin-left: auto;
	margin-right: auto;
}

.blog-post.card .card-img-top img {
	border-radius: 12px !important;
	/* Rounded image corners */
	transition: transform 0.3s ease;
	height: 250px;
	width: 100%;
	object-fit: cover;
}

.blog-post.card:hover .card-img-top img {
	transform: scale(1.02);
}

.blog-post .entry-title {
	margin-bottom: 1.25rem !important;
}

.blog-post .entry-title a {
	color: #1e293b !important;
	font-size: 1.2rem;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: auto;
}

.blog-post .entry-title a:hover {
	color: var(--cosmic-primary) !important;
}

.excerpt-content {
	line-height: 1.6em !important;
	color: #64748b !important;
	font-size: 16px !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3.2em;
	/* 2 lines * 1.6 */
}

.excerpt-content p {
	margin-bottom: 0;
	/* Remove margin to ensure height calculation is correct for line clamping if needed, but for nowrap it's fine */
	display: inline;
	/* Ensure it flows correctly if wrapped or reset block behavior to match container */
}

.entry-meta-modern {
	color: #64748b;
	/* border: 1px solid #dedede;
	border-radius: 30px;
	padding: 5px;
	width: fit-content; */
}

.entry-meta-modern .meta-divider {
	color: #e2e8f0;
	font-weight: 300;
}

.author-avatar img {
	border: 1px solid #e2e8f0;
	padding: 2px;
}

.continue-reading {
	color: #0f172a !important;
	font-size: 0.95rem;
	display: inline-flex;
	align-items: center;
	padding-bottom: 5px;
	border-bottom: 2px solid transparent;
	transition: all 0.3s ease;
}

.continue-reading:hover {
	color: var(--cosmic-primary) !important;
	border-bottom-color: var(--cosmic-primary);
	padding-left: 5px;
}

/* Meta Badge Pills (Category + Date) */
.entry-meta-badges {
	margin-bottom: 0.75rem;
}

.meta-badge {
	display: inline-block;
	font-size: 0.8rem;
	color: #64748b;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 3px 10px;
	line-height: 1.4;
	font-weight: 400;
	transition: all 0.2s ease;
}

a.meta-badge {
	color: #64748b !important;
}

a.meta-badge:hover {
	color: var(--cosmic-primary) !important;
	border-color: var(--cosmic-primary);
}

/* Numbered Pagination */
.cosmictech-pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}

.cosmictech-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--cosmic-border);
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--cosmic-text);
	text-decoration: none;
	transition: all 0.2s ease;
}

.cosmictech-pagination .page-numbers.current,
.cosmictech-pagination .page-numbers:hover {
	background: var(--cosmic-primary);
	border-color: var(--cosmic-primary);
	color: #fff;
}

.cosmictech-pagination .page-numbers.dots {
	border: none;
	background: none;
	color: var(--cosmic-text-muted);
}

.cosmictech-pagination .page-numbers.dots:hover {
	background: none;
	color: var(--cosmic-text-muted);
}

@media (max-width: 768px) {
	.entry-meta-modern {
		flex-wrap: wrap;
	}
}

/*--------------------------------------------------------------
# Page Title Bar
--------------------------------------------------------------*/
.page-title-area {
	position: relative;
	background-color: #f8fafe;
	/* Light grayish blue default */
	z-index: 1;
	overflow: hidden;
}

.page-title-area .title,
.page-title-area .content h1.title {
	color: #1e293b;
	position: relative;
	z-index: 2;
	font-weight: 500 !important;
	/* Forced to 500 as requested */
}

.page-title-area .description {
	color: #64748b;
	font-size: 1.15rem;
	max-width: 600px;
	position: relative;
	z-index: 2;
}

.page-title-area .breadcrumb-wrapper {
	margin-top: 1.5rem;
	position: relative;
	z-index: 2;
}

.page-title-area .breadcrumb-item {
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	font-weight: 600;
}

.page-title-area .breadcrumb-item a {
	transition: color 0.2s ease;
}

.page-title-area .breadcrumb-item a:hover {
	text-decoration: underline;
}

/* Geometric Overlay Pattern */
.page-title-area .shape-overlay {
	position: absolute;
	top: 0;
	right: -10%;
	width: 70%;
	height: 100%;
	background:
		linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.6) 40%, rgba(255, 255, 255, 0.6) 65%, rgba(255, 255, 255, 0.3) 65%) !important;
	transform: skewX(-20deg);
	pointer-events: none;
	z-index: 0;
	opacity: 0.6;
}

@media (max-width: 991px) {
	.page-title-area .shape-overlay {
		width: 100%;
		right: -30%;
		opacity: 0.3;
	}
}

@media (max-width: 768px) {
	.breadcrumb-container {
		display: none !important;
	}

	.page-title-area {
		margin-bottom: 0 !important;
	}
}

/* 404 Page Modern Styles */
.error-404-modern {
	background: var(--cosmic-bg);
	min-height: 70vh;
	display: flex;
	align-items: center;
}

.error-404-title {
	font-size: 8.5rem;
	line-height: .9;
	letter-spacing: -5px;
	background: linear-gradient(45deg, var(--cosmic-text), var(--cosmic-primary));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	margin-bottom: 25px;
}

.error-404-subtitle {
	color: var(--cosmic-text);
	font-weight: 700;
	font-size: 2.25rem;
}

.error-404-desc {
	font-size: 1.1rem;
	max-width: 550px;
	margin-left: auto;
	margin-right: auto;
	color: var(--cosmic-text-muted);
}

.error-404-img img {
	max-width: 480px;
	height: auto;
	filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.08));
}

.error-404-modern .btn {
	border-radius: 50px !important;
	font-weight: 600;
	transition: all 0.3s ease;
}

.error-404-modern .btn-primary {
	background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary)) !important;
	border: none !important;
	color: #fff !important;
}

.error-404-modern .btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
	color: #fff !important;
}

.error-404-modern .btn-outline-secondary {
	border: 2px solid var(--cosmic-border) !important;
	color: var(--cosmic-text) !important;
	background: transparent !important;
}

.error-404-modern .btn-outline-secondary:hover {
	background-color: var(--cosmic-primary) !important;
	border-color: var(--cosmic-primary) !important;
	color: #fff !important;
}

/* -------------------------------------------------------------
 * Footer Widgets Override
 * ------------------------------------------------------------- */
.site-footer .widget {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin-bottom: 2rem;
	color: rgba(255, 255, 255, 0.75);
	/* Default text color */
}

.site-footer .widget-title {
	/* color: #fff; Removed to allow Redux override */
	border-bottom: 0px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 10px;
	margin-bottom: 20px;
}

/* Lenis Smooth Scroll */
html.lenis,
html.lenis body {
	height: auto;
}

.lenis.lenis-smooth {
	scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
	overscroll-behavior: contain;
}

.lenis.lenis-stopped {
	overflow: hidden;
}

.lenis.lenis-scrolling iframe {
	pointer-events: none;
}