/**
 * Theme Name: Starke 3D
 * Author: Vern
 * Description: 
 * Requires at least: 6.1
 * Version: 1.8.1
 * Template: spectra-one
*/

.br_compare_button {
    display: none;
}
.heading-text-shadow {
  text-shadow: 0 0 8px rgba(0, 0, 0, 1);
}

.media-image-shadow .wp-block-media-text__media img {
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 8px; /* Optional: adds slightly rounded corners */
}

.our-story-final-text {
   text-shadow: 0 0 8px rgba(0, 0, 0, 1);
}

.page-title-extra {
    width: fit-content !important;
    height: fit-content !important;
}

.wp-block-uagb-container.contact-us-form-container.uagb-block-0dc0950c {
    min-width: 400px;
    max-width: 650px;
}

.starke-google-maps {
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

.molding-details-images {
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.wp-block-uagb-container.starke-google-maps-container.uagb-block-8d6e5bfc {
    min-width: 350px;
    max-width: 500px
}

.fluentform_wrapper_4 {
    width: 100%;
}

.contact-us-title-paragraph {
    width: fit-content;
}

.wp-block-uagb-container.contact-info-container.uagb-block-a8347b83 {
    width: fit-content;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* --- WP Grid Builder Custom Styles - START--- */
.wpgb-facet.wpgb-facet-7 {
    flex-flow: nowrap;
    display: flex;
    align-items: center;
    column-gap: 8px;
}

.wpgb-facet.wpgb-facet-7 .wpgb-facet-title {
    margin: 0;
    height: fit-content;
    width: fit-content;
    font-size: 1em;
    font-weight: 400;
    white-space: nowrap;
}

.wpgb-facet.wpgb-facet-8 .wpgb-result-count {
    white-space: nowrap;
}

.wpgb-facet.molding-checkbox-facet {
    border-radius: 5px;
}
.molding-checkbox-facet fieldset {
    margin-bottom: 0 !important;
}

.molding-facet-title {
    width: fit-content !important;
    z-index: 1;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2)
}

.molding-checkbox-facet .wpgb-checkbox-facet {
    /*border: 2px solid var(--wpgb-grey-500);*/
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding-top: 10px;
    padding-right: 0;  
}

.molding-checkbox-facet .wpgb-checkbox-facet .wpgb-hierarchical-list {
    overflow: auto;
    max-height: 215px;
    margin-bottom: 12px;
    margin-left: 15px;
    margin-top: 10px;
}

.wpgb-checkbox-label span {
    /*display: none !important;*/
}

.wpgb-facet .wpgb-checkbox-facet .wpgb-hierarchical-list > li {
    margin-top: 0;
}

/* B. The "Follower" Rule: 
    "If I am a visible list item (~), and I come after another visible list item,
    give me a top margin."
    
    The selector [style*="display: none"] allows CSS to recognize the 
    items our JavaScript has hidden. 
*/
.wpgb-facet .wpgb-checkbox-facet .wpgb-hierarchical-list > li:not([style*="display: none"]) ~ li:not([style*="display: none"]) {
    margin-top: 12px; /* <--- Set your desired gap here */
}

.molding-search-facet fieldset {
    margin-bottom: 0 !important;
}

.molding-search-facet-spacer {
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2) !important;
}

.molding-size {
    white-space: normal;
}

/* --- Molding Card Button Styles --- */
.wp-grid-builder .wpgb-card .wpgb-card-wrapper .wpgb-card-body .molding-card-button-container {
    display: flex;
    flex-flow: row wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.wpgb-card-body {
    container-type: inline-size;
    container-name: actions-wrapper;
}
@container actions-wrapper (max-width: 315px) {
    .wp-grid-builder .wpgb-card .wpgb-card-wrapper .wpgb-card-body .molding-card-button-container {
        flex-flow: column wrap;
    }
}

/* Sample Button Base Style */
.starke-sample-btn {
    /* Your New Visual Styles */
    color: #fff;
    background: #6431f6;
    padding: .75rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: .9em;
    line-height: 1.4;
    text-align: center;
    min-width: 124px;

    /* Essential Structural Styles (Kept) */
    border: none;
    cursor: pointer;
    width: fit-content; /* Ensures it fills the card width */
    text-transform: uppercase;
    transition: background-color 0.2s ease;
    white-space: normal;
    box-shadow: 4px 4px 7px 0 rgba(0, 0, 0, .2);
}

/* Updated Hover State (Darker Purple) */
.starke-sample-btn:hover {
    background-color: #4f26c9; 
    color: #fff;
}

/* 1. Out of Stock / Request Mode (Clickable) */
/* We make this Standard Purple now, instead of Grey */
.starke-sample-btn.request-mode {
    background-color: #6431f6; 
    color: #fff;
}

/* 2. Disabled States (Sample Added / Requested) */
/* Keep Purple, but lower opacity to look "inactive" */
.starke-sample-btn.disabled,
.starke-sample-btn.requested,
.starke-sample-btn.added {
    background-color: #6431f6 !important; /* Force Purple */
    color: #fff !important;
    cursor: default;
    pointer-events: none;
    opacity: 1; /* This creates the "faded" disabled look */
    box-shadow: none;
}

/* --- Compare Button Wrapper --- */
.starke-compare-wrapper {
    width: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
}

/* --- The Custom Button --- */
.starke-compare-btn {
    /* Visuals */
    background-color: #667;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: .75em;
    height: 42px;
    
    /* Sizing */
    width: fit-content;

    /* Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse; /* Checkbox on Left */
    gap: 10px; 

    /* Text Styles */
    font-size: .9em;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 4px 4px 7px 0 rgba(0, 0, 0, .2);
}

.starke-compare-btn:hover {
    background-color: #555555;
}

.starke-compare-btn.active {
    background-color: #667;
}

/* --- Checkbox Wrapper (Layout Only) --- */
.starke-compare-btn .checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    /* Removed all visual styling from the wrapper */
    border: none;
    background: transparent;
    width: auto;
    height: auto;
}

/* --- The Real Input (Styled Directly) --- */
.starke-compare-btn .compare-checkbox {
    /* 1. Remove Default Browser Styles */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* 2. Define Box Dimensions */
    width: 20px;
    height: 20px;
    
    /* 3. Visual Style (Unchecked) */
    background-color: #ffffff; 
    border: 2px solid #000;
    border-radius: 4px;
    
    /* 4. Layout */
    cursor: pointer;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* --- The Checkmark (Inside the Input) --- */
.starke-compare-btn .compare-checkbox::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px; /* Center vertically */
    display: none; /* Hidden by default */
}

/* --- Checked State --- */
/* When the input is checked OR the button has .active class */
.starke-compare-btn.active .compare-checkbox,
.starke-compare-btn .compare-checkbox:checked {
    background-color: #fff; /* Fills with Purple */
    border-color: #000;
}

.starke-compare-btn.active .compare-checkbox::after,
.starke-compare-btn .compare-checkbox:checked::after {
    display: block; /* Show Checkmark */
}
/* --- WP Grid Builder Custom Styles - END --- */

@media (max-width: 1600px) {
  .our-story-cover {
    min-height: 500px !important;
  }
  .heading-text-small {
    font-size: 4em !important;
  }

  .sub-heading-text-small {
    font-size: 2em !important;
  }

 .our-story-stack {
    padding-left: 2.5em !important;
    padding-right: 2.5em !important;
  }

 .our-story-text {
   font-size: 1.1em !important;
  }

  .our-story-final-text {
   font-size: 1.7em !important;
  }
}

@media (max-width: 1400px) {
  .our-story-text {
   font-size: .9em !important;
  }

  .our-story-final-text {
   font-size: 1.5em !important;
  }
}

@media (max-width: 1000px) {
  .our-story-cover {
    min-height: 400px !important;
  }
  .heading-text-small {
    font-size: 2.5em !important;
  }

  .sub-heading-text-small {
    font-size: 1.4em !important;
  }

 .our-story-stack {
    padding-left: 2.5em !important;
    padding-right: 2.5em !important;
  }

 .our-story-text {
   font-size: .85em !important;
  }

  .our-story-final-text {
   font-size: 1.5em !important;
  }

 .page-title-extra {
   font-size: 3em !important;
 }
}

/* --- Starke Custom Gallery Tabs & Styles (V17 - Definitive Masonry/Column Fix) --- */

/* Main tab system container - HIDDEN BY DEFAULT */
.gallery-tabs-container ~ .wp-block-uagb-container {
    display: none;
}

.gallery-tabs-container {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
    /* NEW: Hide the container initially and prepare for a smooth fade-in */
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* NEW: This rule makes the container visible only after the JS has run */
.gallery-tabs-container.js-loaded {
    opacity: 1;
}

/* Tab Navigation bar */
.photo-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Individual Tab Button */
.photo-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 500;
    color: #667;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.photo-tab:hover {
    color: #000;
}

.photo-tab.active {
    color: #000;
    border-bottom-color: #333;
}

/* Tab Content Panes */
.photo-tab-content {
    display: none;
}

.photo-tab-content.active {
    display: block;
}

/* Style for the description content */
.photo-tab-content.active .wp-block-uagb-container h3,
.photo-tab-content.active .wp-block-uagb-container p {
    text-align: left;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.photo-tab-content.active .wp-block-uagb-container h3 {
    margin-bottom: 1rem;
}

.photo-tab-content.active .wp-block-uagb-container p {
    margin-bottom: 2.5rem; /* Space between description and gallery */
    font-size: 1.1rem;
    color: #555;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}


/* --- Final Gallery Grid Layout --- */

/* This rule now defines a CSS variable for our column count and prepares the container */
body .photo-tab-content.active .wp-block-gallery.columns-3 {
    --masonry-cols: 4; /* 4 columns on desktop */
    position: relative; /* This is crucial for positioning the items inside */
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Style for each individual image item in the gallery */
body .photo-tab-content.active .wp-block-gallery.columns-3 .blocks-gallery-item {
    position: absolute;
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 5px 5px 2px rgba(0,0,0,0.25);
    /* Set the initial position from the JS variables and add transform to the transition */
    transform: translate(var(--x, 0), var(--y, 0));
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* The hover effect now works perfectly */
body .photo-tab-content.active .wp-block-gallery.columns-3 .blocks-gallery-item:hover {
    /* Use calc() to add your 5px/-5px offset to the existing position */
    transform: translate(calc(var(--x, 0) + 5px), calc(var(--y, 0) - 5px));
    box-shadow: 4px 4px 5px rgba(0,0,0,0.35);
    z-index: 5;
    cursor: pointer;
}

/* Ensure images have their natural height */
body .photo-tab-content.active .wp-block-gallery.columns-3 .blocks-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Responsive Adjustments for Masonry --- */

/* We now use the CSS variable to control columns on different screen sizes */
@media (max-width: 1024px) {
    body .photo-tab-content.active .wp-block-gallery.columns-3 {
        --masonry-cols: 3;
    }
}

@media (max-width: 768px) {
    body .photo-tab-content.active .wp-block-gallery.columns-3 {
        --masonry-cols: 2;
    }
}

@media (max-width: 480px) {
    body .photo-tab-content.active .wp-block-gallery.columns-3 {
        --masonry-cols: 1;
    }
}

/* --- NEW: Lightbox Styles --- */
.starke-lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 0; /* Location of the box */
    margin-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9);
    /* Use flex to easily center the image */
    align-items: center;
    justify-content: center;
}

.starke-lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    animation-name: zoom;
    animation-duration: 0.4s;
}

/* Add Animation */
@keyframes zoom {
    from {transform: scale(0.8)}
    to {transform: scale(1)}
}

.starke-lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.starke-lightbox-close:hover,
.starke-lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* --- NEW: Lightbox Navigation Arrow Styles --- */
.starke-lightbox-prev,
.starke-lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Center vertically */
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
}

.starke-lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.starke-lightbox-prev {
    left: 0;
}

.starke-lightbox-prev:hover,
.starke-lightbox-next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* --- Style WS Form Contact Us form to Match Checkout --- */

/* 1. Define base variables from your "Target" look */
#ws-form-1 {
  --target-height: 56px;
  --target-font-size: 18px;
  --target-padding-top: 22px; /* Makes room for the label */
  --target-padding-bottom: 8px;
  --target-padding-sides: 12px;
  --target-label-color: rgba(18, 18, 18, 0.7);
  --target-border-color: #000;
  --target-border-radius: 4px;
}

/* 2. Style the parent wrapper */
#ws-form-1 .wsf-label-position-inside {
  position: relative;
}

/* 3. Style all input, textarea, and select fields */
#ws-form-1 .wsf-field {
  min-height: var(--target-height);
  height: var(--target-height); /* Force height */
  font-size: var(--target-font-size) !important;
  padding: var(--target-padding-top) var(--target-padding-sides) var(--target-padding-bottom) var(--target-padding-sides);
  border: 1px solid var(--target-border-color) !important;
  border-radius: var(--target-border-radius) !important;
  background-color: #ffffff; /* Ensure background is opaque */
  color: #000; /* Set text color */
}

/* 4. Style the label (initial "placeholder" state) */
#ws-form-1 .wsf-label-position-inside .wsf-label {
  position: absolute;
  left: var(--target-padding-sides);
  top: 19px; /* <-- THIS IS THE FIX */
  transform: translateY(0); /* <-- THIS IS THE FIX */
  font-size: var(--target-font-size);
  font-weight: 400; 
  color: var(--target-label-color);
  transition: all 0.2s ease;
  pointer-events: none; 
  margin: 0;
  padding: 0;
  line-height: 1; 
}

/* 5. Style the "floated" label state */
/* This works because we removed the placeholder in Step 1 */
#ws-form-1 .wsf-field:focus + .wsf-label,
#ws-form-1 .wsf-field:not(:placeholder-shown) + .wsf-label {
  top: 6px; 
  transform: translateY(0) scale(0.75);
  transform-origin: left top;
}

/* 6. Specific tweaks for Textarea */
#ws-form-1 textarea.wsf-field {
  min-height: 120px;
  height: auto; /* Allow textarea to be tall */
  padding-top: var(--target-padding-top);
}

/* --- 7. Restyle Select (Dropdown) Icon (FINAL) --- */

/* A. Hide the default WS Form arrow span (with !important) */
#ws-form-1 .wsf-field-wrapper[data-type="select"] .wsf-select-arrow {
  display: none !important;
}

/* B. Style the <select> element itself */
#ws-form-1 .wsf-field-wrapper[data-type="select"] select.wsf-field {
  
  /* 1. Hide the default system (browser) arrow */
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer;

  /* 2. Add the new BLACK SVG icon */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cpath d='M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;

  /* 3. Position the new icon (centered vertically) */
  background-position: right var(--target-padding-sides) center !important;
  background-size: 1.3em !important; 

  /* 4. Fix padding so text doesn't overlap icon */
  padding-right: calc(var(--target-padding-sides) * 3) !important;
}
/* --- 7. Force Select (Dropdown) Labels to Float --- */

/* This targets the label inside any 'select' field wrapper 
   and permanently sets it to the floated state. */
#ws-form-1 .wsf-field-wrapper[data-type="select"] .wsf-label {
  top: 6px; 
  transform: translateY(0) scale(0.75);
  transform-origin: left top;
}

/* 8. Style the File Upload field */
#ws-form-1 .dropzone {
  min-height: 130px;
  border: 1px dashed var(--target-border-color) !important; 
  border-radius: var(--target-border-radius) !important;
  background-color: #ffffff;
  
  /* --- ADD THESE 3 LINES TO FIX CENTERING --- */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 9. Style the Submit Button */
#ws-form-1 .wsf-button {
  min-height: var(--target-height);
  font-size: var(--target-font-size);
  font-weight: 600;
  border: none;
  border-radius: var(--target-border-radius);
  background-color: #6431F6; /* Your current purple, or change as needed */
  text-transform: none; /* Stop it from being all-caps */
}

