/* =============================================================================
   CSSBUY Spreadsheet Hub — main.css
   Light, clean, Western-friendly UI.
   ============================================================================= */

:root {
	--bg:           #fbfbfd;
	--bg-soft:      #f3f5fa;
	--bg-card:      #ffffff;
	--ink:          #0f1729;
	--ink-soft:     #4a5878;
	--muted:        #7a869a;
	--line:         #e5e9f2;
	--primary:      #2563eb;   /* clean blue */
	--primary-ink:  #1d4ed8;
	--accent:       #ff6a3d;   /* warm CTA orange */
	--accent-ink:   #e2552a;
	--mint:         #e8f5ee;
	--lemon:        #fff7e0;
	--lilac:        #f1eafd;
	--radius:       14px;
	--radius-sm:    10px;
	--shadow-sm:    0 1px 2px rgba(15, 23, 41, 0.04), 0 1px 1px rgba(15, 23, 41, 0.03);
	--shadow-md:    0 8px 24px rgba(15, 23, 41, 0.07);
	--shadow-lg:    0 18px 48px rgba(15, 23, 41, 0.10);
	--font-sans:    "Inter", "Helvetica Neue", Arial, "Segoe UI", system-ui, sans-serif;
	--font-display: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-ink); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	color: var(--ink);
	letter-spacing: -0.01em;
	margin: 0 0 0.6em;
	line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 1rem; color: var(--ink-soft); }

.container {
	width: 100%;
	max-width: 1180px;
	padding: 0 1.2rem;
	margin: 0 auto;
}

/* -----------------------------------------------------------------------------
   Header / Navigation
   ----------------------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.2rem;
	padding: 0.85rem 1.2rem;
}

.site-logo {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3rem;
	font-weight: 800;
	color: var(--ink);
	font-size: 1.15rem;
}
.site-logo .logo-mark { color: var(--primary); }
.site-logo .logo-word { color: var(--ink-soft); font-weight: 600; }

.site-nav { flex: 1; }
.nav-list {
	display: flex;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
}
.nav-list > li > a,
.nav-list > li > .dropdown-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.85rem;
	border-radius: 999px;
	color: var(--ink);
	font-weight: 600;
	font-size: 0.95rem;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: background .15s ease;
}
.nav-list > li > a:hover,
.nav-list > li > .dropdown-toggle:hover { background: var(--bg-soft); }

.has-dropdown { position: relative; }
.dropdown-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 230px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	list-style: none;
	margin: 0;
	padding: 0.4rem;
	opacity: 0;
	transform: translateY(6px);
	visibility: hidden;
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-dropdown.open > .dropdown-menu,
.has-dropdown:hover > .dropdown-menu {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
}
.dropdown-menu li a {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.7rem;
	border-radius: var(--radius-sm);
	color: var(--ink);
	font-weight: 500;
	font-size: 0.95rem;
}
.dropdown-menu li a:hover { background: var(--bg-soft); color: var(--primary-ink); }
.cat-icon { font-size: 1.05rem; }
.chev { font-size: 0.7rem; color: var(--muted); }

.header-cta { display: flex; gap: 0.5rem; }

.mobile-toggle {
	display: none;
	flex-direction: column;
	gap: 4px;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 0.5rem;
}
.mobile-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--ink);
	border-radius: 2px;
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.7rem 1.1rem;
	font-weight: 700;
	font-size: 0.95rem;
	border-radius: 999px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-ink); color: #fff; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; }

.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-ink); }

.btn .btn-icon { font-size: 1rem; }

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin: 1.2rem 0;
}
.cta-row.cta-large .btn {
	padding: 0.95rem 1.4rem;
	font-size: 1.02rem;
}

/* -----------------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------------- */
.hero {
	background:
		radial-gradient(1100px 480px at 8% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
		radial-gradient(900px 380px at 100% 0%, rgba(255, 106, 61, 0.10), transparent 60%),
		linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
	padding: 5rem 0 4rem;
	border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 820px; }
.eyebrow {
	display: inline-block;
	font-size: 0.78rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--primary-ink);
	background: rgba(37, 99, 235, 0.08);
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	margin-bottom: 1rem;
}
.hero-title { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.hero-title .accent { color: var(--primary); }
.hero-sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 680px; }
.hero-meta {
	list-style: none;
	margin: 1.4rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.2rem;
	color: var(--ink-soft);
	font-size: 0.92rem;
}

/* -----------------------------------------------------------------------------
   Sections
   ----------------------------------------------------------------------------- */
.section { padding: 4rem 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 2.4rem; }
.section-head p { color: var(--ink-soft); }

/* Categories grid */
.category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
}
.cat-card {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.25rem 1.1rem;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	color: var(--ink);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	border-color: rgba(37, 99, 235, 0.4);
}
.cat-card-icon {
	width: 44px; height: 44px;
	border-radius: 12px;
	background: var(--bg-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
}
.cat-card-label { flex: 1; font-weight: 600; }
.cat-card-arrow { color: var(--muted); transition: transform .15s ease, color .15s ease; }
.cat-card:hover .cat-card-arrow { color: var(--primary); transform: translateX(3px); }

/* About */
.section-about { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 2.5rem;
	align-items: start;
}
.about-card {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.5rem;
	box-shadow: var(--shadow-sm);
}
.about-card ul { padding-left: 1.1rem; color: var(--ink-soft); margin: 0; }
.about-card li { margin: 0.35rem 0; }

/* Article cards */
.article-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.2rem;
}
.article-card {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.5rem 1.3rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
	position: relative;
	overflow: hidden;
}
.article-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: rgba(37, 99, 235, 0.4);
}
.article-card-index {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--primary);
	letter-spacing: 0.12em;
}
.article-card h3 { margin: 0; }
.article-card h3 a { color: var(--ink); }
.article-card h3 a:hover { color: var(--primary-ink); }
.article-card p { color: var(--ink-soft); flex: 1; }
.article-card-cta { font-weight: 600; color: var(--primary); margin-top: 0.4rem; }

/* Final CTA */
.section-finalcta {
	background:
		linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(255, 106, 61, 0.06)),
		var(--bg);
	border-top: 1px solid var(--line);
}
.finalcta-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.finalcta-inner .cta-row { justify-content: center; }

/* -----------------------------------------------------------------------------
   Single page
   ----------------------------------------------------------------------------- */
.single-hero {
	padding: 3.5rem 0 2.4rem;
	background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--line);
}
.single-hero h1 { margin-bottom: 1rem; max-width: 820px; }
.single-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2.5rem;
	padding: 3rem 1.2rem;
}
.post-content {
	font-size: 1.04rem;
	color: var(--ink-soft);
}
.post-content h2 { margin-top: 2.4rem; color: var(--ink); }
.post-content h3 { margin-top: 1.8rem; color: var(--ink); }
.post-content p, .post-content li { color: var(--ink-soft); }
.post-content ul, .post-content ol { padding-left: 1.3rem; }
.post-content li { margin: 0.35rem 0; }
.post-content blockquote {
	margin: 1.5rem 0;
	padding: 1rem 1.2rem;
	background: var(--bg-soft);
	border-left: 4px solid var(--primary);
	border-radius: var(--radius-sm);
	color: var(--ink);
}
.post-content a { color: var(--primary-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	overflow: hidden;
}
.post-content th, .post-content td {
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
}
.post-content th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
.post-content .key-callout {
	background: var(--mint);
	border-radius: var(--radius);
	padding: 1rem 1.2rem;
	margin: 1.5rem 0;
	color: var(--ink);
}

.single-aside {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
}
.aside-card {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.2rem;
	box-shadow: var(--shadow-sm);
}
.aside-card h4 { margin-top: 0; }
.aside-card ul { list-style: none; padding: 0; margin: 0; }
.aside-card ul li { margin: 0.35rem 0; }
.aside-card ul li a { color: var(--ink); font-weight: 500; }
.aside-card ul li a:hover { color: var(--primary-ink); }
.aside-cta { background: var(--lemon); border-color: #f1e1a4; }

.back-home { margin-top: 2rem; font-weight: 600; }

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 2.5rem;
	padding: 3rem 1.2rem;
}
.footer-col h4 { margin-bottom: 0.9rem; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin: 0.35rem 0; }
.footer-list li a { color: var(--ink-soft); font-weight: 500; }
.footer-list li a:hover { color: var(--primary-ink); }
.footer-bottom {
	background: var(--bg-soft);
	padding: 1.2rem 0;
	font-size: 0.88rem;
	color: var(--muted);
	text-align: center;
}
.footer-bottom a { color: var(--ink-soft); }

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.about-grid { grid-template-columns: 1fr; }
	.single-body { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
	.site-nav, .header-cta { display: none; }
	.mobile-toggle { display: inline-flex; }
	body.mobile-open .site-nav,
	body.mobile-open .header-cta {
		display: flex;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		flex-direction: column;
		gap: 0.4rem;
		padding: 1rem 1.2rem;
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow-md);
	}
	body.mobile-open .nav-list { flex-direction: column; align-items: stretch; }
	body.mobile-open .nav-list > li > a,
	body.mobile-open .nav-list > li > .dropdown-toggle { width: 100%; justify-content: space-between; }
	body.mobile-open .dropdown-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding-left: 0.6rem;
	}
	.footer-grid { grid-template-columns: 1fr; gap: 2rem; }
	.hero { padding: 3.5rem 0 3rem; }
}
