/*
Theme Name: NanoMedix
Theme URI: https://nano-medix.com
Author: Usman Akram
Description: Custom theme for NanoMedix Enterprises — an early-stage nanotechnology biosensing company developing affordable, rapid diagnostic and environmental sensing products.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nanomedix
*/

/* -------------------------------------------------------------------- */
/* 1. Reset                                                              */
/* -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body { margin: 0; overflow-x: hidden; max-width: 100vw; }
img, picture, video { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* -------------------------------------------------------------------- */
/* 2. Design tokens                                                      */
/* -------------------------------------------------------------------- */
:root {
	--bg: #f6f9fa;
	--surface: #ffffff;
	--surface-2: #eef4f4;
	--ink: #0b2836;
	--ink-muted: #4f6672;
	--ink-faint: #8a9ca5;
	--border: #dee8ea;
	--border-strong: #c3d3d6;

	--primary: #0a5c6e;
	--primary-dark: #073c49;
	--primary-ink: #ffffff;
	--accent: #ff6b4a;
	--accent-ink: #ffffff;
	--accent-soft: #fff0ec;
	--teal-soft: #e4f4f2;

	--gradient-brand: linear-gradient(135deg, var(--primary) 0%, #1a8a7a 100%);

	--shadow: 0 1px 2px rgba(11, 40, 54, 0.05), 0 14px 34px rgba(11, 40, 54, 0.08);
	--shadow-sm: 0 1px 3px rgba(11, 40, 54, 0.08);

	--font-display: 'Manrope', 'Segoe UI', sans-serif;
	--font-body: 'Inter', 'Segoe UI', sans-serif;

	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 1rem;
	--space-4: 1.5rem;
	--space-5: 2.5rem;
	--space-6: 4rem;
	--space-7: 6rem;
	--space-8: 9rem;

	--radius: 16px;
	--radius-sm: 10px;
	--radius-lg: 26px;
	--container: 1220px;
	--measure: 42rem;
}

/* -------------------------------------------------------------------- */
/* 3. Base typography                                                    */
/* -------------------------------------------------------------------- */
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
	line-height: 1.65;
}
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display); font-weight: 700; line-height: 1.18;
	letter-spacing: -0.01em; margin: 0 0 var(--space-3); color: var(--ink);
}
p { margin: 0 0 var(--space-3); }
a { color: var(--primary); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal; }
.skip-link { position: absolute; top: -100px; left: var(--space-3); z-index: 1000; background: var(--accent); color: #fff; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-weight: 600; transition: top 0.2s ease; }
.skip-link:focus { top: var(--space-3); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.section-title { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.4rem); margin-bottom: var(--space-2); }
.section-intro { color: var(--ink-muted); max-width: 44rem; }
.section-head { margin-bottom: var(--space-5); }
.text-center { text-align: center; }

/* -------------------------------------------------------------------- */
/* 4. Buttons                                                            */
/* -------------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700;
	font-size: 0.95rem; padding: 13px 28px; border-radius: 999px; border: 2px solid transparent;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--gradient-brand); color: var(--primary-ink); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(10, 92, 110, 0.28); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { box-shadow: 0 12px 28px rgba(255, 107, 74, 0.32); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); background: var(--teal-soft); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn-sm { padding: 9px 20px; font-size: 0.85rem; }

/* -------------------------------------------------------------------- */
/* 5. Header + nav                                                       */
/* -------------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 90;
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-3); }
.site-branding { margin-right: auto; }
.site-branding .custom-logo-link img { max-height: 44px; width: auto; }
.site-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.site-title:hover { color: var(--primary); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--primary); }

.main-navigation .nav-menu { display: flex; gap: var(--space-4); align-items: center; }
.main-navigation .nav-menu a { color: var(--ink-muted); font-size: 0.94rem; font-weight: 600; padding: var(--space-2) 0; position: relative; }
.main-navigation .nav-menu a:hover { color: var(--ink); text-decoration: none; }
.main-navigation .nav-menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--gradient-brand); transform: scaleX(0); transition: transform 0.2s ease; }
.main-navigation .nav-menu a:hover::after { transform: scaleX(1); }
.main-navigation .current-menu-item > a { color: var(--ink); }
.main-navigation .current-menu-item > a::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.icon-btn { background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink); transition: border-color 0.2s ease, color 0.2s ease; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.mobile-only { display: none; }

.nav-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: 100vh; height: 100dvh; background: rgba(6,28,36,0.55); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0.25s; z-index: 65; }
body.nav-open .nav-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
body.nav-open { overflow: hidden; }

@media (max-width: 860px) {
	.header-cta { display: none; }
	.main-navigation {
		position: fixed; top: 0; right: 0; bottom: 0; left: auto; height: 100vh; height: 100dvh;
		width: min(320px, 85vw); max-width: 100vw; background: var(--surface);
		transform: translateX(100%); transition: transform 0.25s ease; z-index: 80; padding: var(--space-6) var(--space-4);
		box-shadow: var(--shadow); overflow-y: auto; overflow-x: hidden; border-left: 1px solid var(--border); box-sizing: border-box;
	}
	.main-navigation .nav-menu { flex-direction: column; align-items: flex-start; gap: var(--space-3); width: 100%; }
	.main-navigation .nav-menu li { width: 100%; }
	.main-navigation .nav-menu a { white-space: normal; overflow-wrap: break-word; }
	body.nav-open .main-navigation { transform: translateX(0); }
	.mobile-only { display: grid; }
}

/* -------------------------------------------------------------------- */
/* 6. Generic page/post content                                          */
/* -------------------------------------------------------------------- */
.site-main { padding-block: var(--space-6); }
.page-header-block, .archive-header { text-align: center; max-width: var(--measure); margin: 0 auto var(--space-6); }
.page-header-block h1, .archive-header h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.7rem); }
.archive-description { color: var(--ink-muted); }

.entry-header { max-width: var(--measure); margin: 0 auto var(--space-5); text-align: center; }
.entry-title { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.8rem); }
.entry-content { max-width: var(--measure); margin-inline: auto; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.5rem; margin-top: var(--space-6); }
.entry-content h3 { font-size: 1.2rem; margin-top: var(--space-5); }
.entry-content p { margin-bottom: var(--space-4); color: var(--ink-muted); }
.entry-content ul, .entry-content ol { margin: 0 0 var(--space-4); padding-left: 1.3em; }
.entry-content li { margin-bottom: var(--space-2); color: var(--ink-muted); }
.entry-content ul { list-style: disc; }
.entry-content img { border-radius: var(--radius-sm); margin-block: var(--space-4); }
.entry-content blockquote { margin: var(--space-5) 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }
.entry-content hr { border: none; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

/* -------------------------------------------------------------------- */
/* 7. Forms                                                               */
/* -------------------------------------------------------------------- */
.field { margin-bottom: var(--space-3); text-align: left; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input, .field textarea {
	width: 100%; padding: 12px var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
	background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--teal-soft); }
.field textarea { min-height: 130px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-notice { padding: var(--space-3); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-weight: 600; }
.form-notice.success { background: var(--teal-soft); color: var(--primary-dark); }
.form-notice.error { background: var(--accent-soft); color: #a13a22; }

/* -------------------------------------------------------------------- */
/* 8. Footer                                                              */
/* -------------------------------------------------------------------- */
.site-footer { background: var(--primary-dark); color: #cfe3e6; margin-top: var(--space-7); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--space-5); padding-block: var(--space-6) var(--space-5); }
.footer-brand .site-title { color: #fff; }
.footer-brand .brand-mark { color: var(--accent); }
.footer-tagline { color: #9fc0c4; font-size: 0.95rem; margin-top: var(--space-2); }
.footer-social { display: inline-block; margin-top: var(--space-2); font-weight: 700; color: #fff; }
.footer-social:hover { color: var(--accent); }
.widget-title { font-family: var(--font-display); font-size: 1rem; color: #fff; margin-bottom: var(--space-3); }
.footer-menu-list { display: flex; flex-direction: column; gap: 10px; }
.footer-menu-list a { color: #b9d4d7; }
.footer-menu-list a:hover { color: #fff; }
.footer-contact a { color: #fff; font-weight: 700; }
.footer-note { color: #9fc0c4; font-size: 0.88rem; margin-top: var(--space-2); }
.site-info { border-top: 1px solid rgba(255,255,255,0.12); padding-block: var(--space-3); font-size: 0.85rem; color: #9fc0c4; }

.back-to-top { position: fixed; bottom: var(--space-4); right: var(--space-4); width: 44px; height: 44px; border-radius: 50%; background: var(--gradient-brand); color: #fff; border: none; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 1.1rem; z-index: 40; opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; }
.back-to-top.is-visible { opacity: 1; transform: translateY(0); }
.back-to-top[hidden] { display: none; }

/* -------------------------------------------------------------------- */
/* 9. 404                                                                 */
/* -------------------------------------------------------------------- */
.error-404 { text-align: center; padding-block: var(--space-7); max-width: var(--measure); margin-inline: auto; }
.error-404 .error-code { font-family: var(--font-display); font-size: clamp(4rem, 3rem + 4vw, 7rem); color: var(--accent); margin-bottom: var(--space-3); font-weight: 800; }

/* -------------------------------------------------------------------- */
/* 10. Responsive                                                         */
/* -------------------------------------------------------------------- */
@media (max-width: 900px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
	.footer-grid { grid-template-columns: 1fr; }
}
