/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks (layout by haas_ib)
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* Blog posts: long unbreakable strings (URLs, API parameter lines) must wrap instead of widening the page */
.single-post__content {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.single-post__content pre,
.single-post__content pre code {
  overflow-wrap: normal;
  word-break: normal;
  max-width: 100%;
  overflow-x: auto;
}

/* Mobile menu: no tap highlight / lingering focus colour on dropdown items */
.nav-nestable,
.nav-nestable * {
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 991px) {
  .nav-nestable .brx-submenu-toggle:focus,
  .nav-nestable .brx-submenu-toggle *:focus,
  .nav-nestable .brx-submenu-toggle:focus-visible,
  .nav-nestable .brx-submenu-toggle *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  /* red only while the dropdown is open (or it is the current page), not after a tap */
  .nav-nestable .brxe-dropdown:not(.open):not(.active):not(.current-menu-ancestor) > .brx-submenu-toggle,
  .nav-nestable .brxe-dropdown:not(.open):not(.active):not(.current-menu-ancestor) > .brx-submenu-toggle > * {
    color: var(--ink, #0E1513) !important;
  }
}

/* Language switcher in the mobile menu only (the .sm-screen element is hidden above 991px: never force it visible) */
@media (max-width: 991px) {
  /* Mobile menu language switcher: tidy equal-width grid (works for DE/EN/ES/PT-BR and for full names alike) */
  .header__tp-switcher.mobile-menu__tp-switcher,
  .header__tp-switcher.mobile-menu__tp-switcher .trp-shortcode-switcher__wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .header__tp-switcher.mobile-menu__tp-switcher .trp-shortcode-overlay {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  @media (min-width: 600px) {
    .header__tp-switcher.mobile-menu__tp-switcher .trp-shortcode-overlay {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
  }
  .header__tp-switcher.mobile-menu__tp-switcher .trp-shortcode-overlay .trp-current-language-item__wrapper,
  .header__tp-switcher.mobile-menu__tp-switcher .trp-shortcode-overlay .trp-switcher-dropdown-list {
    display: contents !important;
  }
  .header__tp-switcher.mobile-menu__tp-switcher .trp-language-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow: hidden !important;
  }
  .header__tp-switcher.mobile-menu__tp-switcher .trp-language-item .trp-language-item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.04em;
  }
}


/* Code blocks: rounded corners everywhere */
.brxe-code pre,
.single-post__content pre,
.wp-block-code {
  border-radius: 16px;
}
@media (max-width: 767px) {
  .brxe-code pre,
  .single-post__content pre,
  .wp-block-code {
    border-radius: 12px;
  }
}


/* No horizontal page scroll: long words / URLs wrap, grid & flex children may shrink below their content width */
.brxe-text,
.brxe-text-basic,
.brxe-heading,
.brxe-post-content,
.brxe-icon-box,
.brxe-list,
main p,
main li,
main a {
  overflow-wrap: anywhere;
}
.brxe-heading,
h1, h2, h3 {
  overflow-wrap: break-word;
}
@media (max-width: 767px) {
  .brxe-heading,
  h1, h2, h3 {
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}
/* inline code (not code blocks) may wrap */
:not(pre) > code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 991px) {
  .brxe-section > *,
  .brxe-container > *,
  .brxe-block > *,
  .brxe-div > * {
    min-width: 0;
  }
}

/* Long button labels may wrap on small screens instead of widening the page */
@media (max-width: 767px) {
  .btn.brxe-button,
  .hero__btn.brxe-button {
    text-wrap: wrap;
    white-space: normal;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}


/* Standard button size (the compact .btn-sm variant, e.g. in the header, keeps its own size) */
.btn:not(.btn-sm).brxe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 15px 25px;
  font-size: 16px;
  line-height: 1.2;
  box-sizing: border-box;
}
.btn.btn-full.brxe-button {
  width: 100%;
}

/* Anti-Fraud intro: centred copy with a tidy button row */
.intro-text.brxe-text {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.intro-actions.brxe-block {
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}

/* Hero secondary button has long text + nowrap; let it wrap on small screens so the page does not scroll sideways */
@media (max-width: 767px) {
	.hero .btn.hero__btn.brxe-button { white-space: normal; text-wrap: wrap; max-width: 100%; text-align: center; }
}

/* The nav (mobile menu toggle) must not be squeezed by the min-width:0 rule above */
.brxe-nav-nested.nav-nestable {
  flex-shrink: 0;
  min-width: auto;
}
