/* Site Navigation & Identity Styles for Ruli24 Help / Knowledge Base */
:root {
  --paper: #f8f7f4;
  --white: #ffffff;
  --ink: #20221f;
  --muted: #62665f;
  --line: #dedfd8;
  --red: #ce342b;
  --red-bright: #dc3c32;
  --dark: #232622;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.65, 0.25, 1);
}

/* Header Component */
.site-header {
  height: 86px;
  position: relative;
  z-index: 900;
  background: #f8f7f4fa;
  border-bottom: 1px solid #e2e2da;
  box-sizing: border-box;
  font-family: var(--font);
}

.header-inner {
  height: 100%;
  width: calc(100% - 64px);
  max-width: 1440px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 19px;
  flex: none;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 109px;
  height: 30px;
  object-fit: contain;
}

.brand-note {
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: #62645e;
  border-left: 1px solid #c9cbc3;
  padding-left: 18px;
  text-align: left;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 27px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
}

.desktop-nav > a {
  padding: 18px 0;
  position: relative;
  text-decoration: none;
  color: var(--ink);
}

.desktop-nav > a::after {
  position: absolute;
  content: '';
  bottom: 10px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), #ff4d4d);
  inset-inline: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.desktop-nav > a:hover::after {
  transform: scaleX(1);
}

.nav-products {
  position: relative;
}

.nav-products summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.nav-products summary::-webkit-details-marker {
  display: none;
}

.nav-products[open] > summary {
  color: var(--red);
}

.mega-menu {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 80px));
  background: var(--paper);
  padding: 30px 36px;
  box-shadow: 0 26px 42px rgba(21, 25, 15, 0.15);
  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  z-index: 1000;
  text-align: left;
}

.mega-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.mega-heading .eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mega-heading a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 26px;
  margin-top: 20px;
}

.mega-grid > a {
  display: grid;
  grid-template-columns: 1fr 16px;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid #dedfd880;
  text-decoration: none;
  color: var(--ink);
}

.mega-grid > a:hover span {
  color: var(--red);
}

.mega-grid > a span {
  font-size: 13px;
  font-weight: 600;
}

.mega-grid > a small {
  grid-column: 1;
  font-size: 10px;
  color: #7a7d75;
}

.mega-grid > a svg {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: #b1b4aa;
}

/* Button Component */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.button-dark {
  background: var(--ink);
  color: #ffffff !important;
}

.button-dark:hover {
  background: #41453d;
}

.button-red {
  background: var(--red);
  color: #ffffff !important;
}

.button-red:hover {
  background: var(--red-bright);
}

.header-cta {
  min-height: 40px;
  padding: 0 18px;
  font-size: 11px;
}

.mobile-toggle,
.mobile-phone,
.icon-button.mobile-toggle,
.icon-button.mobile-phone {
  display: none !important;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 86px 0 0 0;
  background: var(--paper);
  z-index: 850;
  overflow-y: auto;
  padding: 30px;
  font-family: var(--font);
  box-sizing: border-box;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-menu-inner a {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-contact {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-contact a {
  border: none;
  font-size: 14px;
  color: var(--muted);
}

/* Footer Component (Exact match to homepage Warm Paper theme) */
html.m-pageView__state__frame:has(.footer-v2) {
  overflow-y: auto;
}

.site-footer {
  background: var(--paper);
  color: var(--ink);
  padding: 65px 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--font);
  box-sizing: border-box;
}

.footer-container,
.site-footer .container {
  width: calc(100% - 96px);
  max-width: 1320px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.9fr 1fr;
  gap: 60px;
  text-align: left;
}

.footer-brand p {
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: -0.04em;
  margin-top: 24px;
  color: var(--ink);
}

.footer-main nav,
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-main h3 {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 13px;
  color: #596c49;
  font-weight: 650;
}

.footer-main nav > a,
.footer-contact > a {
  font-size: 11px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-main a:hover,
.footer-contact > a:hover {
  color: var(--red);
}

.footer-contact > p {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 220px;
  margin-top: 5px;
}

.footer-bottom {
  margin-top: 54px;
  padding: 23px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 8px;
  color: #606957;
}

.footer-bottom a {
  color: #606957;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-bottom a:hover {
  color: var(--red);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }
  .header-cta {
    display: none;
  }
  .mobile-toggle,
  .mobile-phone,
  .icon-button.mobile-toggle,
  .icon-button.mobile-phone {
    display: inline-flex !important;
  }
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    width: calc(100% - 32px);
  }
  .brand-note {
    display: none;
  }
  .footer-main {
    grid-template-columns: 1fr;
  }
  .footer-container {
    width: calc(100% - 32px);
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }
}

/* ===== DRExplain overrides (blog/help redesign 2026-09) =====
   all.css hides the header row on mobile:
   .b-pageLayout.b-pageLayout__xs .m-pageContent__row__header { display:none }
   That removes the site header (burger + mobile menu) entirely. Restore it. */

@media (max-width: 1024px) {
  .b-pageLayout.b-pageLayout__xs .m-pageContent__row__header {
    display: table-row !important;
  }
  .b-pageLayout.b-pageLayout__xs .m-pageContent__side__header {
    display: table-cell !important;
  }
}

/* Center the article content column in the (wide) article area:
   content is max-width-capped (~960px) but the article td is full-bleed,
   so on wide screens up to ~540px of dead space formed on the right.
   Margin auto balances it. No-op on narrow screens (column = area). */
#workZone_article .b-article__innerWrapper {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* Documentation drawer trigger: replace the bare ≡ glyph with a labeled button */
.b-article__presentSideNavButton {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 30;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  margin: 0;
  box-sizing: border-box !important;
  background: #f8f7f4ee;
  border: 1px solid #dedfd8;
  border-radius: 0 0 8px 0;
  color: #20221f !important;
  font-family: 'Manrope Variable', 'Manrope', sans-serif !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  width: max-content !important;
  max-width: calc(100vw - 24px) !important;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  text-indent: 0;
}

.b-article__presentSideNavButton span {
  display: none !important;
}

.b-article__presentSideNavButton span:before {
  content: none !important;
}

.b-article__presentSideNavButton::before {
  content: "\2261";
  font-size: 18px;
  line-height: 1;
  color: #62665f;
}

.b-article__presentSideNavButton::after {
  content: "Оглавление";
}

.b-article__presentSideNavButton:hover {
  color: #ce342b !important;
  border-color: #ce342b;
}

/* Desktop: keep the control compact (no label column needed, tree is always visible) */
@media (min-width: 1025px) {
  .b-article__presentSideNavButton {
    display: none !important;
  }
}

/* Tree typography: Arial 0.8em -> Manrope 14px, touch-friendly rows */
.b-tree__itemText {
  font-family: 'Manrope Variable', 'Manrope', Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 20px !important;
  white-space: normal !important;
  color: #20221f;
}

.b-tree__itemText a,
.b-tree a {
  color: #20221f;
}

.b-tree__itemText:hover,
.b-tree__itemText a:hover {
  color: #ce342b;
}

/* search input in the tree panel */
#workZone_nav .b-search__inputText,
#workZone_nav input[type="text"] {
  min-height: 40px;
  border: 1px solid #dedfd8;
  border-radius: 7px;
  background: #fff;
  color: #20221f;
  font: 400 14px/20px 'Manrope Variable', 'Manrope', sans-serif;
  padding: 8px 12px;
  box-sizing: border-box;
  width: 100%;
}

/* drawer (side nav) polish on mobile */
@media (max-width: 1024px) {
  #workZone_nav {
    background: #f8f7f4 !important;
    border-right: 1px solid #dedfd8;
    width: min(320px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 48px) !important;
  }
  /* The drawer must remain clickable above the article's dimming overlay. */
  #workZone_nav_content {
    z-index: 50;
  }
  .site-header {
    width: 100vw;
  }
  #workZone_nav.topmost #dismissSideNavButton {
    left: 100%;
    right: auto;
    top: 4px;
    width: 44px;
    height: 44px;
    margin-left: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #20221f;
    background: #f8f7f4;
    border: 1px solid #dedfd8;
    border-radius: 4px;
    box-sizing: border-box;
    text-decoration: none;
  }
  /* make room under the floating TOC button so breadcrumbs are not covered.
     header is a TABLE with border-collapse: the table's own padding is ignored,
     so push the first row's cells down instead (beats custom.css !important). */
  #workZone_article #article__header tr:first-child > td {
    padding-top: 52px !important;
  }
}

/* drawer overlay safety: visible only while the panel is open */
#workZone_article__overlay {
  display: none;
}
#workZone_article.overlayed #workZone_article__overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(32, 34, 31, 0.4);
  z-index: 40;
}
