/* Styles for the /uitstroom recommendations modal (views/uitstroom/recommendations.html.erb). */

/* Origin's .interactible-icon paints the modal close button solid white,
   which visually occludes the modal's inner scrollbar. Make it transparent. */
.yc-recommendations-card .modal__close > button,
.yc-recommendations-card .modal__close > button:hover {
  background: transparent;
  line-height: 1;
}

/* The icon font's glyph has built-in vertical metrics that throw flex
   centering off — collapse to the glyph box so the X sits centered. */
.yc-recommendations-card .modal__close .nyc-icon {
  display: block;
  line-height: 1;
}

.yc-popover {
  position: relative;
  flex-shrink: 0;
  padding-bottom: 1.2rem;
  margin-bottom: -1.2rem;
}

/* Lift the wrapper into its own stacking context on hover so the popover
   body sits above sibling rows even when those rows establish their own
   stacking contexts (e.g. via transform/opacity from the design system). */
.yc-popover:hover,
.yc-popover:focus-within {
  z-index: 100;
}

.yc-popover__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid #ccc;
  color: #666;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: help;
  background: #fff;
  user-select: none;
}

.yc-popover__body {
  position: absolute;
  top: calc(100% - 0.4rem);
  right: 0;
  width: 28rem;
  max-width: calc(100vw - 2rem);
  background: #fff;
  color: #111;
  padding: 1.6rem;
  box-shadow: 0 0 1rem 0 rgba(17, 17, 17, 0.18);
  font-size: 1.3rem;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
  z-index: 9999;
}

.yc-popover__body::before {
  content: "";
  position: absolute;
  top: -0.8rem;
  right: 1.2rem;
  width: 0;
  height: 0;
  border-left: 0.8rem solid transparent;
  border-right: 0.8rem solid transparent;
  border-bottom: 0.8rem solid #fff;
}

.yc-popover__body p { margin: 0 0 0.4rem; }
.yc-popover__body .yc-popover__heading { font-weight: 600; }
.yc-popover__body ul { margin: 0 0 1rem; padding-left: 1.8rem; list-style: disc; }
.yc-popover__body ul:last-child { margin-bottom: 0; }
.yc-popover__body li { list-style: disc; }

.yc-popover:hover .yc-popover__body,
.yc-popover:focus-within .yc-popover__body {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

/* Flip the popover upward — used for the last two recommendation rows so it
   stays inside the modal's scroll container, and as an opt-in modifier
   (.yc-popover--up) wherever the trigger sits low in the viewport (e.g. the
   uitstroom action column where the row below clips a downward popover). */
.yc-recommendations-list > div:nth-last-child(-n+2) .yc-popover,
.yc-popover--up {
  padding-bottom: 0;
  margin-bottom: 0;
  padding-top: 1.2rem;
  margin-top: -1.2rem;
}
.yc-recommendations-list > div:nth-last-child(-n+2) .yc-popover__body,
.yc-popover--up .yc-popover__body {
  top: auto;
  bottom: calc(100% - 0.4rem);
  transform: translateY(4px);
}
.yc-recommendations-list > div:nth-last-child(-n+2) .yc-popover__body::before,
.yc-popover--up .yc-popover__body::before {
  top: auto;
  bottom: -0.8rem;
  border-bottom: none;
  border-top: 0.8rem solid #fff;
}
.yc-recommendations-list > div:nth-last-child(-n+2) .yc-popover:hover .yc-popover__body,
.yc-recommendations-list > div:nth-last-child(-n+2) .yc-popover:focus-within .yc-popover__body,
.yc-popover--up:hover .yc-popover__body,
.yc-popover--up:focus-within .yc-popover__body {
  transform: translateY(0);
}
