/**
 * Pojo Accessibility text-resize compatibility.
 *
 * The plugin enlarges text while the theme contains fixed pixel line heights.
 * Apply a scalable line height to every resized content element. The toolbar is
 * excluded so its own layout remains unchanged.
 */
body[class*="pojo-a11y-resize-font-"] {
  line-height: 1.35 !important;
}

body[class*="pojo-a11y-resize-font-"]
  *:not(#pojo-a11y-toolbar):not(#pojo-a11y-toolbar *) {
  line-height: 1.35 !important;
}

body[class*="pojo-a11y-resize-font-"]
  :is(h1, h2, h3, h4, h5, h6):not(#pojo-a11y-toolbar *) {
  line-height: 1.2 !important;
}

/**
 * Desktop services mega-menu.
 *
 * Pojo applies its resize percentage independently to body, li and span.
 * The mega-menu labels are spans inside list items, so without an explicit
 * font-size on the links the resize percentages compound and the labels become
 * much larger than intended.
 *
 * Give each menu link its original base font size. Pojo can then resize the
 * child span once from that base size instead of repeatedly through body/li.
 */
@media (min-width: 1024px) {
  body[class*="pojo-a11y-resize-font-"] #mega-paslaugos aside a {
    font-size: 18px !important;
    min-width: 0;
  }

  body[class*="pojo-a11y-resize-font-"] #mega-paslaugos .mega-menu-right {
    font-size: 16px !important;
    min-width: 0;
  }

  body[class*="pojo-a11y-resize-font-"]
    #mega-paslaugos
    aside
    a
    > span:last-child,
  body[class*="pojo-a11y-resize-font-"]
    #mega-paslaugos
    .mega-menu-right
    > span:last-child {
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}


/**
 * Hero card list text.
 *
 * Reset the font-size inheritance at the link level so Pojo's percentage
 * resize is applied only once to the text span instead of compounding through
 * body -> li -> span.
 */
body[class*="pojo-a11y-resize-font-"]
  .wp-block-hero
  ul
  > li
  > a {
  font-size: 16px !important;
}

body[class*="pojo-a11y-resize-font-"]
  .wp-block-hero
  ul
  > li
  > a
  > span:first-child {
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
}


/**
 * Our services list items.
 *
 * Reset the font-size inheritance at the link level so Pojo's percentage
 * resize is applied once to the service title instead of compounding through
 * body -> li -> span.
 *
 * This only affects the service-card list in the .our-services block.
 */
body[class*="pojo-a11y-resize-font-"]
  .our-services
  > .mini-container
  > ul
  > li
  > div
  > a {
  font-size: 16px !important;
}

body[class*="pojo-a11y-resize-font-"]
  .our-services
  > .mini-container
  > ul
  > li
  > div
  > a
  > span:nth-child(2) {
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/**
 * Our works cards.
 *
 * Only target H3 titles inside the .our-works block.
 * Do not affect the paragraph/content text under the titles.
 */
body[class*="pojo-a11y-resize-font-"] .our-works article h3 {
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}
