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

/* Render every independently active notice as a visible, ordered card. The
   group owns the placement formerly assigned to one notice so neither the
   home hero nor the Operational information hero is covered. */
body.ris-modern-v5 .ris-active-notices {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(calc(100% - 36px), 1480px);
  max-width: 1480px;
  min-width: 0;
  margin: clamp(28px, 4vw, 54px) auto 24px;
}

body.ris-modern-v5.ris-page-main .ris-active-notices {
  margin-top: clamp(34px, 5vw, 70px);
}

body.ris-modern-v5.ris-route-operational .ris-active-notices {
  width: min(calc(100% - 32px), 1320px);
  max-width: 1320px;
  margin-top: 28px;
  margin-bottom: 28px;
}

body.ris-modern-v5 .ris-active-notice-list {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.ris-modern-v5 .ris-active-notice-list > .ris-active-notice {
  position: relative !important;
  inset: auto !important;
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) !important;
  align-items: center;
  gap: 10px 16px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  padding: clamp(18px, 2.2vw, 28px) clamp(20px, 3vw, 38px) !important;
  border-radius: 22px !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  background: linear-gradient(110deg, rgba(113, 28, 20, .98), rgba(143, 48, 20, .97) 55%, rgba(132, 68, 0, .97)) !important;
}

body.ris-modern-v5 .ris-active-notice__number {
  min-width: 0;
  margin: 0;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 950;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

body.ris-modern-v5 .ris-active-notice__period {
  position: relative;
  z-index: 1;
  justify-self: start;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .16);
  font-size: 12px !important;
  font-weight: 850;
  line-height: 1.45 !important;
  white-space: nowrap;
}

body.ris-modern-v5 .ris-active-notice__period > time {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  white-space: inherit;
}

body.ris-modern-v5 .ris-active-notice__text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.ris-modern-v5 .ris-notice-status-unavailable {
  border-color: rgba(183, 116, 13, .45);
  color: #704707;
  background: #fff9e9;
}

@media (max-width: 760px) {
  body.ris-modern-v5 .ris-active-notices,
  body.ris-modern-v5.ris-page-main .ris-active-notices,
  body.ris-modern-v5.ris-route-operational .ris-active-notices {
    width: calc(100% - 20px);
    max-width: none;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  body.ris-modern-v5 .ris-active-notice-list { gap: 10px; }

  body.ris-modern-v5 .ris-active-notice-list > .ris-active-notice {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 16px !important;
    border-radius: 16px !important;
  }

  body.ris-modern-v5 .ris-active-notice__period {
    justify-self: stretch;
    white-space: normal;
  }
}

/* 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;
  }
}
