
/* CSS Reset & Normalize */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Цветовая палитра */
    --color-primary: #2979ff;
    --color-primary-dark: #1565c0;
    --color-accent: #ff6f00;
    --color-accent-hover: #ff8f00;
    --color-text-main: #1e2329;
    --color-text-secondary: #5f6368;
    --color-bg-body: #f4f6f8;
    --color-bg-white: #ffffff;
    --color-border: #e0e6ed;
    --color-success: #4caf50;
    
    /* Градиенты */
    --grad-blue: linear-gradient(135deg, #428cdc 0%, #2979ff 100%);
    --grad-orange: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    --grad-dark: linear-gradient(135deg, #37474f 0%, #263238 100%);

    /* Размеры и отступы */
    --container-width: 1200px;
    --header-height: 4.5rem;
    --radius-sm: 0.5rem;
    --radius-md: 1.25rem;
    --radius-full: 9999px;
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-blue: 0 4px 15px rgba(41, 121, 255, 0.3);
    --shadow-orange: 0 4px 15px rgba(255, 111, 0, 0.3);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- Утилитарные классы (Layout) --- */
.wrap {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.flx {
    display: flex;
}

.jcsb {
    justify-content: space-between;
}

.aic {
    align-items: center;
}

.fxg {
    flex-grow: 1;
}

/* Отступы из HTML классов */
.b10 { margin-bottom: 0.625rem; }
.b20 { margin-bottom: 1.25rem; }
.r10 { margin-right: 0.625rem; }
.r20 { margin-right: 1.25rem; }

/* Скрытие элементов на планшетах */
@media (max-width: 992px) {
    .hide_992 {
        display: none !important;
    }
}

/* --- Header --- */
header {
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.head-top {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-bg-body);
}

.head-bottom {
    padding-top: 1rem;
    display: flex;
    align-items: center;
}

.download {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    background: #f0f4f9;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Кнопки в хедере */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    height: 2.5rem; /* h30 аналог */
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fon-blu, .fon-blu2 {
    background: var(--grad-blue);
    color: white;
    box-shadow: var(--shadow-blue);
}

.fon-orang {
    background: var(--grad-orange);
    color: white;
    box-shadow: var(--shadow-orange);
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
}

/* Логотип */
.logo svg {
    height: 2.5rem;
    width: auto;
}

.logo path {
    fill: var(--color-primary-dark); /* Перекрашиваем лого для светлого фона */
}
.logo circle {
    fill: var(--color-accent);
}

/* Меню в хедере */
.main-menu ul {
    display: flex;
    gap: 1.5rem;
    margin-left: 2rem;
}

.main-menu a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--color-text-main);
    position: relative;
    padding: 0.5rem 0;
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.main-menu a:hover {
    color: var(--color-primary);
}

.main-menu a:hover::after {
    width: 100%;
}

/* Dropdowns в хедере */
.drop {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: #f0f4f9;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}
.drop:hover {
    background: #e2e8f0;
}

/* --- Layout Grid --- */
.content-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 992px) {
    .content-row {
        grid-template-columns: 1fr;
    }
}

/* --- Sidebar (Aside) --- */
.col-left {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 1rem;
    align-self: start;
}

.menu-category ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-category > ul > li > a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--color-text-main);
    transition: all 0.2s ease;
}

.menu-category > ul > li > a svg {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.menu-category > ul > li > a:hover {
    background-color: #f0f7ff;
    color: var(--color-primary);
    padding-left: 1.25rem; /* Эффект сдвига */
}

.menu-category > ul > li > a:hover svg {
    transform: scale(1.1);
}

/* Подменю в сайдбаре */
.menu-category ul ul {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #f0f0f0;
    margin-left: 1.5rem;
}

.menu-category ul ul li a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-text-secondary);
}

.menu-category ul ul li a:hover {
    color: var(--color-primary);
    background: transparent;
}

/* --- Content Area --- */
.content {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    min-height: 500px;
}

/* Typography in Content */
h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    margin: 2rem 0 1rem;
    color: var(--color-text-main);
    position: relative;
    padding-left: 1rem;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--color-primary);
    border-radius: 2px;
}

p {
    margin-bottom: 1.2rem;
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* Ссылка-кнопка в контенте */
.refka {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.refka a {
    display: inline-block;
    background: var(--grad-orange);
    color: white;
    font-weight: bold;
    padding: 1rem 3rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-orange);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 111, 0, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 111, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 111, 0, 0); }
}

/* Навигация внутри статьи */
nav ol {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.5rem 1.5rem 2.5rem;
    margin-bottom: 2rem;
}

nav ol li {
    margin-bottom: 0.5rem;
    list-style-type: decimal;
    color: var(--color-primary);
    font-weight: 600;
}

nav ol li a {
    color: var(--color-text-main);
    font-weight: normal;
    text-decoration: none;
    border-bottom: 1px dashed #ccc;
}

nav ol li a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Списки */
.entry-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content ul li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.entry-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

table tr {
    border-bottom: 1px solid var(--color-border);
}

table tr:last-child {
    border-bottom: none;
}

table tr:nth-child(even) {
    background-color: #f9fafb;
}

table td {
    padding: 1rem;
    vertical-align: top;
    font-size: 0.95rem;
}

table td:first-child {
    font-weight: 600;
    color: var(--color-text-main);
    width: 35%;
    background-color: #f1f5f9;
}

table td:last-child {
    color: var(--color-text-secondary);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    :root {
        --header-height: 3.5rem;
    }

    .head-top, .head-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    
    .head-top {
        align-items: stretch;
    }
    
    .head-top .flx {
        justify-content: center;
        width: 100%;
    }

    .logo {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .btn {
        width: 100%;
    }

    .refka a {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    table td {
        display: block;
        width: 100%;
        padding: 0.75rem;
    }
    
    table td:first-child {
        border-bottom: 1px dashed var(--color-border);
    }
}
