/*
 * Live mobile audit fixes, 2026-09-02.
 *
 * This file loads last. It deliberately consolidates the shared mobile hero
 * contract instead of adding another page-specific art-direction exception.
 */

@media (max-width: 47.99rem) {
  /* One baseline for every editorial and collection hero. Content can grow
   * beyond it, but short pages no longer start from unrelated heights. */
  .dy26-page-hero,
  .dy26-editorial-hero,
  .dy26-page-hero--compact,
  /* final-polish targets the compact modifier with two class selectors.
   * Match that specificity here so category heroes keep the shared mobile
   * rhythm instead of dropping to the old 20rem height. */
  .dy26-page-hero.dy26-page-hero--compact,
  .dy26-editorial-hero--article,
  .dy26-editorial-hero--about,
  .dy26-editorial-hero--journal,
  .dy26-editorial-hero--process,
  .dy26-editorial-hero--contact,
  .dy26-editorial-hero--cart,
  .dy26-editorial-hero--account,
  .tax-product_cat .dy26-shop-hero {
    height: auto !important;
    min-height: 31rem !important;
    max-height: none !important;
  }

  .dy26-page-hero__inner,
  .dy26-page-hero--compact .dy26-page-hero__inner,
  .dy26-editorial-hero--article .dy26-page-hero__inner {
    align-items: start !important;
    min-height: inherit !important;
    padding-block: calc(var(--dy26-header-height, 4rem) + 1.1rem) 1.5rem !important;
  }

  /* Breadcrumbs and copy share the same left edge, including Process. */
  .dy26-page-hero__copy,
  .dy26-editorial-hero--article .dy26-page-hero__copy,
  .dy26-editorial-hero--process .dy26-page-hero__copy,
  .dy26-page-hero--compact .dy26-page-hero__copy {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-inline-start: 0 !important;
  }

  /* Never slice a word merely to preserve a dramatic narrow column. */
  .dy26-page-hero__copy .dy26-page-hero__title,
  .dy26-editorial-hero--article .dy26-page-hero__copy .dy26-page-hero__title,
  .dy26-page-hero--compact .dy26-page-hero__copy .dy26-page-hero__title {
    width: 100% !important;
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    /* A family name must move as a whole, never as “mâ-choire”. */
    hyphens: none !important;
    text-wrap: balance;
  }

  /* Long article words such as “signification” should move as a whole. */
  .dy26-editorial-hero--article .dy26-page-hero__copy .dy26-page-hero__title {
    font-size: clamp(1.95rem, 8.4vw, 2.25rem) !important;
    hyphens: none !important;
    text-wrap: wrap;
  }

  /* The compact header leaves a real centre column for the wordmark and its
   * promise. It must stay readable rather than collapse into three tiny lines. */
  .dy26-site-header__inner {
    grid-template-columns: 3rem minmax(0, 1fr) 3.6rem !important;
  }

  .dy26-site-header .dy26-brand__wordmark {
    min-height: 1.65rem;
    font-size: 1.34rem !important;
    letter-spacing: 0.31em;
  }

  .dy26-site-header .dy26-brand__seal {
    display: grid !important;
    width: 2.25rem;
    height: 2.25rem;
    left: calc(100% + 0.55rem);
  }

  .dy26-site-header .dy26-brand__tagline {
    display: block !important;
    width: max-content;
    max-width: none;
    margin-block-start: 0.18rem;
    color: var(--dy26-muted);
    font-size: 0.58rem !important;
    letter-spacing: 0.075em;
    line-height: 1.1 !important;
    white-space: nowrap;
  }

  /* WooCommerce may fail to initialise FlexSlider on a translated product.
   * Keep every supplied image available as a main image plus an explicit
   * thumbnail strip even when that external script never creates controls. */
  .single-product .woocommerce-product-gallery[style*="opacity: 0"]:not(.dy26-gallery-is-enhanced) .woocommerce-product-gallery__wrapper {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    transform: none !important;
  }

  .single-product .woocommerce-product-gallery[style*="opacity: 0"]:not(.dy26-gallery-is-enhanced) .woocommerce-product-gallery__image {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    border: 1px solid var(--dy26-border) !important;
    overflow: hidden !important;
  }

  .single-product .woocommerce-product-gallery[style*="opacity: 0"]:not(.dy26-gallery-is-enhanced) .woocommerce-product-gallery__image:first-child {
    grid-column: 1 / -1;
  }

  .single-product .woocommerce-product-gallery[style*="opacity: 0"]:not(.dy26-gallery-is-enhanced) .woocommerce-product-gallery__image:not(:first-child) a {
    display: block !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
  }

  .single-product .woocommerce-product-gallery[style*="opacity: 0"]:not(.dy26-gallery-is-enhanced) .woocommerce-product-gallery__image:not(:first-child) img {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  .single-product .woocommerce-product-gallery.dy26-gallery-is-enhanced > .woocommerce-product-gallery__wrapper {
    display: none !important;
  }

  .single-product .dy26-color-gallery__label {
    grid-column: 1 / -1;
    margin: 0 0 0.1rem;
    color: var(--dy26-ivory-strong);
    font-family: var(--dy26-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .single-product .dy26-color-gallery {
    grid-auto-flow: row !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
