/**
 * Petro Star image frame repair v1.0
 * Targets ONLY Petro Star site's photography in cards, image panels and mosaics.
 * Keeps existing card heights, borders and animations. Crops overflow rather
 * than distorting equipment proportions. Does not affect site logo assets.
 */

/* The wrapper used by the custom Elementor Section widgets is not an ordinary
   Elementor Image widget; previous .elementor-widget-image rules miss it. */
body .pn-site .pn-image:not(.pn-logo-image):not(.pn-footer-logo) {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}

/* Both direct images and images linked through <a>/<picture> must fill frame. */
body .pn-site .pn-image:not(.pn-logo-image):not(.pn-footer-logo) > a,
body .pn-site .pn-image:not(.pn-logo-image):not(.pn-footer-logo) > picture,
body .pn-site .pn-image:not(.pn-logo-image):not(.pn-footer-logo) .elementor-widget-container {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}

body .pn-site .pn-image:not(.pn-logo-image):not(.pn-footer-logo) img,
body .pn-site .pn-brand-card .pn-brand-photo img,
body .pn-site .pn-service-card .pn-service-img img,
body .pn-site .pn-card .pn-card-photo img,
body .pn-site .pn-gallery-tile img,
body .pn-site .pn-spotlight-photo img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  object-fit: cover !important;
  object-position: center center;
  box-sizing: border-box;
}

/* Remove narrow internal wrappers, keeping the existing fixed heights. */
body .pn-site .pn-brand-photo,
body .pn-site .pn-service-img,
body .pn-site .pn-card-photo,
body .pn-site .pn-spotlight-photo {
  display: block;
  width: 100% !important;
  max-width: none !important;
  overflow: hidden;
}

/* Elementor's usual image widget is a separate case; limit it to photograph
   areas so the Petro Star header/footer logo stays at its designed size. */
body .pn-site .pn-card .elementor-widget-image,
body .pn-site .pn-brand-card .elementor-widget-image,
body .pn-site .pn-service-card .elementor-widget-image,
body .pn-site .pn-gallery-tile .elementor-widget-image,
body .pn-site .pn-split-photo .elementor-widget-image {
  width: 100% !important;
  max-width: 100% !important;
}
body .pn-site .pn-card .elementor-widget-image img,
body .pn-site .pn-brand-card .elementor-widget-image img,
body .pn-site .pn-service-card .elementor-widget-image img,
body .pn-site .pn-gallery-tile .elementor-widget-image img,
body .pn-site .pn-split-photo .elementor-widget-image img {
  width: 100% !important;
  max-width: 100% !important;
  object-fit: cover !important;
}
