/* Screen-reader page title where the visible title must stay body-sized text. */
.mhj-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile layout polish for phones. Desktop (min-width: 768px / 800px) is unchanged.
   Loaded last so these overrides win. Safe to keep when the Puter editor republishes a page. */

@media (max-width: 799px) {
  /* Notch / home-indicator. env() is 0 when the device has no safe area. */
  #header.header {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box;
  }

  .header-menu {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
    box-sizing: border-box;
  }

  /* Burger icon box is 35px and the button measures ~37px tall. */
  .header-burger-btn.burger {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-title-logo a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Keep the original inline-flex centering. A block-level flex plus the
     5vw side margins shoved long labels past the right edge of the screen. */
  .header-menu-nav-item > a,
  .header-menu [data-action="back"] {
    min-height: 44px;
    box-sizing: border-box;
  }

  /* iOS zooms focused fields whose text is under 16px. */
  input,
  textarea,
  select {
    font-size: 16px;
  }

  /* Long emails and urls in the footer (320px phones). */
  #footer-sections a,
  #footer-sections p {
    overflow-wrap: anywhere;
  }
}

/* Homepage has no Squarespace header. Show the shared header on phones only.
   Squarespace sets main { --header-height: 0 } only when main is NOT preceded by header.
   The phone header stays in the DOM on desktop (display:none), so force that offset back to 0. */
@media (max-width: 799px) {
  body.homepage #header.header {
    background: #fff;
    box-shadow: 0 1px 0 rgba(27, 42, 58, 0.12);
  }
}

@media (min-width: 800px) {
  body.homepage #header.header {
    display: none !important;
  }

  body.homepage main {
    --header-height: 0px !important;
  }
}

@media (max-width: 767px) {
  /* Squarespace pins short sections to 33vh / 66vh / 100vh, which leaves empty bands on a phone. */
  .page-section.section-height--small,
  .page-section.section-height--medium,
  .page-section.section-height--large {
    min-height: 0 !important;
  }

  /* Mobile grid rows keep desktop spans, so a short heading sits in a tall cell.
     Stack the blocks in their existing order and give them the gutter back. */
  [data-fluid-engine="true"] {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    row-gap: 16px;
    height: auto !important;
    min-height: 0 !important;
    width: 100%;
    max-width: 100%;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    box-sizing: border-box;
  }

  [data-fluid-engine="true"] > .fe-block {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    inset: auto !important;
  }

  /* Fluid images are absolutely positioned inside a grid cell. Give them a real box. */
  .fluid-image-component-root.image-block-outer-wrapper {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: var(--image-component-native-aspect-ratio, 1.5);
    max-height: 72vh;
    margin-inline: auto;
  }

  .sqs-block[data-definition-name="website.components.imageFluid"] :is(.image-block-outer-wrapper, .sqs-block-content, .sqs-image),
  .sqs-block[data-definition-name="website.components.imageFluid"] .sqs-image-content {
    height: 100% !important;
    width: 100% !important;
    max-width: 100%;
  }

  .sqs-block[data-definition-name="website.components.imageFluid"] .design-layout-fluid img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    object-fit: var(--image-component-object-fit, contain);
  }

  .sqsrte-scaled-text-container {
    max-width: 100%;
    overflow: hidden;
  }

  .sqsrte-scaled-text {
    max-width: 100%;
  }

  .map-block .sqs-block-content,
  iframe.site-map-embed {
    width: 100% !important;
    max-width: 100%;
    height: 240px !important;
    min-height: 220px;
    display: block;
  }

  /* Empty gallery strip under the header (workshops) — keep the header offset, drop the blank band. */
  section.gallery-section:has(.gallery-strips-wrapper[style*="height: 0"]) .content-wrapper,
  section.gallery-section:has(.gallery-strips-wrapper[style*="height: 0"]) .gallery {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    overflow: hidden;
  }

  /* Checkbox rows are ~20px tall. */
  .form-wrapper .option label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 6px 0;
    box-sizing: border-box;
  }

  .form-wrapper .option input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    flex: 0 0 22px;
  }
}

/* First and last name sit at 50% and get cramped below ~380px. */
@media (max-width: 380px) {
  .form-wrapper .react-form-contents .field-list .fields.name {
    display: flex;
    flex-direction: column;
  }

  .form-wrapper .react-form-contents .field-list .fields.name .field {
    width: 100% !important;
    max-width: 100%;
  }
}
