/* =========================================================================
   eHealth Sewa — Main Stylesheet
   Mobile-first, dependency-free, performance-conscious.
   ========================================================================= */

/* ---- 1. Custom properties (mirrors theme.json palette for non-block markup) */
:root {
	--ehs-primary: #0f6e5c;
	--ehs-primary-dark: #0a4c40;
	--ehs-accent: #2f9e8f;
	--ehs-sky: #e8f6f3;
	--ehs-ink: #1a2b2a;
	--ehs-body-text: #3c4a49;
	--ehs-muted: #6b7d7b;
	--ehs-white: #ffffff;
	--ehs-alert: #c0392b;
	--ehs-border: #dfe9e7;
	--ehs-radius: 10px;
	--ehs-shadow: 0 4px 18px rgba(15, 110, 92, 0.08);
	--ehs-max: 1160px;
	--ehs-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--ehs-font-heading: 'Lora', Georgia, 'Times New Roman', serif;
}

/* ---- 2. Reset / base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--ehs-font-body);
	font-size: 1rem;
	line-height: 1.7;
	color: var(--ehs-body-text);
	background: var(--ehs-white);
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ehs-primary); text-decoration: none; }
a:hover, a:focus { color: var(--ehs-primary-dark); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--ehs-font-heading);
	color: var(--ehs-ink);
	line-height: 1.25;
	margin: 0 0 0.6em;
	font-weight: 700;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.4em; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
figure { margin: 0 0 1.5em; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; }
table th, table td { border: 1px solid var(--ehs-border); padding: 0.6em 0.8em; text-align: left; }

/* Accessibility helpers */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link {
	left: -9999px;
	top: 0;
	position: absolute;
	z-index: 100000;
	background: var(--ehs-primary);
	color: var(--ehs-white);
	padding: 0.9em 1.2em;
	border-radius: 0 0 6px 0;
}
.skip-link:focus {
	left: 0;
}
:focus-visible {
	outline: 3px solid var(--ehs-accent);
	outline-offset: 2px;
}

/* ---- 3. Layout helpers --------------------------------------------------*/
.ehs-container {
	max-width: var(--ehs-max);
	margin-inline: auto;
	padding-inline: 1.25rem;
}
.ehs-page-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	padding-block: 2.5rem;
}
.no-sidebar .ehs-page-layout,
.ehs-front-page-content {
	grid-template-columns: 1fr;
}
@media (min-width: 900px) {
	body:not(.no-sidebar) .ehs-page-layout {
		grid-template-columns: 2.2fr 1fr;
		align-items: start;
	}
}

/* ---- 4. Utility bar + Header --------------------------------------------*/
.ehs-utility-bar {
	background: var(--ehs-primary-dark);
	color: var(--ehs-white);
	font-size: 0.85rem;
}
.ehs-utility-bar p { margin: 0; padding: 0.45em 0; text-align: center; }

.site-header {
	border-bottom: 1px solid var(--ehs-border);
	background: var(--ehs-white);
	position: sticky;
	top: 0;
	z-index: 500;
}
.ehs-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding-block: 0.9rem;
}
.site-branding { display: flex; flex-direction: column; }
.site-title { margin: 0; font-size: 1.4rem; }
.site-title a { color: var(--ehs-ink); }
.site-description { margin: 0; font-size: 0.85rem; color: var(--ehs-muted); }
.custom-logo { max-height: 60px; width: auto; }

/* Primary nav */
.main-navigation { order: 3; flex-basis: 100%; }
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: none;
	flex-direction: column;
}
.main-navigation ul.open { display: flex; }
.main-navigation li { border-top: 1px solid var(--ehs-border); }
.main-navigation a {
	display: block;
	padding: 0.85em 0.2em;
	color: var(--ehs-ink);
	font-weight: 600;
}
.main-navigation ul ul { padding-left: 1rem; }
.menu-toggle {
	background: none;
	border: 1px solid var(--ehs-border);
	border-radius: 8px;
	padding: 0.5em 0.7em;
	cursor: pointer;
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
}
.menu-toggle-bar {
	width: 22px;
	height: 2px;
	background: var(--ehs-ink);
	display: block;
}

.ehs-header-actions { display: flex; align-items: center; gap: 0.9rem; }
.ehs-header-phone { font-weight: 600; color: var(--ehs-ink); white-space: nowrap; }
.ehs-header-phone:hover { color: var(--ehs-primary); }

@media (min-width: 900px) {
	.main-navigation { order: 2; flex-basis: auto; }
	.main-navigation ul { display: flex !important; flex-direction: row; gap: 1.6rem; }
	.main-navigation li { border-top: none; position: relative; }
	.main-navigation a { padding: 0.4em 0; }
	.main-navigation ul ul {
		position: absolute;
		top: 100%; left: 0;
		background: var(--ehs-white);
		box-shadow: var(--ehs-shadow);
		border-radius: 8px;
		min-width: 200px;
		padding: 0.5em;
		display: none;
		flex-direction: column;
	}
	.main-navigation li:hover > ul,
	.main-navigation li:focus-within > ul { display: flex; }
	.menu-toggle { display: none; }
}

/* Breadcrumbs */
.ehs-breadcrumbs { padding-top: 1rem; font-size: 0.85rem; color: var(--ehs-muted); }
.ehs-breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4em; }
.ehs-breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 0.4em; color: var(--ehs-border); }

/* ---- 5. Buttons ----------------------------------------------------------*/
.ehs-btn, .wp-element-button, .wp-block-button__link {
	display: inline-block;
	padding: 0.75em 1.4em;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	text-decoration: none;
}
.ehs-btn-primary { background: var(--ehs-primary); color: var(--ehs-white); }
.ehs-btn-primary:hover { background: var(--ehs-primary-dark); color: var(--ehs-white); }
.ehs-btn-outline { background: transparent; border-color: var(--ehs-primary); color: var(--ehs-primary); }
.ehs-btn-outline:hover { background: var(--ehs-sky); }
.ehs-btn-lg { padding: 0.95em 1.8em; font-size: 1.05rem; }

/* ---- 6. Hero (front page) -------------------------------------------------*/
.ehs-hero { background: linear-gradient(135deg, var(--ehs-sky), #ffffff); border-bottom: 1px solid var(--ehs-border); }
.ehs-hero-inner {
	display: grid;
	gap: 2rem;
	padding-block: clamp(2.5rem, 6vw, 5rem);
	align-items: center;
}
.ehs-hero-lead { font-size: 1.15rem; color: var(--ehs-muted); max-width: 46ch; }
.ehs-hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.2rem; }
.ehs-hero-media img { border-radius: var(--ehs-radius); box-shadow: var(--ehs-shadow); }
@media (min-width: 900px) {
	.ehs-hero-inner { grid-template-columns: 1.1fr 1fr; }
}

/* ---- 7. Post grid / cards --------------------------------------------------*/
.ehs-post-grid {
	display: grid;
	gap: 1.75rem;
	grid-template-columns: 1fr;
}
@media (min-width: 640px) {
	.ehs-post-grid { grid-template-columns: repeat(2, 1fr); }
}
.ehs-card {
	border: 1px solid var(--ehs-border);
	border-radius: var(--ehs-radius);
	overflow: hidden;
	background: var(--ehs-white);
	box-shadow: var(--ehs-shadow);
	display: flex;
	flex-direction: column;
}
.ehs-card-thumb img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.ehs-card-body { padding: 1.3rem; flex: 1; display: flex; flex-direction: column; }
.entry-meta { font-size: 0.85rem; color: var(--ehs-muted); margin-bottom: 0.6em; }
.entry-title a { color: var(--ehs-ink); }
.ehs-read-more { margin-top: auto; }

/* Single post / page content typography */
.entry-content { max-width: 74ch; }
.entry-content img, .entry-content figure { border-radius: var(--ehs-radius); }
.ehs-page-content .entry-content { max-width: none; }
.ehs-page-thumb img { border-radius: var(--ehs-radius); margin-bottom: 1.5rem; width: 100%; aspect-ratio: 16/7; object-fit: cover; }

/* Post navigation */
.post-navigation, .navigation.pagination { margin-top: 2.5rem; }
.nav-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.nav-subtitle { display: block; font-size: 0.8rem; color: var(--ehs-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.4em; height: 2.4em; margin: 0.2em;
	border: 1px solid var(--ehs-border); border-radius: 6px; text-decoration: none;
}
.pagination .page-numbers.current { background: var(--ehs-primary); color: var(--ehs-white); border-color: var(--ehs-primary); }

/* ---- 8. Sidebar & widgets -------------------------------------------------*/
.widget { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--ehs-border); }
.widget:last-child { border-bottom: none; }
.widget-title { font-size: 1.1rem; margin-bottom: 0.6em; }

/* ---- 9. Comments -----------------------------------------------------------*/
.comments-area { margin-top: 3rem; border-top: 1px solid var(--ehs-border); padding-top: 2rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { border: 1px solid var(--ehs-border); border-radius: var(--ehs-radius); padding: 1.1rem; margin-bottom: 1rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 0.7em; border: 1px solid var(--ehs-border); border-radius: 8px; margin-bottom: 1em;
}

/* Search form */
.ehs-search-form { display: flex; gap: 0.5em; }
.ehs-search-form .search-field { flex: 1; padding: 0.7em; border: 1px solid var(--ehs-border); border-radius: 8px; }

/* ---- 10. Footer ------------------------------------------------------------*/
.site-footer { background: var(--ehs-primary-dark); color: #d7ece7; padding-block: 3rem 1.5rem; margin-top: 3rem; }
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: var(--ehs-sky); }
.ehs-footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 720px) { .ehs-footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.ehs-footer-title { font-size: 1.2rem; color: #fff; font-weight: 700; }
.ehs-footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5em; }
.ehs-footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.2rem; font-size: 0.85rem; }
.ehs-footer-disclaimer { color: #9fc4bc; }

/* ---- 11. Responsive embeds -------------------------------------------------*/
.ehs-embed-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin-bottom: 1.5em; }
.ehs-embed-responsive iframe, .ehs-embed-responsive object, .ehs-embed-responsive embed {
	position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* ---- 12. Reduced motion --------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
