/*
Theme Name: D3 Lite
Author: Vinit Sharma, d3logics
Author URI: https://profiles.wordpress.org/vinit-sharma/
Description: d3 Lite is a fast, lightweight and multipurpose WordPress theme built for speed. It works beautifully with every major page builder (Elementor, Beaver Builder, Brizy and the block editor), ships with a clean accessible mobile menu, and gives you just the options you need — logo, colors, layout width, sidebar and typography — with no bloat.
Version: 1.0.1
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: d3-lite
Tags: blog, e-commerce, custom-menu, custom-logo, custom-background, custom-colors, editor-style, featured-images, footer-widgets, full-width-template, right-sidebar, left-sidebar, threaded-comments, translation-ready, block-styles, wide-blocks, sticky-post

d3 Lite, (C) 2026 d3logics, GPL v2 or later.
*/

/* ============================ Variables ============================ */
:root {
	--d3-container: 1200px;
	--d3-sidebar-width: 30%;
	--d3-primary: #2563eb;
	--d3-text: #2b2b2b;
	--d3-heading: #15171a;
	--d3-border: #e6e8ec;
	--d3-muted: #6b7280;
	--d3-radius: 8px;
	--d3-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--d3-font-size: 17px;
	--d3-heading-font: var(--d3-font);
}

/* ============================ Reset / base ============================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--d3-font);
	font-size: var(--d3-font-size);
	line-height: 1.7;
	color: var(--d3-text);
	background: #fff;
}
img, embed, iframe, object, video { max-width: 100%; height: auto; }
a { color: var(--d3-primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { font-family: var(--d3-heading-font); color: var(--d3-heading); line-height: 1.25; margin: 0 0 .5em; }
p, ul, ol, blockquote, pre, table { margin: 0 0 1.4em; }
blockquote { border-left: 4px solid var(--d3-primary); padding-left: 1em; color: var(--d3-muted); }
hr { border: 0; border-top: 1px solid var(--d3-border); margin: 2em 0; }
:focus-visible { outline: 2px solid var(--d3-primary); outline-offset: 2px; }

/* ============================ Layout ============================ */
.d3-container { width: 100%; max-width: var(--d3-container); margin: 0 auto; padding: 0 20px; }
.site-content { padding: 40px 0; }
.content-area { display: flex; gap: 40px; align-items: flex-start; }
.content-main { flex: 1 1 auto; min-width: 0; }
.widget-area { flex: 0 0 var(--d3-sidebar-width); }
body.d3-no-sidebar .widget-area { display: none; }
body.d3-no-sidebar .content-main { width: 100%; }
body.d3-sidebar-left .content-area { flex-direction: row-reverse; }

/* Full-width / page-builder templates: no container padding, no sidebar */
.d3-builder .site-content { padding: 0; }
.d3-builder .content-area { display: block; }
.d3-builder .d3-container { max-width: 100%; padding: 0; }

/* ============================ Header ============================ */
.site-header { border-bottom: 1px solid var(--d3-border); background: #fff; }
.site-header.is-sticky { position: sticky; top: 0; z-index: 100; }
.d3-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.custom-logo-link img { display: block; max-height: 48px; width: auto; }
.site-title { font-size: 1.4rem; margin: 0; }
.site-title a { color: var(--d3-heading); }
.site-description { margin: 0; font-size: .85rem; color: var(--d3-muted); }

/* ============================ Navigation ============================ */
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-navigation li { position: relative; }
.main-navigation a { display: block; padding: 10px 14px; color: var(--d3-heading); font-weight: 500; border-radius: var(--d3-radius); }
.main-navigation a:hover, .main-navigation .current-menu-item > a { color: var(--d3-primary); text-decoration: none; background: rgba(37,99,235,.06); }
/* Desktop dropdown sub-menus only (mobile uses the slide-in drill-down) */
@media (min-width: 922px) {
	.main-navigation ul ul {
		display: block; position: absolute; left: 0; top: 100%;
		min-width: 200px; background: #fff; border: 1px solid var(--d3-border);
		border-radius: var(--d3-radius); box-shadow: 0 10px 30px rgba(0,0,0,.08);
		padding: 6px; flex-direction: column; gap: 2px;
		opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s; z-index: 50;
	}
	.main-navigation li:hover > ul, .main-navigation li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }
	.main-navigation ul ul ul { left: 100%; top: 0; }
}

/* On desktop the panel is just a transparent wrapper around the menu */
.d3-menu-panel { display: contents; }
.d3-menu-close, .d3-mobile-contact, .d3-submenu-toggle { display: none; }
.d3-menu-overlay { display: none; }

.menu-toggle {
	display: none; align-items: center; gap: 8px;
	background: none; border: 1px solid var(--d3-border); border-radius: var(--d3-radius);
	padding: 9px 12px; cursor: pointer; font: inherit; color: var(--d3-heading);
}
.menu-toggle .bars { width: 20px; height: 2px; background: currentColor; position: relative; display: block; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; }
.menu-toggle .bars::before { top: -6px; }
.menu-toggle .bars::after { top: 6px; }

@media (max-width: 921px) {
	.menu-toggle { display: inline-flex; }
	.site-header { position: relative; }

	/* Off-canvas slide-in panel */
	.d3-menu-panel {
		display: block;
		position: fixed; top: 0; right: 0; bottom: 0;
		width: min(330px, 86vw);
		background: #fff;
		z-index: 1000;
		padding: 64px 22px 24px;
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform .28s ease;
		box-shadow: -12px 0 40px rgba(0,0,0,.18);
	}
	.main-navigation.toggled .d3-menu-panel { transform: none; }

	.d3-menu-panel .menu { display: flex; flex-direction: column; gap: 2px; }
	.main-navigation a { padding: 12px 12px; border-bottom: 1px solid var(--d3-border); border-radius: 0; }

	/* Mobile sub-menu: slide-in drill-down with back button */
	.main-navigation .menu li { position: relative; }
	.main-navigation .menu .menu-item-has-children > a { padding-right: 46px; }
	.d3-submenu-toggle {
		position: absolute; top: 0; right: 0; width: 46px; height: 47px;
		background: none; border: 0; cursor: pointer; display: inline-flex;
		align-items: center; justify-content: center; color: var(--d3-heading);
	}
	.d3-caret { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }

	/* Each sub-menu becomes a full panel that slides in from the right */
	.main-navigation .menu .sub-menu {
		position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 86vw);
		background: #fff; z-index: 1001; display: block;
		padding: 8px 22px 24px; overflow-y: auto;
		transform: translateX(100%); transition: transform .28s ease;
		box-shadow: -12px 0 40px rgba(0,0,0,.18);
		opacity: 1; visibility: visible; border: 0; min-width: 0;
	}
	.main-navigation .menu .sub-menu.is-active { transform: none; }
	.main-navigation .menu .sub-menu .sub-menu { z-index: 1002; }
	.main-navigation .menu .sub-menu .sub-menu .sub-menu { z-index: 1003; }

	/* Back row */
	.d3-submenu-back-wrap { position: relative; }
	.d3-submenu-back {
		display: flex; align-items: center; gap: 10px; width: 100%;
		background: none; border: 0; border-bottom: 2px solid var(--d3-border);
		padding: 14px 4px; cursor: pointer; font: inherit; font-weight: 700;
		color: var(--d3-primary); text-align: left;
	}
	.d3-back-caret { width: 9px; height: 9px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

	/* Close button (stays above sliding sub-menus) */
	.d3-menu-close {
		display: block; position: absolute; top: 12px; right: 14px; z-index: 1100;
		width: 40px; height: 40px; border: 0; background: rgba(0,0,0,.05);
		border-radius: 50%; font-size: 26px; line-height: 1; color: var(--d3-heading); cursor: pointer;
	}
	.d3-menu-close:hover { background: rgba(0,0,0,.1); }

	/* Contact block */
	.d3-mobile-contact { display: block; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--d3-border); }
	.d3-contact-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--d3-heading); font-weight: 600; text-decoration: none; }
	.d3-contact-item:hover { color: var(--d3-primary); }
	.d3-contact-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(37,99,235,.1); color: var(--d3-primary); font-size: 16px; }

	/* Overlay + body lock */
	.d3-menu-overlay {
		display: block; position: fixed; inset: 0; z-index: 999;
		background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s;
	}
	body.d3-menu-open .d3-menu-overlay { opacity: 1; visibility: visible; }
	body.d3-menu-open { overflow: hidden; }
}

/* ============================ Content ============================ */
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: 2rem; }
.entry-meta { color: var(--d3-muted); font-size: .9rem; margin-bottom: 10px; }
.entry-meta a { color: var(--d3-muted); }
.post-thumbnail { display: block; margin-bottom: 20px; }
.post-thumbnail img { width: 100%; border-radius: var(--d3-radius); }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content a { text-decoration: underline; }

/* Blog list */
.d3-post { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--d3-border); }
.d3-post:last-child { border-bottom: 0; }
.d3-post .entry-title { font-size: 1.6rem; }
.d3-post .entry-title a { color: var(--d3-heading); }
.d3-read-more { display: inline-block; margin-top: 6px; font-weight: 600; }

/* Blog grid option */
body.d3-blog-grid .d3-posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
body.d3-blog-grid .d3-post { border: 1px solid var(--d3-border); border-radius: var(--d3-radius); padding: 0; overflow: hidden; margin: 0; }
body.d3-blog-grid .d3-post .post-thumbnail { margin: 0; }
body.d3-blog-grid .d3-post .post-thumbnail img { border-radius: 0; }
body.d3-blog-grid .d3-post .d3-post-body { padding: 18px 20px 22px; }
@media (max-width: 680px) { body.d3-blog-grid .d3-posts { grid-template-columns: 1fr; } }

/* ============================ Buttons / forms ============================ */
.d3-btn, button, input[type="submit"], .wp-block-button__link {
	display: inline-block; background: var(--d3-primary); color: #fff; border: 0;
	padding: 11px 20px; border-radius: var(--d3-radius); font-weight: 600; cursor: pointer; text-decoration: none;
}
.d3-btn:hover, button:hover, input[type="submit"]:hover { filter: brightness(.94); text-decoration: none; color: #fff; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], textarea, select {
	width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--d3-border);
	border-radius: var(--d3-radius); font: inherit; background: #fff; color: var(--d3-text);
}

/* ============================ Widgets ============================ */
.widget { margin-bottom: 32px; }
.widget-title { font-size: 1.1rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--d3-primary); display: inline-block; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 7px 0; border-bottom: 1px solid var(--d3-border); }

/* ============================ Footer ============================ */
.site-footer { border-top: 1px solid var(--d3-border); background: var(--d3-footer-bg, #0f1115); color: var(--d3-footer-color, #c7cbd2); padding: 40px 0; margin-top: 40px; }
.site-footer a { color: #fff; }
.d3-footer-widgets { display: grid; grid-template-columns: repeat(var(--d3-footer-cols, 3), 1fr); gap: 32px; margin-bottom: 24px; }
.site-footer .widget-title { color: #fff; border-color: var(--d3-primary); }
.site-footer .widget ul li { border-color: rgba(255,255,255,.1); }
.d3-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; font-size: .9rem; }
@media (max-width: 782px) { .d3-footer-widgets { grid-template-columns: 1fr; } }

/* ============================ Pagination / misc ============================ */
.d3-pagination { margin-top: 30px; }
.d3-pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.d3-pagination li { margin: 0; }
.d3-pagination a.page-numbers,
.d3-pagination span.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 12px;
	border: 1px solid var(--d3-border); border-radius: var(--d3-radius);
	color: var(--d3-heading); text-decoration: none; font-weight: 600; line-height: 1;
}
.d3-pagination a.page-numbers:hover { background: rgba(37,99,235,.08); border-color: var(--d3-primary); color: var(--d3-primary); }
.d3-pagination span.page-numbers.current { background: var(--d3-primary); color: #fff; border-color: var(--d3-primary); }
.d3-pagination span.page-numbers.dots { border-color: transparent; }

.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden;
	position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background-color: #fff; border-radius: 4px;
	box-shadow: 0 0 2px 2px rgba(0,0,0,.2);
	clip: auto !important; clip-path: none;
	color: var(--d3-primary); display: block;
	font-size: 1rem; font-weight: 700;
	height: auto; left: 10px; line-height: normal;
	padding: 14px 22px; text-decoration: none; top: 10px;
	width: auto; z-index: 100000;
}
.skip-link { position: absolute; left: -9999px; top: 0; }

/* Alignments for block/builder content */
.alignwide { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }

@media (max-width: 921px) {
	.content-area { display: block; }
	.widget-area { margin-top: 40px; }
}

/* ============================ Custom header & footer ============================ */

/* Top bar */
.d3-topbar { background: var(--d3-heading); color: #fff; font-size: .85rem; }
.d3-topbar a { color: #fff; text-decoration: none; }
.d3-topbar a:hover { opacity: .8; text-decoration: none; }
.d3-topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 16px; }
.d3-topbar-left { display: flex; gap: 18px; flex-wrap: wrap; }

/* Social icons */
.d3-social { display: inline-flex; gap: 8px; align-items: center; }
.d3-social-link { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: inherit; transition: .15s; }
.d3-social-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.d3-social.is-footer .d3-social-link:hover { background: var(--d3-primary); }

/* Header right group */
.d3-header-right { display: flex; align-items: center; gap: 10px; }

/* Search */
.d3-search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--d3-border); background: none; border-radius: var(--d3-radius); color: var(--d3-heading); cursor: pointer; }
.d3-search-toggle:hover { color: var(--d3-primary); border-color: var(--d3-primary); }
.d3-search-panel { border-top: 1px solid var(--d3-border); background: #fff; padding: 16px 0; }
.d3-search-panel form { display: flex; gap: 8px; }

/* Header button */
.d3-header-btn { white-space: nowrap; }

/* Centered header layout */
body.d3-header-centered .d3-header-inner { flex-direction: column; gap: 12px; min-height: 0; padding-top: 16px; padding-bottom: 8px; text-align: center; }
body.d3-header-centered .site-branding { flex-direction: column; gap: 6px; }
body.d3-header-centered .d3-header-right { justify-content: center; }
@media (max-width: 921px) {
	body.d3-header-centered .d3-header-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Transparent header (desktop) */
@media (min-width: 922px) {
	body.d3-transparent-header .site-header {
		position: absolute; left: 0; right: 0; top: var(--d3-tt, 0);
		background: transparent; border-bottom-color: rgba(255,255,255,.2); z-index: 50;
	}
	body.d3-transparent-header.admin-bar .site-header { top: 32px; }
	body.d3-transparent-header .site-title a,
	body.d3-transparent-header .main-navigation a { color: #fff; }
	body.d3-transparent-header .site-content { padding-top: 0; }
}

/* Footer extras */
.d3-footer-social { display: flex; justify-content: center; margin-bottom: 20px; }
.d3-footer-bottom { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.d3-footer-bottom.d3-align-center { justify-content: center; text-align: center; }
.d3-footer-bottom.d3-align-left { justify-content: flex-start; }
.d3-footer-bottom.d3-align-right { justify-content: flex-end; }
.d3-footer-bottom.d3-align-split { justify-content: space-between; }
.d3-footer-menu { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.d3-footer-menu a { color: var(--d3-footer-color, #c7cbd2); text-decoration: none; }
.d3-footer-menu a:hover { color: #fff; }
@media (max-width: 600px) { .d3-footer-bottom { justify-content: center; text-align: center; } }

/* Back to top */
.d3-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 200;
	width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: var(--d3-primary); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 18px rgba(0,0,0,.2); opacity: 0; transform: translateY(10px);
	transition: opacity .25s, transform .25s;
}
.d3-to-top.is-visible { opacity: 1; transform: none; }

@media (max-width: 921px) {
	.d3-topbar-inner { justify-content: center; }
	.d3-topbar-right { display: none; }
	.d3-header-btn { display: none; }
}

/* ============================ Header zones (builder) ============================ */
.d3-header-inner { gap: 18px; }
.d3-hz { display: flex; align-items: center; gap: 14px; min-width: 0; }
.d3-hz-left { justify-content: flex-start; }
.d3-hz-center { flex: 1 1 auto; justify-content: center; }
.d3-hz-right { margin-left: auto; justify-content: flex-end; }
.d3-hz-center + .d3-hz-right { margin-left: 0; }
.d3-inline-contact { display: flex; gap: 16px; font-size: .92rem; }
.d3-inline-contact a { color: var(--d3-heading); text-decoration: none; }
.d3-inline-contact a:hover { color: var(--d3-primary); }

/* Centered layout stacks the zones */
body.d3-header-centered .d3-header-inner { flex-direction: column; }
body.d3-header-centered .d3-hz { justify-content: center; margin-left: 0; }

@media (max-width: 921px) {
	.d3-hz-left { flex: 1; }
	.d3-hz .d3-inline-contact, .d3-hz .d3-social.is-header { display: none; }
}

/* ============================ Required WP classes ============================ */
/* Sticky posts */
.sticky { display: block; }
.d3-post.sticky { border: 2px solid var(--d3-primary); border-radius: var(--d3-radius); padding: 20px; }

/* Post author comment highlight */
.bypostauthor > .comment-body { background: rgba(37,99,235,.05); border-radius: var(--d3-radius); padding: 8px; }

/* Captions */
.wp-caption { max-width: 100%; margin-bottom: 1.4em; }
.wp-caption img { display: block; margin: 0 auto; }
.wp-caption-text { font-size: .85rem; color: var(--d3-muted); text-align: center; padding: 6px 0; }
.gallery-caption { display: block; font-size: .85rem; color: var(--d3-muted); }

/* Misc WP defaults */
.wp-block-image figcaption { font-size: .85rem; color: var(--d3-muted); text-align: center; }
.post-password-form input[type="password"] { max-width: 280px; }
.entry-tags { margin-top: 16px; }
.entry-tags a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; background: rgba(37,99,235,.08); border-radius: 20px; font-size: .85rem; text-decoration: none; }

/* Custom header image */
.d3-header-image { line-height: 0; }
.d3-header-image img { display: block; width: 100%; height: auto; }

/* Custom block styles */
.wp-block-button.is-style-d3-outline .wp-block-button__link { background: transparent; color: var(--d3-primary); border: 2px solid var(--d3-primary); }
.wp-block-image.is-style-d3-rounded img { border-radius: 16px; }
