/*
Theme Name: Click and Solve
Theme URI: https://clickandsolve.com
Author: Click and Solve
Author URI: https://clickandsolve.com
Description: The official theme for Click and Solve (clickandsolve.com) — a minimal, professional companion theme built to pair with the Click and Solve Tools plugin. Provides the site header, navigation, footer, and base page layout; the plugin supplies the homepage, tool pages, category pages, and Business Guides content via its own templates (this theme's get_header()/get_footer() are what those templates call into).
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.3
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: click-and-solve-theme
*/

/* -----------------------------------------------------------------------
 * DESIGN TOKENS
 * Mirrors the Click and Solve Tools plugin's own tokens (same variable
 * names/values) so the two never visually disagree, regardless of which
 * stylesheet's :root block the browser applies last. If the plugin's
 * Settings > Branding > Primary Color is ever changed, update the value
 * below to match for full-site consistency.
 * ----------------------------------------------------------------------- */
:root {
	--cas-primary: #0d6efd;
	--cas-primary-dark: #0b5ed7;
	--cas-accent: #f59e0b;
	--cas-ink: #1d2327;
	--cas-muted: #6b7280;
	--cas-muted-bg: #f8fafc;
	--cas-radius: 0.75rem;
	--cas-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08);
	--cas-shadow-lg: 0 1rem 2.5rem rgba(15, 23, 42, 0.12);
	--cas-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--cas-cat-business: #4f46e5;
	--cas-cat-finance: #0d9488;
	--cas-cat-document: #b45309;
	--cas-cat-ai: #db2777;

	--cas-theme-header-bg: #ffffff;
	--cas-theme-border: #e5e7eb;
	--cas-theme-bg: #ffffff;
	--cas-theme-footer-bg: #f8fafc;
	--cas-theme-footer-text: #475569;
	--cas-theme-footer-muted: #94a3b8;
	--cas-theme-footer-heading: #1d2327;
}

/* Optional, restrained dark mode — the project spec asks for both Light
 * and Dark modes. Only the theme chrome (header/footer/body background)
 * responds; plugin-rendered tool UI keeps its own light card styling
 * for now, so forms/inputs remain fully legible. */
@media (prefers-color-scheme: dark) {
	:root {
		--cas-ink: #e5e7eb;
		--cas-muted: #9ca3af;
		--cas-muted-bg: #1e293b;
		--cas-theme-header-bg: #0f172a;
		--cas-theme-border: #1e293b;
		--cas-theme-bg: #0b1220;
		--cas-theme-footer-bg: #0f172a;
		--cas-theme-footer-text: #cbd5e1;
		--cas-theme-footer-muted: #94a3b8;
		--cas-theme-footer-heading: #ffffff;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

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

::selection {
	background: var(--cas-primary);
	color: #fff;
}

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

a {
	color: var(--cas-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--cas-primary-dark);
}

:focus-visible {
	outline: 3px solid var(--cas-primary);
	outline-offset: 2px;
}

/* A consistent type scale so every heading — whether it comes from this
 * theme, a Page, or a Business Guide written in the block editor — reads
 * like one deliberate design system instead of browser defaults. */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--cas-font);
	font-weight: 700;
	line-height: 1.25;
	color: var(--cas-ink);
	letter-spacing: -0.01em;
	margin: 0 0 0.75rem;
}

h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
	margin: 0 0 1.1rem;
}

.cas-site-container {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.screen-reader-text:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.6rem 1rem;
	background: var(--cas-ink);
	color: #fff;
	z-index: 10000;
	border-radius: 0.4rem;
}

/* -----------------------------------------------------------------------
 * SITE HEADER
 * ----------------------------------------------------------------------- */
.cas-site-header {
	background: var(--cas-theme-header-bg);
	border-bottom: 1px solid var(--cas-theme-border);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 4px 16px rgba(15, 23, 42, 0.04);
	position: sticky;
	top: 0;
	z-index: 100;
}

.cas-site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.1rem 0;
}

.cas-site-branding {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	text-decoration: none;
	color: var(--cas-ink);
	font-weight: 800;
	font-size: 1.2rem;
	letter-spacing: -0.01em;
	flex-shrink: 0;
}

.cas-site-branding::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: linear-gradient(135deg, var(--cas-primary), var(--cas-accent));
	flex-shrink: 0;
}

.cas-site-branding img {
	max-height: 36px;
	width: auto;
	display: block;
}

.cas-site-branding:hover {
	color: var(--cas-primary);
}

.cas-primary-nav {
	display: flex;
	align-items: center;
	gap: 1.75rem;
}

.cas-primary-nav ul {
	list-style: none;
	display: flex;
	gap: 1.75rem;
	margin: 0;
	padding: 0;
}

.cas-primary-nav a {
	position: relative;
	color: var(--cas-ink);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 600;
	padding-bottom: 2px;
}

.cas-primary-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 100%;
	bottom: -2px;
	height: 2px;
	background: var(--cas-primary);
	transition: right 0.18s ease;
}

.cas-primary-nav a:hover {
	color: var(--cas-primary);
}

.cas-primary-nav a:hover::after {
	right: 0;
}

.cas-header-cta {
	display: inline-flex;
	align-items: center;
	background: var(--cas-primary);
	color: #fff !important;
	padding: 0.55rem 1.25rem;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cas-header-cta:hover {
	background: var(--cas-primary-dark);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(13, 110, 253, 0.32);
	color: #fff !important;
}

.cas-nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 42px;
	height: 42px;
	background: var(--cas-muted-bg);
	border: 1px solid var(--cas-theme-border);
	border-radius: 0.6rem;
	cursor: pointer;
	flex-shrink: 0;
}

.cas-nav-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var(--cas-ink);
}

@media (max-width: 782px) {
	.cas-nav-toggle {
		display: flex;
	}

	.cas-primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--cas-theme-header-bg);
		border-bottom: 1px solid var(--cas-theme-border);
		box-shadow: var(--cas-shadow);
		flex-direction: column;
		align-items: stretch;
		padding: 1rem 1.25rem;
		display: none;
	}

	.cas-primary-nav.is-open {
		display: flex;
	}

	.cas-primary-nav ul {
		flex-direction: column;
		gap: 0.15rem;
	}

	.cas-primary-nav ul li a {
		display: block;
		padding: 0.7rem 0.25rem;
	}

	.cas-primary-nav ul li a::after {
		display: none;
	}

	.cas-header-cta {
		margin-top: 0.6rem;
		justify-content: center;
	}
}

/* -----------------------------------------------------------------------
 * MAIN CONTENT WRAPPER (used by index.php / page.php / single.php)
 * ----------------------------------------------------------------------- */
.cas-site-main {
	min-height: 50vh;
}

.cas-page-content {
	max-width: 840px;
	margin: 0 auto;
	padding: 3rem 1.25rem;
}

.cas-page-content .entry-title {
	margin-bottom: 1.25rem;
}

.cas-page-content .entry-content > * + * {
	margin-top: 1.1rem;
}

/* -----------------------------------------------------------------------
 * SITE FOOTER
 * ----------------------------------------------------------------------- */
.cas-site-footer {
	background: var(--cas-theme-footer-bg);
	color: var(--cas-theme-footer-text);
	margin-top: 4rem;
	border-top: 1px solid var(--cas-theme-border);
	position: relative;
}

.cas-site-footer::before {
	content: "";
	display: block;
	height: 3px;
	background: var(--cas-primary);
}

.cas-footer-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1fr;
	gap: 2.5rem;
	padding: 3.5rem 0 2rem;
}

.cas-footer-col h2 {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--cas-theme-footer-heading);
	margin: 0 0 1rem;
	font-weight: 700;
}

.cas-footer-col p {
	color: var(--cas-theme-footer-muted);
	font-size: 0.92rem;
	margin: 0 0 0.5rem;
}

.cas-footer-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cas-footer-col ul li {
	margin-bottom: 0.6rem;
}

.cas-footer-col a {
	color: var(--cas-theme-footer-text);
	text-decoration: none;
	font-size: 0.92rem;
	transition: color 0.15s ease;
}

.cas-footer-col a:hover {
	color: var(--cas-primary);
	text-decoration: underline;
}

.cas-footer-bottom {
	border-top: 1px solid var(--cas-theme-border);
	padding: 1.4rem 0;
	font-size: 0.82rem;
	color: var(--cas-theme-footer-muted);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cas-footer-bottom a {
	color: var(--cas-theme-footer-muted);
}

@media (max-width: 782px) {
	.cas-footer-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 480px) {
	.cas-footer-grid {
		grid-template-columns: 1fr;
	}
}

/* -----------------------------------------------------------------------
 * 404 / not-found fallback (used when the plugin isn't handling the
 * request — e.g. a genuinely missing ordinary page, not a /tools/ URL)
 * ----------------------------------------------------------------------- */
.cas-404 {
	max-width: 640px;
	margin: 0 auto;
	padding: 5rem 1.25rem;
	text-align: center;
}

.cas-404 .btn-primary {
	display: inline-block;
	background: var(--cas-primary);
	color: #fff;
	text-decoration: none;
	padding: 0.65rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}

	* {
		transition: none !important;
	}
}
