@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html, body {
    height: 100%; margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #EDECEA;
    -webkit-font-smoothing: antialiased;
}

/* === КОНТЕНТ === */
.content, .pageHeader, .pageFooter {
    font-family: 'Inter', sans-serif; font-size: 15px; color: #374151; line-height: 1.7;
    padding-left: 0; margin: 0; min-width: 0; max-width: 960px; overflow-x: hidden;
}
.TEHeadingH1, .ETHeadingH1, .PEHeadingH1, .MLHeadingH1, .ArHeadingH1 {
    font-size: 13px; font-weight: 500; text-align: left; color: #8C8C8C; margin-bottom: 4px;
}
.pageHeader { padding-top: 8px; text-align: left; }

.p_header1 { font-family: 'Inter', sans-serif; font-size: 36px; font-weight: 700; color: #0D0D0D; margin: 0 0 28px 0; padding-bottom: 0; border: none; letter-spacing: -0.03em; line-height: 1.15; }
.p_header2 { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 600; color: #0D0D0D; margin: 40px 0 16px 0; padding-bottom: 12px; border: solid #E8E6DE; border-width: 0 0 1px 0; letter-spacing: -0.02em; line-height: 1.3; }
.p_header3 { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 600; color: #1F2937; margin: 28px 0 8px 0; line-height: 1.4; }

.p_content { color: #374151; margin: 14px 0 0 0; text-align: left; line-height: 1.7; }
.p_table_content, .p_content_no_spacing { color: #374151; margin: 0; text-align: left; line-height: 1.7; }
.p_list { margin: 4px 0 4px 16px; line-height: 1.7; }
.p_list2 { margin: 4px 0 4px 32px; line-height: 1.7; }

.hlText { font-family: inherit; color: #0039A6; text-decoration: underline; text-decoration-color: rgba(0,57,166,0.3); text-underline-offset: 2px; }
.hlText:hover { color: #002878; text-decoration-color: #0039A6; }

.table_no_borders { width: 100%; border-collapse: collapse; border: 0; margin: 20px 0 0 0; }
.table_no_borders_no_spacing { width: 100%; border-collapse: collapse; border: 0; margin: 8px 0 0 0; }
.searchField { display: none; }
.highlight { background: #FEF9C3; border-radius: 2px; padding: 0 2px; }

/* =========================================
   ШАПКА
   ========================================= */
.header-container {
    display: flex; align-items: center; height: 72px; padding: 0;
    border-bottom: 1px solid #E8E8E8; background-color: #FAF9F6; overflow: visible;
    position: relative;
}
.top-row { display: contents; }
.bottom-row { display: contents; }

.logo-area     { order: 1; margin-right: 16px; }
.search-area   { order: 2; margin: 0; }
.sub-nav       { order: 3; }
.right-actions { order: 4; margin-left: auto; }

.logo-area {
    flex-shrink: 0; font-family: "Arial Black", 'Inter', sans-serif;
    font-size: 22px; font-weight: 900 !important; letter-spacing: -1px; text-decoration: none;
    background: linear-gradient(90deg, #8B9AB4 0%, #2551A5 30%, #183395 50%, #622A67 75%, #C62629 100%) !important;
    -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important;
    background-clip: text !important; white-space: nowrap; margin-left: 0 !important;
}

/* Поиск */
.search-area {
    display: flex; align-items: center;
    width: 180px; flex-shrink: 0; min-width: 180px; height: 36px; overflow: visible;
}

.search-area .ya-site-form,
.search-area > div { width: 100% !important; min-width: 100% !important; max-width: 100% !important; }

.search-area .ya-site-form form {
    display: flex !important; flex-direction: column !important; width: 100% !important;
    margin: 0 !important; padding: 0 !important; border: none !important; background: transparent !important;
}

.search-area .ya-site-form table,
.search-area .ya-site-form tbody {
    display: block !important; width: 100% !important;
    margin: 0 !important; padding: 0 !important; border: none !important; background: transparent !important;
}

.search-area .ya-site-form tr {
    display: flex !important; align-items: stretch !important; width: 100% !important;
    margin: 0 !important; padding: 0 !important; border: none !important; background: transparent !important;
}
.search-area .ya-site-form td { display: block !important; padding: 0 !important; margin: 0 !important; border: none !important; }
.search-area .ya-site-form td:first-child { flex: 1 1 auto !important; min-width: 0 !important; }

.search-area .ya-site-form input[type="search"],
.search-area .ya-site-form input.ya-site-form__input-text {
    width: 100% !important; height: 34px !important; padding: 0 10px !important;
    border-radius: 8px 0 0 8px !important; border: 1px solid #DDD9CE !important;
    border-right: none !important; background-color: #F0EFE9 !important;
    box-sizing: border-box !important; font-size: 13px !important;
    font-family: 'Inter', sans-serif !important; color: #0D0D0D !important;
    outline: none !important; margin: 0 !important; box-shadow: none !important;
    -webkit-appearance: none !important; transition: all 0.15s !important;
}
.search-area .ya-site-form input[type="search"]:focus,
.search-area .ya-site-form input.ya-site-form__input-text:focus {
    background-color: #fff !important; border-color: #C5C1B6 !important;
}

/* Иконка лупы */
.search-area .ya-site-form input[type="submit"],
.search-area .ya-site-form input.ya-site-form__submit {
    font-size: 0 !important; color: transparent !important; text-indent: -9999px !important;
    width: 36px !important; min-width: 36px !important; max-width: 36px !important;
    flex: 0 0 36px !important; height: 34px !important; padding: 0 !important;
    border-radius: 0 8px 8px 0 !important; border: 1px solid #DDD9CE !important;
    border-left: none !important; background-color: #E8E6DE !important;
    cursor: pointer !important; box-sizing: border-box !important; margin: 0 !important;
    -webkit-appearance: none !important; transition: all 0.15s !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: center !important; background-size: 16px 16px !important;
}
.search-area .ya-site-form input[type="submit"]:hover,
.search-area .ya-site-form input.ya-site-form__submit:hover {
    background-color: #DDD9CE !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D0D0D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
}

/* Табы — умное выравнивание */
.sub-nav {
    display: flex; gap: 2px; align-items: center;
    background-color: #E6E5E0; border-radius: 10px; padding: 3px; flex-shrink: 0;
    position: absolute; top: 50%; transform: translateY(-50%);
    left: calc(280px + 56px) !important; z-index: 10;
}
.sub-nav-link {
    text-decoration: none; color: #6B6B6B; font-weight: 500; font-size: 13px;
    font-family: 'Inter', sans-serif; display: flex; align-items: center;
    height: 28px; padding: 0 12px; border-radius: 7px;
    transition: all 0.12s; white-space: nowrap; background-color: transparent;
}
.sub-nav-link:hover { color: #0D0D0D; background-color: rgba(255,255,255,0.5); }
.sub-nav-link:hover::after { display: none; }

.sub-nav-link.active {
    color: #0D0D0D; background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

body[onload*="dokument"] .sub-nav-link[href*="dokument"],
body[onload*="tablicy"] .sub-nav-link[href*="tablicy"],
body[onload*="prezentaciya"] .sub-nav-link[href*="prezentaciya"],
body[onload*="pochta"] .sub-nav-link[href*="pochta"] {
    color: #0D0D0D; background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

/* Правая часть (Кнопка Блог + Меню) */
.right-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding-right: 20px; }

.btn-articles {
    background-color: transparent; color: #5C5C5C; text-decoration: none;
    padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 4px;
    transition: all 0.15s; border: 1px solid #E8E8E8; white-space: nowrap;
}
.btn-articles:hover { color: #0D0D0D; background-color: #EFEEEB; border-color: #D0D0D0; }
.btn-articles svg { width: 12px; height: 12px; }

.hamburger-menu { position: relative; }
.hamburger-btn {
    background: #0D0D0D !important; color: #fff; border: none; border-radius: 6px;
    padding: 6px 14px; display: flex; align-items: center; gap: 6px;
    cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 13px; white-space: nowrap;
}
.hamburger-btn:hover { opacity: 0.85; }
.hamburger-icon { display: flex; flex-direction: column; gap: 3px; }
.hamburger-icon span { display: block; width: 14px; height: 1.5px; background-color: #fff; border-radius: 1px; }

.dropdown-menu {
    display: flex; visibility: hidden; opacity: 0; transform: translateY(-4px);
    transition: all 0.15s ease; position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border: 1px solid #E8E8E8; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    min-width: 200px; z-index: 99999; flex-direction: column; padding: 6px 0;
}
.dropdown-menu::before { content: ''; position: absolute; top: -10px; left: 0; width: 100%; height: 10px; }
.hamburger-menu:hover .dropdown-menu { visibility: visible; opacity: 1; transform: translateY(0); }
.dropdown-menu.show { visibility: visible; opacity: 1; transform: translateY(0); }
.dropdown-menu a { padding: 10px 16px; text-decoration: none; color: #0D0D0D; font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 450; }
.dropdown-menu a:hover { background-color: #F5F5F5; }

/* =========================================
   ЛЕЙАУТ
   ========================================= */
.opnavi { width: 100%; max-width: 1430px; height: auto; min-height: 0; overflow: visible !important; }
.opmenu { flex: 0 0 280px; width: 280px; min-width: 280px; overflow-y: auto; border-right: 1px solid #E8E6DE; background-color: #FAF9F6; }
.frameMenu { width: 100%; height: 100%; overflow-y: auto; }
.sidebar { padding-left: 0 !important; }
.opcontent { flex: 1; overflow-y: auto; padding: 32px 56px 80px 56px; background-color: #FAF9F6; }
.opbody { display: flex; flex-direction: column; align-items: center; padding: 0; overflow: visible; }
.opmain { display: flex; flex: 1; height: calc(100vh - 73px); width: 100%; max-width: 1430px; }

.breadcrumbs { font-family: 'Inter', sans-serif; font-size: 13px; color: #8C8C8C; margin: 0 0 8px 0; text-align: left; }
.breadcrumbs a { color: #8C8C8C; text-decoration: none; }
.breadcrumbs a:hover { color: #0039A6; }
.breadcrumbs span { margin: 0 5px; color: #D0CEC6; }

.pageFooter { margin-top: 56px; padding-top: 20px; border-top: 1px solid #E8E6DE; }
.content img { max-width: 100%; height: auto; border-radius: 4px; margin: 8px 0; }

@media (max-width: 900px) {
    .opcontent { padding: 24px 24px 48px 24px; }
    .opmenu { flex: 0 0 240px; width: 240px; min-width: 240px; }
    .sub-nav { left: calc(240px + 24px); } 
    .sub-nav-link { font-size: 12px; padding: 0 8px; }
    .search-area { width: 120px; min-width: 120px; }
}

@media (max-width: 768px) {
    .header-container { flex-wrap: wrap; height: auto; padding: 8px 16px; }
    .sub-nav { position: static; transform: none; margin-top: 12px; order: 5; }
    .right-actions { margin-left: auto; }
    .search-area { order: 10; min-width: 100%; margin: 12px 0 0 0; width: auto; }
    .opmain { flex-direction: column; height: auto; }
    .opmenu { flex: none; width: 100%; min-width: 100%; max-height: 50vh; border-right: none; border-bottom: 1px solid #E8E6DE; }
    .opcontent { padding: 20px 16px 48px 16px; }
    .content, .pageHeader, .pageFooter { max-width: 100%; }
}