/*
Theme Name: aiXdocsTheme
Theme URI: https://example.com
Author: aiXpert Team
Description: Lightweight documentation theme.
Version: 1.3
Text Domain: aixdocstheme
*/

/* Reset & Base */
:root { 
    --primary: #820761; --text: #334155; --bg: #ffffff; 
    --sidebar-bg: #f1f5f9; --header-h: 100px;
    --side-margin: 2rem;
    --base-font-size: 16px;
    --header-gap: 30px;
}
* { box-sizing: border-box; }
html { font-size: var(--base-font-size); }
body { font-family: 'Golos Text', sans-serif; margin: 0; padding: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--primary); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; }

/* Dynamic Container Logic */
.header-container, .main-container, .footer-container { 
    width: calc(100% - (var(--side-margin) * 2)); 
    max-width: 1440px; 
    margin: 0 auto; 
}

/* Compact Mode (800px - 1200px) - Reduction by ~25% */
@media screen and (min-width: 800px) and (max-width: 1200px) {
    :root { 
        --base-font-size: 13px; /* ~75% of 16px */
        --header-gap: 15px;
    }
    .top-menu ul { gap: 15px; }
    .site-branding { min-width: 90px; }
}

/* Header */
.site-header { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 100; padding: 15px 0; }
.header-container { display: flex; flex-direction: column; gap: 15px; }
.header-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-branding-area { display: flex; align-items: center; gap: 20px; }
.header-search-area { flex-shrink: 0; }

/* Branding */
.site-branding { display: flex; flex-direction: row; align-items: center; gap: 50px; text-align: left; }
.site-title { font-weight: 400; font-size: 1.1rem; color: #0f172a; margin: 0; line-height: 1.2; }
.custom-logo-link { display: block; line-height: 0; }
.custom-logo-link img { max-height: 65px; width: auto; display: block; margin: 0; }

/* Menu & Search */
.top-menu ul { display: flex; gap: 25px; font-size: 0.95rem; font-weight: 500; border-top: 1px solid #f1f5f9; padding-top: 15px; }
.header-search form { display: flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px 8px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: border-color 0.2s, box-shadow 0.2s; }
.header-search form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(130, 7, 97, 0.1); }
.header-search label { display: flex; align-items: center; margin-bottom: 0; }
.header-search input[type="search"] { border: none; background: transparent; outline: none; font-size: 0.9rem; width: 180px; color: var(--text); padding: 4px; }
.header-search .search-submit { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 6px 14px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.header-search .search-submit:hover { background: #6b064f; }
.header-search .screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.burger-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

/* Top Menu Active */
.top-menu ul li.current-menu-item > a, .top-menu ul li a:hover { color: var(--primary); }
.top-menu ul li.current-menu-item > a { border-bottom: 3px solid var(--primary); padding-bottom: 4px; }

/* 3-Column Layout */
.main-container { display: flex; flex-wrap: nowrap; }
.docs-sidebar { width: 25%; background: var(--sidebar-bg); border-right: none; height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); overflow-y: hidden; padding: 20px; flex-shrink: 0; transition: overflow 0.3s; }
.docs-sidebar:hover { overflow-y: auto; }

/* Custom Scrollbar for Sidebar */
.docs-sidebar::-webkit-scrollbar { width: 5px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.docs-sidebar:hover::-webkit-scrollbar-thumb { background: #cbd5e1; }
/* Firefox support */
.docs-sidebar { scrollbar-width: none; }
.docs-sidebar:hover { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

.docs-content { width: 60%; padding: 30px 40px; min-width: 0; background: #fff; }
.docs-sidebar-right { width: 15%; padding: 20px; background: #fff; border-left: none; }

/* Sidebar Nav */
.sidebar-nav li { margin-bottom: 2px; position: relative; }
.sidebar-nav li a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem; color: #475569; line-height: 1.4; }
.sidebar-nav li a:hover, .sidebar-nav li.current-menu-item > a { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.sidebar-nav ul.sub-menu { display: none; padding-left: 15px; margin-top: 2px; }
.sidebar-nav ul.sub-menu li a { padding: 6px 12px; font-size: 0.85rem; }

/* Long menu item adjustment (applied via JS) */
.sidebar-nav li a.long-title { 
    padding: 3px 12px;  
    font-size: 0.8rem;
    line-height: 17px;
}
.sidebar-nav li.open > ul.sub-menu { display: block; }
.menu-toggle { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0.5; }
.menu-toggle::after { content: '▼'; font-size: 8px; }
.sidebar-nav li.open > .menu-toggle { transform: rotate(180deg); }

/* External Links */
a.external-link::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    background: url('../icons/external-link.svg') no-repeat center center;
    background-size: contain;
    vertical-align: middle;
    opacity: 0.6;
}

/* Blockquote */
blockquote {
    background: #e6f4ff;
    padding: 1px 40px;
    text-align: left;
    display: block;
    color: grey !important;
    font-style: italic;
    opacity: 0.8;
    border-radius: 11px;
    margin-left: 0;
    position: relative;
    border: none;
}
blockquote::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 18px;
    width: 20px;
    height: 20px;
    background: url('../icons/info.svg') no-repeat center center;
    background-size: contain;
}

/* Post Navigation */
.post-navigation { display: flex; gap: 20px; margin-top: 50px; padding-top: 30px; border-top: 1px solid #f1f5f9; }
.nav-box { flex: 1; display: flex; flex-direction: column; padding: 20px; border: 1px solid #eef2f6; border-radius: 12px; transition: all 0.2s ease; text-decoration: none !important; }
.nav-box:hover { background-color: #f8fafc; border-color: #e2e8f0; transform: translateY(-2px); }
.nav-box .nav-label { font-size: 0.8rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; display: block; }
.nav-box .nav-title { font-size: 0.95rem; font-weight: 500; color: var(--text); line-height: 1.4; display: block; }
.nav-box.nav-next { text-align: right; }
.nav-placeholder { flex: 1; }
@media (max-width: 600px) { .post-navigation { flex-direction: column; } .nav-placeholder { display: none; } }

/* Footer */
.site-footer { background: #ffffff; color: #334155; padding: 40px 0; border-top: 1px solid #e2e8f0; margin-top: auto; }
.footer-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
.footer-col.branding { text-align: left; display: flex; flex-direction: column; align-items: flex-start; }
.footer-col.branding .custom-logo-link { margin-bottom: 15px; }
.footer-col h4 { color: #0f172a; margin-bottom: 15px; font-size: 1rem; }
.footer-col ul li { margin-bottom: 8px; font-size: 0.9rem; }

/* Mobile & Tablet */
@media (max-width: 992px) {
    .burger-btn { display: block; }
    .top-menu, .header-search, .docs-sidebar-right { display: none; }
    .docs-sidebar { position: fixed; left: -100%; top: 0; height: 100vh; z-index: 200; transition: 0.3s; width: 280px; }
    .docs-sidebar.active { left: 0; }
    .sidebar-overlay.active { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 150; display: block; }
    .docs-content { width: 100%; padding: 20px; }
    .footer-container { grid-template-columns: 1fr; }
}


/* Стили главной страницы */

/* Пока скрываем H1, но в будущем решить, что с этим делать */
.home h1 {
    display: none;
}

.home .is-layout-grid p {
    border: 1px solid #d7d7d7;
    border-radius: 4px;
    padding: 14px;
    margin: 0;
}


