/* Portfolio image sizing fix — additive, does not replace existing card styles. */
.project-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 0;
  max-height: 280px;
  overflow: hidden;
  border-radius: 16px;
  position: relative;
  background: var(--bg-lift, #161b22);
  isolation: isolate;
}

.project-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center;
  border-radius: inherit;
}

.project-image-placeholder {
  display: grid;
  place-items: center;
}

.project-image-placeholder span {
  font-size: 2.5rem;
  color: var(--accent, #00f5a0);
}

.service-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 220px;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 20px;
  background: var(--bg-lift, #161b22);
}

.service-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  object-position: center;
}

/* Detail modal images: show the complete source image instead of cropping it.
   Desktop gets a fixed visual viewport while preserving the image's aspect ratio. */
.portfolio-details-dialog .details-cover-image {
  display: block;
  width: 100%;
  height: min(65vh, 560px);
  max-width: 100%;
  max-height: 65vh;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border, #21262d);
  border-radius: 14px;
  padding: 8px;
  box-sizing: border-box;
  margin-bottom: 22px;
}

@media (max-width: 768px) {
  /* Preserve the existing mobile-friendly behavior while still preventing crop. */
  .portfolio-details-dialog .details-cover-image {
    height: auto;
    max-height: 58vh;
    object-fit: contain;
    padding: 6px;
  }
}

@media (max-width: 680px) {
  .project-image {
    aspect-ratio: 16 / 10;
    max-height: none;
    border-radius: 14px;
  }

  .service-image {
    aspect-ratio: 16 / 10;
    max-height: none;
    border-radius: 13px;
  }
}
