/* =========================================================================
   Osama Shawky — light/dark switch
   Loaded after site.css, motion.css and charts.css. Additive only: it
   re-declares the palette for dark mode and styles the header toggle.
   ========================================================================= */

/* -------------------------------------------------------------------------
 * Header toggle
 * ---------------------------------------------------------------------- */
.theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: #fff;
	color: var(--ink);
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.theme-toggle:hover {
	border-color: var(--purple);
	color: var(--purple);
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--purple);
	outline-offset: 2px;
}

.theme-toggle svg {
	display: block;
	width: 15px;
	height: 15px;
}

.theme-toggle .icon-moon {
	display: none;
}

html[data-theme="dark"] .theme-toggle {
	background: #141414;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
	display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
	display: block;
}

/* -------------------------------------------------------------------------
 * Dark palette
 * ---------------------------------------------------------------------- */
html[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0a0a0a;
	--paper: #111111;
	--warm: #151515;
	--ink: #f4f1ec;
	--muted: #9f9f9f;
	--line: #282828;
	--border: #1c1c1c;
	--lav: #171717;
	--lav2: #272727;
}

html[data-theme="dark"] body {
	background: var(--bg);
	color: var(--ink);
}

/* Navigation and footer */
html[data-theme="dark"] .nav-shell {
	background: #0a0a0aef;
	border-bottom-color: #ffffff14;
}

html[data-theme="dark"] .nav-links {
	color: #cfcfcf;
}

html[data-theme="dark"] .menu {
	background: #141414;
	color: var(--ink);
}

html[data-theme="dark"] .ticker {
	background: var(--paper);
}

html[data-theme="dark"] .footer {
	background: var(--paper);
}

html[data-theme="dark"] .footer-col a,
html[data-theme="dark"] .footer-bottom,
html[data-theme="dark"] .ticker-item span,
html[data-theme="dark"] .hero-meta,
html[data-theme="dark"] .atlas-node small,
html[data-theme="dark"] .atlas-caption,
html[data-theme="dark"] .microstat small,
html[data-theme="dark"] .inline-stat span,
html[data-theme="dark"] .quote footer small,
html[data-theme="dark"] .experience-row .role-title,
html[data-theme="dark"] .case-fact span,
html[data-theme="dark"] .disclaimer,
html[data-theme="dark"] .form-note {
	color: var(--muted);
}

html[data-theme="dark"] .hero-lead,
html[data-theme="dark"] .service ul,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .quote blockquote {
	color: #c7c7c7;
}

html[data-theme="dark"] .expertise-strip span {
	background: #ffffff10;
	border-color: var(--line);
}

/* Light surfaces */
html[data-theme="dark"] .btn.outline:hover {
	background: #161616;
}

html[data-theme="dark"] .achievement-side,
html[data-theme="dark"] .quote,
html[data-theme="dark"] .service,
html[data-theme="dark"] .article-link,
html[data-theme="dark"] .subnav a,
html[data-theme="dark"] .education,
html[data-theme="dark"] .venture-card:not(.dark),
html[data-theme="dark"] .case-fact,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .milestone-card,
html[data-theme="dark"] .atlas-node {
	background: var(--paper);
	border-color: var(--line);
}

html[data-theme="dark"] .microstat {
	background: #ffffff12;
	border-color: #ffffff1f;
}

html[data-theme="dark"] .atlas-core {
	box-shadow:
		0 0 0 18px #0a0a0a,
		0 0 0 19px #282828,
		0 25px 70px #00000066;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select {
	background: #141414;
	border-color: var(--line);
	color: var(--ink);
}

html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .field textarea::placeholder {
	color: #7d7d7d;
}

/* Charts and company marks */
html[data-theme="dark"] .os-viz,
html[data-theme="dark"] .os-logos {
	--os-viz-ink: var(--ink);
	--os-viz-muted: var(--muted);
	--os-viz-track: #2c2c2c;
	--os-viz-track-strong: #414141;
	--os-viz-card: #111111;
	--os-viz-soft: #171717;
}

html[data-theme="dark"] .os-logo:hover {
	box-shadow: 0 16px 34px #00000066;
}

html[data-theme="dark"] .os-logo-mark {
	filter: grayscale(1) invert(1);
}

html[data-theme="dark"] .os-logo-mark--paper,
html[data-theme="dark"] .os-logo-mark--block {
	filter: grayscale(1);
}

/* Blog, archives and comments */
html[data-theme="dark"] .entry-content p,
html[data-theme="dark"] .entry-content li,
html[data-theme="dark"] .entry-content blockquote,
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] .woocommerce div.product .woocommerce-product-details__short-description,
html[data-theme="dark"] .os-enquiry-note {
	color: #c7c7c7;
}

html[data-theme="dark"] .entry-content code,
html[data-theme="dark"] .entry-content pre {
	background: #171717;
	border-color: var(--line);
	color: var(--ink);
}

html[data-theme="dark"] .search-form input[type="search"],
html[data-theme="dark"] .comment-form input[type="text"],
html[data-theme="dark"] .comment-form input[type="email"],
html[data-theme="dark"] .comment-form input[type="url"],
html[data-theme="dark"] .comment-form textarea {
	background: #141414;
	border-color: var(--line);
	color: var(--ink);
}

html[data-theme="dark"] .form-notice.error {
	background: #2a1414;
	border-color: #5a2020;
	color: #ffb3b3;
}

/* WooCommerce */
html[data-theme="dark"] .os-cart-link,
html[data-theme="dark"] .woocommerce .woocommerce-ordering select,
html[data-theme="dark"] .woocommerce ul.products li.product,
html[data-theme="dark"] .woocommerce .quantity .qty,
html[data-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li,
html[data-theme="dark"] .woocommerce table.shop_table,
html[data-theme="dark"] .woocommerce form .form-row input.input-text,
html[data-theme="dark"] .woocommerce form .form-row textarea,
html[data-theme="dark"] .woocommerce form .form-row select,
html[data-theme="dark"] .woocommerce .woocommerce-info,
html[data-theme="dark"] .woocommerce .woocommerce-message,
html[data-theme="dark"] .woocommerce .woocommerce-error,
html[data-theme="dark"] .woocommerce table.cart td.actions .coupon .input-text,
html[data-theme="dark"] .woocommerce nav.woocommerce-pagination ul li a,
html[data-theme="dark"] .woocommerce nav.woocommerce-pagination ul li span,
html[data-theme="dark"] .woocommerce-checkout #order_review,
html[data-theme="dark"] .woocommerce-checkout #payment div.payment_box {
	background: var(--paper);
	border-color: var(--line);
	color: var(--ink);
}

html[data-theme="dark"] .woocommerce table.shop_table th {
	background: #161616;
	color: var(--muted);
}

html[data-theme="dark"] .woocommerce-checkout #payment div.payment_box {
	color: #c7c7c7;
}

html[data-theme="dark"] .woocommerce button.button:disabled,
html[data-theme="dark"] .woocommerce button.button:disabled[disabled] {
	background: #1a1a1a;
	border-color: #1a1a1a;
}

html[data-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li a {
	color: var(--ink);
}

html[data-theme="dark"] .woocommerce .woocommerce-ordering select option {
	background: #141414;
	color: var(--ink);
}

/* Elementor surfaces */
html[data-theme="dark"] .elementor .os-warm {
	background: var(--warm);
}
