/*
Theme Name: ZenBlink Documentation
Theme URI: https://legacy.zenblink.com/
Author: JOBUTSU LTD
Description: Lightweight documentation theme for ZenBlink, ZenDyn, and related technical reference material.
Version: 1.3.4
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: zenblink-docs
*/

:root {
  --zb-ink: #050505;
  --zb-text: #2b2f33;
  --zb-muted: #697078;
  --zb-canvas: #f6f7f8;
  --zb-line: #dde1e5;
  --zb-white: #ffffff;
  --zb-accent: #325ee6;
  --zb-code: #17191c;
  --zb-radius: 12px;
  --zb-content: 820px;
  --zb-shell: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--zb-text);
  background: var(--zb-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
a { color: var(--zb-accent); text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
code, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
code {
  padding: 0.12rem 0.34rem;
  border-radius: 5px;
  background: #edf0f3;
  color: #23262a;
  font-size: 0.9em;
}
pre {
  overflow: auto;
  padding: 1rem 1.15rem;
  border-radius: var(--zb-radius);
  background: var(--zb-code);
  color: #f7f7f7;
  line-height: 1.55;
}
pre code { padding: 0; background: transparent; color: inherit; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: 8px; left: 8px; width: auto; height: auto;
  padding: 12px 16px; clip: auto; background: var(--zb-white); color: var(--zb-ink);
}

.zb-site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--zb-line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
}
.admin-bar .zb-site-header { top: 32px; }
.zb-header-inner {
  width: min(calc(100% - 40px), var(--zb-shell));
  min-height: 72px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
}
.zb-brand {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  color: var(--zb-ink); text-decoration: none;
}
.zb-brand img { display: block; width: 174px; max-height: 44px; object-fit: contain; }
.zb-docs-label {
  padding-left: 20px; border-left: 1px solid var(--zb-line);
  color: var(--zb-muted); font-size: 0.9rem; font-weight: 650;
}
.zb-header-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.zb-header-nav a { color: var(--zb-text); text-decoration: none; font-weight: 650; }
.zb-search-form { position: relative; }
.zb-search-form input {
  width: 260px; min-height: 42px; padding: 8px 44px 8px 14px;
  border: 1px solid var(--zb-line); border-radius: 9px; background: var(--zb-canvas);
  color: var(--zb-text); font: inherit;
}
.zb-search-form button {
  position: absolute; inset: 0 0 0 auto; width: 42px; border: 0; background: transparent;
  color: var(--zb-muted); cursor: pointer;
}

.zb-docs-layout {
  width: min(calc(100% - 40px), var(--zb-shell));
  margin: 0 auto; display: grid;
  grid-template-columns: 250px minmax(0, var(--zb-content)) 220px;
  justify-content: space-between; gap: 48px;
}
.zb-sidebar, .zb-toc { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 128px); overflow: auto; }
.zb-sidebar { padding: 42px 0; }
.zb-sidebar-title, .zb-toc-title {
  margin: 0 0 14px; color: var(--zb-ink); font-size: 0.78rem;
  font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.zb-sidebar ul, .zb-toc ol { margin: 0; padding: 0; list-style: none; }
.zb-sidebar li + li { margin-top: 5px; }
.zb-sidebar a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: var(--zb-muted); text-decoration: none; line-height: 1.35;
}
.zb-sidebar a:hover, .zb-sidebar .current_page_item > a {
  background: var(--zb-canvas); color: var(--zb-ink);
}
.zb-article { min-width: 0; padding: 54px 0 96px; }
.zb-breadcrumbs { margin: 0 0 26px; color: var(--zb-muted); font-size: 0.88rem; }
.zb-breadcrumbs a { color: inherit; }
.zb-article h1, .zb-article h2, .zb-article h3 { color: var(--zb-ink); line-height: 1.2; letter-spacing: -0.025em; scroll-margin-top: 108px; }
.zb-article h1 { margin: 0 0 18px; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.zb-article h2 { margin: 3.25rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--zb-line); font-size: 1.75rem; }
.zb-article h3 { margin: 2.25rem 0 0.65rem; font-size: 1.25rem; }
.zb-article p { margin: 0 0 1.2rem; }
.zb-article p, .zb-article li { overflow-wrap: anywhere; }
.zb-article ul, .zb-article ol { padding-left: 1.35rem; }
.zb-article li + li { margin-top: 0.35rem; }
.zb-article strong { color: var(--zb-ink); }
.zb-article blockquote {
  margin: 1.5rem 0; padding: 0.85rem 1rem; border-left: 4px solid var(--zb-accent);
  background: #f3f6ff;
}
.zb-toc { padding: 52px 0; font-size: 0.84rem; }
.zb-toc a { display: block; padding: 4px 0; color: var(--zb-muted); text-decoration: none; line-height: 1.4; }
.zb-toc a:hover, .zb-toc a.is-active { color: var(--zb-accent); }
.zb-toc .toc-h3 { padding-left: 12px; }

.zb-docs-home { padding: 72px 0 110px; }
.zb-docs-hero { max-width: 850px; }
.zb-eyebrow { color: var(--zb-accent); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.zb-docs-hero h1 { margin: 12px 0 18px; color: var(--zb-ink); font-size: clamp(2.8rem, 7vw, 5.4rem); line-height: 1; letter-spacing: -0.055em; }
.zb-docs-hero p { max-width: 690px; color: var(--zb-muted); font-size: 1.15rem; }
.zb-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-top: 56px; }
.zb-card {
  min-height: 220px; padding: 28px; border: 1px solid var(--zb-line); border-radius: var(--zb-radius);
  background: var(--zb-white); color: inherit; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.zb-card:hover { transform: translateY(-3px); border-color: #bfc6ce; box-shadow: 0 16px 38px rgba(10,18,30,.08); }
.zb-card h2 { margin: 0 0 12px; color: var(--zb-ink); font-size: 1.35rem; line-height: 1.2; }
.zb-card p { margin: 0; color: var(--zb-muted); }

.zb-search-results, .zb-basic-page { width: min(calc(100% - 40px), 920px); margin: 0 auto; padding: 64px 0 100px; }
.zb-result { padding: 26px 0; border-top: 1px solid var(--zb-line); }
.zb-result h2 { margin: 0 0 7px; }
.zb-result h2 a { color: var(--zb-ink); text-decoration: none; }
.zb-site-footer { border-top: 1px solid var(--zb-line); color: var(--zb-muted); }
.zb-footer-inner { width: min(calc(100% - 40px), var(--zb-shell)); margin: 0 auto; padding: 28px 0; font-size: 0.88rem; }

/* The existing public holding page is intentionally untouched by the docs UI. */
body.home .zb-site-header, body.home .zb-site-footer { display: none; }

@media (max-width: 1100px) {
  .zb-docs-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
  .zb-toc { display: none; }
  .zb-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-bar .zb-site-header { top: 46px; }
  .zb-header-inner { width: calc(100% - 24px); min-height: 64px; gap: 12px; }
  .zb-brand img { width: 132px; }
  .zb-docs-label, .zb-header-nav > a { display: none; }
  .zb-header-nav { min-width: 0; }
  .zb-search-form input { width: min(34vw, 132px); padding-left: 10px; }
  .zb-docs-layout { display: block; width: min(calc(100% - 32px), var(--zb-content)); overflow-x: hidden; }
  .zb-sidebar { position: static; min-width: 0; max-height: none; overflow: hidden; padding: 24px 0 0; }
  .zb-sidebar ul { display: flex; width: 100%; max-width: 100%; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
  .zb-sidebar li { flex: 0 0 auto; margin: 0 !important; }
  .zb-article { padding-top: 32px; }
  .zb-docs-home { padding-top: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
