/**
 * Consistent image dimensions sitewide.
 * All photos use object-fit: cover (logos use contain).
 */

:root {
  --img-banner-h: 750px;
  --img-banner-h-mobile: 480px;
  --img-page-banner-h: 340px;
  --img-feature-h: 220px;
  --img-gallery-h: 220px;
  --img-thumb-ratio: 16 / 10;
  --img-map-h: 400px;
  --img-logo-h: 64px;
  --img-logo-w: 160px;
  --img-icon-size: 88px;
  --img-deals-size: 80px;
  --img-avatar-size: 128px;
}

/* Override global img auto-height inside fixed frames */
.media-slot:has(img) {
  display: block;
}

.media-slot img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* —— Home hero slider (all slides same height) —— */
.hero {
  height: var(--img-banner-h);
}

.hero__slides,
.hero__slide {
  height: 100%;
}

.hero__slide .media-slot--hero {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: unset;
  border-radius: 0;
  overflow: hidden;
}

/* —— Inner page top banner (product pages) —— */
.page-hero--split .media-slot--hero {
  width: 100%;
  height: var(--img-page-banner-h);
  min-height: 0;
  aspect-ratio: unset;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Benefits / side panel image (same height as page banner) */
.media-slot--panel,
.section--soft .grid--2 > .media-slot--hero {
  width: 100%;
  height: var(--img-page-banner-h);
  min-height: 0;
  aspect-ratio: unset;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* —— Feature & gallery grids (equal height) —— */
.media-slot--feature,
.media-slot--gallery {
  width: 100%;
  height: var(--img-feature-h);
  min-height: 0;
  aspect-ratio: unset;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.feature-block .media-slot--feature,
.feature-block .media-slot--gallery {
  margin-bottom: var(--space-sm);
}

/* Service / blog cards: align image areas */
.grid--3 .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid--3 .card .media-slot--feature {
  flex-shrink: 0;
  margin-bottom: var(--space-md);
}

.grid--3 .feature-block {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid--3 > .card.text-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* —— Blog thumbnails —— */
.media-slot--thumb {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: var(--img-thumb-ratio);
  max-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.map-block {
  margin-top: var(--space-lg);
}

/* —— Contact / wide map —— */
.media-slot--map {
  width: 100%;
  height: var(--img-map-h);
  min-height: 0;
  aspect-ratio: unset;
  overflow: hidden;
  border-radius: var(--radius-md);
}

/* —— About page inline image —— */
.about-feature-image .media-slot--feature {
  height: var(--img-page-banner-h);
  margin-top: var(--space-md);
}

/* —— Round icons (home 3 columns) —— */
.media-slot--icon {
  width: var(--img-icon-size);
  height: var(--img-icon-size);
  min-height: 0;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

.media-slot--icon img {
  object-position: center top;
}

/* —— Doctor avatars —— */
.media-slot--avatar {
  width: var(--img-avatar-size);
  height: var(--img-avatar-size);
  min-height: 0;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

/* —— We Deals In: brand logos & card icons (80×80) —— */
.media-slot--deals-brand,
.media-slot--deals-icon {
  width: var(--img-deals-size);
  height: var(--img-deals-size);
  min-height: 0;
  min-width: 0;
  flex-shrink: 0;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
}

.media-slot--deals-icon {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.media-slot--deals-brand img,
.media-slot--deals-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* —— Brand logos row —— */
.media-slot--logo {
  width: var(--img-logo-w);
  height: var(--img-logo-h);
  min-height: 0;
  min-width: 0;
  flex-shrink: 0;
  padding: 0.35rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.media-slot--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brands-logos {
  align-items: stretch;
}

/* —— Gallery row on product pages —— */
.gallery-grid .media-slot--feature,
.gallery-grid .media-slot--gallery {
  height: var(--img-gallery-h);
}

@media (max-width: 768px) {
  :root {
    --img-banner-h: var(--img-banner-h-mobile);
    --img-page-banner-h: 280px;
    --img-feature-h: 200px;
    --img-gallery-h: 200px;
    --img-map-h: 280px;
  }
}
