/* Carmar Interiors v3.1.0: media should show the work clearly, never force it into a crop. */

.hero-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-media picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Keep mixed-aspect slides top-aligned. Flex stretch creates false blank panels under shorter media. */
.media-rail {
  align-items: flex-start;
}

/* Galleries use the source aspect ratio. Wide rooms stay wide, portrait rooms stay portrait. */
.media-slide {
  flex: 0 0 min(94vw, 640px);
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  background: #ece8df;
}

.media-slide img,
.media-slide video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.media-slide img {
  background: #ece8df;
}

.media-slide.is-video {
  background: #071514;
}

.media-slide video {
  background: #071514;
}

/* Captions belong below the work, never over it. */
.media-slide figcaption {
  position: static;
  padding: 14px 16px 16px;
  min-height: 76px;
  background: #fff;
  color: var(--ink);
}

.media-slide figcaption span {
  color: var(--teal);
}

.media-gallery-soft .media-slide figcaption {
  background: #fff;
}

.media-gallery-dark .media-slide {
  background: #102827;
}

.media-gallery-dark .media-slide figcaption {
  background: #173332;
  color: #fff;
}

.media-gallery-dark .media-slide figcaption span {
  color: #d4efec;
}

.media-gallery-dark .media-slide video {
  background: #081716;
}

/* Installation/process photography is documentary proof, so do not crop it. */
.process-image {
  background: transparent;
}

.process-image img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}

/* Service galleries sit close enough to the service copy to read as one category. */
.service-block + .media-gallery {
  padding-top: 34px;
  padding-bottom: 66px;
}

.services-work-link {
  background: var(--cream);
}

.services-work-link .closing-card {
  margin-top: 0;
}

.work-social {
  background: var(--cream);
}

@media (min-width: 860px) {
  .media-slide {
    flex-basis: min(46vw, 680px);
  }
}

@media (max-width: 859px) {
  .hero-media picture img {
    object-position: center 38%;
  }
}

@media (max-width: 430px) {
  .media-slide {
    flex-basis: calc(100vw - 30px);
  }

  .media-slide figcaption {
    min-height: 70px;
  }
}


/* Carmar v3.1.0: additions stay inside existing service offerings, with
   natural source proportions and no forced crops/blank stretched panels. */
.detail-gallery { min-width:0; width:100%; max-width:100%; overflow:hidden; }
.detail-gallery-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 12px; font-size:12px; font-weight:750; letter-spacing:.045em; }
.detail-gallery-heading .gallery-count { display:block; margin-top:4px; font-size:11px; font-weight:400; letter-spacing:0; color:var(--muted); }
.detail-gallery .rail-buttons { display:flex; flex-shrink:0; gap:8px; }
.detail-gallery .rail-button { width:35px; height:35px; }
.detail-gallery-track { display:flex; width:100%; max-width:100%; overflow-x:auto; align-items:flex-start; scroll-snap-type:x mandatory; gap:12px; }
.detail-gallery-track .media-slide { flex:0 0 min(100%,420px); max-width:100%; align-self:flex-start; margin:0; background:transparent; border:1px solid rgba(18,35,34,.08); }
.detail-gallery-track .media-slide img,.detail-gallery-track .media-slide video { display:block; width:100%; height:auto; max-height:none; object-fit:contain; background:#eeeae2; }
.detail-gallery-track .media-slide figcaption { min-height:0; padding:10px 11px; background:#fff; }
.detail-gallery-track .media-slide figcaption strong { font-family:inherit; font-size:12px; font-weight:600; line-height:1.4; }
.detail-gallery .rail-buttons .rail-button:focus-visible,.detail-gallery-track:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
@media (min-width:860px) { .detail-gallery-track .media-slide { flex-basis:min(100%,400px); } }
@media (max-width:859px) { .detail-gallery-track .media-slide { flex-basis:min(86%,380px); } }
@media (prefers-reduced-motion:reduce) { .detail-gallery-track { scroll-behavior:auto; } }
