/*
Theme Name: KnowledgeFlow
Theme URI: https://example.com/knowledgeflow
Author: Generated by ChatGPT
Author URI: https://example.com
Description: A clean, modern Knowledge Base theme with AJAX search, category tabs, and Customizer options.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: knowledgeflow
Tags: knowledge-base, documentation, responsive, clean
*/

:root {
  --kf-primary: #2563eb;
  --kf-secondary: #7c3aed;
  --kf-text: #1f2937;
  --kf-bg: #ffffff;
  --kf-card: #f9fafb;
  --kf-border: #e5e7eb;
  --kf-topbar-bg: #0a0a0a;
  --kf-menu-color: #ffffff;
  --kf-menu-hover: #f97316;
  --kf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base */
* { box-sizing: border-box; }
body {
  font-family: var(--kf-font);
  color: var(--kf-text);
  background: var(--kf-bg);
  margin: 0;
  line-height: 1.6;
}
.kf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Top Header (Navigation Bar) */
.kf-topbar {
  background: var(--kf-topbar-bg);
  padding: 14px 0;
  transition: background-color 0.3s ease-in-out;
  position: relative;
}
.kf-topbar .kf-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
}
.kf-logo { height: 28px; }
.kf-menu { list-style: none; display: inline-flex; gap: 24px; margin: 0; padding: 0; }
.kf-menu li a { color: var(--kf-menu-color); text-decoration: none; font-weight: 500; }

/* Header (Support Section) */
.kf-header {
  background: linear-gradient(135deg, var(--kf-primary), var(--kf-secondary));
  padding: 36px 0;
  color: #fff;
  position: relative;
  text-align: center;
}
.kf-header .kf-inner { max-width: 900px; margin: 0 auto; }
.kf-title { font-size: 36px; margin: 0; font-weight: 700; }
.kf-subtitle { opacity: 0.95; margin-top: 8px; font-size: 15px; color: rgba(255,255,255,0.9); }

/* Search Bar */
/* Search Bar - Full Width Centered Fix */
.kf-search-wrapper {
  max-width: 900px;
  width: 90%;
  margin: 24px auto;
  display: flex;
  justify-content: center;
}

.kf-search {
  position: relative;
  flex: 1;
}

.kf-search input {
  width: 100%;
  padding: 14px 52px 14px 20px;
  border-radius: 10px;
  border: none;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  font-size: 16px;
}

.kf-search button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #ec407a;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 768px) {
  .kf-search-wrapper {
    max-width: 100%;
    width: 94%;
    margin: 20px auto;
  }

  .kf-search input {
    font-size: 15px;
    padding: 12px 48px 12px 16px;
  }

  .kf-search button {
    padding: 8px 12px;
  }
}


.kf-search { position: relative; }
.kf-search input { width: 100%; padding: 14px 48px 14px 16px; border-radius: 10px; border: none; box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.kf-search button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: #ec407a; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; }

/* Tabs */
.kf-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 12px 0; margin-top: 8px; }
.kf-tab { background: var(--kf-card); border: 1px solid var(--kf-border); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.kf-tab.active { background: var(--kf-primary); color: #fff; border-color: var(--kf-primary); }

/* Grid (Article Cards) */
.kf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 28px 0; }
.kf-card { background: var(--kf-card); border: 1px solid var(--kf-border); padding: 20px; border-radius: 12px; cursor: pointer; transition: all 0.18s; }
.kf-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); border-color: var(--kf-primary); }
.kf-card h3 { margin: 0 0 8px; font-size: 18px; }
.kf-card p { margin: 0; color: #6b7280; font-size: 14px; }

/* Single Post */
.kf-single { max-width: 880px; margin: 32px auto; padding: 0 20px; }
.kf-single h1 { font-size: 36px; margin-bottom: 10px; }
.kf-single .meta { color: #6b7280; margin-bottom: 18px; border-bottom: 1px solid var(--kf-border); padding-bottom: 12px; }

/* Footer */
.kf-footer { padding: 28px 0; text-align: center; color: #6b6b6b; border-top: 1px solid var(--kf-border); margin-top: 30px; }

/* Responsive */
@media (max-width: 768px) {
  .kf-header .kf-inner { flex-direction: column; align-items: flex-start; text-align:left; padding: 20px; }
  .kf-title { font-size: 24px; }
  .kf-search-wrapper { margin-top: 25px; max-width: 100%; }
}

/* Fix custom logo size */
.custom-logo {
  height: 32px !important;
  width: auto !important;
  max-height: 40px;
  object-fit: contain;
  vertical-align: middle;
}

/* Breadcrumbs */
.kf-breadcrumbs {
  font-size: 14px;
  margin: 20px 0 10px;
  color: #6b7280;
}
.kf-breadcrumbs a {
  color: var(--kf-primary);
  text-decoration: none;
}
.kf-breadcrumbs span {
  margin: 0 6px;
  color: #9ca3af;
}
.kf-breadcrumbs a:hover {
  text-decoration: underline;
}
.kf-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
/* ================================
   Mobile Header Fix
   ================================ */
@media (max-width: 540px) {

  .kf-topbar {
    padding: 10px 0;
  }

  .kf-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
  }

  /* Make logo+title smaller */
  .custom-logo {
    max-height: 28px !important;
  }

  .kf-inner div[style*="color:#fff;font-weight:600;"] {
    font-size: 14px !important;
  }

  /* Compact button style */
  .kf-header-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #ff7a3d;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
  }
  .kf-header-btn::before {
  content: "☰"; /* three-line hamburger icon */
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  text-align: center;
  transform: translateY(1px);
}
  /* Hide button text only on small screens */
  .kf-header-btn span {
    display: none;
  }

  .kf-header-btn:hover {
    opacity: 0.9;
  }
}
/* ================================
   Fix Header Title & Subtitle Alignment
   ================================ */
@media (max-width: 768px) {
  .kf-header-content {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
  }

  .kf-header-content h1,
  .kf-header-content p {
    text-align: center !important;
    width: 100%;
  }

  /* Optional: shrink title size a bit for mobile */
  .kf-header-content h1 {
    font-size: 24px !important;
  }

  .kf-header-content p {
    font-size: 15px !important;
  }
}
/* ================================
   Header Title + Subtitle Alignment Fix
   ================================ */
.kf-header-content {
  text-align: center;
}

.kf-header-content .kf-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.kf-header-content .kf-subtitle {
  font-size: 16px;
  color: #d1d5db;
}

/* Mobile fix */
@media (max-width: 768px) {
  .kf-header-content {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
  }

  .kf-header-content .kf-title {
    font-size: 24px !important;
  }

  .kf-header-content .kf-subtitle {
    font-size: 15px !important;
  }

  .kf-search-wrapper {
    text-align: center;
  }

  .kf-search {
    justify-content: center;
  }
}

/* ================================
   Absolute Header Centering Fix
   ================================ */

.kf-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.kf-header .kf-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  gap: 8px;
}

.kf-header-content,
.kf-header-content * {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.kf-header .kf-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.kf-header .kf-subtitle {
  font-size: 16px;
  color: #d1d5db;
}

/* ================================
   HEADER TITLE & SUBTITLE CENTER FIX (FINAL)
   ================================ */

/* Desktop and general layout */
.kf-header {
  background: linear-gradient(135deg, var(--kf-primary), var(--kf-secondary));
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.kf-header .kf-inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.kf-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 6px;
}

.kf-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

/* Search Bar Centering */
.kf-search-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.kf-search {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Responsive refinement */
@media (max-width: 768px) {
  .kf-header {
    padding: 30px 0;
  }

  .kf-header .kf-inner {
    padding: 0 20px;
  }

  .kf-title {
    font-size: 24px !important;
  }

  .kf-subtitle {
    font-size: 15px !important;
  }

  .kf-search-wrapper {
    padding: 0 20px;
  }

  .kf-search input {
    width: 100%;
    max-width: 340px;
  }
}
/* ================================
   Scrollable Category Tabs
   ================================ */
.kf-category-bar-wrapper {
  position: relative;
  overflow: hidden;
  margin: 20px auto;
  width: 100%;
}

.kf-category-bar {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  scroll-behavior: smooth;
  padding: 8px 16px;
  -ms-overflow-style: none;  /* Hide scrollbar in IE and Edge */
  scrollbar-width: none;     /* Hide scrollbar in Firefox */
}

/* Hide scrollbar in WebKit browsers (Chrome, Safari, Opera) */
.kf-category-bar::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Prevent accidental vertical scrollbars */
.kf-category-bar::-webkit-scrollbar-track,
.kf-category-bar::-webkit-scrollbar-thumb {
  background: transparent;
  border: none;
}


.kf-category-bar a {
  background: #f0f2f5;
  border-radius: 8px;
  padding: 8px 16px;
  color: #222;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.kf-category-bar a:hover {
  background: #e3e6ea;
}

.kf-category-bar a.active {
  background: var(--kf-primary, #2b6ff0);
  color: #fff;
}

/* Fading Edges */
.kf-category-bar-wrapper::before,
.kf-category-bar-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.kf-category-bar-wrapper::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.kf-category-bar-wrapper::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}
/* Prevent touch bounce scroll (iOS fix) */
.kf-category-bar {
  -webkit-overflow-scrolling: touch;
}


/* Mobile tweaks */
@media (max-width: 768px) {
  .kf-category-bar {
    gap: 8px;
    padding: 6px 12px;
  }

  .kf-category-bar a {
    padding: 6px 14px;
    font-size: 14px;
  }
}
.kf-title a:hover {
  opacity: 0.9;
}


