/* Hand-written fixes on top of the original CSS (not css-isolate output). Linked last by app/(site)/[[...slug]]/layout.tsx. */

/* Supreme Modules card carousels (home services and testimonials, the single-row carousels on the service pages):
   the plugin sizes the carousel one of two ways, chosen when it starts and kept on resize. Above 980px it follows
   the visible cards' height (auto height) and aligns cards to the top, so a card with a one-line title is shorter
   than one with a three-line title and the carousel jumps as it slides. Below that, or when the page was opened
   narrower and then widened, it locks the carousel to a pixel height measured at start, which cuts off the bottom
   of the cards once they grow taller (a narrower window, a title that wraps). Here the wrapper always sizes to its
   tallest card at the current width (every card, not only the visible ones) and every card stretches to it, with
   the button at the bottom. Multi-row carousels (swiper-container-multirow, /services/ and the service category
   pages) need Swiper's fixed height and are left alone. A carousel that was multi-row at a narrower width and
   became single-row on a resize keeps Swiper's row gap (margin-top: 15px) on every other card, which pushes those
   cards down; a single-row carousel never has one, so it is cleared. */
.dsm_card_carousel_wrapper.swiper-container-horizontal:not(.swiper-container-multirow) > .swiper-wrapper {
  height: auto !important;
  align-items: stretch;
}
.dsm_card_carousel_wrapper.swiper-container-horizontal:not(.swiper-container-multirow) > .swiper-wrapper > .swiper-slide {
  height: auto !important;
  margin-top: 0 !important;
  display: flex;
  flex-direction: column;
}
.dsm_card_carousel_wrapper.swiper-container-horizontal:not(.swiper-container-multirow) .swiper-slide > .et_pb_module_inner,
.dsm_card_carousel_wrapper.swiper-container-horizontal:not(.swiper-container-multirow) .swiper-slide .dsm_card_wrapper {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.dsm_card_carousel_wrapper.swiper-container-horizontal:not(.swiper-container-multirow) .swiper-slide .dsm_card_wrapper > .et_pb_button_wrapper {
  margin-top: auto;
}

/* Home "areas of concern" flip boxes: the Unwanted Hair box (.dsm_flipbox_9) also has its photo set on the outer
   module (an original Divi setting, home.css), which is square, while the card inside has 10px corners, so the
   photo shows at the corners. The outer box takes the same corners. It is the only flip box with its own background. */
:where(body:is([data-route="/"])) .dsm_flipbox_9 {
  border-radius: 10px;
}

/* Supreme Modules "float" hover effect (.dsm-float: home hero buttons, product card buttons, the hero buttons of the
   service pages, the gallery footer): the plugin raises the button on :hover, :active AND :focus. A clicked link keeps
   focus, and Back restores the page with it still focused, so the button stays raised until something else is
   clicked. Here a focus that came from the mouse or a tap no longer raises it; hover, press, and keyboard (Tab) focus
   still do. */
.dsm-float:focus:not(:focus-visible):not(:hover):not(:active) {
  -webkit-transform: perspective(1px) translateZ(0);
  transform: perspective(1px) translateZ(0);
}
