/*
Theme Name: DeskFactor Support
Theme URI: https://deskfactor.com
Author: DeskFactor
Author URI: https://deskfactor.com
Description: Knowledge-base support theme for DeskFactor, built on the Underscores (_s) skeleton and re-themed with the DeskFactor Tech Teal design system.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: deskfactorsupport
Tags: custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* -----------------------------------------------------------------------
   1.0 Design tokens
--------------------------------------------------------------------------*/
:root {
	/* DeskFactor Tech Teal Palette */
	--background: 180 17% 96%;
	--foreground: 228 15% 20%;

	--card: 0 0% 100%;
	--card-foreground: 228 15% 20%;

	--primary: 180 28% 52%; /* Tech Teal ~#5FA8A8 */
	--primary-foreground: 0 0% 100%;
	--primary-glow: 180 39% 63%;

	--secondary: 0 0% 27%; /* Charcoal */
	--secondary-foreground: 0 0% 100%;

	--muted: 180 15% 95%;
	--muted-foreground: 228 15% 55%;

	--accent: 180 39% 90%; /* Light teal, used for category badges */
	--accent-foreground: 180 28% 41%;

	--success: 147 67% 47%;
	--success-foreground: 0 0% 100%;
	--warning: 38 92% 50%;
	--warning-foreground: 228 15% 20%;
	--destructive: 0 84% 60%;
	--destructive-foreground: 0 0% 100%;

	--border: 220 13% 91%;
	--input: 180 15% 94%;
	--ring: 180 28% 52%;

	--radius: 1rem; /* 16px base; components derive rounded-md (6px)/rounded-xl (12px)/rounded-full as needed */

	--shadow-soft: 0 2px 10px rgba(95, 168, 168, 0.08);
	--shadow-medium: 0 4px 20px rgba(95, 168, 168, 0.12);

	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dark {
	--background: 228 15% 10%;
	--foreground: 180 17% 98%;
	--card: 228 15% 12%;
	--card-foreground: 180 17% 98%;
	--primary: 180 28% 58%;
	--primary-foreground: 0 0% 100%;
	--primary-glow: 180 39% 68%;
	--secondary: 0 0% 32%;
	--secondary-foreground: 0 0% 100%;
	--muted: 228 15% 16%;
	--muted-foreground: 180 17% 70%;
	--accent: 180 28% 20%;
	--accent-foreground: 180 39% 63%;
	--border: 228 15% 22%;
	--input: 228 15% 18%;
	--ring: 180 28% 58%;
	--shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.3);
	--shadow-medium: 0 4px 20px rgba(95, 168, 168, 0.15);
}

/* -----------------------------------------------------------------------
   2.0 Reset / base
--------------------------------------------------------------------------*/
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background-color: hsl(var(--background));
	color: hsl(var(--foreground));
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: inherit;
	text-decoration: none;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

button,
input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: hsl(var(--background));
	border-radius: 6px;
	box-shadow: var(--shadow-medium);
	clip: auto !important;
	clip-path: none;
	color: hsl(var(--foreground));
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 8px;
	line-height: normal;
	padding: 12px 16px;
	text-decoration: none;
	top: 8px;
	width: auto;
	z-index: 100000;
}

/* -----------------------------------------------------------------------
   3.0 Layout helpers
--------------------------------------------------------------------------*/
.container {
	width: 100%;
	max-width: 1140px;
	margin-inline: auto;
	padding-inline: 24px;
}

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1 0 auto;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* -----------------------------------------------------------------------
   4.0 Typography scales
--------------------------------------------------------------------------*/

/* 4.1 Marketing / content scale — homepage, category pages, headers, hero */
.h-display,
.h-marketing {
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.h-display {
	font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem);
}

.h-marketing {
	font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
}

.text-accent {
	color: hsl(var(--primary));
}

.marketing-subtext {
	font-size: 1.0625rem;
	line-height: 1.6;
	color: hsl(var(--muted-foreground));
}

/* 4.2 Article body scale — reads like documentation */
.article-body {
	font-weight: 400;
	font-size: 0.875rem; /* 14px base */
	line-height: 1.7;
	color: hsl(var(--foreground));
}

.article-body h2 {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 2em 0 0.75em;
}

.article-body h3 {
	font-size: 1.0625rem;
	font-weight: 700;
	margin: 1.75em 0 0.5em;
}

.article-body p {
	margin: 0 0 1.25em;
}

.article-body ul,
.article-body ol {
	margin: 0 0 1.25em;
	padding-left: 1.5em;
}

.article-body ul {
	list-style: disc;
}

.article-body ol {
	list-style: decimal;
}

.article-body code {
	background: hsl(var(--muted));
	border-radius: 4px;
	padding: 0.15em 0.4em;
	font-size: 0.85em;
}

.article-body pre {
	background: hsl(var(--muted));
	border-radius: 12px;
	padding: 1em;
	overflow-x: auto;
}

.article-body a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

.article-body img {
	border-radius: 12px;
	margin: 1.5em 0;
}

/* -----------------------------------------------------------------------
   5.0 Header
--------------------------------------------------------------------------*/
.site-header {
	background-color: hsl(var(--background));
	border-bottom: 1px solid hsl(var(--border));
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 18px;
}

.site-logo {
	display: flex;
	align-items: center;
	gap: 8px;
}

.site-logo img {
	height: 32px;
	width: auto;
}

.site-logo-text {
	font-weight: 700;
	font-size: 1rem;
	color: hsl(var(--foreground));
}

.site-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: hsl(var(--secondary));
	color: hsl(var(--primary));
	font-weight: 700;
	flex-shrink: 0;
}

.main-navigation {
	display: flex;
	align-items: center;
	gap: 32px;
}

.main-navigation ul {
	display: flex;
	align-items: center;
	gap: 28px;
}

.main-navigation a {
	font-size: 0.9375rem;
	font-weight: 500;
	color: hsl(var(--foreground));
	transition: color 0.15s ease;
}

.main-navigation a:hover {
	color: hsl(var(--primary));
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 20px;
}

.menu-toggle {
	display: none;
	background: none;
	border: 1px solid hsl(var(--input));
	border-radius: 8px;
	padding: 8px 10px;
	cursor: pointer;
}

/* -----------------------------------------------------------------------
   6.0 Buttons
--------------------------------------------------------------------------*/
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 10px;
	font-weight: 500;
	font-size: 0.9375rem;
	padding: 10px 20px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.btn-primary {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
	background-color: hsl(var(--primary-glow));
	color: hsl(var(--primary-foreground));
}

.btn-outline {
	background-color: hsl(var(--background));
	border-color: hsl(var(--input));
	color: hsl(var(--foreground));
}

.btn-outline:hover {
	background-color: hsl(var(--accent));
}

.btn-sm {
	padding: 6px 14px;
	font-size: 0.8125rem;
}

.btn-icon-trailing svg {
	width: 16px;
	height: 16px;
	transition: transform 0.15s ease;
}

.btn:hover .btn-icon-trailing svg {
	transform: translateX(2px);
}

/* -----------------------------------------------------------------------
   7.0 Cards
--------------------------------------------------------------------------*/
.card {
	background-color: hsl(var(--card));
	color: hsl(var(--card-foreground));
	border: 1px solid hsl(var(--border));
	border-radius: 12px;
	box-shadow: var(--shadow-soft);
}

.card-padded {
	padding: 24px;
}

/* -----------------------------------------------------------------------
   8.0 Badges / pills
--------------------------------------------------------------------------*/
.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 999px;
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 12px;
	white-space: nowrap;
}

.step-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-weight: 700;
	font-size: 0.875rem;
	flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   9.0 Search
--------------------------------------------------------------------------*/
.kb-search-form {
	display: flex;
	align-items: center;
	gap: 10px;
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: 12px;
	box-shadow: var(--shadow-medium);
	padding: 8px 8px 8px 18px;
	max-width: 640px;
	margin-inline: auto;
}

.kb-search-form input[type="search"] {
	flex: 1;
	border: none;
	background: transparent;
	outline: none;
	font-size: 0.9375rem;
	color: hsl(var(--foreground));
}

.kb-search-form input[type="search"]::placeholder {
	color: hsl(var(--muted-foreground));
}

/* -----------------------------------------------------------------------
   10.0 Hero
--------------------------------------------------------------------------*/
.hero {
	text-align: center;
	padding: 72px 0 56px;
}

.hero h1 {
	margin: 0 0 16px;
}

.hero .marketing-subtext {
	max-width: 560px;
	margin: 0 auto 32px;
}

/* -----------------------------------------------------------------------
   11.0 Category grid
--------------------------------------------------------------------------*/
.section {
	padding: 48px 0;
}

.section-title {
	margin: 0 0 24px;
}

.category-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.category-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
	box-shadow: var(--shadow-medium);
	transform: translateY(-2px);
}

.category-card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
	font-size: 1.25rem;
	flex-shrink: 0;
}

.category-card-name {
	font-weight: 700;
	font-size: 0.9375rem;
}

.category-card-count {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

/* -----------------------------------------------------------------------
   12.0 Article list (popular articles / search / category archive list)
--------------------------------------------------------------------------*/
.article-list-card {
	padding: 8px;
}

.article-list-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	border-bottom: 1px solid hsl(var(--border));
	transition: background-color 0.15s ease;
}

.article-list-row:last-child {
	border-bottom: none;
}

.article-list-row:hover {
	background-color: hsl(var(--muted));
}

.article-list-title {
	font-weight: 500;
	font-size: 0.9375rem;
}

.article-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

/* -----------------------------------------------------------------------
   13.0 Breadcrumb
--------------------------------------------------------------------------*/
.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 24px;
}

.breadcrumb a:hover {
	color: hsl(var(--primary));
}

.breadcrumb .sep {
	color: hsl(var(--border));
}

.breadcrumb .current {
	color: hsl(var(--foreground));
	font-weight: 500;
}

/* -----------------------------------------------------------------------
   14.0 Single article layout
--------------------------------------------------------------------------*/
.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 32px;
	align-items: start;
}

.article-main,
.blog-main {
	padding: 32px;
}

.article-title,
.blog-title {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 16px 0 12px;
}

.article-meta {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 24px;
}

.article-sidebar {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sidebar-heading {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: hsl(var(--muted-foreground));
	margin-bottom: 12px;
}

.sidebar-article-link {
	display: block;
	padding: 10px 0;
	font-size: 0.875rem;
	border-bottom: 1px solid hsl(var(--border));
}

.sidebar-article-link:last-child {
	border-bottom: none;
}

.sidebar-article-link:hover {
	color: hsl(var(--primary));
}

.sidebar-article-link.is-current {
	color: hsl(var(--primary));
	font-weight: 700;
}

/* Contact callout */
.callout-contact {
	background-color: hsl(var(--secondary));
	color: hsl(var(--secondary-foreground));
	border-radius: 12px;
	padding: 24px;
}

.callout-contact h3 {
	margin: 0 0 8px;
	font-size: 1.0625rem;
}

.callout-contact p {
	margin: 0 0 16px;
	font-size: 0.875rem;
	opacity: 0.85;
}

/* Helpful vote widget */
.helpful-widget {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid hsl(var(--border));
	text-align: center;
}

.helpful-widget-title {
	font-weight: 700;
	font-size: 0.9375rem;
	margin-bottom: 14px;
}

.helpful-widget-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.helpful-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.helpful-btn.is-active {
	background-color: hsl(var(--accent));
	border-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

.helpful-widget-thanks {
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	margin-top: 10px;
}

/* -----------------------------------------------------------------------
   15.0 Footer
--------------------------------------------------------------------------*/
.site-footer {
	border-top: 1px solid hsl(var(--border));
	padding: 32px 0;
	margin-top: auto;
}

.site-footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

/* -----------------------------------------------------------------------
   16.0 404 / empty states
--------------------------------------------------------------------------*/
.empty-state {
	text-align: center;
	padding: 96px 0;
}

.empty-state .h-display {
	color: hsl(var(--primary));
	font-size: clamp(3rem, 2.5rem + 2vw, 5rem);
	margin-bottom: 8px;
}

/* -----------------------------------------------------------------------
   17.0 Pagination
--------------------------------------------------------------------------*/
.pagination.navigation {
	margin-top: 32px;
}

.pagination .nav-links {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid hsl(var(--border));
	font-size: 0.875rem;
}

.pagination .page-numbers.current {
	background-color: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* -----------------------------------------------------------------------
   18.0 Generic page content
--------------------------------------------------------------------------*/
.page-content-card {
	padding: 40px;
	max-width: 760px;
	margin-inline: auto;
}

/* -----------------------------------------------------------------------
   18.5 Blog
--------------------------------------------------------------------------*/
.blog-card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.blog-card {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.blog-card:hover {
	box-shadow: var(--shadow-medium);
	transform: translateY(-2px);
}

.blog-card-image-wrap {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.blog-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.blog-card-image-fallback {
	background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-glow)));
}

.blog-card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 20px;
}

.blog-card-title {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
}

.blog-card-meta {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
	margin: 0;
}

.blog-single-hero {
	width: 100%;
	height: 320px;
	overflow: hidden;
}

.blog-single-hero-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.blog-single-hero-fallback {
	background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-glow)));
}

.blog-byline {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}

.blog-byline-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.blog-byline-name {
	font-size: 0.875rem;
	font-weight: 700;
}

.blog-byline-meta {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

.blog-avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: hsl(var(--secondary));
	color: hsl(var(--primary));
	font-weight: 700;
	flex-shrink: 0;
}

/* Editorial body copy — regular weight, generous line-height; distinct from
   .article-body's documentation scale used by the KB. */
.blog-content {
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.75;
	color: hsl(var(--foreground));
}

.blog-content h2 {
	font-size: 1.375rem;
	font-weight: 700;
	margin: 1.75em 0 0.75em;
}

.blog-content h3 {
	font-size: 1.125rem;
	font-weight: 700;
	margin: 1.5em 0 0.5em;
}

.blog-content p {
	margin: 0 0 1.25em;
}

.blog-content ul,
.blog-content ol {
	margin: 0 0 1.25em;
	padding-left: 1.5em;
}

.blog-content ul {
	list-style: disc;
}

.blog-content ol {
	list-style: decimal;
}

.blog-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

.blog-content img {
	border-radius: 12px;
	margin: 1.5em 0;
}

.blog-content blockquote {
	border-left: 3px solid hsl(var(--primary));
	margin: 1.5em 0;
	padding-left: 1.25em;
	color: hsl(var(--muted-foreground));
	font-style: italic;
}

/* -----------------------------------------------------------------------
   19.0 Responsive
--------------------------------------------------------------------------*/
@media (max-width: 900px) {
	.category-grid,
	.blog-card-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.article-layout {
		grid-template-columns: 1fr;
	}

	.article-sidebar {
		position: static;
	}
}

@media (max-width: 768px) {
	.main-navigation {
		display: none;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.category-grid,
	.article-grid {
		grid-template-columns: 1fr;
	}

	.site-header-inner {
		flex-wrap: wrap;
	}

	.article-main,
	.blog-main {
		padding: 20px;
	}

	.hero {
		padding: 48px 0 40px;
	}

	.blog-card-grid {
		grid-template-columns: 1fr;
	}
}
