/* Articles / Knowledge Base page (articles.html) */

/* Nav override for articles */
.nav {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  margin-bottom: 0;
  background: rgba(5, 8, 22, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.nav-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.brand span {
  font-size: 18px;
}

/* Hero section */
.kb-hero {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 24px 0;
  box-sizing: border-box;
}

.kb-hero-inner {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: var(--radius-xl);
  padding: 44px 28px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  background:
    radial-gradient(ellipse 60% 50% at 50% -20%, rgba(56, 189, 248, 0.15), transparent),
    var(--gradient-card);
  box-shadow: var(--shadow-lg), var(--shadow-inset);
}

.kb-hero-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 180px at 50% -30px, rgba(56, 189, 248, 0.18), transparent);
  pointer-events: none;
}

.kb-hero-inner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
}

.kb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.kb-hero h1 {
  position: relative;
  z-index: 1;
  margin: 12px 0 10px;
  font-size: clamp(32px, 4.5vw, 46px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kb-hero p {
  max-width: 720px;
  margin: 0 auto 18px;
  color: #9db0c8;
  font-size: 15px;
}

.kb-search {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(5, 8, 22, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.15);
  padding: 5px 5px 5px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  box-sizing: border-box;
  transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}

.kb-search:focus-within {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1), var(--shadow-sm);
}

.kb-search svg {
  margin-left: 8px;
  opacity: 0.7;
  flex-shrink: 0;
}

.kb-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #e2e8f0;
  padding: 10px 4px;
  font-size: 14px;
  min-width: 0;
}

.kb-search button {
  background: var(--gradient-brand);
  color: #00131c;
  font-weight: 700;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
  transition: all var(--duration) var(--ease-out);
}

.kb-search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.35);
}

/* Track chooser (AIX / Linux) */
.kb-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 6px;
}

.kb-track {
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--soft);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: border-color var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out),
    background var(--duration) var(--ease-out);
}

.kb-track:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.kb-track.active {
  border-color: rgba(56, 189, 248, 0.5);
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(56, 189, 248, 0.16), transparent),
    rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18), var(--shadow-md);
}

.kb-track-label {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kb-track.active .kb-track-label {
  color: #7dd3fc;
}

.kb-track-desc {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}

.kb-track-panel[hidden],
.filters[hidden] {
  display: none !important;
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
  margin-top: 8px;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

.chip:hover {
  border-color: rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

.chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.08));
  border-color: rgba(56, 189, 248, 0.45);
  color: #e0f6ff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 4px 12px rgba(56, 189, 248, 0.1);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  margin: 18px 0 22px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.section-head .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent);
}

.section-head.spaced {
  margin-top: 34px;
}

/* Article grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid .card {
  content-visibility: auto;
  contain-intrinsic-size: 1px 320px;
  min-height: 190px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--gradient-card);
  border: 1px solid rgba(56, 189, 248, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.grid .card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
}

.grid .card.featured {
  grid-column: span 2;
  padding: 32px;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(56, 189, 248, 0.1), transparent),
    var(--gradient-card);
  border-color: rgba(56, 189, 248, 0.22);
  min-height: 250px;
}

.grid .card.featured::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.7), rgba(139, 92, 246, 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.grid .card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.32;
}

.grid .card.featured h3 {
  font-size: 27px;
}

.grid .card h3 a {
  color: #f1f5f9;
  text-decoration: none;
}

.grid .card h3 a:hover,
.grid .card:hover h3 a {
  color: #7dd3fc;
}

.grid .card p {
  margin: 0 0 16px;
  color: #9eb3cb;
  font-size: 14.6px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}

.read {
  color: #7dd3fc;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: all var(--duration) var(--ease-out);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.read:hover,
.grid .card:hover .read {
  background: var(--gradient-brand);
  color: #00212f;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.meta {
  color: #64748b;
  font-size: 12px;
}

/* Linux series section */
.linux-series-wrapper {
  margin-top: 0;
}

.linux-series-header {
  background: linear-gradient(135deg, rgba(20, 33, 55, 0.95), rgba(11, 18, 31, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.linux-series-header h3 {
  font-size: 32px;
  margin: 10px 0 8px;
  color: var(--text);
}

.linux-series-header p {
  max-width: 760px;
  margin: 0 0 14px;
  color: #aebed3;
}

.linux-series-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  font-weight: 600;
  color: #c7d2e3;
  font-size: 14px;
}

.linux-series-meta span {
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 999px;
}

.linux-series-meta .meta-check-icon {
  color: #4ade80;
}

.linux-series-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.chapter-grid .card {
  position: relative;
  min-height: 275px;
  padding: 18px 20px;
}

.chapter-grid .card .tag {
  position: absolute;
  top: 18px;
  left: 18px;
  margin: 0;
  font-size: 11px;
  padding: 5px 10px;
}

.chapter-grid .difficulty-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #dbeafe;
}

.chapter-grid .card h3 {
  margin-top: 42px;
  min-height: 54px;
  padding-right: 100px;
  line-height: 1.25;
}

.chapter-grid .card p {
  min-height: 58px;
  margin-bottom: 12px;
  line-height: 1.55;
}

.chapter-grid .card .card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-grid .read {
  padding: 10px 16px;
}

/* No results message */
.no-results {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  margin-top: 20px;
}

.no-results.visible {
  display: block;
}

.no-results h3 {
  margin: 0 0 8px;
  color: #e2e8f0;
}

.no-results p {
  margin: 0;
}

.search-highlight {
  background: rgba(56, 189, 248, 0.35);
  color: #e0f6ff;
  padding: 0 2px;
  border-radius: 3px;
}

@media (max-width: 980px) {
  .kb-tracks {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid .card.featured {
    grid-column: span 2;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .kb-search input {
    width: 100%;
  }

  .kb-track {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid .card.featured {
    grid-column: span 1;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .linux-series-header h3 {
    font-size: 24px;
  }
}
