/*
Theme Name: KB Support Theme
Theme URI: https://olatechsupport.com/kb-support-theme
Author: Olamide
Author URI: https://olatechsupport.com/
Description: Knowledge base theme for IT tech support with live AJAX search, synonyms, voting, views, contact, and role-based visibility.
Version: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kb-support
*/

/* Basic Reset & Typography */
*{box-sizing:border-box}html{font-size:16px}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;line-height:1.6;color:#1f2937;background:#f9fafb}
a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
.container{max-width:1100px;margin:0 auto;padding:1rem}
.site-header{background:#111827;color:#fff;padding:.75rem 0}
.site-title{margin:0;font-size:1.25rem}
.site-branding { display:flex; align-items:center; justify-content: center; gap:.5rem; }
.site-branding .custom-logo { max-height:150px; height:auto; width:auto; }
.site-title { font-weight:700; text-decoration:none; }
.site-nav a{color:#e5e7eb;margin-right:1rem}
.hero{padding:3rem 0;text-align:center;background:#111827;color:#fff}
.search-wrap{max-width:720px;margin:1.25rem auto;position:relative}
.search-wrap input[type="search"]{width:100%;padding:0.85rem 1rem;border-radius:0.75rem;border:1px solid #d1d5db;outline:none}
.results-list{margin-top:.75rem;background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;overflow:hidden}
.result-item{padding:.75rem 1rem;border-top:1px solid #f3f4f6}
.result-item:first-child{border-top:none}
.badge{display:inline-block;padding:.1rem .5rem;border-radius:.5rem;background:#e5e7eb;color:#374151;font-size:.75rem;margin-right:.25rem}
.grid{display:grid;gap:1rem}
.grid-3{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:0.75rem;padding:1rem}
.card h3{margin-top:0}
.footer{background:#111827;color:#9ca3af;padding:2rem 0;margin-top:3rem}
.breadcrumbs{font-size:.875rem;margin:.5rem 0}
.kb-meta{font-size:.875rem;color:#6b7280}
.kb-content{margin-top:1rem}
.category-filter{margin:1rem 0}
button, .button{background:#2563eb;color:#fff;border:none;border-radius:.5rem;padding:.6rem .9rem;cursor:pointer}
button:hover,.button:hover{opacity:0.95}

/* Search input + button */
.search-row{display:flex;gap:.5rem;align-items:center}
.search-row input[type="search"]{flex:1}
.search-row button{white-space:nowrap}

/* Helpfulness voting & contact */
.kb-helpful{margin-top:1.5rem;padding:1rem;border:1px solid #e5e7eb;border-radius:.75rem;background:#fff}
.kb-helpful p{margin:.25rem 0 .75rem}
.kb-helpful .buttons{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.kb-helpful .buttons button{padding:.5rem .85rem;border-radius:.5rem;border:1px solid #d1d5db;background:#f3f4f6;color:#111827}
.kb-helpful .buttons button[data-active="1"]{background:#2563eb;color:#fff;border-color:#2563eb}
.kb-vote-count{font-size:.875rem;color:#6b7280;margin-left:.5rem}
.kb-views{font-size:.875rem;color:#6b7280;margin-left:.5rem}
.kb-contact{margin-top:1rem;padding:1rem;border:1px dashed #cbd5e1;border-radius:.75rem;background:#f8fafc}
.kb-contact h4{margin:.25rem 0 .5rem}
.kb-contact form{display:grid;gap:.5rem}
.kb-contact input,.kb-contact textarea{width:100%;padding:.6rem .75rem;border:1px solid #d1d5db;border-radius:.5rem}
.kb-contact button{align-self:start}

/* No-results block */
.kb-no-results{padding:1rem}
.kb-no-results strong{display:block;margin-bottom:.25rem}

@media (prefers-color-scheme: dark){
  body{background:#0f172a;color:#e5e7eb}
  .card,.results-list{background:#111827;border-color:#1f2937}
  .search-wrap input[type="search"]{background:#0b1220;color:#e5e7eb;border-color:#1f2937}
  .site-nav a{color:#cbd5e1}
  .kb-helpful{background:#111827;border-color:#1f2937}
  .kb-contact{background:#0b1220;border-color:#1f2937}
  .kb-helpful .buttons button{background:#1f2937;color:#e5e7eb;border-color:#334155}
}

/* Thank-you success block */
.results-list .kb-thanks{
  background: #ECFDF5;         /* light green */
  border: 1px solid #10B981;   /* emerald */
  color: #065F46;               /* dark teal text */


}
.results-list .kb-thanks strong{
  display: block;
}

/* Dark mode variant */
@media (prefers-color-scheme: dark){
  .results-list .kb-thanks{
    background: #062E27;       /* deep green */
    border-color: #10B981;
    color: #D1FAE5;            /* mint text */
  }
}

/* Force readable text in the no-results + contact sections */
.results-list .kb-no-results,
.results-list .kb-no-results strong,
.results-list .kb-no-results div,
.results-list .kb-contact,
.results-list .kb-contact h4 {
  color: #111827; /* dark text */
}

/* Slightly softer 2nd line under "No results found" */
.results-list .kb-no-results div { color: #374151; }

/* Inputs should stay dark-on-light */
.results-list .kb-contact input,
.results-list .kb-contact textarea {
  color: #111827;
  background: #ffffff;
}

/* Keep good contrast when the OS is in dark mode */
@media (prefers-color-scheme: dark){
  .results-list .kb-no-results,
  .results-list .kb-no-results strong,
  .results-list .kb-no-results div,
  .results-list .kb-contact,
  .results-list .kb-contact h4 {
    color: #e5e7eb; /* light text on dark */
  }
  .results-list .kb-no-results div { color: #cbd5e1; }
  .results-list .kb-contact input,
  .results-list .kb-contact textarea {
    background: #0b1220;
    color: #e5e7eb;
  }
}
/* KB search: make article description (excerpt) pure black */
.results-list .result-item a + div {
  color: #000;
}

/* Keep good contrast in dark mode (optional, but recommended) */
@media (prefers-color-scheme: dark){
  .results-list .result-item a + div {
    color: #e5e7eb;
  }
}