/*  
==========================================================
  ADJUSTMENTS TO THE GALLERY OF THUMBNAILS **
==========================================================
*/

/*
  This section applies layout adjustments to the gallery thumbnails.
  - Controls padding and margins around gallery items.
  - Aligns the gallery content for a uniform presentation.
  - Ensures spacing consistency across all Envira galleries.
  - Adds drop shadow to thumbnail images for visual depth.
*/

/* Apply top padding to the gallery container */
.envira-gallery {
    padding-top: 4vh !important;
}

/* Adjust the outer gallery wrapper padding */
.envira-gallery-wrap {
    padding: 3vh !important;
    text-align: right !important; /* Align the gallery container to the right */
}

/* Add spacing below each thumbnail */
.envira-gallery-item {
    margin-bottom: 3vh !important;
}

/* Add drop shadow to thumbnail images */
.envira-gallery-item-inner .envira-gallery-image {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Optional: Enhance hover effect for thumbnails */
.envira-gallery-item-inner .envira-gallery-image:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    transform: scale(1.03);
}

/* Ensure the 'Download All' button is properly aligned */
.envira-gallery-wrap .envira-download-all {
    display: inline-block !important;
    margin-right: 5vw !important;
}
/*  
==========================================================
  LIGHTBOX IMAGE POSITION ADJUSTMENT — MOBILE PORTRAIT
  Overrides desktop settings for vertical mobile view
==========================================================
*/

@media screen and (max-width: 768px) and (orientation: portrait) {

  /* Lightbox image container override */
  div[data-envirabox-id] .envirabox-image-wrap {
    box-shadow: none !important;
    border: none !important;
    margin-top: 18vh !important;
    left: 50% !important;
    margin-left: -2.5vw !important; /* manually center the image */
    transform: none !important;
    position: fixed !important;
    z-index: 9999 !important;
  }

  /* Specific image inside the lightbox */
  div[data-envirabox-id] .envirabox-image-wrap img {
    width: 90vw !important;
    height: auto !important;
    max-height: 80vh !important;
    display: block !important;
  }

  /* Download button */
.envirabox-toolbar .envira-download-button {
  position: fixed !important;
  right: 0 !important;
	transform: translateX(25px) !important;
	}

} /* end mobile portrait media query */

/*  
==========================================================
ENVIRA GALLERY DELIVERY GALLERY GLOBAL CSS
==========================================================
*/

/*  
==========================================================
  LIGHTBOX CAPTION WRAP TRANSPARENCY **
  Makes the caption wrap transparent while keeping buttons visible
==========================================================
*/

.envirabox-caption-wrap {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/*  
==========================================================
  LIGHTBOX TOOLBAR TRANSPARENCY **
  Makes the toolbar transparent while keeping buttons visible
==========================================================
*/

.envirabox-toolbar {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/*  
==========================================================
  LIGHTBOX OVERLAY BACKGROUND (Set to #f5f5f7 @ 75% opacity) **
  Custom background for lightbox overlay
==========================================================
*/

div[data-envirabox-id] .envirabox-bg {
    background: rgba(245, 245, 247, 0.6) !important;
    background-size: 170% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/*  
==========================================================
  LIGHTBOX IMAGE POSITION ADJUSTMENT **
  Moves the lightbox image container lower on the screen
==========================================================
*/

div[data-envirabox-id] .envirabox-image-wrap {
    position: fixed !important;
    top: 15vh !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 0.26vh solid rgba(0, 0, 67, 0.12) !important;
    box-shadow: 0vh 0.65vh 2.6vh -0.52vh rgba(0, 0, 0, 0.5) !important;
}

/* ====== Lightbox Download Button (Normal State) ====== */
.envirabox-toolbar .envira-download-button {
    position: fixed !important;
    top: 2.75vh !important;
    right: 15vw !important;
    width: 56px !important;
    height: 56px !important;
    background-color: #0468bf !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    z-index: 100000 !important;
    box-shadow: 0 .5vh 1.2vh -0.2vh rgba(0, 0, 0, 0.3) !important;
}

.envirabox-toolbar .envira-download-button::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 52px !important;
    height: 52px !important;
    background-image: url('/wp-content/uploads/2025/03/djbphoto-download-button-borderless.png') !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
}

.envirabox-toolbar .envira-download-button:hover::before {
    background-image: url('/wp-content/uploads/2025/03/djbphoto-branded-download-button-Hover.png') !important;
    width: 52px !important;
    height: 52px !important;
}

/* ====== GALLERY DOWNLOAD BUTTON (WITH FUNCTIONAL BRANDED ICON & HOVER EFFECT) ====== */
.envira-gallery-item-inner .envira-download-button {
    position: relative !important;
    background-color: #0468bf !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    box-shadow: 0 1vh 2.5vh -0.5vh rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease-in-out !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.envira-gallery-item-inner .envira-download-button::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 90% !important;
    height: 90% !important;
    background-image: url('/wp-content/uploads/2025/03/djbphoto-download-button-borderless.png') !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10000 !important;
    pointer-events: none !important;
}

.envira-gallery-item-inner .envira-download-button:hover::before {
    background-image: url('/wp-content/uploads/2025/03/djbphoto-branded-download-button-Hover.png') !important;
}

/*
==========================================================
  ENVIRA PROOFING GALLERY COLOR CUSTOMIZATION
  Cleansed and consolidated overrides to replace default green
  (#3c9d37) with branded blue (#0468bf) across checkbox, borders,
  and buttons in the Envira proofing workflow.
==========================================================*/

/*
  CHECKBOX OVERRIDE
  Applies brand blue background and custom white checkmark
*/

  form.envira-proofing-form input[type=checkbox]:checked + label {
  background-color: #0468bf !important;
  background-image: url('/wp-content/uploads/2025/04/white-tick-mark-icon-transparent-background-7017516950512374lahsvx00q.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
} 

/*
  SELECTED IMAGE BORDER
  Ensures selected images show a blue border
*/
.envira-proofing-selected {
  border-color: #0468bf !important;
}

/*
  FIELD + BUTTON GROUP WRAPPER
  Align fields in one row above buttons, with defined spacing
*/
.envira-proofing-fields-row,
.envira-proofing-buttons {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 40px !important;
  margin: 20px auto !important;
  width: fit-content !important;
}

/*
  MATCH TALK-TO-DEAN STYLE FOR PROOFING SUMMARY SUBMIT BUTTON
  (Non-input-based fallback)
*/
button[name="envira_proofing_submit"] {
  display: inline-block !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  padding: 0.75rem 1.5rem !important;
  margin: 20px !important;
  border: 2px solid #0468bf !important;
  color: #0468bf !important;
  background-color: #f5f5f7 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.36) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  cursor: pointer !important;
}

/* Hover state to match */
button[name="envira_proofing_submit"]:hover {
  background-color: #0468bf !important;
  color: #f5f5f7 !important;
  border-color: #0468bf !important;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.20) !important;
}

/* ========================= HIDE Envira Notes Textarea and Save Button ========================= */
form.envira-proofing-form textarea[name="envira_proofing_notes"],
form.envira-proofing-form input[name="envira_proofing_save"] {
  display: none !important;
}



/*
  PROOFING BUTTONS WITH CUSTOM STYLING
*/
input[name="envira_proofing_submit"],
input[name="envira_proofing_save"],
input[name="envira_proofing_delete"] {
  display: inline-block !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  padding: 0.75rem 1.5rem !important;
  margin: 20px !important;
  border: 2px solid #0468bf !important;
  color: #0468bf !important;
  background-color: #fafafb !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.36) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

/*
  HOVER STATE FOR SUBMIT/SAVE/DELETE BUTTONS
*/
input[name="envira_proofing_submit"]:hover,
input[name="envira_proofing_save"]:hover,
input[name="envira_proofing_delete"]:hover {
  background-color: #0468bf !important;
  color: #f5f5f7 !important;
  border-color: #0468bf !important;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.20) !important;
}

/* =======================================================================================
  FORM FIELD STYLING (RESPONSIVE FLEX-FRIENDLY)
======================================================================================= */

textarea[name="envira_proofing_notes"] {
  background-color: #f5f5f7 !important;
  border: 2px solid #d6d6d6 !important;
  font-family: "Open Sans", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.036rem !important;
  color: #000 !important;
  padding: 0.75rem 1rem !important;
  margin: 20px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  width: 40% !important;
  max-width: 100% !important;
  display: inline-block !important;
}

/* === CENTER NAME + EMAIL USING TEXT-CENTER + INLINE-BLOCK === */
form.envira-proofing-form {
  text-align: center;
}

form.envira-proofing-form input[name="envira_proofing_name"],
form.envira-proofing-form input[name="envira_proofing_email"] {
  display: inline-block !important;
  vertical-align: top;
  margin: 0 16px !important;
  text-align: left;
  background-color: #f5f5f7 !important;
  border: 2px solid #d6d6d6 !important;
  font-family: "Open Sans", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.036rem !important;
  color: #000 !important;
  padding: 0.75rem 1rem !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  box-shadow: 0 4px 13px -3px rgba(0, 0, 0, 0.28) !important;
  width: 350px !important;
  max-width: 90% !important;
}
/* 
 === DEBUG: Highlight unwrapped input fields ===
form.envira-proofing-form input[name="envira_proofing_name"],
form.envira-proofing-form input[name="envira_proofing_email"] {
  background-color: #ffdddd !important;
  outline: 3px solid red !important;
}
 */

/* ============================================================================
   ENVIRA PROOFING SUMMARY BAR — STICKY FOOTER LAYOUT
============================================================================ */

/* Hide summary box by default */
.envira-proofing-summary-box {
  display: none;
}

/* Show only when URL contains ?view=admin */
body.show-summary .envira-proofing-summary-box {
  display: block;
}

.envira-proofing-summary-box {
  position: fixed !important;
  width: 100vw !important;
  background: #f5f5f7 !important;
  box-shadow: 0 -4px 14px -3px rgba(0, 0, 0, 0.6) !important;
  padding: 2vh 3vw !important;
  z-index: 99990 !important;
}

/* ============================================================================
   INNER CONTAINER — HORIZONTAL FLEX LAYOUT
============================================================================ */

.envira-proofing-summary-box-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 2vw !important;
  max-width: 100vw !important;
  margin: 0 auto !important;
  height: 120px !important; 
  background-color: rgba(0,0,0, 0.36) !important; /* Subtle translucent panel tone */
/* border: 3px solid green !important;  DEBUG: Highlights inner container */
}

.envira-proofing-summary-box .images-inner {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important; /* Optional: controls space between thumbnails */
}

/* ============================================================================
   IMAGE PREVIEW — LEFT SIDE OF FOOTER WITH SCROLLING BEHAVIOR
============================================================================ */

.envira-proofing-summary-box .images {
  flex-grow: 1 !important;
  max-width: 87% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.envira-proofing-summary-box .images::-webkit-scrollbar {
  height: 6px;
}

.envira-proofing-summary-box .images::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.envira-proofing-summary-box .images-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  align-items: center !important;
}

.envira-proofing-summary-box .images-inner .image {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center !important;
  overflow: hidden;
}

.envira-proofing-summary-box .images-inner .image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
}


/* ============================================================================
   ACTION BUTTONS — RIGHT SIDE
============================================================================ */

.envira-proofing-summary-box .buttons {
  display: flex !important;
  gap: 0.5rem !important;
  justify-content: flex-end !important;
  flex-grow: 1 !important;
  max-width: none !important;
  flex-wrap: wrap !important;
  width: 320px !important;
  min-width: 320px !important;
}

/* ============================================================================
   BUTTON STYLING — MATCHES “Talk to Dean” Button Aesthetic
============================================================================ */

.envira-proofing-summary-box button[name="envira_proofing_submit"],
.envira-proofing-summary-box button[name="envira_proofing_save"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  padding: 0.75em 2em !important;
  margin: 0 !important;
  border: 2px solid #0468bf !important;
  color: #0468bf !important;
  background-color: #f5f5f7 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.36) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  cursor: pointer !important;
  min-width: 200px !important;
  max-width: 100% !important;
  width: auto !important;
  text-align: center !important;
  white-space: normal !important;
  height: auto !important;
  line-height: 1.3 !important;
  overflow-wrap: break-word !important;
  text-wrap: balance !important;
  word-break: break-word !important;
}

/* Responsive: shrink padding and font on small screens */
@media (max-width: 768px) {
  .envira-proofing-summary-box button[name="envira_proofing_submit"] {
    font-size: 0.9rem !important;
    padding: 0.6em 1.25em !important;
  }
}


/* ============================================================================
   HOVER STATE — BLUE INVERTED STYLE
============================================================================ */

.envira-proofing-summary-box button[name="envira_proofing_submit"]:hover,
.envira-proofing-summary-box button[name="envira_proofing_save"]:hover {
  background-color: #0468bf !important;
  color: #f5f5f7 !important;
  border-color: #0468bf !important;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.20) !important;
}

/* ============================================================================
   HIDE SAVE BUTTON
============================================================================ */

.envira-proofing-summary-box button[name="envira_proofing_save"] {
  display: none !important;
}



/* ============================================================================
   VISIBILITY FIX — ALLOWS IMAGE PREVIEW TO EXPAND WITHOUT BEING MASKED
   NOTE: This resolved a major issue where selected images were being clipped
   inside the proofing summary box due to overflow: hidden. However, it may 
   also lead to unexpected behavior or layout shifts if not properly bounded.
============================================================================ */

.envira-proofing-summary-box,
.envira-proofing-summary-box-inner,
.envira-proofing-summary-box .images,
.envira-proofing-summary-box .images-inner {
  overflow: visible !important;
}

/* ============================================================================
Lightbox image above summary-box-enabling tickbox access
============================================================================ */

.envirabox-image-wrap {
  position: fixed !important; /* Ensure it participates in stacking context */
}

/*  
==========================================================
Scoped Lightbox Checkbox Styling (Checked + Unchecked)
- Scoped to .envirabox-stage to avoid impacting gallery
- No border-radius
- Maintains consistent size, padding, and line-height
- Replaces text with overlay image when checked
==========================================================
*/

/* Unchecked state: Blue-black text, no background */
.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"] + label {
  background-color: #fafafb !important;
  background-image: none !important;
  color: #0468bf !important;
  border: 2px solid #0468bf !important;
  border-radius: 0 !important;
  position: relative !important;
}

/* Checked state: Blue background, white text */
.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"]:checked + label {
  background-color: #0468bf !important;
  color: #000 !important;
  border: 2px solid #0468bf !important;
  border-radius: 0 !important;
  padding-left: 40px !important;
  position: relative !important;
}

/* White tick icon box aligned left */
.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"]:checked + label::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 10px !important;
  width: 20px !important;
  height: 20px !important;
  background-color: #0468bf !important;
  background-image: url('/wp-content/uploads/2025/04/white-tick-mark-icon-transparent-background-7017516950512374lahsvx00q.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 16px 16px !important;
  transform: translateY(-50%) !important;
  border-radius: 0 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

/* Hide label text when checked (requires HTML span wrapper) */
.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"] + label span.label-text {
  display: inline;
  position: relative;
  z-index: 1;
}

.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"]:checked + label span.label-text {
  display: none !important;
}

/* Overlay full "Selected" image when checked */
.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"] + label::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/wp-content/uploads/2025/05/Selected-with-tickmark.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[type="checkbox"]:checked + label::after {
  opacity: 1;
  pointer-events: auto;
}



@media (max-width: 768px) {
  .envira-proofing-summary-box {
    display: none !important;
  }
}

/*
==========================================================
Mobile Field Stack for Lightbox Proofing Fields
- Scoped specifically to .envirabox-stage
- Targets name, email, and order notes inputs
==========================================================
*/

@media (max-width: 768px) {
  .envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox .envira-proofing-fields-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2vh !important;
  }

  .envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox textarea[name="envira_proofing_notes"],
  .envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[name="envira_proofing_name"],
  .envirabox-stage form.envira-proofing-form.envira-proofing-form-lightbox input[name="envira_proofing_email"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }
}

/*
==========================================================
Modal Overlay to imprtove UX
==========================================================
*/

#proof-modal .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(245, 245, 247, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out;
}


/* === Modal Box === */
#proof-modal .modal-content {
  background: #f5f5f7;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 2em;
  max-width: 560px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 300ms ease, transform 300ms ease;
}

/* === Modal Active State === */
#proof-modal.show .modal-overlay {
  opacity: 1;
  visibility: visible;
}

#proof-modal.show .modal-content {
  opacity: 1;
  transform: scale(1);
}

/* === Modal Content Typography === */
#proof-modal .modal-content {
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  color: #000044;
}

#proof-modal .modal-content h3,
#proof-modal .modal-content p {
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  color: #000044;
  margin: 0 0 1rem 0;
}

/* === Close Button === */
#proof-modal .modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* === CTA Button === */
#proof-modal #scroll-to-form {
  display: inline-block;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  margin: 20px;
  border: 2px solid #0468bf;
  color: #0468bf;
  background-color: #f5f5f7;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.36);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

#proof-modal #scroll-to-form:hover {
  background-color: #0468bf;
  color: #f5f5f7;
  border-color: #0468bf;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.20);
}

