/* ============================================================
   base.css — Global foundation
   Design tokens, reset, layout, buttons, and shared components
   (tool cards, post cards, section headings, pagination).
   Loaded on every page.
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
	--brand: #6d28d9;
	--brand-dark: #5b21b6;
	--brand-light: #ede9fe;
	--brand-soft: rgba(109, 40, 217, 0.10);
	--brand-softer: rgba(109, 40, 217, 0.06);

	--ink: #0f172a;
	--ink-2: #1e293b;
	--muted: #64748b;
	--muted-2: #94a3b8;
	--line: #e2e8f0;
	--line-2: #eef2f7;
	--bg: #ffffff;
	--bg-soft: #f8fafc;
	--bg-soft-2: #f1f5f9;

	--green: #16a34a;
	--green-soft: #dcfce7;
	--amber: #d97706;
	--amber-soft: #fef3c7;
	--blue: #2563eb;
	--blue-soft: #dbeafe;
	--pink: #db2777;
	--pink-soft: #fce7f3;

	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;
	--radius-xl: 28px;

	--shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
	--shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
	--shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
	--shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
	--shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12), 0 8px 24px rgba(15, 23, 42, 0.06);
	--shadow-brand: 0 12px 30px rgba(109, 40, 217, 0.28);

	--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--font-display: 'Sora', 'Inter', -apple-system, sans-serif;

	--container: 1200px;
	--header-h: 68px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); }
button { font-family: inherit; cursor: pointer; }
ul, ol { padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: var(--brand); color: #fff;
	padding: 10px 16px; z-index: 9999;
	border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}
.site { overflow: hidden; }
.section { padding: 72px 0; }

/* ---------- Buttons ---------- */
.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--brand);
	color: #fff !important;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 22px;
	border-radius: var(--radius-sm);
	border: none;
	transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
	box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
	background: var(--brand-dark);
	color: #fff !important;
	transform: translateY(-1px);
}
.btn-block { width: 100%; }

/* ---------- Section headings (shared: front-page + archive) ---------- */
.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 40px;
}
.section-title {
	font-size: clamp(26px, 3.4vw, 36px);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 8px;
}
.section-subtitle { font-size: 16px; color: var(--muted); margin: 0; max-width: 560px; }
.section-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 14.5px;
	color: var(--brand);
	white-space: nowrap;
	flex-shrink: 0;
	padding: 8px 0;
}
.section-link:hover { gap: 10px; }

/* ---------- Tool cards (shared: front-page + archive + search) ---------- */
.tools-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.tools-grid-latest { grid-template-columns: repeat(3, 1fr); }

.tool-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	transition: all .18s ease;
	position: relative;
}
.tool-card:hover {
	border-color: var(--brand);
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}
.tool-card-link { display: block; color: inherit; padding: 22px; }
.tool-card-link:hover { color: inherit; }

.tool-card-top {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 14px;
}
.tool-logo {
	width: 52px; height: 52px;
	flex-shrink: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--bg-soft-2);
	display: flex;
	align-items: center;
	justify-content: center;
}
.tool-logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-logo-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%; height: 100%;
	background: var(--brand);
	color: #fff;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 22px;
}
.tool-headline { flex: 1; min-width: 0; }
.tool-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 16.5px;
	margin: 0 0 3px;
	color: var(--ink);
	letter-spacing: -0.01em;
}
.tool-cat {
	display: inline-block;
	font-size: 12.5px;
	color: var(--muted);
	font-weight: 500;
}
.tool-featured-flag {
	color: var(--amber);
	font-size: 18px;
	line-height: 1;
}
.tool-desc {
	font-size: 14px;
	color: var(--muted);
	line-height: 1.55;
	margin: 0 0 16px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.tool-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 14px;
	border-top: 1px solid var(--line-2);
}
.tool-meta-left { display: flex; gap: 6px; flex-wrap: wrap; }

.pricing-tag {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	text-transform: capitalize;
}
.pricing-tag-free { background: var(--green-soft); color: var(--green); }
.pricing-tag-freemium { background: var(--blue-soft); color: var(--blue); }
.pricing-tag-paid, .pricing-tag-premium { background: var(--pink-soft); color: var(--pink); }

.tool-rating { display: flex; align-items: center; gap: 5px; }
.star-rating { display: inline-flex; font-size: 13px; line-height: 1; }
.star { color: var(--amber); }
.star-empty { color: var(--line); }
.tool-rating-num { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- Post cards (blog listings) ---------- */
.post-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	transition: all .18s ease;
}
.post-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card-link { display: block; color: inherit; }
.post-card-link:hover { color: inherit; }
.post-card-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft-2); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body { padding: 20px; }
.post-card-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.post-card-title { font-size: 17px; margin: 0 0 8px; }
.post-card-excerpt { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------- Pagination (shared) ---------- */
.pagination, .navigation {
	margin-top: 40px;
	display: flex;
	justify-content: center;
}
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px; height: 40px;
	padding: 0 12px;
	margin: 0 4px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-size: 14px;
	font-weight: 500;
	color: var(--ink-2);
	transition: all .15s ease;
}
.page-numbers:hover, .page-numbers.current {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

/* ---------- Base responsive ---------- */
@media (max-width: 1080px) {
	.tools-grid { grid-template-columns: repeat(3, 1fr); }
	.tools-grid-latest { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
	.section { padding: 56px 0; }
	.section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
	.tools-grid, .tools-grid-latest { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.container { padding: 0 16px; }
	.section { padding: 44px 0; }
	.tools-grid, .tools-grid-latest { grid-template-columns: 1fr; }
}
