/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--accent: #1f7a5c;
	--accent-strong: #165c45;
	--accent-soft: #e6f3ed;
	--bg: #f7faf8;
	--surface: #ffffff;
	--ink: #1c2a25;
	--muted: #5a6c65;
	--line: #dde8e3;
	--warn-bg: #fff7e6;
	--warn-line: #f0d9a6;
	--danger: #c0392b;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(20, 50, 40, .05), 0 8px 24px rgba(20, 50, 40, .06);
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Helvetica, Arial, sans-serif;
	--font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", "Noto Serif Devanagari", serif;
	--wrap: 1180px;
	--narrow: 720px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--accent: #5fc9a1;
		--accent-strong: #8fe0bf;
		--accent-soft: #17332a;
		--bg: #0e1a16;
		--surface: #15241f;
		--ink: #e6f0ec;
		--muted: #9bb0a8;
		--line: #243832;
		--warn-bg: #2a2412;
		--warn-line: #5a4a1c;
		--danger: #ff8a80;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
	}
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img, video, iframe, svg { max-width: 100%; height: auto; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; font-weight: 700; }

.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:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0; z-index: 1000;
	top: 8px; left: 8px; padding: 12px 18px; background: var(--surface); color: var(--ink);
	box-shadow: var(--shadow); border-radius: 8px; text-decoration: none; font-weight: 600;
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--narrow)); margin-inline: auto; }
.section { padding: 56px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); }
.section-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* Buttons */
.btn, .wp-block-button__link, .comment-form .submit, .search-form .search-submit {
	display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
	background: var(--accent); color: #fff; border: 2px solid var(--accent);
	padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none;
	transition: background .2s, transform .2s;
}
.btn:hover, .wp-block-button__link:hover, .comment-form .submit:hover, .search-form .search-submit:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent-strong); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) .comment-form .submit { color: #0e1a16; } :root:not([data-theme="light"]) .btn-ghost { color: var(--accent); } }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; margin-right: auto; flex: 1 1 auto; min-width: 0; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; max-width: 100%; }
.brand-link > span:last-child { min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 12px; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { display: block; font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tag { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-logo { max-height: 44px; width: auto; }

.primary-nav { flex: none; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.primary-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { background: var(--accent-soft); color: var(--accent-strong); }

.icon-btn { flex: none; width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.header-search { border-top: 1px solid var(--line); background: var(--surface); padding: 14px 0; }
.header-search[hidden] { display: none; }

@media (max-width: 860px) {
	.nav-toggle { display: inline-grid; }
	.primary-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 20px 18px; display: none; box-shadow: var(--shadow); }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
	.primary-nav a { padding: 12px 14px; }
}

/* Search form */
.search-form { display: flex; gap: 10px; }
.search-form label { flex: 1; }
.search-field, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea, .post-password-form input[type="password"] {
	width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit;
}
.search-field:focus, .comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }

/* Reading progress */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }
.admin-bar .read-progress { top: 32px; }

/* ==========================================================================
   Home hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; background: linear-gradient(180deg, var(--accent-soft), var(--bg)); border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .4em; }
.hero p { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { position: absolute; right: -60px; top: -40px; width: 520px; max-width: 60vw; opacity: .9; color: var(--accent); pointer-events: none; }
@media (max-width: 760px) { .hero { padding: 48px 0 40px; } .hero-art { opacity: .35; right: -140px; } }

/* ==========================================================================
   Cards & grids
   ========================================================================== */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Only post cards belong in the grid. Anything a plugin injects between them (ad slots, auto-placed ad wrappers,
   empty widget boxes) would take up a grid cell and leave a hole, so those are removed from the layout. */
.grid > :not(.card) { display: none !important; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--accent-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.card-ph svg { width: 56px; height: 56px; opacity: .55; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { font-size: 1.2rem; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent-strong); text-decoration: underline; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .96rem; }
.card-meta, .entry-meta { margin-top: auto; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.chip { align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; color: var(--accent-strong); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.chip:hover { background: var(--accent); color: #fff; }

/* Featured block */
.featured { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.featured .card-large { grid-row: span 2; }
.card-large .card-media { aspect-ratio: 16 / 9; }
.card-large .card-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.card-large .card-body { padding: 26px 28px 28px; }
.featured .card-side { flex-direction: row; }
.featured .card-side .card-media { width: 40%; aspect-ratio: auto; flex: none; }
.featured .card-side .card-body { padding: 16px 18px; }
.featured .card-side .card-excerpt { display: none; }
@media (max-width: 900px) { .featured { grid-template-columns: minmax(0, 1fr); } .featured .card-large { grid-row: auto; } }
@media (max-width: 520px) { .featured .card-side { flex-direction: column; } .featured .card-side .card-media { width: 100%; aspect-ratio: 16/10; } }

/* Topic tiles */
.topics { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .topics { grid-template-columns: minmax(0, 1fr); } }
.topic > span:last-child { min-width: 0; }
.topic-name, .tool-name { overflow-wrap: anywhere; }
.topic { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.topic:hover { border-color: var(--accent); transform: translateY(-2px); }
.topic-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.topic-name { display: block; font-weight: 600; line-height: 1.25; }
.topic-count { font-size: .82rem; color: var(--muted); }

.band { background: var(--surface); border-block: 1px solid var(--line); }

/* ==========================================================================
   Archive / search headers, pagination
   ========================================================================== */
.page-head { padding: 48px 0 12px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .3em; }
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; }
.page-head .search-form { margin-top: 18px; max-width: 520px; }
.archive-body { padding: 24px 0 64px; }

.pagination, .navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers { min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); color: var(--ink); font-weight: 600; }
a.page-numbers:hover { background: var(--accent-soft); }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-numbers.current { color: #0e1a16; } }

.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ==========================================================================
   Single post & pages
   ========================================================================== */
.entry-header { padding: 48px 0 24px; }
.entry-header .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.entry-title { margin-bottom: .45em; }
.entry-lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 20px; }
.entry-meta { margin: 0; font-size: .9rem; }
.entry-meta .avatar { border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.entry-meta a { color: var(--ink); text-decoration: none; font-weight: 600; }
.reviewed { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 14px; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; font-size: .88rem; font-weight: 600; }
.reviewed svg { width: 18px; height: 18px; }

.entry-figure { width: min(100% - 40px, 960px); margin: 8px auto 32px; }
.entry-figure img { width: 100%; border-radius: var(--radius); display: block; }
.entry-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; text-align: center; }

.entry-content { font-size: 1.125rem; line-height: 1.8; padding-bottom: 24px; }
.entry-content > * { max-width: min(var(--narrow), 100%); margin-inline: auto; }
.entry-content > .alignwide { max-width: min(980px, 100%); }
.entry-content > .alignfull { max-width: none; }
.entry-content > * + * { margin-top: 1.4em; margin-bottom: 0; }
.entry-content h2 { font-size: 1.75rem; margin-top: 2.2em; scroll-margin-top: 90px; }
.entry-content h3 { font-size: 1.35rem; margin-top: 1.8em; scroll-margin-top: 90px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }
.entry-content blockquote, .wp-block-quote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 18px 24px; border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--font-head); font-size: 1.2rem; }
.entry-content blockquote p { margin: 0; }
.entry-content blockquote cite { display: block; margin-top: 10px; font: .85rem var(--font-body); color: var(--muted); }
.entry-content img { border-radius: 10px; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--accent-soft); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); }
.entry-content pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: 10px; font-size: .9rem; }
.page-links { font-weight: 600; }
.entry-content { overflow-wrap: anywhere; }
.entry-content input, .entry-content select, .entry-content textarea, .entry-content button { max-width: 100%; font: inherit; }
.entry-content iframe, .entry-content video, .entry-content embed { max-width: 100%; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { margin: 0; }

/* Table of contents */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; font-size: 1rem; line-height: 1.5; }
.toc-title { font: 700 .8rem var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li + li { margin-top: 6px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Disclaimer */
.disclaimer { display: flex; gap: 14px; align-items: flex-start; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 18px 20px; font-size: .95rem; margin-block: 32px; }
.disclaimer svg { width: 24px; height: 24px; flex: none; color: #b7791f; margin-top: 2px; }
.disclaimer p { margin: 0; }
.disclaimer strong { display: block; margin-bottom: 2px; }

.entry-footer { padding: 8px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: .85rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--surface); }
.tags a:hover { border-color: var(--accent); color: var(--accent-strong); }

.author-box { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); margin-block: 28px; }
.author-box .avatar { border-radius: 50%; flex: none; }
.author-box h3 { margin: 0 0 4px; font-size: 1.1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .95rem; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block: 28px; }
.post-nav a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav .prev:only-child { grid-column: 1; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: auto; } }

/* Comments */
.comments { padding: 24px 0 56px; }
.comments-title { font-size: 1.4rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .88rem; color: var(--muted); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-author .fn { font-weight: 700; font-style: normal; color: var(--ink); }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--muted); text-decoration: none; }
.reply a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.comment-form p { margin: 0 0 16px; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: center; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.comment-notes, .logged-in-as { color: var(--muted); font-size: .9rem; }

/* Breadcrumbs (Yoast / Rank Math) */
.breadcrumbs, #breadcrumbs, .rank-math-breadcrumb { font-size: .85rem; color: var(--muted); margin: 0 0 14px; }
.breadcrumbs a, #breadcrumbs a, .rank-math-breadcrumb a { color: var(--muted); }

/* 404 */
.notfound { text-align: center; padding: 88px 0; }
.notfound .big { font-family: var(--font-head); font-size: clamp(4rem, 14vw, 8rem); color: var(--accent); line-height: 1; margin: 0 0 12px; }
.notfound .search-form { max-width: 480px; margin: 24px auto 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-widgets { display: grid; gap: 32px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 48px 0 8px; }
@media (max-width: 760px) { .footer-widgets { grid-template-columns: minmax(0, 1fr); } }
.widget { margin-bottom: 24px; }
.widget-title { font-size: 1.05rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 5px 0; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }
.footer-bar { padding: 28px 0 40px; display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: flex-start; border-top: 1px solid var(--line); margin-top: 16px; }
.footer-note { max-width: 62ch; font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.footer-copy { font-size: .85rem; color: var(--muted); margin: 0; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; }
.footer-nav a { font-size: .9rem; color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent-strong); text-decoration: underline; }

/* WordPress core alignment & captions */
.alignleft { float: left; margin: .4em 1.4em 1em 0; }
.alignright { float: right; margin: .4em 0 1em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: .85rem; color: var(--muted); }
.sticky .card-title::before { content: "★ "; color: var(--accent); }
.bypostauthor > .comment-body .fn::after { content: " · Author"; font-size: .75rem; color: var(--accent-strong); }

@media print {
	.site-header, .site-footer, .comments, .read-progress, .post-nav, .hero-art { display: none !important; }
	body { background: #fff; color: #000; }
}

/* ==========================================================================
   Health tools tiles (homepage) & full-width page template
   ========================================================================== */
.tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tool { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; transition: border-color .2s, transform .2s; }
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.tool-ico svg { width: 22px; height: 22px; }
.tools-section { padding-bottom: 8px; }
.page-wide .entry-content > * { max-width: none; }

/* ==========================================================================
   Long / bilingual titles and Hindi (Devanagari) typography
   ========================================================================== */
.card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-large .card-title { -webkit-line-clamp: 4; }
.card-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.entry-title { font-size: clamp(1.6rem, 3.8vw, 2.4rem); overflow-wrap: anywhere; }

/* Devanagari has tall headline-bars and stacked matras: more line height, no tight tracking, sans headings. */
html:lang(hi) { --font-head: var(--font-body); }
html:lang(hi) body { line-height: 1.75; }
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3, html:lang(hi) h4 { line-height: 1.4; letter-spacing: 0; }
html:lang(hi) .hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
html:lang(hi) .entry-content { line-height: 1.95; }
html:lang(hi) .chip, html:lang(hi) .kicker, html:lang(hi) .toc-title { letter-spacing: 0; text-transform: none; }
html:lang(hi) .card-title { line-height: 1.5; }

/* ==========================================================================
   Small-screen refinements
   ========================================================================== */
@media (max-width: 860px) {
	.header-inner { gap: 10px; min-height: 60px; }
	/* Long site titles wrap onto two lines instead of being pushed under the buttons. */
	.brand-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
	.brand-tag { display: none; }
	.brand-mark { width: 34px; height: 34px; border-radius: 10px; }
	.icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 520px) {
	.wrap, .wrap-narrow, .entry-figure { width: min(100% - 32px, var(--wrap)); }
	.wrap-narrow { width: min(100% - 32px, var(--narrow)); }
	.section { padding: 40px 0; }
	.entry-header { padding: 32px 0 16px; }
	.entry-content { font-size: 1.05rem; }
	.hero-actions .btn { flex: 1 1 100%; justify-content: center; }
	.card-body, .card-large .card-body { padding: 16px 18px 18px; }
	.author-box { flex-direction: column; }
	.search-form { flex-direction: column; }
	.search-form .search-submit { justify-content: center; }
	.header-search .search-form { flex-direction: row; }
}

/* ==========================================================================
   "Always dark" colour scheme (Customizer) and header cart badge
   ========================================================================== */
:root[data-theme="dark"] {
	--accent: #5fc9a1; --accent-strong: #8fe0bf; --accent-soft: #17332a;
	--bg: #0e1a16; --surface: #15241f; --ink: #e6f0ec; --muted: #9bb0a8; --line: #243832;
	--warn-bg: #2a2412; --warn-line: #5a4a1c; --danger: #ff8a80;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
:root[data-theme="dark"] .btn, :root[data-theme="dark"] .comment-form .submit, :root[data-theme="dark"] .page-numbers.current { color: #0e1a16; }
:root[data-theme="dark"] .btn-ghost { color: var(--accent); }

.hblog-cart-link { position: relative; text-decoration: none; }
.hblog-cart-link .cart-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
:root[data-theme="dark"] .hblog-cart-link .cart-count { color: #0e1a16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hblog-cart-link .cart-count { color: #0e1a16; } }

/* ==========================================================================
   Third-party boxes inside posts
   ========================================================================== */
/* Safety net: a calculator or embed that is wider than the screen can't make the whole page scroll sideways. */
body { overflow-x: clip; }

/* Community links dropped into posts (WhatsApp / Telegram channel links) become clear buttons. */
.entry-content a[href*="whatsapp.com"], .entry-content a[href*="wa.me"], .entry-content a[href*="t.me/"], .entry-content a[href*="telegram.me"] {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; background: #0b7a6f; color: #fff !important;
	font-weight: 700; text-decoration: none !important; line-height: 1.3; transition: background .2s;
}
.entry-content a[href*="t.me/"], .entry-content a[href*="telegram.me"] { background: #1a76a3; }
.entry-content a[href*="whatsapp.com"]:hover, .entry-content a[href*="wa.me"]:hover { background: #095f56; }
.entry-content a[href*="t.me/"]:hover, .entry-content a[href*="telegram.me"]:hover { background: #145c7e; }
.entry-content a[href*="whatsapp.com"] strong, .entry-content a[href*="wa.me"] strong, .entry-content a[href*="t.me/"] strong { color: inherit; }

/* ==========================================================================
   Mobile hardening (v1.3)
   ========================================================================== */

/* ---- Sub-menus --------------------------------------------------------- */
.primary-nav .menu-item-has-children { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.primary-nav .menu-item-has-children > a { flex: 1 1 auto; }
.sub-toggle { flex: none; width: 36px; height: 36px; margin-left: -6px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.sub-toggle:hover { background: var(--accent-soft); color: var(--accent-strong); }
.sub-toggle svg { transition: transform .2s; }
.is-open > .sub-toggle svg { transform: rotate(180deg); }
.primary-nav .sub-menu { display: none; list-style: none; margin: 0; padding: 6px; flex-basis: 100%; }
.primary-nav .is-open > .sub-menu { display: block; }
@media (min-width: 861px) {
	.primary-nav .sub-menu { position: absolute; top: 100%; left: 0; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; flex-direction: column; }
	.primary-nav .menu-item-has-children:hover > .sub-menu, .primary-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
	.primary-nav .sub-menu a { border-radius: 10px; white-space: nowrap; }
}
@media (max-width: 860px) {
	.primary-nav { max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto; overscroll-behavior: contain; }
	.primary-nav .sub-menu { padding: 0 0 6px 14px; }
	.sub-toggle { width: 44px; height: 44px; margin-left: 0; }
}

/* ---- Legacy / third-party content inside posts ------------------------- */
:where(.entry-content) :where(div, section, figure, form, table, img, video, iframe, embed, object, ins, canvas, svg, input, select, textarea, pre) { max-width: 100%; }
.entry-content :where(input, select, textarea) { box-sizing: border-box; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="youtu.be"], .entry-content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.entry-content ins.adsbygoogle { display: block; max-width: 100%; overflow: hidden; margin-inline: auto; }
.entry-content img[width][height] { height: auto; }
.entry-content .wp-block-image img, .entry-content figure img { height: auto; }

/* ---- Logo -------------------------------------------------------------- */
.custom-logo-link { display: block; max-width: 100%; }
.custom-logo { max-width: 100%; height: auto; }

/* ---- Touch devices ----------------------------------------------------- */
@media (hover: none) {
	.card:hover, .topic:hover, .tool:hover, .btn:hover, ul.products li.product:hover { transform: none; box-shadow: none; }
	.card:hover .card-title a { text-decoration: none; }
}

/* ---- Phones ------------------------------------------------------------ */
@media (max-width: 600px) {
	.alignleft, .alignright { float: none; display: block; margin: 1em auto; }
	.btn, .comment-form .submit, .search-form .search-submit { min-height: 46px; justify-content: center; }
	.tags a { padding: 9px 14px; }
	.section-link { display: inline-block; padding: 8px 0; }
	.footer-nav ul { gap: 0 18px; }
	.footer-nav a { display: block; padding: 10px 0; }
	.reply a, .comment-metadata a { display: inline-block; padding: 6px 0; }
	.comment-list .children { padding-left: 14px; }
	.post-nav a { padding: 14px 16px; }
	.author-box { padding: 18px; }
	.disclaimer { padding: 16px; }
	.toc { padding: 16px 18px; }
	.toc li { padding: 2px 0; }
	.entry-meta { gap: 6px 12px; }
	.page-head { padding-top: 32px; }
	.notfound { padding: 56px 0; }
}
@media (max-width: 380px) {
	.hero { padding: 36px 0 32px; }
	.hero p { font-size: 1.05rem; }
	.entry-content { font-size: 1rem; line-height: 1.8; }
	.section-head h2 { font-size: 1.35rem; }
}

/* Landscape phones: keep the sticky header compact. */
@media (max-height: 480px) and (orientation: landscape) {
	.header-inner { min-height: 52px; }
	.site-header { position: static; }
}

/* ---- Forms on touch screens: 16px+ text (prevents iOS zoom-on-focus) and comfortable tap height ---- */
@media (max-width: 600px) {
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]), select, textarea { font-size: max(16px, 1rem); }
	.chip { padding: 8px 14px; }
	.author-box h3 a { display: inline-block; padding: 6px 0; }
}
.entry-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, button, textarea) { min-height: 44px; }
.entry-content :where(select, input:not([type="checkbox"]):not([type="radio"])) { padding-inline: 12px; }

/* ---- Any touch device (phones, tablets): bigger tap targets ---- */
@media (pointer: coarse) {
	.footer-nav a { display: block; padding: 10px 0; }
	.reply a, .comment-metadata a { display: inline-block; padding: 10px 12px; }
	.tags a { padding: 9px 14px; }
	.chip { padding: 8px 14px; }
	.author-box h3 a { display: inline-block; padding: 8px 0; }
	.brand-link { min-height: 44px; }
	.section-link { display: inline-block; padding: 10px 0; }
}

/* ==========================================================================
   Table-of-contents plugins in dark mode
   Easy Table of Contents (and TOC+/LuckyWP) ship a light box. Instead of a white
   slab with inherited light text, restyle it to match the theme. "!important" is
   deliberate: the plugins print their own CSS after the theme's.
   ========================================================================== */
:root[data-theme="dark"] body #ez-toc-container,
:root[data-theme="dark"] body #toc_container,
:root[data-theme="dark"] body .lwptoc_i {
	background: var(--surface) !important; border: 1px solid var(--line) !important; box-shadow: none !important; color: var(--ink) !important;
}
:root[data-theme="dark"] body #ez-toc-container :is(p, span, div, li, h2, h3, nav, .ez-toc-title, .ez-toc-title *, .ez-toc-title-container *, .toc_title, .lwptoc_title),
:root[data-theme="dark"] body #toc_container :is(p, span, li, .toc_title),
:root[data-theme="dark"] body .lwptoc_i :is(p, span, li, div) { color: var(--ink) !important; }
:root[data-theme="dark"] body #ez-toc-container a, :root[data-theme="dark"] body #toc_container a, :root[data-theme="dark"] body .lwptoc_i a { color: var(--accent) !important; }
:root[data-theme="dark"] body #ez-toc-container a:hover, :root[data-theme="dark"] body #toc_container a:hover, :root[data-theme="dark"] body .lwptoc_i a:hover { color: var(--accent-strong) !important; }
:root[data-theme="dark"] body #ez-toc-container .ez-toc-btn, :root[data-theme="dark"] body #ez-toc-container a.ez-toc-toggle { background: transparent !important; border: 1px solid var(--line) !important; box-shadow: none !important; color: var(--ink) !important; }
:root[data-theme="dark"] body #ez-toc-container .ez-toc-icon-toggle-span svg, :root[data-theme="dark"] body #ez-toc-container .ez-toc-icon-toggle-span svg * { fill: var(--ink) !important; color: var(--ink) !important; }

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) body #ez-toc-container, :root:not([data-theme="light"]) body #toc_container, :root:not([data-theme="light"]) body .lwptoc_i {
		background: var(--surface) !important; border: 1px solid var(--line) !important; box-shadow: none !important; color: var(--ink) !important;
	}
	:root:not([data-theme="light"]) body #ez-toc-container :is(p, span, div, li, h2, h3, nav, .ez-toc-title, .ez-toc-title *, .ez-toc-title-container *, .toc_title, .lwptoc_title),
	:root:not([data-theme="light"]) body #toc_container :is(p, span, li, .toc_title),
	:root:not([data-theme="light"]) body .lwptoc_i :is(p, span, li, div) { color: var(--ink) !important; }
	:root:not([data-theme="light"]) body #ez-toc-container a, :root:not([data-theme="light"]) body #toc_container a, :root:not([data-theme="light"]) body .lwptoc_i a { color: var(--accent) !important; }
	:root:not([data-theme="light"]) body #ez-toc-container .ez-toc-btn, :root:not([data-theme="light"]) body #ez-toc-container a.ez-toc-toggle { background: transparent !important; border: 1px solid var(--line) !important; box-shadow: none !important; color: var(--ink) !important; }
	:root:not([data-theme="light"]) body #ez-toc-container .ez-toc-icon-toggle-span svg, :root:not([data-theme="light"]) body #ez-toc-container .ez-toc-icon-toggle-span svg * { fill: var(--ink) !important; color: var(--ink) !important; }
}

/* Light mode: the plugin's default pale-grey TOC heading is hard to read; use dark text (dark-mode rules above win in dark). */
body #ez-toc-container p.ez-toc-title, body #ez-toc-container .ez-toc-title { color: #1c2a25 !important; }

/* ==========================================================================
   Desktop menu with many / long items: items that don't fit move into "More"
   ========================================================================== */
@media (min-width: 861px) {
	.brand { flex: 0 0 auto; margin-right: 0; max-width: 340px; }
	.brand-name { max-width: 270px; }
	.primary-nav { flex: 1 1 0; min-width: 0; display: block; }
	.primary-nav > ul { width: max-content; max-width: 100%; margin-left: auto; flex-wrap: nowrap; }
	.primary-nav > ul > li { flex: none; }
	.primary-nav > ul > li > a { white-space: nowrap; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
	/* hide until the first fit calculation so the menu never flashes in overflowing */
	html.js:not(.nav-ready) .primary-nav > ul { visibility: hidden; }
}
.hblog-more[hidden] { display: none !important; }
.hblog-more > .more-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-weight: 500; font-size: .95rem; cursor: pointer; }
.hblog-more > .more-toggle:hover, .hblog-more.is-open > .more-toggle { background: var(--accent-soft); color: var(--accent-strong); }
.hblog-more.is-open > .more-toggle svg { transform: rotate(180deg); }
.hblog-more > .sub-menu { right: 0; left: auto; width: max-content; max-width: 340px; }
.hblog-more .sub-menu a { white-space: normal; }
.hblog-more .sub-toggle { display: none; }
.hblog-more .sub-menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; background: none; padding: 0 0 0 12px; min-width: 0; }
.hblog-more .menu-item-has-children { display: block; }

/* ==========================================================================
   Easy Table of Contents: one clean toggle button, title and toggle on one row
   (the plugin draws an extra bordered box around its toggle and a gold focus ring after a tap)
   ========================================================================== */
body #ez-toc-container .ez-toc-title-container { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: auto; }
body #ez-toc-container p.ez-toc-title { display: block !important; flex: 1 1 auto; margin: 0 !important; padding: 0 !important; }
body #ez-toc-container .ez-toc-title-toggle { display: block !important; flex: none; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
body #ez-toc-container .ez-toc-title-toggle .ez-toc-js-icon-con, body #ez-toc-container .ez-toc-title-toggle a > span, body #ez-toc-container .ez-toc-title-toggle a > span > span { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; display: inline-flex; align-items: center; }
body #ez-toc-container a.ez-toc-toggle { float: none !important; margin: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 10px !important; border: 1px solid var(--line) !important; border-radius: 10px !important; background: transparent !important; box-shadow: none !important; text-decoration: none; outline: none; }
body #ez-toc-container a.ez-toc-toggle:hover { background: var(--accent-soft) !important; }
body #ez-toc-container a.ez-toc-toggle:focus { outline: none !important; }
body #ez-toc-container a.ez-toc-toggle:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* ==========================================================================
   Dark / light switch (header button)
   Shows a sun while the page is dark (tap = go light) and a moon while light.
   ========================================================================== */
.scheme-toggle { cursor: pointer; }
.scheme-toggle > span { display: grid; place-items: center; }
.scheme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .scheme-toggle .i-sun { display: grid; }
:root[data-theme="dark"] .scheme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .scheme-toggle .i-sun { display: grid; }
	:root:not([data-theme]) .scheme-toggle .i-moon { display: none; }
}
/* Elementor pages always stay light, so the switch is hidden there. */
:root[data-scheme-locked] .scheme-toggle { display: none; }
