/* File: /includes/portfolio-shortcode/assets/portfolio-shortcode.css */

/* Wrapper */
.portfolio-shortcode-wrapper {
    width: 100%;
    position: relative;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Card layout */
.portfolio-card {
    flex: 0 0 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    background-color: rgb(245, 245, 245);
}

/* Card content: left-aligned */
.portfolio-card-content {
    padding: 20px;
    background-color: rgb(245, 245, 245);
    text-align: left;
}
.portfolio-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1.3em;
    padding-bottom: 3px;
    color: #062b38;
    line-height: normal;
}
.portfolio-description {
    font-size: 15px;
    line-height: 1.6;
    color: #062b38;
    margin-bottom: 1.3em;
}

/* Responsive breakpoints */
@media (max-width: 992px) {
    .portfolio-card {
        flex: 1 1 calc(50% - 20px);
        max-width: 100%;
    }
}
@media (max-width: 600px) {
    .portfolio-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Thumbnail area */
.portfolio-thumb {
    position: relative;
    overflow: hidden;
    background-color: white;
}
.portfolio-thumb img {
    width: 100%;
    display: block;
    height: auto;
}

.portfolio-thumb iframe,
.portfolio-thumb video {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    max-width: none !important;
}

.portfolio-shortcode-wrapper .portfolio-thumb iframe {
    width: calc(100% + 4px) !important;
    height: calc(100% + 4px) !important;
    margin: -2px !important;
    padding: 0 !important;
    border: none !important;
    display: block;
}

/* Center spinner in thumbnail */

.spinner-container-thumb{
    background-color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -20px;
    margin-top: -20px;
    width: 40px;
    height: 40px;
    display: none;
    border-radius: 100%;
    -webkit-animation: mpp-scaleout 1.0s infinite ease-in-out;
    animation: mpp-scaleout 1.0s infinite ease-in-out;
}

.portfolio-shortcode-wrapper .portfolio-thumb .svg-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    z-index: 1000;
    display: block;
}

.portfolio-shortcode-wrapper .portfolio-thumb .svg-spinner .path {
    stroke: grey !important;  /* Adjust color as needed */
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}


/* Overlay for video preview */
.portfolio-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: rgba(0,0,0,0.7);
    display: none;
    pointer-events: none;
    outline: 0;
    
}

/* Infinite Scroll Spinner & Message */
/* Spinner container styling */
#spinner-container {
    display: none; /* Initially hidden; JS will toggle this */
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: transparent !important;
    padding: 0;
}

/* Ensure the SVG displays at the intended size */
#spinner-container svg.svg-spinner {
    width: 50px !important;
    height: 50px !important;
    display: block;
    background: transparent !important;
}

/* Style the spinner circle */
#spinner-container svg.svg-spinner .path {
    stroke: grey !important; /* Customize the color as needed */
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite !important;
}

/* Keyframes for the spinner animation */
@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.portfolio-load-message {
    text-align: center;
    margin-top: 30px;  /* Increased margin for clarity */
    color: #666;
}

/* Fancybox customizations */
.fancybox-container .fancybox-button--arrow_left,
.fancybox-container .fancybox-button--arrow_right {
    display: none;
}
.fancybox-custom .fancybox-button.fancybox-close-small {
    color: white;
    opacity: 1;
    font-size: 50px;
    width: 75px;
    transition: transform 0.3s ease;
}

.fancybox-slide--image .fancybox-button.fancybox-close-small {
    top: -120px; /* or whatever you prefer */
    z-index: 9999;
}

.fancybox-slide--image {
    padding-top: 80px; /* adjust to match the offset */
}

.fancybox-custom .fancybox-button.fancybox-close-small:hover {
    transform: scale(1.3);
}

.fancybox-content,
.fancybox-iframe {
    background: transparent !important;
}

/* Lightbox caption styling */
.fancybox-caption .lightbox-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}
.fancybox-caption .lightbox-desc {
    margin: 5px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: white;
}

@media (max-width: 768px) {
    .fancybox-custom .fancybox-caption {
        padding: 20px;
    }
    .fancybox-custom .fancybox-slide {
        padding: 0;
    }
    .fancybox-button.fancybox-close-small {
        top: 15%;
    }
}



/* thumbnail overlay */
.portfolio-thumb-link {
    position: relative;
    display: block;
}

.portfolio-thumb-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.4); /* optional */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.portfolio-thumb-link:hover .portfolio-thumb-text-overlay {
    opacity: 1;
}

.portfolio-thumb-label {
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}







/* filters */

.wpc-filter-layout-dropdown .select2-container--default .select2-selection--single,
.wpc-filter-content .wpc-filters-widget-select{
    border-radius: 1.5rem;
}

.wpc-filter-content .wpc-filters-widget-select{
    padding: 6px 14px;
    line-height: 2.507em;
    height: auto;
    font-size: 0.84em;
    font-weight: 600;
}

/* .select2-container--open .select2-selection--single{
    border-radius: 9px!important;
} */

.select2-container--default .select2-selection--single .select2-selection__arrow{
    position:relative;
}

.widget-title.wpc-filter-title{
    font-size: 0.9em;
}

.select2-container .select2-selection{
    font-size: 0.84em;
    font-weight: 600;
}

/* mobile filter button */
body .wpc-filters-open-button-container a.wpc-filters-open-widget{
    border-radius: 0px;
}

/* chips */
.wpc-filter-chips-list{
    display: flex;
    overflow-x: auto;
    padding-left: 0;
}

.wpc-filters-open-button-container{
    padding-bottom: 1em;
}

.wpc-filter-chips-list a, body .wpc-filter-chips-list li.wpc-filter-chip a{
    border-radius: 99px;
    padding: 1em 1.2em;
    font-size: 16px;
}

.wpc-filter-chip-name{
    overflow:visible;
}

@media (max-width:768px) {
    .wpc-custom-selected-terms{
        display: none;
    }
}

/* Search & Filter (legacy/pro results shortcode form) */
.portfolio-shortcode-wrapper .searchandfilter ul{
    display: flex;
    flex-wrap: wrap;
    gap: 2%;
    padding-left: 0;
    margin-left: 0;
    list-style: none;
}

.portfolio-shortcode-wrapper .searchandfilter ul > li{
    flex: 0 0 32%;
    max-width: 32%;
    margin: 0;
}

.portfolio-shortcode-wrapper .searchandfilter ul > li:last-child{
    flex: 0 0 100%;
    max-width: 100%;
}

.portfolio-shortcode-wrapper .searchandfilter select,
.portfolio-shortcode-wrapper .searchandfilter input[type="text"],
.portfolio-shortcode-wrapper .searchandfilter input[type="submit"]{
    border-radius: 1.5rem;
}

.portfolio-shortcode-wrapper .searchandfilter select,
.portfolio-shortcode-wrapper .searchandfilter input[type="text"]{
    padding: 6px 14px;
    line-height: 2.507em;
    height: auto;
    font-size: 0.84em;
    font-weight: 600;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px){
    .portfolio-shortcode-wrapper .searchandfilter ul > li{
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Search & Filter v3 dropdowns (combobox) - match FEP pill style */
/* Apply to S&F fields globally + to results container `search-filter-query--id-<id>` */
.search-filter-base,
.search-filter-query .search-filter-base{
    --search-filter-input-border-radius: 1.5rem;
    /* Disable the plugin default input border so we don't get a "double border" */
    --search-filter-input-border-width: 0px;
    --search-filter-input-border-style: solid;
    --search-filter-input-border-color: transparent;
    --search-filter-input-border-hover-color: transparent;
    --search-filter-input-border-focus-color: transparent;
}

/*
 * Layout: S&F v3 fields don't always share a flex container, so use inline-flex to
 * allow them to sit next to each other and wrap naturally.
 */
.search-filter-field,
.search-filter-query .search-filter-field{
    max-width: 32%;
    width: 32%;
    display: inline-flex;
    vertical-align: top;
    margin-right: 2%;
    margin-bottom: 20px;
}

/* ensure 3rd item in a row doesn't overflow */
.search-filter-field:nth-of-type(3n),
.search-filter-query .search-filter-field:nth-of-type(3n){
    margin-right: 0;
}

/* Use specific field + combobox classes to override plugin styles without !important */
.search-filter-field.search-filter-style--choice-select .search-filter-field__input.search-filter-component-combobox{
    width: 100%;
    padding: 0;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__header{
    border-radius: 1.5rem;
    border: 1px solid #c9d1e0;
    background: #fff;
    box-shadow: none;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__actions{
    padding: 20px 30px;
    min-height: unset;
    display: flex;
    align-items: center;
}

/* Single select header (selected item display) */
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox--mode-single .search-filter-component-combobox__actions{
    padding-right: 10px; /* space for icons */
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox--mode-single .search-filter-component-combobox__selection{
    flex: 1 1 auto;
    min-width: 0;
    padding: 20px 30px;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #111;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox--mode-single .search-filter-component-combobox__actions-input{
    width: 100%;
    display: block;
    line-height: 1.2;
    padding: 0;
}

/* Make the clear "x" + caret align nicely */
.search-filter-component-combobox__clear-selection,
.search-filter-query .search-filter-component-combobox__clear-selection{
    margin-left: 8px;
}

.search-filter-component-combobox__listbox-toggle,
.search-filter-query .search-filter-component-combobox__listbox-toggle{
    margin-left: 6px;
}

/* remove divider + extra internal borders to avoid "double border" look */
.search-filter-component-combobox__input-divider,
.search-filter-query .search-filter-component-combobox__input-divider{
    display: none;
}
.search-filter-component-combobox__header *{
    box-shadow: none;
}
/* remove internal borders that can appear as a divider/double-border */
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__selection,
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__listbox-toggle{
    border: none;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__actions-input{
    font-size: 0.84em;
    font-weight: 600;
    color: #111;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox__actions-input::placeholder{
    color: #111;
    opacity: 1;
    font-size: 1em;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox{
    border-radius: 16px;
    padding: 14px;
    box-sizing: border-box;
    width: 100%;
    left: 0;
    right: 0;
}

/* Popover listbox has inline width/left styles; force it to match input width */
.search-filter-field.search-filter-style--choice-select .search-filter-field__popup.search-filter-component-combobox-base__listbox{
    width: 100%!important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* No padding on option <li> items (as requested) */
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox-option{
    padding: 20px 20px;
    margin: 0;
    line-height: 1.6em;
    font-size: 1em;
    font-weight: 600;
    color: #062b38;
    background: transparent;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
}

.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox-option:hover,
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox-option[aria-selected="true"]{
    background: #f5f5f5;
    color: #062b38;
}

/* Remove default blue highlight / focus styles */
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox-option:focus,
.search-filter-field.search-filter-style--choice-select .search-filter-component-combobox-base__listbox-option:active{
    outline: none;
    box-shadow: none;
}

/* Checkmark on hover + when selected */
.search-filter-component-combobox-base__listbox-option:hover::after,
.search-filter-query .search-filter-component-combobox-base__listbox-option:hover::after,
.search-filter-component-combobox-base__listbox-option[aria-selected="true"]::after,
.search-filter-query .search-filter-component-combobox-base__listbox-option[aria-selected="true"]::after{
    content: "✓";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #0570e2;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    
}

/* Responsive */
@media (max-width: 768px){
    .search-filter-field,
    .search-filter-query .search-filter-field{
        max-width: 100%;
        width: 100%;
        margin-right: 0;
    }
}

/* When rendering Search & Filter results, use S&F's built-in spinner (hide theme spinner). */
.search-filter-query .cooler-sf-results #spinner-container{
    display: none !important;
}