
/* ==========================================================================
   MASTERINFOBIZ PORTAL — BAKIN-STYLE LIGHT & AIRY DESIGN SYSTEM 2026/2027
   ========================================================================== */

:root {
    /* Palette: Bakin Premium Online School Style */
    --bg-page: #f8fafc;           /* Свежий, светлый slate-50 */
    --bg-surface: #ffffff;        /* Чистый белый для карточек */
    --bg-surface-alt: #f1f5f9;    /* Мягкий фон для акцентных блоков */
    --bg-header: #0f172a;         /* Глубокий темно-синий для шапки */
    --bg-drawer: #0f172a;         /* Темная контрастная шторка меню */
    
    --border-color: #e2e8f0;      /* Тонкая элегантная граница */
    --border-light: #cbd5e1;      /* Чуть более контрастная граница */
    
    --text-heading: #0f172a;      /* Глубокий темно-синий для заголовков */
    --text-body: #334155;         /* Насыщенный читаемый текст для чтения */
    --text-muted: #64748b;        /* Второстепенный текст, даты, метки */
    
    /* Brand Accents */
    --primary: #1e3a8a;           /* Royal Navy Blue */
    --primary-blue: #2563eb;      /* Sapphire Blue */
    --primary-light: #eff6ff;     /* Мягкая синяя подложка */
    
    /* Conversion Gold / Amber */
    --gold: #f59e0b;              /* Теплый янтарный / золото */
    --gold-hover: #d97706;        /* Темное золото при наведении */
    --gold-light: #fef3c7;        /* Светлая золотая подложка */
    
    /* Semantic Colors */
    --emerald: #10b981;
    --emerald-light: #ecfdf5;
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Rubik', 'Plus Jakarta Sans', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    --shadow-gold: 0 4px 14px rgba(245, 158, 11, 0.35);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--primary-blue); }

/* ==========================================================================
   TOPBAR & HEADER
   ========================================================================== */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--gold) 0%, #ea580c 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-gold);
}
.brand-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    font-family: var(--font-heading);
}
.brand-title span { color: var(--gold); }
.brand-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-cta-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #ea580c 100%);
    color: #fff !important;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-gold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
}
.btn-cta-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}
.btn-nav-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0 !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-nav-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.mobile-hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* ==========================================================================
   3-COLUMN GRID LAYOUT (STRICT MINMAX PREVENTS BLOWOUT)
   ========================================================================== */
.portal-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    /* КРИТИЧЕСКИ ВАЖНО: minmax(0, 1fr) исключает вылет разметки за пределы экрана */
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

/* Left Sidebar */
.portal-sidebar-left {
    position: sticky;
    top: 80px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--shadow-sm);
}
.nav-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 8px;
}
.portal-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
}
.portal-nav-link:hover, .portal-nav-link.active {
    background: var(--primary-light);
    color: var(--primary-blue);
}
.portal-nav-link .nav-icon { font-size: 16px; }

.ecosystem-box {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.ecosystem-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.ecosystem-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-body);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.ecosystem-link:last-child { border-bottom: none; }
.ecosystem-link:hover { color: var(--primary-blue); }

/* Center Feed */
.portal-feed-center {
    min-width: 0; /* Предотвращает горизонтальный скролл во флекс/грид */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Hero Manifesto (Bakin-Style Warm Navy & Gold) */
.hero-manifesto {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-radius: var(--radius-md);
    padding: 28px;
    color: #fff;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.hero-manifesto h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 10px;
    color: #fff;
}
.hero-manifesto h1 span { color: var(--gold); }
.hero-manifesto p {
    font-size: 15px;
    color: #cbd5e1;
    margin-bottom: 18px;
    max-width: 700px;
    line-height: 1.6;
}
.hero-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.hero-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Category Filters */
.feed-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.filter-btn {
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.filter-btn.active, .filter-btn:hover {
    background: var(--primary-light);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Article Cards (Bakin Clean Surface Style) */
.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    min-width: 0;
}
.article-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.article-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.article-badge-category {
    background: var(--primary-light);
    color: var(--primary-blue);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
}
.article-title {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.35;
}
.article-title a { color: var(--text-heading); }
.article-title a:hover { color: var(--primary-blue); }
.article-excerpt {
    font-size: 15px;
    color: var(--text-body);
    line-height: 1.6;
}
.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}
.author-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-heading);
}
.author-avatar {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
}
.card-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Single Post Page Styling */
.single-post-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}
.single-post-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.single-post-title {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-heading);
    margin: 14px 0 16px;
}
.single-post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-body);
    min-width: 0;
    max-width: 100%;
}
.single-post-content .lead {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-heading);
    font-weight: 500;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}
.single-post-content h2 {
    font-family: var(--font-heading);
    font-size: 23px;
    font-weight: 800;
    color: var(--text-heading);
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}
.single-post-content h3 {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 24px 0 12px;
}
.single-post-content p { margin-bottom: 18px; }
.single-post-content ul, .single-post-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}
.single-post-content li { margin-bottom: 8px; }

/* Responsive Tables & Media */
.single-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    display: table;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}
.single-post-content th, .single-post-content td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}
.single-post-content th {
    background: var(--bg-surface-alt);
    color: var(--text-heading);
    font-weight: 700;
}
.single-post-content blockquote {
    border-left: 4px solid var(--gold);
    background: var(--gold-light);
    padding: 18px 22px;
    margin: 24px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #78350f;
    font-style: normal;
    font-weight: 500;
}

/* Right Sidebar (Widgets) */
.portal-sidebar-right {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.widget-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 12px;
}
.widget-badge-gold {
    background: var(--gold-light);
    color: #92400e;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 800;
}

/* Niche Radar Mini Widget */
.radar-mini-input {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-heading);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    font-family: var(--font-sans);
}
.radar-mini-input:focus { border-color: var(--primary-blue); }
.radar-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, #ea580c 100%);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    transition: opacity 0.2s;
}
.radar-btn:hover { opacity: 0.95; }

/* ==========================================================================
   MOBILE APP BAR & DRAWER (APP-LIKE EXPERIENCE)
   ========================================================================== */
.mobile-app-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}
.app-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    border: none;
}
.app-bar-item:hover, .app-bar-item.active {
    color: var(--gold);
}
.app-bar-icon { font-size: 19px; }

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
}
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--bg-drawer);
    z-index: 1001;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-drawer.open {
    transform: translateX(0);
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.drawer-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}
.drawer-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.drawer-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
}
.drawer-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1100px) {
    .portal-container { grid-template-columns: 240px minmax(0, 1fr); }
    .portal-sidebar-right { display: none; }
}
@media (max-width: 860px) {
    .portal-container {
        grid-template-columns: 1fr;
        padding: 16px 14px 80px; /* Отступ снизу для App Bar */
    }
    .portal-sidebar-left { display: none; }
    .mobile-hamburger { display: block; }
    .topbar-actions .btn-nav-outline { display: none; }
    .topbar-actions .btn-cta-gold { padding: 6px 14px; font-size: 12px; }
    .mobile-app-bar { display: flex; }
    .single-post-wrapper { padding: 24px 18px; }
    .single-post-title { font-size: 24px; }
    .hero-manifesto h1 { font-size: 22px; }
}
