/* ==========================================================================
   Turbinou KB Theme � Docs estruturada
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand: #F58220;
  --brand-soft: rgba(245, 130, 32, 0.08);
  --brand-ring: rgba(245, 130, 32, 0.25);
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --ring-soft: rgba(24, 24, 27, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--zinc-50);
  color: var(--zinc-900);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.side-link.active {
    color: #ff7a00;
    font-weight: 600;
    background: rgba(255,122,0,.08);
    border-radius: 8px;
}

.side-link.active svg {
    color: #ff7a00;
}

.side-link:hover {
    color: #ff7a00;
}

.brand img{
  width: 150px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--brand-soft); color: var(--brand); }

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

/* -------- Header / Nav -------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--zinc-200);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--zinc-900);
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800;
  font-size: 14px;
}
.brand .muted { color: var(--zinc-400); font-weight: 500; }

.nav-links {
  display: flex; gap: 28px;
  font-size: 14px; font-weight: 500;
  color: var(--zinc-600);
}
.nav-links a:hover { color: var(--brand); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--zinc-900); color: #fff;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  transition: background .15s ease;
}
.nav-cta:hover { background: var(--brand); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* -------- Hero / Search -------- */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--zinc-900);
}
.hero p.lede {
  color: var(--zinc-600);
  font-size: 17px;
  max-width: 56ch;
  margin: 0 auto 36px;
}

.search-form {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.search-form input[type="search"] {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 48px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--zinc-900);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .15s ease, border-color .15s ease;
  font-family: inherit;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.search-form .icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--zinc-400);
  pointer-events: none;
}
.search-form button { display: none; }

/* -------- Category grid (home) -------- */
.section { padding: 56px 0 96px; }
.section-title {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400);
  margin: 0 0 24px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.cat-card {
  display: block;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--zinc-200);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cat-card:hover {
  border-color: var(--brand-ring);
  box-shadow: 0 4px 16px rgba(245, 130, 32, 0.06);
  transform: translateY(-1px);
}
.cat-icon {
  width: 40px; height: 40px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.cat-icon svg { width: 20px; height: 20px; }
.cat-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--zinc-900);
}
.cat-card p {
  margin: 0;
  font-size: 13px;
  color: var(--zinc-500);
  line-height: 1.5;
}
.cat-card .count {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--zinc-400);
}

/* -------- Subcategory / Category layout -------- */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 48px 0 96px;
}
.layout-article {
  grid-template-columns: 240px minmax(0, 1fr) 200px;
}
@media (max-width: 980px) {
  .layout, .layout-article { grid-template-columns: 1fr; gap: 32px; }
  .sidebar, .toc { display: none; }

  .brand img {
    width: 120px;
}
}

.sidebar nav { position: sticky; top: 96px; }
.sidebar .group-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400);
  padding: 0 12px; margin-bottom: 12px;
}
.sidebar a.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--zinc-600);
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar a.side-link:hover { background: var(--zinc-100); color: var(--zinc-900); }
.sidebar a.side-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.sidebar a.side-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* -------- Breadcrumb -------- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--zinc-400);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--zinc-700); }
.breadcrumb .sep { color: var(--zinc-300); }
.breadcrumb .current { color: var(--zinc-900); font-weight: 500; }

/* -------- Page headings -------- */
.page-title {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
}
.page-desc {
  color: var(--zinc-600);
  font-size: 16px;
  margin: 0 0 40px;
  max-width: 64ch;
}

/* -------- Article list (subcategory) -------- */
.article-group { margin-bottom: 48px; }
.article-group h3.group-title {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--zinc-400);
  margin: 0 0 18px;
}
.article-list { display: grid; gap: 10px; }
.article-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: 12px;
  font-weight: 500;
  color: var(--zinc-700);
  transition: border-color .15s, color .15s;
}
.article-row:hover {
  border-color: var(--brand-ring);
  color: var(--brand);
}
.article-row .chev { width: 16px; height: 16px; color: var(--zinc-300); transition: color .15s; }
.article-row:hover .chev { color: var(--brand); }

/* -------- Single article -------- */
.article {
  max-width: 720px;
}
.article h1 {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 14px;
}
.article .lede {
  font-size: 18px;
  color: var(--zinc-600);
  line-height: 1.55;
  margin-bottom: 32px;
}
.article-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; color: var(--zinc-500);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--zinc-200);
}

.article .content { font-size: 16px; color: var(--zinc-700); line-height: 1.75; }
.article .content h2 {
  font-size: 22px; font-weight: 600;
  color: var(--zinc-900);
  margin: 48px 0 16px;
  letter-spacing: -0.015em;
}
.article .content h3 {
  font-size: 17px; font-weight: 600;
  color: var(--zinc-900);
  margin: 32px 0 12px;
}
.article .content p { margin: 0 0 18px; }
.article .content ul, .article .content ol { padding-left: 22px; margin: 0 0 22px; }
.article .content li { margin-bottom: 8px; }
.article .content img {
  border-radius: 12px;
  border: 1px solid var(--zinc-200);
  margin: 24px 0;
}
.article .content a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(245,130,32,.35);
  text-underline-offset: 3px;
}
.article .content blockquote,
.article .content .callout {
  padding: 16px 18px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  margin: 24px 0;
  color: #7c3d0a;
  font-size: 14px;
}
.article .content code {
  background: var(--zinc-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--zinc-800);
}
.article .content pre {
  background: var(--zinc-900);
  color: #f4f4f5;
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.article .content pre code { background: transparent; color: inherit; padding: 0; }

/* -------- Feedback box -------- */
.feedback {
  margin-top: 56px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.feedback p { margin: 0; font-weight: 600; color: var(--zinc-900); }
.feedback small { display: block; color: var(--zinc-500); font-weight: 400; margin-top: 2px; }
.feedback-buttons { display: flex; gap: 8px; }
.feedback-buttons button {
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--zinc-200);
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--zinc-700);
  transition: all .15s;
}
.feedback-buttons button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* -------- TOC -------- */
.toc { position: sticky; top: 96px; align-self: start; }
.toc h4 {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--zinc-400);
  margin: 0 0 16px;
}
.toc ul { list-style: none; padding: 0; margin: 0 0 32px; }
.toc li { margin-bottom: 10px; }
.toc a {
  font-size: 13px; color: var(--zinc-500);
  display: block;
  transition: color .15s;
}
.toc a:hover, .toc a.active { color: var(--brand); }

.related {
  border-top: 1px solid var(--zinc-200);
  padding-top: 20px;
}
.related a {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--zinc-700);
  margin-bottom: 12px;
  line-height: 1.4;
}
.related a:hover { color: var(--brand); }

/* -------- Footer -------- */
.site-footer {
  border-top: 1px solid var(--zinc-200);
  background: #fff;
  padding: 32px 0;
  margin-top: 64px;
}
.site-footer .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--zinc-500);
}
.site-footer .links { display: flex; gap: 24px; }
.site-footer a:hover { color: var(--brand); }

/* -------- Empty / search results -------- */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--zinc-500);
}
.empty h2 { color: var(--zinc-900); margin: 0 0 8px; }

/* -------- Pagination -------- */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin: 40px 0;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--zinc-200);
  background: #fff;
  color: var(--zinc-600);
}
.pagination .current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
