/* ===================================================
   1. GRID THUMBNAILS (Targets ONLY grid cards, NOT lightbox)
   =================================================== */
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) a,
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) .pfg-field-item,
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) .pfg-img-wrap,
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) .pfg-item-inner,
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) .thumbnail {
    height: 280px !important;
    max-height: 280px !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
}

/* Constrain grid image tags while leaving lightbox images uncropped */
div[class*="pfg"]:not(.pfg-lightbox):not(.pfg-lightbox-content) img:not(.pfg-lightbox-image) {
    width: 100% !important;
    height: 280px !important;
    max-height: 280px !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    margin: 0 !important;
}

/* ===================================================
   2. LIGHTBOX POPUP FIX (Full length uncropped image)
   =================================================== */
.pfg-lightbox-content {
    max-width: 850px !important;
    width: 90vw !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

img.pfg-lightbox-image {
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    display: block !important;
    object-fit: contain !important;
}

.pfg-lightbox,
.pfg-lightbox--open {
    overflow-y: auto !important;
}

/* Hide all PFG gallery items after the 9th item */
div[class*="pfg"] .pfg-field-item:nth-child(n+10) {
    display: none !important;
}

/* Class added via button click to reveal all remaining items */
.show-all-pfg-items div[class*="pfg"] .pfg-field-item:nth-child(n+10) {
    display: block !important;
}
/* Hide all PFG grid cards after item #9 */
.pfg-gallery-item:nth-child(n+10),
div[class*="pfg-item"]:nth-child(n+10),
.pfg-column:nth-child(n+10) {
    display: none !important;
}

/* Reveal all items when the class is added */
body.show-all-pfg-items .pfg-gallery-item:nth-child(n+10),
body.show-all-pfg-items div[class*="pfg-item"]:nth-child(n+10),
body.show-all-pfg-items .pfg-column:nth-child(n+10) {
    display: block !important;
}
/* Collapse Beaver Builder module container to auto dimensions */
.view-more-pfg-btn,
.view-more-pfg-btn .fl-module-content,
.view-more-pfg-btn .fl-button-wrap {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 25px auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: max-content !important;
}

/* Style the clickable button link */
.view-more-pfg-btn a,
.view-more-pfg-btn .fl-button {
    display: inline-block !important;
    height: auto !important;
    width: auto !important;
    padding: 12px 30px !important;
    background-color: #d32f2f !important; /* Your red color */
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

/* WPForms Confirmation Box Override */
.wpforms-confirmation-container-full,
.wpforms-confirmation-container,
div.wpforms-confirmation-container-full {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Forminator / Contact Form 7 / Gravity Forms Overrides */
.forminator-response-message.forminator-show--success,
.wpcf7-response-output,
.gform_confirmation_message {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  padding: 0 !important;
}