/* Load after the existing release styles. Preserve normal-size styling while
   allowing enlarged text to wrap and controls to remain within the viewport. */

.br-tabs {
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}
.br-tabs button {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Text is only shortened after JavaScript confirms an expansion control is
   available. This also leaves the full review readable without JavaScript. */
.br-card .br-quote:not(.is-expandable) {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.village-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.village-links a {
  min-width: 0;
  gap: 8px;
  overflow-wrap: anywhere;
}
.village-links a > span,
.village-links a > svg {
  flex-shrink: 0;
}

/* Long place names must not become the minimum width of a content column. */
main :is(h1, h2, h3),
.body-copy,
.notice,
.blog-article,
.blog-article > a {
  overflow-wrap: anywhere;
}
.crematorium-opening > *,
.crematorium-body-grid > *,
.crematorium-fact-grid > *,
.crematorium-more-grid > *,
.arranging-steps > div > div,
.crematorium-address > div,
.blog-article,
.blog-article > a,
.local-category > span:nth-child(2) {
  min-width: 0;
}
main :is(.button, .text-link),
.crematorium-deeper a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.local-category > span:nth-child(2) {
  overflow-wrap: anywhere;
}
.area-name-grid a,
.area-name-grid a > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.area-name-grid a > svg {
  flex-shrink: 0;
}

/* Native form controls must not set the grid's minimum width at large text. */
.callback-dialog form,
.callback-dialog label {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.callback-dialog form > *,
.callback-dialog :is(input, select, textarea) {
  min-width: 0;
  max-width: 100%;
}
.callback-dialog :is(input, select, textarea) {
  width: 100%;
}
.callback-dialog :is(h2, p, label, .button) {
  overflow-wrap: anywhere;
}
.callback-dialog .button {
  white-space: normal;
}
.wishes-sharing {
  min-width: 0;
  overflow-wrap: anywhere;
}
.sharing-fields > label {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.sharing-fields input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.wishes-sharing .wishes-checkbox > span {
  min-width: 0;
}

/* Keep cookie controls reachable on short screens at every width. The banner
   sits 18px from the bottom on wider screens, so preserve the same gap above. */
.bt-cookie {
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
}
.bt-cookie-dialog {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
@media (max-width: 600px) {
  .bt-cookie {
    max-height: 65vh;
    max-height: 65dvh;
  }
  .bt-cookie-dialog {
    max-height: 85vh;
    max-height: 85dvh;
  }
}

@media (max-width: 1150px) {
  .site-header {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--btf-header-top, 0px) - var(--btf-call-bar-height, 0px));
    max-height: calc(100dvh - var(--btf-header-top, 0px) - var(--btf-call-bar-height, 0px));
  }
  .site-header .header-inner {
    width: 100%;
    flex: 0 0 auto;
  }
  .site-header .mobile-navigation {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 680px) {
  :root {
    scroll-padding-bottom: calc(var(--btf-call-bar-height, 63px) + 16px);
  }
  .site-header .header-inner {
    height: auto;
    min-height: 78px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .site-header .brand {
    min-width: 0;
    flex: 1 1 auto;
  }
  .site-header .brand-tree {
    flex: 0 0 36px;
  }
  .site-header .brand-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .site-header .header-phone,
  .site-header .menu-toggle {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    margin-left: 0;
  }
  .site-footer {
    padding-bottom: calc(var(--btf-call-bar-height, 63px) + 49px);
  }
}
