/*
Theme Name: FinanceOps Desk
Theme URI: https://finance.nssmu.in/
Description: Minimal editorial theme (DM Serif Display / DM Sans) for ERP, finance operations and accounting guides. Includes optional Google Ad Manager slots (Appearance > Customize > Ads).
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: financeops
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: 'DM Sans', sans-serif;
	background: #ffffff;
	color: #1a1a1a;
	overflow-x: hidden;
	max-width: 100%;
	line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
.screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Navbar ---------- */
.navbar {
	background: #ffffff;
	padding: 20px 0;
	border-bottom: 1px solid #f0f0f0;
	position: sticky;
	top: 0;
	z-index: 100;
}
.nav-inner {
	max-width: 1008px;
	margin: auto;
	padding: 0 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
	gap: 1rem;
}
.nav-brand {
	font-family: 'DM Serif Display', serif;
	font-size: 22px;
	color: #1a1a1a;
	letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: #888; font-size: 14px; font-weight: 500; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: #1a1a1a; }
.mn-menu-toggle {
	display: none;
	background: none;
	border: 1px solid #eee;
	border-radius: 4px;
	padding: 0.35rem 0.6rem;
	cursor: pointer;
	color: #1a1a1a;
	font-size: 1.125rem;
	line-height: 1;
	flex-shrink: 0;
}

/* ---------- Ads ---------- */
.site-ad {
	max-width: 960px;
	margin: 1.5rem auto;
	padding: 0.75rem 1rem;
	background: #fafafa;
	border: 1px solid #f0f0f0;
	border-radius: 6px;
	text-align: center;
}
.post-inner .site-ad { max-width: none; margin: 0 0 1.5rem; }
.ad-label {
	display: block;
	font-size: 0.625rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #aaa;
	margin-bottom: 0.5rem;
}
.ad-container {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: clamp(50px, 64vw, 250px);
}
.site-ad.hidden, .ad-container.hidden { display: none !important; }

/* ---------- Hero ---------- */
.hero { max-width: 1008px; margin: 64px auto 0; padding: 0 24px; }
.hero-inner {
	border-bottom: 1px solid #f0f0f0;
	padding-bottom: 48px;
	display: grid;
	grid-template-columns: 1fr 420px;
	gap: 64px;
	align-items: center;
}
.hero-inner > * { min-width: 0; }
.hero-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #888;
	margin-bottom: 16px;
}
.hero-title {
	font-family: 'DM Serif Display', serif;
	font-weight: 700;
	font-size: 42px;
	line-height: 1.15;
	color: #1a1a1a;
	margin: 0 0 20px;
}
.hero-excerpt { font-size: 16px; color: #555; line-height: 1.7; margin-bottom: 28px; font-weight: 300; }
.hero-btn, .load-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #1a1a1a;
	color: #ffffff;
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font: 500 14px 'DM Sans', sans-serif;
	cursor: pointer;
	transition: 0.2s;
}
.load-more-btn { padding: 12px 28px; }
.hero-btn:hover, .load-more-btn:hover { background: #333; color: #ffffff; }
.load-more-btn[disabled] { opacity: .5; cursor: default; }

/* ---------- Image placeholders / thumbnails ---------- */
.img-ph {
	background: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
	overflow: hidden;
}
.img-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-img { width: 100%; height: 300px; border-radius: 8px; font-size: 36px; }
.blog-item-img { width: 200px; height: 130px; border-radius: 6px; font-size: 24px; color: #ddd; }
.related-img { width: 80px; height: 56px; border-radius: 4px; font-size: 16px; color: #ddd; order: 2; }

/* ---------- Category bar ---------- */
.cat-bar { display: flex; flex-wrap: wrap; gap: 10px; max-width: 1008px; margin: 32px auto 0; padding: 0 24px; }
.cat-chip {
	font-size: 12px;
	font-weight: 500;
	color: #888;
	padding: 5px 14px;
	border: 1px solid #eee;
	border-radius: 4px;
	transition: 0.2s;
}
.cat-chip:hover, .cat-chip.active { color: #1a1a1a; border-color: #aaa; }

/* ---------- Category / archive header ---------- */
.cat-header { max-width: 1008px; margin: 56px auto 0; padding: 0 24px 40px; border-bottom: 1px solid #f0f0f0; }
.cat-back {
	font-size: 13px; font-weight: 500; color: #aaa;
	display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; transition: 0.2s;
}
.cat-back:hover { color: #1a1a1a; }
.cat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #aaa; margin-bottom: 12px; }
.cat-title { font-family: 'DM Serif Display', serif; font-weight: 700; font-size: 44px; line-height: 1.1; color: #1a1a1a; margin: 0; }
.cat-desc { color: #888; font-size: 15px; margin: 14px 0 0; font-weight: 300; }

/* ---------- Post list ---------- */
.section { max-width: 1008px; margin: 56px auto; padding: 0 24px; }
.section-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #888;
	margin-bottom: 32px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f0f0f0;
}
.blog-list { display: flex; flex-direction: column; }
.blog-item {
	display: grid;
	grid-template-columns: 1fr 200px;
	gap: 32px;
	align-items: center;
	padding: 32px 0;
	border-bottom: 1px solid #f0f0f0;
}
.blog-item > * { min-width: 0; }
.blog-item:last-child { border-bottom: none; }
.blog-item-category {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #888;
	margin-bottom: 6px;
}
.blog-item-date {
	font-size: 12px;
	color: #aaa;
	font-weight: 500;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
}
.blog-item-title {
	font-family: 'DM Serif Display', serif;
	font-weight: 400;
	font-size: 22px;
	line-height: 1.3;
	color: #1a1a1a;
	margin: 0 0 10px;
	transition: 0.2s;
}
.blog-item-title:hover { color: #555; }
.blog-item-excerpt { font-size: 14px; color: #777; line-height: 1.6; font-weight: 300; margin: 0; }
.load-more-wrap { text-align: center; margin-top: 40px; }
.empty { padding: 40px 0; color: #888; }

/* ---------- Single post ---------- */
.post-wrap { max-width: 1008px; margin: 0 auto; padding: 0 1rem 3rem; width: 100%; overflow-x: hidden; }
.post-inner { max-width: 680px; margin: 0 auto; padding-top: 2rem; }
.back-link {
	display: inline-flex; align-items: center; gap: 0.35rem;
	color: #888; font-size: 0.8125rem; font-weight: 500; margin-bottom: 2.5rem; transition: color 0.2s;
}
.back-link:hover { color: #1a1a1a; }
.post-date {
	display: block;
	font-size: 0.75rem;
	color: #aaa;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 1.25rem;
}
.post-title {
	font-family: 'DM Serif Display', serif;
	font-weight: 700;
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	line-height: 1.15;
	color: #1a1a1a;
	margin: 0 0 1.5rem;
}
.post-thumbnail { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 2.5rem; display: block; }
.post-content, .page-content { font-size: 1.0625rem; line-height: 1.85; color: #333; font-weight: 300; }
.post-content h2, .post-content h3, .page-content h2, .page-content h3 {
	font-family: 'DM Serif Display', serif;
	font-weight: 400;
	color: #1a1a1a;
	line-height: 1.25;
	margin: 2rem 0 1rem;
}
.post-content h2, .page-content h2 { font-size: 1.75rem; }
.post-content h3, .page-content h3 { font-size: 1.35rem; }
.post-content p, .page-content p { margin-bottom: 1.25rem; }
.post-content a { color: #1a1a1a; border-bottom: 1px solid #ddd; }
.post-content strong, .page-content strong { color: #1a1a1a; font-weight: 600; }
.post-content ul, .post-content ol, .page-content ul, .page-content ol { padding-left: 24px; margin: 0 0 1.4rem; }
.post-content li, .page-content li { margin-bottom: 8px; }
.post-content blockquote, .page-content blockquote {
	border-left: 2px solid #1a1a1a;
	padding: 16px 24px;
	margin: 28px 0;
	color: #888;
	font-family: 'DM Serif Display', serif;
	font-size: 20px;
	line-height: 1.5;
}
.post-content table, .page-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; line-height: 1.6; }
.post-content th, .post-content td, .page-content th, .page-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.post-content th, .page-content th { font-weight: 600; color: #1a1a1a; background: #fafafa; }

/* Related posts */
.related { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid #f0f0f0; }
.related-heading { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: #888; margin: 0 0 1.5rem; }
.related-list { display: flex; flex-direction: column; }
.related-item {
	display: grid;
	grid-template-columns: 1fr 80px;
	gap: 1.25rem;
	align-items: center;
	padding: 1.25rem 0;
	border-bottom: 1px solid #f0f0f0;
	transition: opacity 0.2s;
}
.related-item:hover { opacity: 0.8; }
.related-item:last-child { border-bottom: none; }
.related-title {
	font-family: 'DM Serif Display', serif;
	font-size: 1.0625rem;
	line-height: 1.3;
	color: #1a1a1a;
	margin-bottom: 0.35rem;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	text-decoration-color: #bbb;
	transition: text-decoration-color 0.2s, color 0.2s;
}
.related-item:hover .related-title { color: #555; text-decoration-color: #1a1a1a; }
.related-meta { font-size: 0.75rem; color: #aaa; }

/* ---------- Pages ---------- */
.page-wrap { max-width: 680px; margin: 0 auto; padding: 64px 24px 100px; }
.page-header { padding-bottom: 32px; margin-bottom: 40px; border-bottom: 1px solid #f0f0f0; }
.page-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #aaa; margin-bottom: 16px; }
.page-title { font-family: 'DM Serif Display', serif; font-weight: 700; font-size: 40px; line-height: 1.15; color: #1a1a1a; margin: 0; }
.page-content { color: #555; }
.page-content a { color: #1a1a1a; text-decoration: underline; text-underline-offset: 3px; }
.search-form { display: flex; gap: 8px; max-width: 460px; margin-bottom: 24px; }
.search-form input { flex: 1; font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 6px; border: 1px solid #eee; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid #f0f0f0; background: #fafafa; }
.site-footer-inner {
	max-width: 1008px;
	margin: auto;
	padding: 28px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
}
.site-footer-copy { font-size: 13px; color: #bbb; }
.site-footer-links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.site-footer-links a { color: #aaa; font-size: 13px; padding: 4px 10px; transition: color 0.2s; }
.site-footer-links a:hover { color: #1a1a1a; }
.footer-sep { color: #ddd; font-size: 12px; }

/* ---------- Rewarded opt-in modal ---------- */
.reward-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; padding: 1rem; }
.reward-modal[hidden] { display: none; }
.reward-modal__dialog { background: #fff; border-radius: 1rem; border: 1px solid #f3f4f6; padding: 1.5rem; width: 100%; max-width: 28rem; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1); }
.reward-modal__title { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 600; color: #111827; line-height: 1.3; }
.reward-modal__card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 1rem; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.reward-modal__card:hover { border-color: #aaa; }
.reward-modal__play { flex: none; width: 42px; height: 42px; border-radius: 50%; background: #1a1a1a; color: #fff; display: grid; place-items: center; font-size: 15px; }
.reward-modal__card-title { display: block; font-weight: 600; }
.reward-modal__card-subtitle { display: block; font-size: 14px; color: #6b7280; }
.reward-modal__dismiss { margin-top: 12px; background: none; border: 0; color: #6b7280; font: inherit; font-size: 14px; cursor: pointer; padding: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.hero-inner { grid-template-columns: 1fr; gap: 32px; }
	.hero-title { font-size: 30px; }
	.blog-item { grid-template-columns: 1fr; gap: 16px; }
	.blog-item-img { width: 100%; height: 180px; }
	.mn-menu-toggle { display: block; }
	.nav-links {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin-top: 20px;
		background: #ffffff;
		border-bottom: 1px solid #f0f0f0;
		flex-direction: column;
		align-items: stretch;
		padding: 0.5rem 24px 1rem;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
		z-index: 101;
		gap: 0;
	}
	.nav-links.is-open { display: flex; }
	.nav-links a { padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
	.nav-links a:last-child { border-bottom: none; }
	.site-footer-inner { flex-direction: column; }
	.cat-title { font-size: 30px; }
	.page-title { font-size: 30px; }
	.post-title { font-size: 1.75rem; }
	.related-item { grid-template-columns: 1fr; }
	.related-img { width: 100%; height: 160px; order: 0; }
	.post-content table, .page-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.section, .hero, .cat-bar, .cat-header { padding-left: 16px; padding-right: 16px; }
	.nav-inner { padding: 0 16px; }
	.site-ad { margin-left: 16px; margin-right: 16px; }
	.post-inner .site-ad { margin-left: 0; margin-right: 0; }
}
