/* Hahnenkleer Hof – site-wide smartphone width protection.
 * Keep the page itself vertical, while preserving internal scrolling for the
 * magnified event flyer and any naturally wider data table. */
@media (max-width:767px) {
  html,
  body {
    width:100%;
    max-width:100%;
    overflow-x:clip;
  }

  /* A wide flex/grid child must be allowed to shrink within the viewport. */
  body :where(
    #page, .site, .site-content, .site-main, .site-header, .header-inner,
    main, article, .entry-content, .page-content,
    .hh-home-editable, .hh-home-section, .hh-section-inner, .hh-gallery,
    .hh-feature, .hh-feature-media, .hh-feature-text, .hh-booking,
    .hh-d21-section, .hh-d21-widget, .hh-d21-contact,
    .hhce-original-intro, .hhce-footer-four-columns, .hhce-footer-widget-cell,
    .hhce-footer-editable, .hh-custom-bottom-links,
    .hhe-banner, .hhe-banner-inner, .hhe-dialog-content, .hhe-intro,
    .hhe-poster-wrap, .hhe-shortcode
  ) {
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
  }

  /* Large photos and third-party embeds never enlarge their parent page. */
  body :where(main, article, .entry-content, .page-content, .hh-home-section,
    .hh-booking, .hh-d21-section, .hhe-banner) :where(img, video, canvas, svg, iframe) {
    max-width:100%;
    box-sizing:border-box;
  }
  body :where(input, textarea, select, button) {
    box-sizing:border-box;
    max-width:100%;
  }

  /* Links, addresses and legal/footer content can contain long unbroken text. */
  body :where(.entry-content, .page-content, .hh-feature-text,
    .hh-d21-contact, .hhce-footer-editable, .hh-custom-bottom-links) {
    overflow-wrap:anywhere;
  }
  .hh-custom-bottom-links a {
    white-space:normal;
  }

  /* Keep preformatted content or a wide table in its own bounded scroller. */
  body :where(.entry-content, .page-content) :where(pre, table) {
    display:block;
    box-sizing:border-box;
    max-width:100%;
    overflow-x:auto;
    overscroll-behavior-x:contain;
  }

  /* Existing mobile booking controls continue to use the full available width. */
  .hh-d21-section .hh-d21-widget,
  .hh-d21-section .hh-d21-widget .d21-quickbook,
  .hh-d21-section .hh-d21-widget .d21-container-view {
    min-width:0!important;
    max-width:100%!important;
  }
}

/* Older browsers without overflow:clip still cannot pan the whole document. */
@supports not (overflow:clip) {
  @media (max-width:767px) {
    html, body {overflow-x:hidden}
  }
}
