/* QuickDTC Forum — mobile-first stylesheet.
   Base styles below target a 375px viewport. Desktop enhancements live
   in the @media (min-width: 768px) block at the bottom. */

:root {
	--qdf-navy: #0f1923;
	--qdf-amber: #f5a623;
	--qdf-white: #ffffff;
	--qdf-text: #1a1f24;
	--qdf-text-muted: #6b7280;
	--qdf-border: #e5e7eb;
	--qdf-bg: #f4f5f7;
	--qdf-high-bg: #fee2e2;
	--qdf-high-text: #dc2626;
	--qdf-med-bg: #fffbeb;
	--qdf-med-text: #d97706;
	--qdf-low-bg: #f0fdf4;
	--qdf-low-text: #16a34a;
}

.qdf-body {
	background: var(--qdf-bg);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--qdf-text);
	margin: 0;
}

/* ---------- Site header (logo bar, present on every forum page) ---------- */

.qdf-site-header {
	background: var(--qdf-navy);
	padding: 12px 16px;
	display: flex;
	align-items: center;
}

.qdf-site-logo {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	text-decoration: none;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.01em;
	-webkit-tap-highlight-color: transparent;
}

.qdf-site-logo-quick {
	color: var(--qdf-white);
}

.qdf-site-logo-dtc {
	color: var(--qdf-amber);
}

.qdf-container {
	max-width: 720px;
	margin: 0 auto;
	padding: 12px 12px 48px;
}

.qdf-container-narrow {
	max-width: 560px;
}

/* ---------- Header ---------- */

.qdf-page-header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.qdf-page-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--qdf-navy);
	margin: 0;
}

.qdf-new-post-btn {
	align-self: flex-start;
}

/* ---------- Buttons ---------- */

.qdf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.qdf-btn-block {
	width: 100%;
}

.qdf-btn-primary {
	background: var(--qdf-amber);
	color: var(--qdf-navy);
}

.qdf-btn-primary:active {
	background: #e0941c;
}

.qdf-btn:disabled {
	opacity: 0.65;
	cursor: default;
}

.qdf-btn-secondary {
	background: var(--qdf-white);
	color: var(--qdf-navy);
	border: 1px solid var(--qdf-border);
}

/* ---------- Sort tabs ---------- */

.qdf-sort-tabs {
	display: flex;
	background: var(--qdf-white);
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--qdf-border);
	margin-bottom: 16px;
}

.qdf-sort-tab {
	flex: 1;
	text-align: center;
	padding: 12px 8px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--qdf-text-muted);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	border-right: 1px solid var(--qdf-border);
}

.qdf-sort-tab:last-child {
	border-right: none;
}

.qdf-sort-tab-active {
	background: var(--qdf-navy);
	color: var(--qdf-white);
}

/* ---------- Post list / cards ---------- */

.qdf-post-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qdf-post-card {
	display: block;
	background: var(--qdf-white);
	border-radius: 10px;
	padding: 12px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.qdf-post-card-body {
	flex: 1;
	min-width: 0;
}

.qdf-post-card-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: var(--qdf-text);
	text-decoration: none;
	margin-bottom: 6px;
	line-height: 1.35;
}

.qdf-post-card-title:visited,
.qdf-post-card-title:link,
.qdf-post-card-title:hover,
.qdf-post-card-title:active {
	color: var(--qdf-text);
}

.qdf-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--qdf-text-muted);
	background: #f3f4f6;
	padding: 6px 10px;
	border-radius: 6px;
	margin-bottom: 10px;
}

.qdf-meta-dot {
	color: var(--qdf-border);
}

.qdf-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.qdf-badge-guest {
	background: #eef2f7;
	color: var(--qdf-text-muted);
}

.qdf-badge-code {
	background: #fff4e0;
	color: #b9760f;
}

.qdf-badge-team {
	background: var(--qdf-navy);
	color: var(--qdf-amber);
}

.qdf-badge-member {
	background: #e0f2fe;
	color: #0369a1;
}

.qdf-comment-team {
	background: #fff8e6;
	border-left: 4px solid var(--qdf-amber);
	box-shadow: 0 1px 3px rgba(245,166,35,0.25);
}

/* ---------- Like / Dislike (shared by posts + comments) ---------- */

.qdf-like-dislike {
	display: flex;
	gap: 8px;
}

.qdf-like-dislike[data-vote-pending="1"] {
	opacity: 0.7;
}

.qdf-like-btn,
.qdf-dislike-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 14px;
	border: 1.5px solid var(--qdf-border);
	background: var(--qdf-white);
	border-radius: 999px;
	font-size: 15px;
	cursor: pointer;
	color: var(--qdf-text-muted);
	-webkit-tap-highlight-color: transparent;
}

.qdf-like-btn:active,
.qdf-dislike-btn:active {
	background: var(--qdf-bg);
}

.qdf-like-btn.qdf-liked {
	border-color: var(--qdf-low-text);
	background: var(--qdf-low-bg);
	color: var(--qdf-low-text);
	font-weight: 700;
}

.qdf-dislike-btn.qdf-disliked {
	border-color: var(--qdf-high-text);
	background: var(--qdf-high-bg);
	color: var(--qdf-high-text);
	font-weight: 700;
}

.qdf-like-count,
.qdf-dislike-count {
	font-size: 13px;
	font-weight: 700;
}

.qdf-comment-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 4px;
}

.qdf-thread-actions {
	display: none; /* superseded by the unified "Did this solve your problem?" card below the post */
}

/* ---------- "Did this solve your problem?" unified feedback card ---------- */

.qdf-helpful-widget {
	margin-top: 16px;
	padding: 18px 16px;
	background: #f7f8fa;
	border-radius: 10px;
	text-align: center;
}

.qdf-helpful-label {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--qdf-navy);
}

.qdf-helpful-votes {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-bottom: 10px;
}

.qdf-helpful-votes .qdf-like-btn,
.qdf-helpful-votes .qdf-dislike-btn {
	min-width: 110px;
	justify-content: center;
	font-weight: 600;
}

.qdf-helpful-summary {
	font-size: 13px;
	color: var(--qdf-text-muted);
	margin: 0;
	min-height: 18px;
}

.qdf-optional-tag {
	color: var(--qdf-text-muted);
	font-weight: 400;
	text-transform: none;
}

/* ---------- Empty state / pagination ---------- */

.qdf-empty-state {
	text-align: center;
	color: var(--qdf-text-muted);
	padding: 32px 16px;
	background: var(--qdf-white);
	border-radius: 10px;
}

.qdf-pagination {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 16px;
}

/* ---------- Forms ---------- */

.qdf-form {
	background: var(--qdf-white);
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 20px;
}

.qdf-form-row {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.qdf-form-group {
	margin-bottom: 14px;
}

.qdf-form-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--qdf-text);
	margin-bottom: 6px;
}

.qdf-input,
.qdf-textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	font-size: 16px; /* prevents iOS zoom-on-focus */
	border: 1px solid var(--qdf-border);
	border-radius: 8px;
	box-sizing: border-box;
	font-family: inherit;
	background: var(--qdf-white);
	color: var(--qdf-text);
}

.qdf-textarea {
	min-height: 100px;
	resize: vertical;
}

.qdf-textarea.qdf-autogrow {
	resize: none;
	overflow: hidden;
	min-height: 64px;
}

.qdf-input:focus,
.qdf-textarea:focus {
	outline: 2px solid var(--qdf-amber);
	outline-offset: 1px;
}

.qdf-form-hint {
	font-size: 12px;
	color: var(--qdf-text-muted);
	margin: 4px 0 0;
}

.qdf-form-status {
	font-size: 13px;
	margin-top: 10px;
	min-height: 18px;
}

.qdf-form-status.qdf-status-error {
	color: var(--qdf-high-text);
}

.qdf-form-status.qdf-status-success {
	color: var(--qdf-low-text);
}

.qdf-duplicate-notice {
	background: #fff8ec;
	border: 1px solid var(--qdf-amber);
	border-radius: 8px;
	padding: 12px 14px;
	margin-top: 12px;
	font-size: 14px;
}

.qdf-duplicate-notice p {
	margin: 0 0 8px;
	font-weight: 600;
	color: var(--qdf-navy);
}

.qdf-duplicate-link {
	display: block;
	color: var(--qdf-navy);
	text-decoration: underline;
	margin-bottom: 12px;
	font-size: 14px;
}

.qdf-duplicate-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Honeypot: visually hidden, but not display:none/type=hidden, so basic
   bots that skip hidden fields still trip it. */
.qdf-hp-wrap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Hero ---------- */

.qdf-hero {
	background: var(--qdf-navy);
	border-radius: 10px;
	padding: 18px 16px;
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.qdf-hero-brand {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.qdf-hero-title {
	font-size: 19px;
	font-weight: 700;
	color: var(--qdf-white);
}

.qdf-hero-tagline {
	font-size: 13px;
	color: #c7ccd4;
}

.qdf-hero-forum-btn {
	align-self: flex-start;
	background: var(--qdf-amber);
	color: var(--qdf-navy);
	border: none;
	font-weight: 700;
}

/* ---------- Popular Truck Problem Discussions ---------- */

.qdf-popular-section {
	margin-top: 24px;
	padding: 16px 14px;
	background: #eef0f3;
	border-radius: 12px;
}

.qdf-popular-heading {
	font-size: 16px;
	font-weight: 700;
	color: var(--qdf-navy);
	margin: 0 0 12px;
}

.qdf-popular-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.qdf-popular-item {
	display: block;
	background: var(--qdf-white);
	border-radius: 8px;
	padding: 12px 14px;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(0,0,0,0.06);
	color: var(--qdf-text);
}

.qdf-popular-item:visited,
.qdf-popular-item:link,
.qdf-popular-item:hover,
.qdf-popular-item:active {
	color: var(--qdf-text);
}

.qdf-popular-item-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: inherit;
	margin-bottom: 4px;
	line-height: 1.35;
}

.qdf-popular-item-meta {
	font-size: 12px;
	color: var(--qdf-text-muted);
}

/* ---------- Thread page ---------- */

.qdf-breadcrumb {
	font-size: 14px;
	margin-bottom: 12px;
}

.qdf-breadcrumb a {
	color: var(--qdf-text-muted);
	text-decoration: none;
}

.qdf-thread {
	background: var(--qdf-white);
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 16px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.qdf-thread-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--qdf-navy);
	margin: 0 0 8px;
	line-height: 1.3;
}

.qdf-thread-text {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.6;
}

.qdf-thread-text p {
	margin: 0 0 12px;
}

/* ---------- Code reference card ---------- */

.qdf-code-ref-card {
	background: var(--qdf-navy);
	color: var(--qdf-white);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
	border-left: 4px solid var(--qdf-amber);
}

.qdf-code-ref-header {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--qdf-amber);
	margin-bottom: 6px;
}

.qdf-code-ref-title {
	font-size: 16px;
	margin: 0 0 8px;
}

.qdf-code-ref-link {
	color: var(--qdf-amber);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.qdf-severity-high { border-left-color: var(--qdf-high-text); }
.qdf-severity-medium { border-left-color: var(--qdf-med-text); }
.qdf-severity-low { border-left-color: var(--qdf-low-text); }

/* ---------- Comments ---------- */

.qdf-comments-section {
	margin-bottom: 16px;
}

.qdf-comment-form-bottom {
	margin-top: 0;
}

.qdf-comments-heading {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 12px;
	color: var(--qdf-navy);
}

.qdf-comment-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qdf-comment {
	background: var(--qdf-white);
	border-radius: 10px;
	padding: 10px 12px;
}

.qdf-comment-row {
	display: block;
}

.qdf-comment-body-col {
	flex: 1;
	min-width: 0;
}

.qdf-comment-meta {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: var(--qdf-text-muted);
	margin-bottom: 6px;
	background: #f3f4f6;
	padding: 5px 9px;
	border-radius: 6px;
	width: fit-content;
}

.qdf-badge-reply {
	background: #ede9fe;
	color: #6d28d9;
}

.qdf-comment-text {
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 6px;
	word-wrap: break-word;
}

.qdf-comment-image-link {
	display: block;
	margin: 8px 0;
}

.qdf-comment-image {
	display: block;
	width: 100%;
	max-width: 100%;
	max-height: 360px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--qdf-border);
}

.qdf-reply-toggle {
	background: none;
	border: none;
	color: var(--qdf-text-muted);
	font-size: 12px;
	font-weight: 600;
	padding: 8px 0;
	min-height: 32px;
	cursor: pointer;
}

.qdf-admin-reply-toggle {
	background: none;
	border: none;
	color: #b9760f;
	font-size: 12px;
	font-weight: 700;
	padding: 8px 0;
	min-height: 32px;
	cursor: pointer;
	margin-left: auto;
}

.qdf-admin-reply-slot {
	margin-top: 8px;
	padding: 12px;
	background: #fff8e6;
	border: 1px solid var(--qdf-amber);
	border-radius: 8px;
}

.qdf-admin-reply-bottom {
	margin-bottom: 16px;
}

.qdf-admin-reply-bottom .qdf-admin-reply-toggle {
	margin-left: 0;
	background: #fff8e6;
	border: 1px solid var(--qdf-amber);
	border-radius: 8px;
	padding: 10px 14px;
	width: 100%;
	text-align: center;
}

.qdf-admin-reply-image-group {
	margin-top: 4px;
}

.qdf-file-input {
	display: block;
	width: 100%;
	font-size: 13px;
	margin-top: 4px;
}

.qdf-inline-notice {
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-bottom: 12px;
}

.qdf-inline-notice-success {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

/* ---------- Discuss CTA (rendered on QuickDTC code pages) ---------- */

.qdf-discuss-cta {
	margin-top: 16px;
}

.qdf-discuss-button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	width: 100%;
	background: var(--qdf-navy);
	color: var(--qdf-white);
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	box-sizing: border-box;
	padding: 10px 16px;
}

/* ---------- Admin (basic, desktop-oriented since wp-admin already is) --- */

.qdf-admin .qdf-stat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin: 16px 0 24px;
}

.qdf-admin .qdf-stat-card {
	background: var(--qdf-white);
	border: 1px solid var(--qdf-border);
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.qdf-admin .qdf-stat-card-flag {
	border-color: var(--qdf-high-text);
}

.qdf-admin .qdf-stat-num {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: var(--qdf-navy);
}

.qdf-admin .qdf-stat-label {
	font-size: 12px;
	color: var(--qdf-text-muted);
	text-transform: uppercase;
}

.qdf-row-flagged {
	background: var(--qdf-high-bg) !important;
}

/* =====================================================================
   Desktop enhancement — mobile is the default above this point.
   ===================================================================== */

@media (min-width: 768px) {
	.qdf-container {
		padding: 24px 16px 64px;
	}

	.qdf-page-header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.qdf-page-title {
		font-size: 26px;
	}

	.qdf-new-post-btn {
		align-self: auto;
	}

	.qdf-sort-tabs {
		max-width: 320px;
	}

	.qdf-form-row {
		flex-direction: row;
		gap: 12px;
	}

	.qdf-form-row .qdf-form-group {
		flex: 1;
	}

	.qdf-comment {
		padding: 12px 16px;
	}

	.qdf-admin .qdf-stat-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.qdf-build-marker {
	text-align: center;
	font-size: 11px;
	color: #c7ccd4;
	padding: 8px 0 16px;
	margin: 0;
}
