/* ExKnowledge.com — Light theme, Flowcase-inspired */
:root {
  --bg: #1e2a38;
  --bg-card: #263545;
  --bg-card-hover: #2d3e50;
  --bg-nav: #1a2535;
  --border: #344556;
  --border-light: #2e3f50;
  --text: #d8dce0;
  --text-muted: #8896a4;
  --text-bright: #f0f2f4;
  --accent: #4a9fd9;
  --accent-light: #6bb5e5;
  --accent-bg: rgba(74,159,217,0.12);
  --accent-green: #4ecdc4;
  --accent-orange: #f0a760;
  --accent-red: #e74c3c;
  --accent-yellow: #f9ca63;
  --radius: 16px;
  --max-w: 1120px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: all 0.2s; }
a:hover { color: #5a4bd6; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  background: rgba(26,37,53,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
body { padding-top: 62px; }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 20px; font-weight: 800; color: var(--text-bright); z-index: 9010; letter-spacing: -0.3px; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text-bright); }
.nav-links a.active { color: var(--accent); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; position: relative; z-index: 9010;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text-bright);
  position: absolute; left: 5px; transition: all 0.3s; border-radius: 2px;
}
.nav-toggle span:nth-child(1) { top: 8px; }
.nav-toggle span:nth-child(2) { top: 15px; }
.nav-toggle span:nth-child(3) { top: 22px; }
.nav-toggle.open span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

/* --- Hero --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 { font-size: 52px; font-weight: 800; color: var(--text-bright); margin-bottom: 20px; letter-spacing: -1px; line-height: 1.1; }
.hero h1 span { color: var(--accent); }
.hero .subtitle { font-size: 19px; color: var(--text-muted); max-width: 580px; margin: 0 auto 36px; line-height: 1.6; font-weight: 400; }
.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block; padding: 14px 32px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(74,159,217,0.3); }
.btn-primary:hover { background: #3a8ec8; color: #fff; box-shadow: 0 4px 16px rgba(74,159,217,0.4); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-bright); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* --- Topic Grid --- */
.section { padding: 64px 0; }
.section-title { font-size: 34px; font-weight: 800; color: var(--text-bright); margin-bottom: 12px; letter-spacing: -0.5px; }
.section-subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: 40px; max-width: 560px; }

.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.topic-card {
  background: var(--bg-card); border: 1.5px solid var(--border-light); border-radius: var(--radius);
  padding: 28px; transition: all 0.25s; cursor: pointer; position: relative;
  text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow-sm);
}
.topic-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.topic-card .icon { font-size: 28px; margin-bottom: 12px; display: block; }
.topic-card h3 { font-size: 17px; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.topic-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.topic-card .tag {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; margin-top: 12px;
}

/* --- Content Page --- */
.content-page { padding: 48px 0 80px; }
.content-page .breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.content-page .breadcrumb a { color: var(--text-muted); }
.content-page .breadcrumb a:hover { color: var(--accent); }

.content-body {
  max-width: 820px; flex: 1; min-width: 0;
  background: var(--bg-card); border: 1.5px solid var(--border-light); border-radius: var(--radius);
  padding: 48px; line-height: 1.8; box-shadow: var(--shadow-sm);
}
.content-body h1 { font-size: 34px; font-weight: 800; color: var(--text-bright); margin-bottom: 8px; letter-spacing: -0.5px; }
.content-body .page-intro { font-size: 17px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.7; }
.content-body h2 { font-size: 22px; font-weight: 700; color: var(--text-bright); margin: 40px 0 16px; padding-top: 24px; border-top: 1px solid var(--border-light); }
.content-body h3 { font-size: 17px; font-weight: 600; color: var(--text-bright); margin: 28px 0 12px; }
.content-body h4 { font-size: 15px; font-weight: 600; color: var(--text-bright); margin: 20px 0 8px; }
.content-body p { margin-bottom: 16px; }
.content-body ul, .content-body ol { margin: 0 0 16px 20px; padding-left: 0; }
.content-body li { margin-bottom: 8px; padding-left: 4px; }
.content-body li ul, .content-body li ol { margin-top: 8px; margin-bottom: 4px; }
.content-body strong { color: var(--text-bright); }
.content-body code { background: var(--accent-bg); color: var(--accent); padding: 2px 7px; border-radius: 5px; font-size: 13px; word-break: break-word; }
.content-body pre { background: #1a2535; border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; margin: 16px 0 24px; }
.content-body pre code { background: none; color: var(--text); padding: 0; font-size: 13px; line-height: 1.5; word-break: normal; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border-radius: 12px; border: 1px solid var(--border); -webkit-overflow-scrolling: touch; box-shadow: var(--shadow-sm); }
.content-body table { width: 100%; border-collapse: collapse; font-size: 14px; display: table; margin: 0; background: var(--bg-card); }
.content-body th { text-align: left; padding: 12px 16px; border-bottom: 2px solid var(--border); color: var(--text-bright); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(0,0,0,0.15); }
.content-body td { padding: 11px 16px; border-bottom: 1px solid var(--border-light); }
.content-body tr:hover td { background: rgba(255,255,255,0.03); }

/* Sidebar */
.content-layout { display: flex; gap: 40px; }
.content-sidebar { width: 260px; flex-shrink: 0; }
.sidebar-card { background: var(--bg-card); border: 1.5px solid var(--border-light); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: sticky; top: 78px; box-shadow: var(--shadow-sm); }
.sidebar-card h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 12px; font-weight: 700; }
.sidebar-card a { display: block; padding: 6px 0; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.sidebar-card a:hover { color: var(--accent); }
.sidebar-card a.current { color: var(--accent); font-weight: 600; }

/* --- Stats Bar --- */
.stats-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 32px 0; }
.stat-item {
  background: var(--bg-card); border: 1.5px solid var(--border-light); border-radius: 14px;
  padding: 18px 32px; text-align: center; min-width: 110px; box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; font-weight: 600; }

/* --- Image Strip --- */
.image-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 0 0 20px; overflow: hidden;
}
.image-strip img {
  width: 100%; height: 180px; object-fit: cover; border-radius: 12px;
  transition: transform 0.3s; box-shadow: var(--shadow-sm);
}
.image-strip img:hover { transform: scale(1.02); }

/* --- Content Hero Image --- */
.content-hero {
  width: 100%; height: 240px; object-fit: cover; border-radius: var(--radius);
  margin-bottom: 32px; box-shadow: var(--shadow-md);
}

/* --- Footer --- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; text-align: center; background: var(--bg-nav); }
.footer p { font-size: 13px; color: var(--text-muted); }

/* ========================= */
/* --- MOBILE / RESPONSIVE --- */
/* ========================= */

@media (max-width: 900px) {
  .content-layout { flex-direction: column; }
  .content-sidebar { width: 100%; order: -1; }
  .sidebar-card { position: static; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; gap: 0;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #1a2535;
    padding: 80px 32px 32px;
    z-index: 9005;
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border-light); }
  .nav-links a { display: block; padding: 18px 0; font-size: 18px; color: var(--text); }
  .nav-links a:hover, .nav-links a.active { color: var(--accent); }

  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 30px; letter-spacing: -0.5px; }
  .hero .subtitle { font-size: 15px; margin-bottom: 24px; }
  .hero-cta .btn { padding: 12px 24px; font-size: 14px; }

  .stats-bar { gap: 8px; padding: 20px 0; }
  .stat-item { padding: 12px 18px; min-width: 70px; }
  .stat-num { font-size: 22px; }

  .image-strip { grid-template-columns: 1fr; gap: 8px; }
  .image-strip img { height: 140px; }

  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .topic-grid { grid-template-columns: 1fr; gap: 12px; }
  .topic-card { padding: 20px; }

  .content-page { padding: 20px 0 48px; }
  .content-body { padding: 20px; border-radius: 12px; }
  .content-body h1 { font-size: 24px; }
  .content-body h2 { font-size: 19px; margin: 28px 0 12px; padding-top: 16px; }
  .content-hero { height: 160px; margin-bottom: 20px; border-radius: 12px; }

  .table-wrap { margin-left: -20px; margin-right: -20px; border-radius: 0; border-left: none; border-right: none; }

  .content-sidebar { width: 100%; order: -1; margin-bottom: 16px; }
  .sidebar-card { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 12px 16px; }
  .sidebar-card h4 { width: 100%; margin-bottom: 4px; }
  .sidebar-card a { padding: 5px 10px; font-size: 12px; background: rgba(0,0,0,0.15); border-radius: 8px; }
  .sidebar-card a.current { background: var(--accent-bg); color: var(--accent); }

  .footer { padding: 24px 0; }
  .container { padding: 0 16px; }
  .audience-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  .stat-item { min-width: 60px; padding: 10px 12px; }
  .stat-num { font-size: 18px; }
  .content-body { padding: 16px; }
  .content-body h1 { font-size: 22px; }
}

/* Qualification questions list */
.qual-questions { padding-left: 1.2em; }
.qual-questions li { margin-bottom: 10px; line-height: 1.6; }
.qual-questions li a { color: var(--accent); }

/* Search */
.search-toggle { cursor: pointer; font-size: 16px; }
.search-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(10,18,26,0.85); backdrop-filter: blur(4px); align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.open { display: flex; }
.search-box { width: 90%; max-width: 600px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.search-input { width: 100%; padding: 16px 50px 16px 20px; background: transparent; border: none; color: var(--text-bright); font-size: 17px; outline: none; }
.search-input::placeholder { color: var(--text-muted); }
.search-close { position: absolute; right: 16px; top: 14px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.search-close:hover { color: var(--text-bright); }
.search-box { position: relative; }
.search-results { max-height: 420px; overflow-y: auto; border-top: 1px solid var(--border); }
.search-hint { padding: 20px; color: var(--text-muted); font-size: 14px; text-align: center; }
.search-result { display: block; padding: 14px 20px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background 0.15s; }
.search-result:hover { background: var(--bg-card-hover); }
.search-result-page { display: block; font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.search-result-heading { display: block; font-size: 15px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.search-result-snippet { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.search-result-snippet mark { background: var(--accent-bg); color: var(--accent-light); border-radius: 2px; padding: 0 2px; }
@media (max-width: 768px) {
  .search-overlay { padding-top: 20px; }
  .search-box { width: 95%; }
  .search-results { max-height: 60vh; }
}
