/* OPORA mobile fixes 1.0.0 — scoped overrides loaded after precision.css. */

/* 1. Mobile menu: the dropdown overlays the page instead of growing the header. */
@media (max-width: 1024px) {
  body.opora-kit-page .mobile-nav { position: relative !important; }
  body.opora-kit-page .mobile-nav > nav {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(300px, calc(100vw - 32px)) !important;
    max-width: none !important;
    max-height: calc(100dvh - var(--opora-header-height, 113px) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box !important;
    margin: 0 !important;
    z-index: 60 !important;
    padding: 8px !important;
    gap: 0 !important;
    background: #fff !important;
    border: 1px solid #e0eaf4 !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 30px rgba(0, 32, 91, .12) !important;
  }
  body.opora-kit-page .mobile-nav > nav > .elementor-element { width: 100% !important; max-width: 100% !important; }
  body.opora-kit-page .mobile-nav > nav .elementor-button {
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 44px;
    box-sizing: border-box;
    text-align: left !important;
  }
}

/* 2. Popup: the cookie banner goes under the overlay while a popup is open; it is not accepted. */
body.opora-kit-page.dialog-prevent-scroll .opora-cookie { z-index: 9990 !important; }
/* Background lock is Elementor's own body overflow:hidden. Do not add overflow:hidden on html:
   with both set the browser resets the page scroll to the top when the popup opens. */
.elementor-popup-modal:has(.opora-popup-content) .dialog-message { overscroll-behavior: contain; }

/* Close button: 44x44 hit area, the icon keeps its 15px size. */
.elementor-popup-modal:has(.opora-popup-content) .dialog-close-button {
  width: 44px !important;
  height: 44px !important;
  top: 6px !important;
  right: 6px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 2;
}
.elementor-popup-modal:has(.opora-popup-content) .dialog-close-button svg { width: 15px !important; height: 15px !important; flex: 0 0 15px; }

/* On phones and tablets the button sits in its own strip, so scrolled fields never pass under it. */
@media (max-width: 1024px) {
  .elementor-popup-modal:has(.opora-popup-content) .dialog-widget-content { display: flex !important; flex-direction: column; }
  .elementor-popup-modal:has(.opora-popup-content) .dialog-close-button {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    align-self: flex-end;
    flex: 0 0 44px;
    margin: 2px 2px 0 0;
  }
  .elementor-popup-modal:has(.opora-popup-content) .dialog-message { max-height: calc(100dvh - 32px - 46px) !important; }
  .elementor-popup-modal .opora-popup-content.opora-kit-root { padding-top: 4px !important; }
}

/* 3. Long words on 320–359 px: sizes scale so the longest word fits; texts unchanged, original sizes from 360 px.
   Not hyphenation: browsers without a Russian dictionary would split names without a hyphen. */
@media (max-width: 359px) {
  body .opora-native-root .elementor-element.opora-style-e076fbc6.opora-style-e076fbc6.opora-style-e076fbc6 {
    font-size: min(31px, calc((100vw - 48px) * .098)) !important;
  }
  /* Chairman name: «Александрович» reached into the right padding. */
  body .opora-native-root .elementor-element.opora-style-78b3aa8e.opora-style-78b3aa8e.opora-style-78b3aa8e {
    font-size: min(37px, calc((100vw - 48px) * .127)) !important;
  }
  html body.opora-kit-page .person-card.dark .elementor-widget .elementor-heading-title.elementor-heading-title {
    font-size: min(17px, calc((100vw - 210px) / 8.1)) !important;
  }
  html body.opora-kit-page .person-card.light .elementor-widget .elementor-heading-title.elementor-heading-title {
    font-size: min(15px, calc((100vw - 211px) / 8.3)) !important;
  }
}

/* Hero photo PA6A3779 on computers: the back of the man in the black jacket sits 20 px from the right edge.
   He is at 89.4% of the photo width, so the photo is widened and pinned left. precision.css fixes this
   image at width:100% and object-position:54% 18% with !important, so the Elementor image settings cannot do it.
   Replacing the photo needs this rule updated or removed. Tablets and phones are unchanged. */
@media (min-width: 1025px) {
  html body .opora-native-root .elementor-element.opora-style-12cb790f.opora-style-12cb790f.opora-style-12cb790f img {
    width: calc((100% - 20px) / .894) !important;
    max-width: none !important;
    object-position: 0% 18% !important;
  }
}

/* 4. Slider indicators: ~44 px tall hit area, bars keep their size; side extensions stay inside the 7 px gap. */
/* precision.css sets position:static!important on each dot, so this needs more weight. */
html body.opora-kit-page .opora-native-root .elementor-element.ev-dot.ev-dot { position: relative !important; }
body.opora-kit-page .ev-dot::before {
  content: '';
  position: absolute;
  left: -3px;
  right: -3px;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
  cursor: pointer;
}
