/* UkrRIS v5.5.18: targeted regression repairs. */

/* Inner-page navigation is absent at the top of the Danube project page and
   becomes available after the same small scroll threshold as other sections. */
body.ris-modern-v5.ris-route-danube:not(.ris-nav-visible) #main_in_bl {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(-50%, -14px, 0) !important;
}

body.ris-modern-v5.ris-route-danube.ris-nav-visible #main_in_bl {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate3d(-50%, 0, 0) !important;
}

/* The legacy menu used inside every Operational information title has zero
   height. Give the actual title its own flow so a wrapped line expands both
   the grid cell and the document card. */
@media (max-width: 760px) {
  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu,
  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li,
  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li > a {
    position: static !important;
    display: block !important;
    float: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.42 !important;
  }

  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu {
    z-index: auto !important;
  }

  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li {
    position: relative !important;
  }

  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li > a {
    padding-right: 28px !important;
  }

  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li > ul {
    z-index: 20 !important;
  }

  body.ris-modern-v5.ris-route-operational #content table.infoReports tr:not(:first-child) td:nth-child(2) > ul.menu > li > .arrow {
    top: 7px !important;
    right: 0 !important;
  }
}

/* The journal header row is legacy markup inside tbody rather than thead.
   In full-screen mobile/tablet mode only its TH cells stay fixed; the first
   data column remains horizontally scrollable as requested. */
@media (max-width: 1100px) {
  body.ris-modern-v5.ris-page-journal.ris-journal-focus .vj-table > thead > tr:first-child > th,
  body.ris-modern-v5.ris-page-journal.ris-journal-focus .vj-table > tbody > tr:first-child > th,
  body.ris-modern-v5.ris-page-journal.ris-journal-focus .vj-table > tr:first-child > th {
    position: sticky !important;
    z-index: 2102 !important;
    top: calc(68px + env(safe-area-inset-top)) !important;
    color: #0b3145 !important;
    background: #e4f3f9 !important;
    background-clip: padding-box !important;
    box-shadow: 0 2px 0 #b8d4e1, 0 8px 18px rgba(3, 48, 70, .12) !important;
  }

  body.ris-modern-v5.ris-page-journal.ris-journal-focus .vj-table > tbody > tr:not(:first-child) > td,
  body.ris-modern-v5.ris-page-journal.ris-journal-focus .vj-table > tr:not(:first-child) > td {
    position: static !important;
  }
}
