/* A photo cover is opt-in: functional screens and article headers use their own layout. */
@media (max-width:767px) {
  #main > section.ds-hero.aj-mobile-cover[id] {
    --cover-gutter: clamp(18px, 5.5vw, 38px);
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    display: flex !important;
    flex-flow: column nowrap !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100%;
    max-width: none;
    height: auto !important;
    min-height: calc(100vh - var(--aj-scroll-header-height, 64px)) !important;
    min-height: calc(100svh - var(--aj-scroll-header-height, 64px)) !important;
    padding: clamp(60px, 12svh, 120px) var(--cover-gutter) max(24px, env(safe-area-inset-bottom)) !important;
    margin: 0;
    background: #faf8f5 !important;
  }
  #main > .ds-hero.aj-mobile-cover[id]::before,
  #main > .ds-hero.aj-mobile-cover[id]::after,
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-photo::before,
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-photo::after { display: none !important; }
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-photo {
    position: absolute !important;
    inset: 0 !important;
    z-index: -2;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 0;
    pointer-events: none;
  }
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-photo :is(picture,img) {
    position: static !important;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    max-width: none;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: var(--aj-cover-focus, 50%) center;
    border-radius: 0;
    transform: none;
  }
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-copy {
    position: relative;
    isolation: isolate;
    z-index: 1;
    display: grid !important;
    gap: 12px;
    align-self: stretch;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0;
    color: #292724;
  }
  /* Anchor the fade to the actual copy height, including long page titles and larger text. */
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: -90px calc(-1 * var(--cover-gutter)) calc(-1 * max(24px, env(safe-area-inset-bottom)));
    background: linear-gradient(to bottom,rgba(250,248,245,0),rgba(250,248,245,.68) 58px,rgba(250,248,245,.94) 90px,rgba(250,248,245,.97));
  }
  #main > .ds-hero.aj-mobile-cover[id] :is(.ds-hero-heading,.ds-hero-detail) {
    position: static;
    display: grid;
    justify-items: start;
    gap: 10px;
    width: auto;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }
  #main > .ds-hero.aj-mobile-cover[id] :is(.ds-eyebrow,.ds-hero-title,.ds-hero-lead,.category-ux-delivery,.ds-hero-actions,.ds-hero-note) {
    max-width: 100%;
    margin: 0 !important;
    overflow-wrap: anywhere;
  }
  #main > .ds-hero.aj-mobile-cover[id] .ds-eyebrow {
    color: #494540;
    font-size: 14px;
    line-height: 1.3;
  }
  #main > .ds-hero.aj-mobile-cover[id] .ds-hero-title {
    color: #292724;
    font-size: clamp(30px, 8.1vw, 43px) !important;
    line-height: 1.04 !important;
  }
  #main > .ds-hero.aj-mobile-cover[id] .ds-hero-lead {
    color: #393631;
    font-size: clamp(16px,4vw,18px);
    line-height: 1.42;
  }
  #main > .ds-hero.aj-mobile-cover[id] :is(.category-ux-delivery,.ds-hero-note) {
    color: #494540;
    font-size: 14px;
    line-height: 1.35;
  }
  /* Keep an open shelf and the lower edge of the shutter above the text. */
  #main > .ds-hero.aj-mobile-cover[id] img[src="/shutters-family/cabinet-hero-v1.webp"] {
    object-view-box: inset(28% 0 0);
  }
  @supports not (object-view-box: inset(28% 0 0)) {
    #main > .ds-hero.aj-mobile-cover[id] img[src="/shutters-family/cabinet-hero-v1.webp"] {
      transform: translateY(-20%);
    }
  }
  #main > .ds-hero.aj-mobile-cover[id] .ds-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 4px;
  }
}
@media (max-width:767px) and (max-height:680px) {
  #main > section.ds-hero.aj-mobile-cover[id] { padding-top:32px !important; }
  #main > .ds-hero.aj-mobile-cover[id] > .ds-hero-copy { gap:8px; }
  #main > .ds-hero.aj-mobile-cover[id] :is(.ds-hero-heading,.ds-hero-detail) { gap:8px; }
  #main > .ds-hero.aj-mobile-cover[id] .ds-hero-title { font-size:clamp(28px,7.5vw,36px) !important; }
  #main > .ds-hero.aj-mobile-cover[id] img[src="/shutters-family/cabinet-hero-v1.webp"] {
    object-view-box: none;
    transform: translateY(-46%);
  }
  #main > .ds-hero.aj-mobile-cover[id]:has(img[src="/shutters-family/cabinet-hero-v1.webp"]) > .ds-hero-copy::before {
    top: -36px;
    background: linear-gradient(to bottom, transparent, rgba(250,248,245,.95) 36px, rgba(250,248,245,.97));
  }
}
