/*
Theme Name: Shift India
Theme URI: https://shiftindia.com
Author: Shift Media Ventures
Description: Hindi-first, mobile-first news theme for Shift India. Neem-green brand system, light and dark modes, reader controls (text size, listen, save), the four-block Shift story format, NewsArticle structured data, and fixed-height ad slots. No jQuery.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shift-india
Tags: news, blog, custom-logo, custom-menu, featured-images, translation-ready, rtl-language-support, threaded-comments
*/

/* ---------- 1. Tokens ---------- */
:root {
	--paper: #FAF8F4;
	--surface: #FFFFFF;
	--ink: #111418;
	--slate: #5B6470;
	--line: #E4E0D8;
	--brand: #1F6B4A;
	--brand-ink: #FFFFFF;
	--brand-soft: #E6F0EA;
	--signal: #C8371F;
	--haldi: #E0A526;
	--haldi-soft: #FBF3DC;

	--font-head: "Anek Devanagari", "Noto Sans Devanagari", system-ui, sans-serif;
	--font-read: "Tiro Devanagari Hindi", "Noto Serif Devanagari", Georgia, serif;
	--font-ui: "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;

	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
	--radius-img: 4px;
	--radius-card: 12px;
	--wrap: 1200px;
	--read: 720px;
	--reader-scale: 1;
	--tabbar-h: 60px;
}
:root[data-theme="dark"] {
	--paper: #0F1412;
	--surface: #171D1A;
	--ink: #F2F0EA;
	--slate: #A3ABB5;
	--line: #2A322E;
	--brand: #6FCF9B;
	--brand-ink: #0F1412;
	--brand-soft: #17271F;
	--signal: #FF7A5C;
	--haldi: #F0C04A;
	--haldi-soft: #2A2412;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--paper: #0F1412; --surface: #171D1A; --ink: #F2F0EA; --slate: #A3ABB5; --line: #2A322E;
		--brand: #6FCF9B; --brand-ink: #0F1412; --brand-soft: #17271F; --signal: #FF7A5C;
		--haldi: #F0C04A; --haldi-soft: #2A2412;
	}
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-ui);
	font-size: 16px;
	line-height: 1.6;
	padding-bottom: var(--tabbar-h);
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0 0 var(--s4); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: var(--s4); top: -100px; background: var(--brand); color: var(--brand-ink); padding: var(--s3) var(--s4); z-index: 100; border-radius: 8px; }
.skip-link:focus { top: var(--s2); color: var(--brand-ink); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-comfort="1"] * { animation: none !important; transition: none !important; }

/* ---------- 3. Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; }
.brand { display: flex; align-items: center; gap: var(--s2); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: var(--brand-ink); }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1; }
.brand-tag { display: none; font-size: 12px; color: var(--slate); margin-left: var(--s2); }
.custom-logo { max-height: 40px; width: auto; }
.header-actions { display: flex; align-items: center; gap: var(--s1); }
.icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 48px; min-height: 48px; background: none; border: 0; border-radius: 50%;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.lang-switch { font-weight: 600; font-size: 14px; }
.theme-toggle .icon-moon, :root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.desk-rail { border-top: 1px solid var(--line); }
.desk-rail ul { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: var(--s2) 0; overflow-x: auto; scrollbar-width: none; }
.desk-rail ul::-webkit-scrollbar { display: none; }
.desk-rail a {
	display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4);
	border: 1px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 15px; white-space: nowrap; background: var(--surface);
}
.desk-rail .current-menu-item > a, .desk-rail a:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.search-panel { display: none; border-top: 1px solid var(--line); padding: var(--s3) 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: var(--s2); }
.search-field {
	flex: 1; min-height: 48px; padding: 0 var(--s4); font: inherit; color: var(--ink);
	background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
	min-height: 48px; padding: 0 var(--s5); border: 0; border-radius: 999px;
	background: var(--brand); color: var(--brand-ink); font-weight: 600;
}
.btn:hover { color: var(--brand-ink); filter: brightness(1.08); }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); filter: none; }

/* ---------- 4. Live strip ---------- */
.live-strip { background: var(--signal); color: #fff; }
:root[data-theme="dark"] .live-strip { color: #0F1412; }
.live-strip a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; color: inherit; font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- 5. Cards ---------- */
.kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--brand); letter-spacing: .01em; }
.meta { font-size: 13px; color: var(--slate); }
.meta a:hover { color: var(--brand); }
.card { display: flex; flex-direction: column; gap: var(--s2); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-img); background: var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-title { font-size: 20px; }
.card-excerpt { color: var(--slate); font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card--lead .card-title { font-size: 28px; line-height: 1.2; }
.card--lead .card-excerpt { font-size: 17px; color: var(--ink); -webkit-line-clamp: 3; }

.card--compact { flex-direction: row; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.card--compact:last-child { border-bottom: 0; }
.card--compact .card-media { flex: none; width: 104px; aspect-ratio: 4 / 3; }
.card--compact .card-title { font-size: 17px; }
.card--compact .card-body { display: flex; flex-direction: column; gap: var(--s1); }

.card--video .card-media { position: relative; }
.card--video .card-media::after {
	content: ""; position: absolute; left: var(--s3); bottom: var(--s3); width: 40px; height: 40px; border-radius: 50%;
	background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 24px no-repeat;
}

/* ---------- 6. Front page ---------- */
.section { padding: var(--s5) 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.section-title { font-size: 22px; display: flex; align-items: center; gap: var(--s2); }
.section-title::before { content: ""; width: 6px; height: 22px; background: var(--brand); border-radius: 3px; }
.section-more { font-size: 14px; font-weight: 600; color: var(--brand); white-space: nowrap; }

.top-grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
.top-grid > *, .grid > *, .desks > * { min-width: 0; }
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--s4); }
.brief-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.brief-title { font-size: 18px; }
.brief-badge { font-size: 12px; font-weight: 600; background: var(--haldi-soft); color: var(--ink); padding: 2px var(--s2); border-radius: 999px; }
.brief-list { display: flex; gap: var(--s3); list-style: none; margin: 0; padding: 0 0 var(--s2); overflow-x: auto; scroll-snap-type: x mandatory; counter-reset: brief; }
.brief-item {
	flex: 0 0 82%; scroll-snap-align: start; counter-increment: brief;
	background: var(--paper); border-radius: 8px; padding: var(--s4); min-height: 148px;
}
.brief-item::before { content: counter(brief); font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1; color: var(--brand); display: block; margin-bottom: var(--s2); }
.brief-item h3 { font-size: 17px; margin-bottom: var(--s1); }
.brief-item p { font-size: 14px; color: var(--slate); margin: 0; }

.grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
.rail { display: flex; gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s2); }
.rail > * { flex: 0 0 72%; scroll-snap-align: start; }

.hub { background: var(--brand-soft); border-radius: var(--radius-card); padding: var(--s5) var(--s4); }
.hub .section-title::before { background: var(--haldi); }
.hub-desc { color: var(--slate); margin-top: calc(var(--s3) * -1); }

.desks { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
.desk-block .card--lead .card-title { font-size: 22px; }

.cta { background: var(--ink); color: var(--paper); border-radius: var(--radius-card); padding: var(--s5); display: grid; gap: var(--s4); }
.cta h2 { font-size: 24px; }
.cta p { margin: 0; opacity: .85; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.cta .btn-ghost { color: var(--paper); border-color: currentColor; }

/* ---------- 7. Ad slots (fixed height: no layout shift) ---------- */
.ad-slot { margin: var(--s5) auto; text-align: center; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; overflow: hidden; }
.ad-slot::before { content: attr(data-label); font-size: 11px; color: var(--slate); letter-spacing: .08em; padding: var(--s1); }
.ad-slot--banner { min-height: 120px; }

/* ---------- 8. Single story ---------- */
.story { max-width: var(--read); margin: 0 auto; padding: var(--s5) 0 var(--s7); }
.breadcrumb { font-size: 13px; color: var(--slate); margin-bottom: var(--s3); }
.breadcrumb a { color: var(--brand); font-weight: 600; }
.story-title { font-size: 28px; line-height: 1.22; margin-bottom: var(--s4); }
.byline { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.byline img { width: 44px; height: 44px; border-radius: 50%; }
.byline-name { font-weight: 600; }
.byline .meta { display: block; }

.reader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.chip-btn {
	display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3);
	background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500;
}
.chip-btn:hover, .chip-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.chip-btn .icon { width: 18px; height: 18px; }
.reader-bar .spacer { flex: 1; }

.story-figure { margin: 0 calc(var(--s4) * -1) var(--s5); }
.story-figure img { width: 100%; }
.story-figure figcaption { font-size: 13px; color: var(--slate); padding: var(--s2) var(--s4) 0; }

.box { border-radius: var(--radius-card); padding: var(--s4) var(--s5); margin: 0 0 var(--s5); }
.box-label { font-family: var(--font-head); font-weight: 700; font-size: 15px; margin-bottom: var(--s2); display: flex; align-items: center; gap: var(--s2); }
.box--answer { background: var(--brand-soft); border-left: 4px solid var(--brand); }
.box--answer .box-label { color: var(--brand); }
.box--answer p { font-family: var(--font-head); font-weight: 500; font-size: calc(19px * var(--reader-scale)); line-height: 1.55; margin: 0; }
.box--impact { background: var(--haldi-soft); border-left: 4px solid var(--haldi); }
.box--impact > :last-child, .box--sources > :last-child { margin-bottom: 0; }
.box--sources { background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.box--sources ul { margin: 0; padding-left: var(--s5); }
.box--sources a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

.entry-content { font-family: var(--font-read); font-size: calc(18px * var(--reader-scale)); line-height: 1.7; }
.entry-content > * { margin-bottom: 1.2em; }
.entry-content h2 { font-size: 1.35em; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.15em; margin-top: 1.4em; }
.entry-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin-left: 0; margin-right: 0; padding: var(--s2) var(--s5); border-left: 4px solid var(--brand); font-size: 1.1em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-family: var(--font-ui); font-size: 13px; color: var(--slate); margin-top: var(--s2); }
.entry-content table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .9em; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: left; }
.entry-content th { background: var(--brand-soft); }
.entry-content .alignwide { margin-left: calc(var(--s4) * -1); margin-right: calc(var(--s4) * -1); max-width: none; }
.entry-content iframe { width: 100%; }

.tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0; }
.tags a { font-size: 14px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.updated-line { font-size: 13px; color: var(--slate); border-top: 1px solid var(--line); padding-top: var(--s3); }

.author-box { display: flex; gap: var(--s4); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); margin: var(--s5) 0; }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box h2 { font-size: 18px; }
.author-box p { font-size: 15px; color: var(--slate); margin: var(--s1) 0 var(--s2); }
.author-box a.more { color: var(--brand); font-weight: 600; font-size: 14px; }

.related { max-width: var(--wrap); }
.related-label { font-size: 12px; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- 9. Archive, author, search, page ---------- */
.page-head { padding: var(--s5) 0 var(--s4); }
.page-title { font-size: 28px; }
.page-desc { color: var(--slate); max-width: var(--read); margin-top: var(--s2); }
.author-head { display: flex; gap: var(--s4); align-items: center; }
.author-head img { width: 88px; height: 88px; border-radius: 50%; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s2); padding: var(--s6) 0; }
.pagination .page-numbers { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.empty { padding: var(--s7) 0; text-align: center; color: var(--slate); }

/* ---------- 10. Comments ---------- */
.comments-area { max-width: var(--read); margin: 0 auto; padding-bottom: var(--s7); }
.comments-title, .comment-reply-title { font-size: 20px; margin-bottom: var(--s4); display: block; }
.comment-list { list-style: none; margin: 0 0 var(--s5); padding: 0; }
.comment-list .children { list-style: none; padding-left: var(--s5); }
.comment-body { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: var(--s2); font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--slate); margin: var(--s1) 0 var(--s2); }
.comment-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: var(--s1); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: var(--s3); font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.comment-form .submit { min-height: 48px; padding: 0 var(--s5); border: 0; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ---------- 11. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s6) 0; margin-top: var(--s6); }
.footer-grid { display: grid; gap: var(--s5); }
.footer-tag { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--brand); }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer-menu a { display: inline-flex; min-height: 44px; align-items: center; font-size: 15px; }
.footer-note { font-size: 13px; color: var(--slate); }
.widget-title { font-size: 16px; margin-bottom: var(--s2); }

/* ---------- 12. Mobile tab bar ---------- */
.tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: var(--tabbar-h);
	display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
	background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a, .tabbar button {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	font-size: 12px; font-weight: 500; background: none; border: 0; color: var(--slate);
}
.tabbar .is-active, .tabbar a:hover, .tabbar button:hover { color: var(--brand); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--s4)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--s3) var(--s5); border-radius: 999px; font-size: 14px; z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.is-on { opacity: 1; }

/* ---------- 13. Larger screens ---------- */
@media (min-width: 600px) {
	.brand-tag { display: inline; }
	.grid { grid-template-columns: repeat(2, 1fr); }
	.rail > * { flex-basis: 40%; }
	.brief-item { flex-basis: 44%; }
	.story-title { font-size: 34px; }
	.story-figure { margin-left: 0; margin-right: 0; }
	.story-figure img { border-radius: var(--radius-img); }
	.story-figure figcaption { padding-left: 0; padding-right: 0; }
	.desks { grid-template-columns: repeat(2, 1fr); }
	.cta { grid-template-columns: 1.4fr 1fr; align-items: center; padding: var(--s6); }
}
@media (min-width: 900px) {
	body { padding-bottom: 0; }
	.tabbar { display: none; }
	.toast { bottom: var(--s5); }
	.wrap { padding: 0 var(--s5); }
	.header-bar { min-height: 68px; }
	.brand-name { font-size: 26px; }
	.desk-rail ul { flex-wrap: wrap; overflow: visible; }
	.top-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
	.card--lead .card-title { font-size: 36px; }
	.brief-list { flex-direction: column; overflow: visible; }
	.brief-item { flex: none; min-height: 0; display: grid; grid-template-columns: 32px 1fr; column-gap: var(--s2); padding: var(--s3); }
	.brief-item::before { grid-row: span 2; font-size: 24px; margin: 0; }
	.brief-item p { display: none; }
	.grid { grid-template-columns: repeat(3, 1fr); }
	.grid--4 { grid-template-columns: repeat(4, 1fr); }
	.rail { overflow: visible; display: grid; grid-template-columns: repeat(4, 1fr); }
	.hub { padding: var(--s6); }
	.desks { grid-template-columns: repeat(4, 1fr); }
	.story-title { font-size: 40px; }
	.footer-grid { grid-template-columns: 1.2fr 2fr; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
	.site-header, .site-footer, .tabbar, .reader-bar, .ad-slot, .related, .comments-area, .cta { display: none !important; }
	body { background: #fff; color: #000; padding: 0; }
}
