/*
Theme Name: Support Portal
Theme URI: https://example.com/support-portal-theme
Author: Karn
Author URI: https://example.com
Description: A clean, modern helpdesk theme designed to pair with the Advanced Support Portal plugin. Features a search-first homepage, knowledge-base layouts, and a customer-portal feel out of the box.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: support-portal-theme
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, helpdesk
*/

/* ===========================================================================
   Design tokens
   ======================================================================== */
:root {
	--spt-primary: #2271b1;
	--spt-primary-dark: #185a8c;
	--spt-ink: #1d2327;
	--spt-muted: #646970;
	--spt-line: #e5e7eb;
	--spt-bg: #f6f8fb;
	--spt-card: #ffffff;
	--spt-radius: 10px;
	--spt-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .05);
	--spt-maxw: 1140px;
	--spt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ===========================================================================
   Reset & base
   ======================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	font-family: var(--spt-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--spt-ink);
	background: var(--spt-bg);
}
a { color: var(--spt-primary); text-decoration: none; }
a:hover { color: var(--spt-primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--spt-ink); }

.spt-container { max-width: var(--spt-maxw); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ===========================================================================
   Buttons
   ======================================================================== */
.spt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: 8px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
	text-decoration: none;
}
.spt-btn:hover { text-decoration: none; }
.spt-btn:active { transform: translateY(1px); }
.spt-btn-primary { background: var(--spt-primary); color: #fff; }
.spt-btn-primary:hover { background: var(--spt-primary-dark); color: #fff; }
.spt-btn-ghost { background: #fff; color: var(--spt-ink); border-color: var(--spt-line); }
.spt-btn-ghost:hover { border-color: var(--spt-primary); color: var(--spt-primary); }
.spt-btn-light { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.spt-btn-light:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ===========================================================================
   Site header
   ======================================================================== */
.spt-site-header {
	background: #fff;
	border-bottom: 1px solid var(--spt-line);
	position: sticky;
	top: 0;
	z-index: 100;
}
.spt-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 68px;
}
.spt-branding { display: flex; align-items: center; gap: 12px; }
.spt-logo-img img { display: block; max-height: 40px; width: auto; }
.spt-site-title { font-size: 20px; font-weight: 700; margin: 0; }
.spt-site-title a { color: var(--spt-ink); }
.spt-site-desc { margin: 0; font-size: 12px; color: var(--spt-muted); }

.spt-nav { display: flex; align-items: center; gap: 24px; }
.spt-menu { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.spt-menu a { color: var(--spt-ink); font-weight: 500; }
.spt-menu a:hover { color: var(--spt-primary); text-decoration: none; }
.spt-menu .current-menu-item > a { color: var(--spt-primary); }
.spt-header-actions { display: flex; align-items: center; gap: 12px; }

.spt-nav-toggle {
	display: none;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 8px;
}
.spt-nav-toggle span,
.spt-nav-toggle span::before,
.spt-nav-toggle span::after {
	display: block;
	width: 24px; height: 2px;
	background: var(--spt-ink);
	position: relative;
	transition: .2s;
}
.spt-nav-toggle span::before { content: ""; position: absolute; top: -7px; }
.spt-nav-toggle span::after { content: ""; position: absolute; top: 7px; }

/* ===========================================================================
   Hero
   ======================================================================== */
.spt-hero {
	background: linear-gradient(135deg, var(--spt-primary), var(--spt-primary-dark));
	color: #fff;
	padding: 72px 0 84px;
	text-align: center;
}
.spt-hero h1 { font-size: 40px; margin: 0 0 12px; color: #fff; }
.spt-hero p { font-size: 18px; opacity: .9; margin: 0 auto 28px; max-width: 620px; }
.spt-hero-search {
	display: flex;
	max-width: 620px;
	margin: 0 auto;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.spt-hero-search input[type="search"] {
	flex: 1;
	border: 0;
	padding: 16px 20px;
	font-size: 16px;
	color: var(--spt-ink);
}
.spt-hero-search input[type="search"]:focus { outline: none; }
.spt-hero-search button {
	border: 0;
	background: var(--spt-primary);
	color: #fff;
	padding: 0 26px;
	font-weight: 600;
	cursor: pointer;
}
.spt-hero-search button:hover { background: var(--spt-primary-dark); }

/* ===========================================================================
   Section helpers
   ======================================================================== */
.spt-section { padding: 56px 0; }
.spt-section-head { text-align: center; margin-bottom: 36px; }
.spt-section-head h2 { font-size: 28px; margin: 0 0 8px; }
.spt-section-head p { color: var(--spt-muted); margin: 0; }

/* ===========================================================================
   Action cards (Submit / Track / Browse)
   ======================================================================== */
.spt-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 22px;
}
.spt-card {
	background: var(--spt-card);
	border: 1px solid var(--spt-line);
	border-radius: var(--spt-radius);
	padding: 28px;
	text-align: center;
	box-shadow: var(--spt-shadow);
	transition: transform .15s ease, box-shadow .15s ease;
	display: block;
	color: inherit;
}
.spt-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.1); text-decoration: none; color: inherit; }
.spt-card-icon {
	width: 56px; height: 56px;
	margin: 0 auto 16px;
	border-radius: 14px;
	display: grid; place-items: center;
	background: #e8f1fb; color: var(--spt-primary);
	font-size: 26px;
}
.spt-card h3 { margin: 0 0 8px; font-size: 19px; }
.spt-card p { margin: 0; color: var(--spt-muted); font-size: 15px; }

/* ===========================================================================
   KB / article grid
   ======================================================================== */
.spt-kb-section { background: #fff; border-top: 1px solid var(--spt-line); border-bottom: 1px solid var(--spt-line); }
.spt-kb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}
.spt-kb-item {
	border: 1px solid var(--spt-line);
	border-radius: var(--spt-radius);
	padding: 22px;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.spt-kb-item:hover { border-color: var(--spt-primary); box-shadow: var(--spt-shadow); }
.spt-kb-item h3 { margin: 0 0 8px; font-size: 18px; }
.spt-kb-item h3 a { color: var(--spt-ink); }
.spt-kb-item h3 a:hover { color: var(--spt-primary); text-decoration: none; }
.spt-kb-item p { color: var(--spt-muted); font-size: 15px; margin: 0 0 12px; }
.spt-kb-item .spt-readmore { font-weight: 600; font-size: 14px; }
.spt-kb-cat-count { font-size: 13px; color: var(--spt-muted); }

/* ===========================================================================
   Generic content / pages
   ======================================================================== */
.spt-main { padding: 48px 0; }
.spt-content-wrap { display: flex; gap: 40px; align-items: flex-start; }
.spt-content { flex: 1; min-width: 0; }
.spt-page-card {
	background: #fff;
	border: 1px solid var(--spt-line);
	border-radius: var(--spt-radius);
	box-shadow: var(--spt-shadow);
	padding: 36px;
}
.spt-page-card.is-wide { max-width: 860px; margin: 0 auto; }
.spt-entry-title { margin: 0 0 20px; font-size: 30px; }
.spt-entry-content > * { max-width: 100%; }
.spt-entry-content p { margin: 0 0 1em; }
.spt-entry-content img { border-radius: 8px; }
.spt-entry-meta { color: var(--spt-muted); font-size: 14px; margin-bottom: 16px; }
.spt-back-link { display: inline-block; margin-bottom: 18px; font-weight: 600; }

/* Breadcrumb */
.spt-breadcrumb { color: var(--spt-muted); font-size: 14px; margin-bottom: 18px; }
.spt-breadcrumb a { color: var(--spt-muted); }
.spt-breadcrumb a:hover { color: var(--spt-primary); }

/* ===========================================================================
   Sidebar
   ======================================================================== */
.spt-sidebar { width: 300px; flex-shrink: 0; }
.spt-widget {
	background: #fff;
	border: 1px solid var(--spt-line);
	border-radius: var(--spt-radius);
	padding: 22px;
	margin-bottom: 22px;
}
.spt-widget .widget-title { margin: 0 0 14px; font-size: 16px; }
.spt-widget ul { list-style: none; margin: 0; padding: 0; }
.spt-widget li { padding: 6px 0; border-bottom: 1px solid var(--spt-line); }
.spt-widget li:last-child { border-bottom: 0; }

/* ===========================================================================
   Pagination
   ======================================================================== */
.spt-pagination { margin-top: 32px; display: flex; justify-content: center; }
.spt-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 0 4px;
	border: 1px solid var(--spt-line);
	border-radius: 8px;
	background: #fff;
	color: var(--spt-ink);
}
.spt-pagination .page-numbers.current { background: var(--spt-primary); color: #fff; border-color: var(--spt-primary); }
.spt-pagination a.page-numbers:hover { border-color: var(--spt-primary); text-decoration: none; }

/* ===========================================================================
   404 / empty states
   ======================================================================== */
.spt-empty { text-align: center; padding: 60px 20px; }
.spt-empty h1 { font-size: 64px; margin: 0; color: var(--spt-primary); }
.spt-empty h2 { margin: 8px 0 12px; }
.spt-empty p { color: var(--spt-muted); }

/* ===========================================================================
   Footer
   ======================================================================== */
.spt-site-footer {
	background: #11243a;
	color: #cbd5e1;
	padding: 48px 0 24px;
	margin-top: 60px;
}
.spt-footer-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 32px;
	margin-bottom: 32px;
}
.spt-site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.spt-site-footer a { color: #cbd5e1; }
.spt-site-footer a:hover { color: #fff; }
.spt-footer-menu { list-style: none; margin: 0; padding: 0; }
.spt-footer-menu li { padding: 5px 0; }
.spt-footer-bottom {
	border-top: 1px solid rgba(255,255,255,.1);
	padding-top: 20px;
	font-size: 14px;
	color: #94a3b8;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

/* ===========================================================================
   Comments (KB articles / posts)
   ======================================================================== */
.spt-comments { margin-top: 32px; }
.spt-comments ol { list-style: none; margin: 0; padding: 0; }
.spt-comments .comment-body { padding: 16px 0; border-bottom: 1px solid var(--spt-line); }

/* ===========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 860px) {
	.spt-content-wrap { flex-direction: column; }
	.spt-sidebar { width: 100%; }
}
@media (max-width: 768px) {
	.spt-nav-toggle { display: block; }
	.spt-nav {
		position: absolute;
		top: 68px; left: 0; right: 0;
		background: #fff;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 10px 20px 20px;
		border-bottom: 1px solid var(--spt-line);
		box-shadow: var(--spt-shadow);
		display: none;
	}
	.spt-nav.is-open { display: flex; }
	.spt-menu { flex-direction: column; gap: 0; }
	.spt-menu li { border-bottom: 1px solid var(--spt-line); }
	.spt-menu a { display: block; padding: 12px 0; }
	.spt-header-actions { margin-top: 12px; }
	.spt-hero h1 { font-size: 30px; }
}
