@media (max-width: 950px) {
  .header .navbar nav.open {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - 74px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 16px 16px;
  }

  .header .navbar nav > a,
  .header .navbar nav > details > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    white-space: normal;
  }

  .header .navbar .resource-menu[open] { flex: none; }
  .header .navbar .resource-menu ul {
    position: static;
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
  }
  .header .navbar .resource-menu li a { min-height: 44px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  .wrap { width: calc(100% - 32px); }

  main :is(h1,h2,h3,p,figcaption,dd,td,th) {
    overflow-wrap: anywhere;
  }
  :is(.inner-grid,.site-footer-grid,.catalog-filter-grid,.projects-hero-layout,.product-summary-spread) > * {
    min-width: 0;
  }
  main :is(.section,.inner-section) { padding-block: clamp(32px, 8vw, 54px); }

  .cg-home-banners .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
  }
  .cg-home-banners .hero::after { display: none; }
  .cg-home-banners .hero-copy {
    order: -1;
    padding-block: 30px 20px;
  }
  .cg-home-banners .hero :is(h1,h2) {
    margin: 0;
    font-size: clamp(2rem, 8vw, 3.8rem);
    line-height: 1.04;
    letter-spacing: -.04em;
  }
  .cg-home-banners .hero .hero-kicker { margin: 0 0 10px; }
  .cg-home-banners .hero .hero-description { margin: 12px 0 16px; }
  .cg-home-banners .hero .hero-image {
    position: static;
    flex: none;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    z-index: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .cg-home-banners-controls {
    position: static;
    justify-content: center;
    transform: none;
    border-radius: 0;
    padding: 4px 16px;
  }
  .cg-home-banners-controls button,
  .cg-home-banners-controls .cg-home-banners-dot { width: 44px; height: 44px; }

  .product-editorial .product-hero-layout { gap: 0; }
  .product-editorial .product-hero-copy { padding: 24px 18px; }
  .product-editorial .product-hero-copy h1 {
    font-size: clamp(1.8rem, 7.2vw, 2.8rem);
    line-height: 1.1;
  }
  .product-editorial .product-editorial-photo img {
    max-height: none;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .product-editorial .product-section-nav { padding: 7px; }
  .product-editorial .product-section-nav a,
  .catalog-results .model-sizes a { display: inline-flex; align-items: center; min-height: 44px; }
  .product-spec-table { max-width: 100%; }

  #quote-form, #quote-popup-form, #document-request-form { min-width: 0; }
  :is(#quote-form,#quote-popup-form,#document-request-form) :is(input,select,textarea) {
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  .quote-popup {
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .quote-popup form { padding: 56px 16px 18px; }
  .quote-popup-close { width: 44px; height: 44px; }
  .floating-contact { bottom: max(10px, env(safe-area-inset-bottom)); }
}

@media (max-width: 540px) {
  .header .navbar { width: calc(100% - 24px); gap: 6px; }
  .header .navbar .brand { gap: 5px; font-size: 13px; }
  .header .navbar .brand small { font-size: 7px; letter-spacing: .08em; }
  .header .navbar .brand .brand-mark { width: 27px; height: 27px; }
  .header .navbar :is(.menu,.top-quote) {
    min-height: 44px;
    padding-inline: 7px;
    font-size: 12px;
  }
  .header .navbar .top-quote { line-height: 1.2; text-align: center; }
  .catalog-page .catalog-results .inner-grid,
  .catalog-results .inner-grid:last-child { grid-template-columns: minmax(0, 1fr); }
  .site-footer-grid > * { padding-block: 20px; }
}

.cg-home-banner-picture { display: contents; }
@media (max-width: 760px) {
  .cg-home-banners .cg-home-banner-picture .hero-image {
    aspect-ratio: 1 / 1;
    object-position: center;
  }
}

/* The mobile photo and its copy share the same square. */
@media (max-width: 760px) {
  body:not(.inner-page) .header {
    margin-bottom: 0;
    background: #191e20;
  }

  .cg-home-banners .hero {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    aspect-ratio: 1 / 1;
    min-height: 0;
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }

  .cg-home-banners .hero .hero-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .cg-home-banners .hero::after {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 22%, #0a14192b 42%, #0a1419ba 70%, #0a1419ef 100%);
  }

  .cg-home-banners .hero-copy {
    grid-area: 1 / 1;
    align-self: end;
    order: 0;
    margin: 0 auto;
    padding-block: 12px 16px;
  }

  .cg-home-banners .hero :is(h1,h2) {
    max-width: 15ch;
    font-size: clamp(1.4rem, 6vw, 3.25rem);
    line-height: 1.05;
    text-wrap: initial;
    text-shadow: 0 1px 8px #0008;
  }

  .cg-home-banners .hero .hero-kicker {
    margin: 0 0 6px;
    font-size: clamp(.6rem, 2.2vw, .85rem);
    letter-spacing: .1em;
  }

  .cg-home-banners .hero .hero-description {
    margin: 8px 0 12px;
    font-size: clamp(.76rem, 3.1vw, 1rem);
    line-height: 1.4;
  }

  .cg-home-banners .hero .actions { gap: 7px; }
  .cg-home-banners .hero .button {
    min-height: 44px;
    padding: 6px clamp(7px, 2.6vw, 15px);
    font-size: clamp(.69rem, 2.75vw, .9rem);
  }
}
