/* Frontend Utilities - Utilities
   Small class-based utilities intended to be safe across Duda projects.
*/

.nowrap {
  white-space: nowrap !important;
}

.width-60 {
  scale: 0.6 !important;
  transform-origin: left top !important;
}

@supports (width: calc-size(max-content, size * 0.6)) {
  .width-60 {
    width: calc-size(max-content, size * 0.6) !important;
    scale: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .no-tablet-animation {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (max-width: 1200px) {
  .stack-desktop-narrow {
    display: flex;
    flex-direction: column !important;
    align-items: start !important;
    gap: 48px !important;
  }

  .stack-desktop-narrow.shrink {
    width: max-content !important;
  }
}

.row-scroll-mobile,
.row-scroll-tablet,
.row-scroll-tablet-mobile {
  --row-scroll-gap: 16px;
  --row-scroll-padding-inline: 5%;
  --row-scroll-snap-type: x proximity;
  --row-scroll-snap-align: start;
  --row-scroll-item-width: 65vw;
}

@media (min-width: 1025px) {
  .bg-tablet-only,
  .bg-tablet-only::before,
  .bg-tablet-mobile-only,
  .bg-tablet-mobile-only::before,
  .bg-mobile-only,
  .bg-mobile-only::before {
    background-color: transparent !important;
    background-image: none !important;
  }

  .border-tablet-only,
  .border-tablet-mobile-only,
  .border-mobile-only {
    border-width: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .bg-desktop-only,
  .bg-desktop-only::before,
  .bg-mobile-only,
  .bg-mobile-only::before {
    background-color: transparent !important;
    background-image: none !important;
  }

  .border-desktop-only,
  .border-mobile-only {
    border-width: 0 !important;
  }

  :is(.row-scroll-tablet, .row-scroll-tablet-mobile),
  #dm :is(.row-scroll-tablet, .row-scroll-tablet-mobile) {
    display: block !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: var(--row-scroll-snap-type);
    scroll-padding-inline: var(--row-scroll-padding-inline);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  :is(.row-scroll-tablet, .row-scroll-tablet-mobile)::-webkit-scrollbar,
  #dm :is(.row-scroll-tablet, .row-scroll-tablet-mobile)::-webkit-scrollbar {
    display: none;
  }

  :is(.row-scroll-tablet, .row-scroll-tablet-mobile) .row-scroll-track,
  #dm :is(.row-scroll-tablet, .row-scroll-tablet-mobile) .row-scroll-track {
    display: inline-flex !important;
    gap: var(--row-scroll-gap) !important;
    box-sizing: border-box !important;
    padding-inline: var(--row-scroll-padding-inline) !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }

  :is(.row-scroll-tablet, .row-scroll-tablet-mobile) .row-scroll-track > *,
  #dm :is(.row-scroll-tablet, .row-scroll-tablet-mobile) .row-scroll-track > * {
    flex: 0 0 var(--row-scroll-item-width) !important;
    max-width: var(--row-scroll-item-width) !important;
    scroll-snap-align: var(--row-scroll-snap-align);
  }
}

@media (max-width: 767px) {
  .bg-desktop-only,
  .bg-desktop-only::before,
  .bg-desktop-tablet-only,
  .bg-desktop-tablet-only::before,
  .bg-tablet-only,
  .bg-tablet-only::before {
    background-color: transparent !important;
    background-image: none !important;
  }

  .border-desktop-only,
  .border-desktop-tablet-only,
  .border-tablet-only {
    border-width: 0 !important;
  }

  :is(.row-scroll-mobile, .row-scroll-tablet-mobile),
  #dm :is(.row-scroll-mobile, .row-scroll-tablet-mobile) {
    display: block !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: var(--row-scroll-snap-type);
    scroll-padding-inline: var(--row-scroll-padding-inline);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  :is(.row-scroll-mobile, .row-scroll-tablet-mobile)::-webkit-scrollbar,
  #dm :is(.row-scroll-mobile, .row-scroll-tablet-mobile)::-webkit-scrollbar {
    display: none;
  }

  :is(.row-scroll-mobile, .row-scroll-tablet-mobile) .row-scroll-track,
  #dm :is(.row-scroll-mobile, .row-scroll-tablet-mobile) .row-scroll-track {
    display: inline-flex !important;
    gap: var(--row-scroll-gap) !important;
    box-sizing: border-box !important;
    padding-inline: var(--row-scroll-padding-inline) !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }

  :is(.row-scroll-mobile, .row-scroll-tablet-mobile) .row-scroll-track > *,
  #dm :is(.row-scroll-mobile, .row-scroll-tablet-mobile) .row-scroll-track > * {
    flex: 0 0 var(--row-scroll-item-width) !important;
    max-width: var(--row-scroll-item-width) !important;
    scroll-snap-align: var(--row-scroll-snap-align);
  }
}

/* Ubiweb text adapters
   Kept outside Duda page CSS because its serializer removes the :is() and
   :where() selectors that apply the page-defined typography variables. */

#dmRoot #dm .galano.galano,
#dmRoot #dm .galano.galano :is(
  .dmNewParagraph,
  .adv-stagger-line,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  ul,
  ol,
  li,
  a
) {
  font-family: GalanoGrotesque-SemiBold !important;
}

#dm :is(
  .text-xs,
  .text-sm,
  .text-xl,
  .text-2xl,
  .upper-xs,
  .upper-sm,
  .upper
),
#dm :is(
  .text-xs,
  .text-sm,
  .text-xl,
  .text-2xl,
  .upper-xs,
  .upper-sm,
  .upper
) :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  ul,
  ol,
  li,
  a,
  .dmNewParagraph[data-binding]
) {
  font-size: var(--text-util-font-size) !important;
  line-height: var(--text-util-line-height) !important;
  letter-spacing: var(--text-util-letter-spacing) !important;
  font-family: var(--text-util-font-family) !important;
}

#dmRoot #dm :is(
  .text-xs,
  .text-sm,
  .text-xl,
  .text-2xl,
  .upper-xs,
  .upper-sm,
  .upper
) .dmNewParagraph,
#dmRoot #dm :is(
  .text-xs,
  .text-sm,
  .text-xl,
  .text-2xl,
  .upper-xs,
  .upper-sm,
  .upper
) .dmNewParagraph :where(
  p,
  span,
  ul,
  ol,
  li,
  a
) {
  font-size: var(--text-util-font-size) !important;
  line-height: var(--text-util-line-height) !important;
  letter-spacing: var(--text-util-letter-spacing) !important;
  font-family: var(--text-util-font-family) !important;
}

#dm :is(.upper-xs, .upper-sm, .upper),
#dm :is(.upper-xs, .upper-sm, .upper) :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  ul,
  ol,
  li,
  a,
  .dmNewParagraph[data-binding]
) {
  text-transform: uppercase !important;
}

#dm :is(.bold):where([class*="theme-"], [class*="text-"]),
#dm :is(.bold):where([class*="theme-"], [class*="text-"]) :where(
  .dmNewParagraph,
  .dmNewParagraph[data-binding],
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  li,
  a
) {
  font-family: PPNeueMontreal-Semibold !important;
  font-style: normal !important;
}

#dm :is(.italic):where([class*="theme-"], [class*="text-"]),
#dm :is(.italic):where([class*="theme-"], [class*="text-"]) :where(
  .dmNewParagraph,
  .dmNewParagraph[data-binding],
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  li,
  a
) {
  font-family: PPNeueMontreal-HairlineItalic !important;
  font-style: normal !important;
}

#dm :is(.thin):where([class*="theme-"], [class*="text-"]),
#dm :is(.thin):where([class*="theme-"], [class*="text-"]) :where(
  .dmNewParagraph,
  .dmNewParagraph[data-binding],
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  li,
  a
) {
  font-family: PPNeueMontreal-Hairline !important;
  font-style: normal !important;
}

#dm :is(.light):where([class*="theme-"], [class*="text-"]),
#dm :is(.light):where([class*="theme-"], [class*="text-"]) :where(
  .dmNewParagraph,
  .dmNewParagraph[data-binding],
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  li,
  a
) {
  font-family: PPNeueMontreal-Light !important;
  font-style: normal !important;
}

/* Native Duda theme-class adapter. */
#dm :where(
  .theme-body,
  .theme-h1,
  .theme-h2,
  .theme-h3,
  .theme-h4,
  .theme-h5,
  .theme-h6
),
#dm :where(
  .theme-body,
  .theme-h1,
  .theme-h2,
  .theme-h3,
  .theme-h4,
  .theme-h5,
  .theme-h6
) :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  ul,
  ol,
  li,
  a,
  .dmNewParagraph[data-binding]
) {
  color: var(--theme-color);
  direction: var(--theme-direction);
  font-family: var(--theme-font-family) !important;
  font-weight: var(--theme-font-weight) !important;
  font-style: var(--theme-font-style);
  font-size: var(--theme-font-size) !important;
  line-height: var(--theme-line-height) !important;
  letter-spacing: var(--theme-letter-spacing) !important;
  text-decoration: var(--theme-text-decoration);
  text-transform: var(--theme-text-transform);
}

/*
  Responsive Ubiweb theme values.
  Duda adds !important to the French page's base custom properties, which
  prevents its lower-specificity media-query values from taking effect.
  The doubled #dm selector keeps these overrides scoped to Duda while making
  both language pages resolve the same responsive typography values.
*/
@media (min-width: 1025px) {
  #dm#dm .theme-body {
    --theme-font-size: 18px !important;
    --theme-letter-spacing: var(--theme-body-letter-spacing) !important;
  }

  #dm#dm .theme-h1 {
    --theme-font-size: 70px !important;
    --theme-line-height: 1.1 !important;
    --theme-letter-spacing: var(--theme-h1-letter-spacing) !important;
  }

  #dm#dm .theme-h2 {
    --theme-font-size: 55px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h2-letter-spacing) !important;
  }

  #dm#dm .theme-h3 {
    --theme-font-size: 36px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h3-letter-spacing) !important;
  }

  #dm#dm .theme-h4 {
    --theme-font-size: 30px !important;
    --theme-line-height: 1.3 !important;
    --theme-letter-spacing: var(--theme-h4-letter-spacing) !important;
  }

  #dm#dm .theme-h5 {
    --theme-font-size: 24px !important;
    --theme-line-height: 1.4 !important;
    --theme-letter-spacing: var(--theme-h5-letter-spacing) !important;
  }

  #dm#dm .theme-h6 {
    --theme-font-size: 20px !important;
    --theme-line-height: 1.5 !important;
    --theme-letter-spacing: var(--theme-h6-letter-spacing) !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #dm#dm .theme-body {
    --theme-font-size: 18px !important;
    --theme-letter-spacing: var(--theme-body-letter-spacing) !important;
  }

  #dm#dm .theme-h1 {
    --theme-font-size: 70px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h1-letter-spacing) !important;
  }

  #dm#dm .theme-h2 {
    --theme-font-size: 55px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h2-letter-spacing) !important;
  }

  #dm#dm .theme-h3 {
    --theme-font-size: 36px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h3-letter-spacing) !important;
  }

  #dm#dm .theme-h4 {
    --theme-font-size: 30px !important;
    --theme-letter-spacing: var(--theme-h4-letter-spacing) !important;
  }

  #dm#dm .theme-h5 {
    --theme-font-size: 24px !important;
    --theme-line-height: 1.4 !important;
    --theme-letter-spacing: var(--theme-h5-letter-spacing) !important;
  }

  #dm#dm .theme-h6 {
    --theme-font-size: 20px !important;
    --theme-letter-spacing: var(--theme-h6-letter-spacing) !important;
  }
}

@media (max-width: 767px) {
  #dm#dm .theme-body {
    --theme-font-size: 16px !important;
    --theme-letter-spacing: var(--theme-body-letter-spacing) !important;
  }

  #dm#dm .theme-h1 {
    --theme-font-size: 50px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h1-letter-spacing) !important;
  }

  #dm#dm .theme-h2 {
    --theme-font-size: 45px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h2-letter-spacing) !important;
  }

  #dm#dm .theme-h3 {
    --theme-font-size: 28px !important;
    --theme-line-height: 1.2 !important;
    --theme-letter-spacing: var(--theme-h3-letter-spacing) !important;
  }

  #dm#dm .theme-h4 {
    --theme-font-size: 24px !important;
    --theme-letter-spacing: var(--theme-h4-letter-spacing) !important;
  }

  #dm#dm .theme-h5 {
    --theme-font-size: 20px !important;
    --theme-letter-spacing: var(--theme-h5-letter-spacing) !important;
  }

  #dm#dm .theme-h6 {
    --theme-font-size: 18px !important;
    --theme-letter-spacing: var(--theme-h6-letter-spacing) !important;
  }
}
