/* ==================================================================
   JekCMS Marketing — Documentation Styles
   ================================================================== */

.docs-wrap {
    padding: calc(var(--header-height, 80px) + 56px) 0 96px;
    background: var(--color-bg-primary, #fff);
    color: var(--color-text-primary, #111);
}
.docs-container { max-width: 1200px; }

/* ---- Hero (landing + 404) ---- */
.docs-hero {
    text-align: center;
    margin-bottom: 56px;
    padding: 0 20px;
}
.docs-hero__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary, #2563eb);
    padding: 6px 14px;
    border: 1px solid var(--color-primary, #2563eb);
    border-radius: 9999px;
    margin-bottom: 22px;
}
.docs-hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 18px;
    color: var(--color-text-primary);
}
.docs-hero p {
    font-size: 18px;
    line-height: 1.65;
    color: var(--color-text-muted, #6b7280);
    max-width: 640px;
    margin: 0 auto 32px;
}
.docs-hero__search {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}
.docs-hero__search input {
    width: 100%;
    padding: 16px 60px 16px 22px;
    font-size: 16px;
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: 9999px;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}
.docs-hero__search input:focus { border-color: var(--color-primary); }
.docs-hero__search kbd {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    font-family: inherit;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-secondary, #f9fafb);
    color: var(--color-text-muted);
}

/* ---- Landing grid ---- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.docs-card {
    position: relative;
    display: block;
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-bg-primary);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.docs-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 32px rgba(37,99,235,0.08);
}
.docs-card__icon {
    display: block;
    width: 32px; height: 32px;
    background: var(--color-primary);
    mask: var(--icon-url) center/contain no-repeat;
    -webkit-mask: var(--icon-url) center/contain no-repeat;
    margin-bottom: 14px;
    opacity: 0.9;
}
.docs-card__icon--zap      { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>'); }
.docs-card__icon--settings { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>'); }
.docs-card__icon--plug     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 2v6M15 2v6M12 22v-5M18 8v2a6 6 0 0 1-12 0V8"/></svg>'); }
.docs-card__icon--code     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>'); }
.docs-card__icon--layout   { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="21" x2="9" y2="9"/></svg>'); }
.docs-card__icon--cpu      { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><line x1="9" y1="1" x2="9" y2="4"/><line x1="15" y1="1" x2="15" y2="4"/><line x1="9" y1="20" x2="9" y2="23"/><line x1="15" y1="20" x2="15" y2="23"/><line x1="20" y1="9" x2="23" y2="9"/><line x1="20" y1="14" x2="23" y2="14"/><line x1="1" y1="9" x2="4" y2="9"/><line x1="1" y1="14" x2="4" y2="14"/></svg>'); }
.docs-card__icon--book     { --icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>'); }
.docs-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text-primary);
}
.docs-card p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-muted);
    margin: 0;
}
.docs-card__arrow {
    position: absolute;
    right: 22px; bottom: 20px;
    font-size: 20px;
    color: var(--color-text-muted);
    transition: transform 0.2s, color 0.2s;
}
.docs-card:hover .docs-card__arrow { color: var(--color-primary); transform: translateX(4px); }

/* ---- Breadcrumb ---- */
.docs-breadcrumb {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.docs-breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}
.docs-breadcrumb a:hover { color: var(--color-primary); }
.docs-breadcrumb span:not([aria-current]) { opacity: 0.4; }
.docs-breadcrumb [aria-current] { color: var(--color-text-primary); font-weight: 500; }

/* ---- Category view ---- */
.docs-cat-header { margin-bottom: 36px; }
.docs-cat-header h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 12px;
    color: var(--color-text-primary);
}
.docs-cat-header p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 60ch;
}
.docs-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.docs-page-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 24px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}
.docs-page-list a:hover {
    border-color: var(--color-primary);
    transform: translateX(3px);
}
.docs-page-list h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--color-text-primary);
}
.docs-page-list p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}
.docs-page-list a > span {
    font-size: 22px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.docs-page-list a:hover > span { color: var(--color-primary); }
.docs-empty {
    color: var(--color-text-muted);
    font-size: 14px;
    padding: 16px 0;
}

/* ---- Doc page layout ---- */
.docs-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}
@media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; gap: 24px; }
    .docs-side { order: 2; }
    .docs-side__sticky { position: static !important; }
}

.docs-side { min-width: 0; }
.docs-side__sticky {
    position: sticky;
    top: calc(var(--header-height, 80px) + 32px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 8px;
}
.docs-side h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 12px;
}
.docs-toc, .docs-cat-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    border-left: 1px solid var(--color-border);
}
.docs-toc li, .docs-cat-list li { margin: 0; }
.docs-toc a, .docs-cat-list a {
    display: block;
    padding: 6px 14px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.docs-toc__sub a { padding-left: 28px; }
.docs-toc a:hover, .docs-cat-list a:hover,
.docs-toc a.is-active, .docs-cat-list a.is-active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

/* ---- Article ---- */
.docs-article { min-width: 0; }
.docs-article__body {
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--color-text-primary);
}
.docs-article__body > * + * { margin-top: 1.15em; }
.docs-article__body h1 {
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.12;
    margin: 0 0 18px;
}
.docs-article__body h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 48px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: 120px;
}
.docs-article__body h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 10px;
    scroll-margin-top: 120px;
}
.docs-article__body h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 24px 0 8px;
}
.docs-article__body p { margin: 0; }
.docs-article__body p + p { margin-top: 1.1em; }
.docs-article__body a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.docs-article__body a:hover { text-decoration-thickness: 2px; }
.docs-article__body ul, .docs-article__body ol { padding-left: 22px; margin: 0; }
.docs-article__body ul li, .docs-article__body ol li { margin: 6px 0; }
.docs-article__body code {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    background: var(--color-bg-secondary, #f3f4f6);
    border-radius: 4px;
    color: var(--color-text-primary);
}
.docs-article__body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    margin: 24px 0;
}
.docs-article__body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}
.docs-article__body blockquote {
    margin: 24px 0;
    padding: 14px 20px;
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-secondary, #f9fafb);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--color-text-primary);
}
.docs-article__body hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 36px 0;
}
.docs-article__body strong { font-weight: 700; }

/* ---- Pager ---- */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}
.docs-pager a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 22px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.docs-pager a:hover { border-color: var(--color-primary); }
.docs-pager__next { text-align: right; }
.docs-pager span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.docs-pager strong {
    font-size: 15px;
    color: var(--color-text-primary);
}

/* ---- Search panel ---- */
.docs-search-panel {
    position: absolute;
    left: 0; right: 0; top: calc(100% + 8px);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    padding: 6px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 20;
    text-align: left;
}
.docs-search-hit {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}
.docs-search-hit + .docs-search-hit { margin-top: 2px; }
.docs-search-hit:hover { background: var(--color-bg-secondary, #f9fafb); }
.docs-search-hit__cat {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.docs-search-hit__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 3px;
}
.docs-search-hit__excerpt {
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.docs-search-empty {
    padding: 18px 14px;
    font-size: 14px;
    color: var(--color-text-muted);
    text-align: center;
}

/* ---- Dark mode tune ---- */
html[data-theme="dark"] .docs-article__body pre { background: #020617; color: #e2e8f0; }
html[data-theme="dark"] .docs-article__body code { background: rgba(255,255,255,0.06); }
html[data-theme="dark"] .docs-article__body blockquote { background: rgba(255,255,255,0.03); }
html[data-theme="dark"] .docs-hero__search kbd { background: rgba(255,255,255,0.05); }
