/* =====================================================================
   自由IT同盟 — Documentation layout (portal + sidebar nav)
   ===================================================================== */

/* ============ DOCS PORTAL (home) ============ */
.docs-hero { padding: 56px 0 18px; text-align: center; }
.docs-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: .1em; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 5px 13px; border-radius: 100px; margin-bottom: 22px;
}
.docs-hero h1 { font-size: 40px; font-weight: 900; line-height: 1.34; letter-spacing: .01em; }
.docs-hero h1 .hl { color: var(--brand-ink); }
.docs-hero p { font-size: 16px; color: var(--ink-2); margin: 16px auto 0; max-width: 34em; }
.docs-search {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow); max-width: 560px; margin: 30px auto 0;
  transition: border-color .15s, box-shadow .15s;
}
.docs-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 4px var(--brand-soft); }
.docs-search svg { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.docs-search input { flex: 1; border: 0; outline: none; background: none; font-family: inherit; font-size: 15.5px; color: var(--ink); }
.docs-search .hint { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.quick-links { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.quick-links .label { font-size: 12px; color: var(--ink-3); }

/* portal: section of category doc-cards */
.portal { padding: 26px 0 10px; }
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.doc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 22px 14px; transition: transform .16s, box-shadow .16s, border-color .16s;
  display: flex; flex-direction: column;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in oklch, var(--cat) 30%, var(--line)); }
.doc-card .dc-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 14px; }
.doc-card .dc-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  color: var(--cat); background: color-mix(in oklch, var(--cat) 12%, white);
  border: 1px solid color-mix(in oklch, var(--cat) 24%, white);
}
.doc-card .dc-ico svg { width: 24px; height: 24px; }
.doc-card .dc-head .dc-title { min-width: 0; padding-top: 2px; }
.doc-card .dc-head h3 { font-size: 15.5px; font-weight: 900; line-height: 1.35; }
.doc-card .dc-head p { font-size: 11px; color: var(--ink-3); font-family: var(--mono); margin: 4px 0 0; letter-spacing: .02em; }
.doc-card .dc-links { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); padding-top: 6px; }
.doc-card .dc-links a {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2);
  padding: 8px 6px; border-radius: 8px; transition: background .14s, color .14s; line-height: 1.4;
}
.doc-card .dc-links a:hover { background: color-mix(in oklch, var(--cat) 8%, white); color: var(--cat); }
.doc-card .dc-links a svg { width: 14px; height: 14px; color: var(--cat); flex-shrink: 0; opacity: .7; }
.doc-card .dc-more { margin-top: auto; padding-top: 8px; font-size: 12.5px; font-weight: 700; font-family: var(--head); color: var(--cat); display: inline-flex; align-items: center; gap: 6px; }

/* portal: getting-started band */
.start-band {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px;
}
.start-card {
  display: flex; align-items: flex-start; gap: 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  transition: border-color .15s, background .15s;
}
.start-card:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.start-card .sn { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-line); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.start-card h4 { font-size: 14.5px; font-weight: 700; }
.start-card p { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 0; line-height: 1.6; }

/* ============ SIDEBAR NAV (doc pages) ============ */
.docs-shell { display: grid; grid-template-columns: 268px 1fr; gap: 0; align-items: start; max-width: 1480px; margin: 0 auto; padding: 0 24px; }
.docs-nav {
  position: sticky; top: 68px; align-self: start;
  max-height: calc(100vh - 68px); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 26px 22px 40px 0;
}
.docs-nav::-webkit-scrollbar { width: 8px; }
.docs-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.nav-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; margin-bottom: 18px;
}
.nav-search svg { width: 15px; height: 15px; color: var(--ink-3); }
.nav-search input { border: 0; background: none; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); width: 100%; }
.nav-group { margin-bottom: 4px; }
.nav-group > .ng-head {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  font-family: var(--head); font-weight: 700; font-size: 13.5px; color: var(--ink);
  background: none; border: 0; padding: 8px 10px; border-radius: 8px; transition: background .14s;
}
.nav-group > .ng-head:hover { background: var(--surface-3); }
.nav-group > .ng-head .ng-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--cat, var(--brand)); flex-shrink: 0; }
.nav-group > .ng-head .chev { margin-left: auto; transition: transform .18s; color: var(--ink-3); }
.nav-group.collapsed > .ng-head .chev { transform: rotate(-90deg); }
.nav-group .ng-items { display: flex; flex-direction: column; margin: 2px 0 6px; padding-left: 19px; border-left: 1px solid var(--line); margin-left: 14px; overflow: hidden; }
.nav-group.collapsed .ng-items { display: none; }
.nav-group .ng-items a {
  font-size: 13px; color: var(--ink-2); padding: 6px 10px; border-radius: 7px; line-height: 1.5;
  border-left: 2px solid transparent; margin-left: -20px; padding-left: 18px; transition: color .14s, background .14s, border-color .14s;
}
.nav-group .ng-items a:hover { color: var(--ink); background: var(--surface-3); }
.nav-group .ng-items a.current { color: var(--brand-ink); font-weight: 700; border-left-color: var(--brand); background: var(--brand-soft); }
.nav-sep { height: 1px; background: var(--line-2); margin: 12px 10px; }
.nav-secthead { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); padding: 4px 10px 10px; text-transform: uppercase; }

/* ---- nested: top-level family (e.g. Microsoft Defender) → product groups → articles ---- */
.nav-parent { margin-bottom: 4px; }
.np-head {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--ink);
  background: none; border: 0; padding: 9px 10px; border-radius: 8px; transition: background .14s; cursor: pointer;
}
.np-head:hover { background: var(--surface-3); }
.np-head .np-ic { width: 18px; height: 18px; color: var(--acc); flex-shrink: 0; }
.np-head .np-ic svg { width: 18px; height: 18px; }
.np-head .chev { margin-left: auto; transition: transform .18s; color: var(--ink-3); }
.nav-parent.collapsed .np-head .chev { transform: rotate(-90deg); }
.np-body { margin: 2px 0 4px; padding-left: 12px; margin-left: 9px; border-left: 1px solid var(--line); }
.nav-parent.collapsed .np-body { display: none; }
.np-body .nav-group { margin-bottom: 2px; }
.np-body .nav-group > .ng-head { font-size: 13px; font-weight: 500; }
.nav-top-link { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); padding: 8px 10px; border-radius: 8px; }
.nav-top-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-top-link svg { width: 16px; height: 16px; color: var(--ink-3); }

/* doc page main column adjusts */
.docs-main { min-width: 0; padding: 0 0 0 44px; }
.docs-main .art-layout { padding-top: 30px; }

/* ============ KB / SECTION HUB ============ */
.hub-head { padding: 36px 0 0; }
.hub-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; color: var(--acc-ink); background: var(--acc-soft); border: 1px solid var(--acc-line); padding: 5px 12px; border-radius: 100px; }
.hub-head h1 { font-family: var(--head); font-weight: 900; font-size: 38px; letter-spacing: .01em; margin: 18px 0 0; }
.hub-head p { font-size: 16px; color: var(--ink-2); line-height: 1.9; margin: 14px 0 0; max-width: 44em; }
.hub-sec { margin-top: 46px; }
.hub-sec .sec-bar { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.hub-sec .sec-bar h2 { font-family: var(--head); font-weight: 900; font-size: 21px; display: flex; align-items: center; gap: 11px; }
.hub-sec .sec-bar .pill { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 100px; padding: 3px 10px; }
.hub-sec > .sub { font-size: 13.5px; color: var(--ink-3); margin: 0 0 18px; }
.hub-rule { border: 0; border-top: 1px solid var(--line); margin: 12px 0 22px; }

.kb-list { display: flex; flex-direction: column; gap: 12px; }
.kb-row {
  display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.kb-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in oklch, var(--cat, var(--acc)) 30%, var(--line)); }
.kb-row .kb-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--cat, var(--acc)); background: color-mix(in oklch, var(--cat, var(--acc)) 11%, white); border: 1px solid color-mix(in oklch, var(--cat, var(--acc)) 22%, white); }
.kb-row .kb-ic svg { width: 23px; height: 23px; }
.kb-row .kb-body { min-width: 0; }
.kb-row .kb-body h3 { font-size: 16px; font-weight: 700; font-family: var(--head); line-height: 1.5; }
.kb-row:hover .kb-body h3 { color: var(--acc-ink); }
.kb-row .kb-body p { font-size: 13px; color: var(--ink-2); margin: 5px 0 0; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.kb-row .kb-meta { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
.kb-row .kb-go { color: var(--ink-3); display: grid; place-items: center; }
.kb-row .kb-go svg { width: 19px; height: 19px; transition: transform .15s; }
.kb-row:hover .kb-go svg { transform: translateX(3px); color: var(--acc); }
.kb-row.soon { opacity: .62; pointer-events: none; }
.kb-row.soon .kb-go { visibility: hidden; }
.rl-remove { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.rl-remove:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.rl-remove svg { width: 16px; height: 16px; }
.soon-tag { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

/* empty state (section with no articles yet) */
.empty-state { text-align: center; padding: 60px 20px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--surface-2); }
.empty-state .es-ic { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); }
.empty-state .es-ic svg { width: 28px; height: 28px; }
.empty-state h3 { font-family: var(--head); font-weight: 700; font-size: 18px; }
.empty-state p { font-size: 14px; color: var(--ink-3); margin: 10px auto 0; max-width: 30em; line-height: 1.8; }

/* mobile nav toggle for docs */
.docs-navbtn { display: none; }
.nav-scrim { display: none; }

@media (max-width: 1100px) {
  .portal-grid { grid-template-columns: repeat(2, 1fr); }
  .start-band { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-nav {
    position: fixed; left: 0; top: 68px; z-index: 40; width: 300px; background: var(--surface);
    box-shadow: var(--shadow-lg); padding: 22px; transform: translateX(-110%); transition: transform .25s;
    border-right: 1px solid var(--line);
  }
  .docs-nav.open { transform: translateX(0); }
  .docs-main { padding-left: 0; }
  .docs-navbtn {
    display: inline-flex; align-items: center; gap: 8px; position: sticky; top: 76px; z-index: 30;
    margin: 12px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
    padding: 9px 14px; font-size: 13px; font-weight: 700; font-family: var(--head); box-shadow: var(--shadow-sm);
  }
  .docs-navbtn svg { width: 16px; height: 16px; }
  .nav-scrim { display: none; position: fixed; inset: 68px 0 0; background: oklch(0.2 0.02 255 / 0.3); z-index: 35; }
  .nav-scrim.show { display: block; }
}
@media (max-width: 600px) {
  .portal-grid { grid-template-columns: 1fr; }
  .docs-hero h1 { font-size: 30px; }
}
