/* Shared presentation geometry. Keep every source intact, never stretch or crop a product. */
:root {
  --product-view-ratio: 4 / 3;
  --application-view-ratio: 16 / 9;
  --product-thumbnail-size: 6rem;
  --product-column-gap: clamp(2rem, 6vw, 5rem);
  --document-photo-inset: 1rem;
}

/* Keep one catalogue photo size across category and recommendation grids.
   Reserve unused columns instead of enlarging one or two product cards. */
.product-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

/* Training collections share one continuous white product surface. Source
   photographs retain their pixels; no filters, blending or CSS enlargement. */
.detail-page[data-product-category="training-seating"] .detail-hero {
  background: #fff;
  color: var(--navy);
}
.detail-page[data-product-category="training-seating"] :is(.product-gallery__stage, .product-gallery__thumbnails button) {
  background: #fff;
}
.detail-page[data-product-category="training-seating"] :is(.detail-summary__lede, .detail-summary .project-selection p) {
  color: var(--muted);
}
.detail-page[data-product-category="training-seating"] :is(.photographed-configurations-link, .detail-summary .text-link, .detail-summary .button-secondary) {
  color: var(--navy);
  border-color: var(--navy);
}
.detail-page[data-product-category="training-seating"] .detail-summary .button-secondary:hover {
  background: var(--navy);
  color: #fff;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.detail-hero__grid, .product-model-hero__grid, .uni-hero__grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--product-column-gap);
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.product-gallery__stage, .product-model-gallery__stage) {
  width: 100%;
  aspect-ratio: var(--product-view-ratio);
  min-height: 0;
  max-height: none;
  padding: 0;
  border-radius: 0;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.product-gallery__stage, .product-model-gallery__stage) > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.product-gallery__thumbnails, .product-model-gallery__thumbnails) {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--product-thumbnail-size));
  grid-auto-columns: auto;
  grid-auto-flow: row;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.25rem;
  overflow: visible;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.product-gallery__thumbnails, .product-model-gallery__thumbnails) button {
  position: relative;
  width: var(--product-thumbnail-size);
  height: var(--product-thumbnail-size);
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 0;
  padding: 0;
}

/* Percentage heights inside an intrinsic grid track can otherwise resolve to
   the portrait image's natural height and crop the feet below the button. */
:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  :is(.product-gallery__thumbnails, .product-model-gallery__thumbnails) button > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  .product-model-feature__media {
  position: relative;
  aspect-ratio: var(--product-view-ratio);
  min-height: 0;
  padding: 0;
  border-radius: 0;
}

:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
  .product-model-feature__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

/* Reversing a feature must not move its image into a narrower text column. */
:is(.detail-page, .product-model-page, .product-family-page, .uni-pilot) .product-model-feature {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 62rem) {
  :is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
    :is(.detail-hero__grid, .product-model-hero__grid, .uni-hero__grid) {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-model-page .product-model-hero__grid {
    grid-template-areas: "heading" "gallery" "summary";
    grid-template-rows: auto;
  }
  .uni-pilot .uni-hero__grid {
    grid-template-areas: "heading" "gallery" "choices";
    grid-template-rows: auto;
  }
  :is(.detail-page, .product-model-page, .product-family-page, .uni-pilot) .product-model-feature {
    grid-template-columns: minmax(0, 1fr);
  }
  :is(.detail-page, .product-model-page, .product-family-page, .uni-pilot)
    .product-model-feature--reverse .product-model-feature__figure { order: 0; }
}

/* ScenePicture may return either an img or a picture. Size both paths equally;
   captions remain outside the frame and can wrap without resizing the image. */
:is(.configuration-application, .product-application-story__figure) > picture {
  display: block;
  width: 100%;
  aspect-ratio: var(--application-view-ratio);
}

:is(.configuration-application, .product-application-story__figure) > img,
:is(.configuration-application, .product-application-story__figure) > picture > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--application-view-ratio);
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

@media (max-width: 47.5rem) {
  :root { --product-thumbnail-size: 4rem; }
}

/* Home: a daylight material palette, punctuated by the existing brand navy.
   No new content, images, animations or navigation hierarchy. */
.home-page--navigation {
  --home-mineral: oklch(96% 0.009 230);
  --home-chalk: oklch(98% 0.006 95);
  --home-paper: oklch(99% 0.003 95);
  background: var(--home-chalk);
}
.home-page--navigation .home-headline-carousel { background: var(--home-mineral); }
.home-page--navigation .home-headline__frame { background: var(--home-mineral); }
.home-page--navigation .category-section { background: var(--home-chalk); }
.home-page--navigation .home-category,
.home-page--navigation .home-category__image { background: var(--home-paper); }
.home-page--navigation .home-navigation-about { background: var(--navy); }
.home-page--navigation .manufacturing-motion__copy,
.home-page--navigation .manufacturing-motion__copy h2,
.home-page--navigation .manufacturing-motion__facility figcaption strong { color: var(--warm-white); }
.home-page--navigation .manufacturing-motion__copy p,
.home-page--navigation .manufacturing-motion__facility figcaption { color: #d4dde5; }
.home-page--navigation .manufacturing-motion__copy .text-link { color: var(--brand-yellow); }
.home-page--navigation .home-navigation-about a:focus-visible { outline-color: var(--brand-yellow); }
.home-page--navigation .home-navigation-project { background: var(--home-mineral); }
.home-page--navigation .home-navigation-contact .final-cta__inner { padding-block: 0; }

/* A model identifier is one name, not two words at its hyphen. */
.product-model-code-label { white-space: nowrap; }

/* Captions occupy their longest natural text height, keeping thumbnail rows
   stable while viewing different photos. Hidden labels are not announced. */
.gallery-caption-track { display: grid; min-width: 0; }
.gallery-caption-text { grid-area: 1 / 1; visibility: hidden; }
.gallery-caption-text[data-visible="true"] { visibility: visible; }
.product-model-gallery__disclosure {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

/* Case photos keep their native composition. Equal visible insets replace
   fixed-ratio letterboxing; product and application galleries remain unchanged. */
.projects-page .card-grid { grid-template-columns: minmax(0, 1fr); }
.project-detail-summary { max-width: none; }
.project-detail-summary h1 { font-size: clamp(1.5rem, 5vw, 4rem); line-height: 1.2; }
.project-title__unit { display: inline-block; max-width: 100%; }
.project-detail-summary > p { max-width: 65ch; }
.project-card__image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: auto;
  padding: var(--document-photo-inset);
  background: transparent;
}
.project-card__image img,
.solution-projects .project-card__image img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}
.project-card:hover img { transform: none; }
.project-gallery figure {
  align-content: start;
  padding: var(--document-photo-inset);
}
.project-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
}
.project-gallery figure:first-child,
.project-gallery figure:last-child { grid-column: auto; }
/* One original photograph keeps the normal desktop frame size, centred rather
   than leaving an empty second column or enlarging a modest catalogue source. */
.project-gallery > figure:only-child {
  grid-column: 1 / -1;
  width: calc((100% - clamp(1.5rem, 3vw, 3rem)) / 2);
  justify-self: center;
}
@media (max-width: 47.5rem) {
  .project-gallery > figure:only-child { width: 100%; }
}
.company-facility img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
.company-workshops__grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  object-position: center;
}

/* Reserve the same two-line text tracks in multi-column product grids.
   Do not truncate long names or add empty space to single-column phone cards. */
@media (min-width: 47.5625rem) {
  .card-grid:not(.card-grid--single) .product-card__body > .card-kicker,
  .card-grid:not(.card-grid--single) .product-card__body > h3 {
    min-block-size: 2lh;
  }

  .card-grid:not(.card-grid--single) .product-card__body > h3 a {
    align-items: flex-start;
  }
}

/* Larger comparisons remain balanced and readable instead of seven tiny
   choices followed by one orphan. Compact existing comparisons stay intact. */
.configuration-index--expanded {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 62rem) {
  .configuration-index--expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 761px) {
  .projects-page .project-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
  }
}
