/**
 * ExhibitSD Gallery Styles
 * 
 * Customize these styles to match your site's design.
 * The BEM naming convention is used for easy overriding.
 * 
 * @package ExhibitStudios
 * @version 1.0.0
 */

/* ==========================================================================
   CSS VARIABLES - Customize your theme colors here
   ========================================================================== */

.exhibitsd-gallery {
    /* Colors - Adjust these to match your brand */
    --exhibitsd-primary: #1a1a1a;
    --exhibitsd-secondary: #666666;
    --exhibitsd-accent: #0055BB;
    --exhibitsd-accent-hover: #005177;
    --exhibitsd-background: #ffffff;
    --exhibitsd-card-bg: #ffffff;
    --exhibitsd-border: #e0e0e0;
    --exhibitsd-text: #333333;
    --exhibitsd-text-light: #666666;
    --exhibitsd-overlay: rgba(0, 0, 0, 0.6);
    
    /* Typography */
    --exhibitsd-font-family: inherit;
    --exhibitsd-font-size-sm: 0.875rem;
    --exhibitsd-font-size-base: 1rem;
    --exhibitsd-font-size-lg: 1.25rem;
    
    /* Spacing */
    --exhibitsd-gap: 24px;
    --exhibitsd-padding: 16px;
    --exhibitsd-radius: 8px;
    
    /* Transitions */
    --exhibitsd-transition: 0.3s ease;
}


/* Processing state */
.exhibitsd-gallery--processing .exhibitsd-gallery__filter-btn,
.exhibitsd-gallery--processing .exhibitsd-gallery__clear-tags,
.exhibitsd-gallery--processing .exhibitsd-gallery__clear-all {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.exhibitsd-gallery--processing .exhibitsd-gallery__grid {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.exhibitsd-gallery {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--exhibitsd-padding);
    font-family: var(--exhibitsd-font-family);
    box-sizing: border-box;
}

.exhibitsd-gallery *,
.exhibitsd-gallery *::before,
.exhibitsd-gallery *::after {
    box-sizing: inherit;
}


/* ==========================================================================
   FILTERS SECTION
   ========================================================================== */

.exhibitsd-gallery__filters {
    margin-bottom: 40px;
    padding: 40px 0;
    position: relative;
}

.exhibitsd-gallery__filters .fw-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background:#0F0F0F;
    z-index: 0;;
}

.exhibitsd-gallery__filter-group {
    margin-bottom: 20px;
    display: flex;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.exhibitsd-gallery__filter-group-titlebox {
    position: relative;
    z-index: 1;
}

.exhibitsd-gallery__filter-group--tags {
    display:block;
    margin-bottom: 10px;
}

.exhibitsd-gallery__filter-group:last-child {
    margin-bottom: 0;
}

.exhibitsd-gallery__filter-label {
    margin: 0 0 12px;
    font-size: var(--exhibitsd-font-size-sm);
    font-weight: 600;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    color: white;
    font-family: "Saira Stencil One",Sans-serif !important;
  font-size: 24px !important;
  font-style: normal !important;
  line-height: 1em !important;
}

.exhibitsd-gallery__togglebox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: white;
    margin-bottom: 10px;
}

.exhibitsd-gallery__togglebox-label svg {
    width: 16px;
    height: 16px;
    transition: transform 0.5s ease-in-out;
}

.exhibitsd-gallery__togglebox-label svg path { fill: white; }

.exhibitsd-gallery__togglebox-label:hover {
    color: var(--exhibitsd-accent);
    cursor: pointer;
}

.exhibitsd-gallery__togglebox-label:hover svg path { fill: var(--exhibitsd-accent); }

.exhibitsd-gallery__filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.exhibitsd-gallery__filter-group-button-box {
    max-height: 0;
    border-top: 1px solid white;
    width: 100%;
    transition: all 0.5s ease-in-out;
    overflow: hidden;
    padding: 0 10px;
    opacity: 0.7;
}

.exhibitsd-gallery__filter-group-button-box.open {
    max-height: 800px; /* Arbitrary large height to allow expansion */
    padding: 10px;
    border: 1px solid white;
    opacity: 1;
}

.exhibitsd-gallery__filter-group--tags.open .exhibitsd-gallery__togglebox-label svg {
    transform: rotate(180deg);
}

@media screen and (max-width: 768px) {
    .exhibitsd-gallery__filter-group--tags {
        display:none !important;
    }
}


/* ==========================================================================
   FILTER BUTTONS
   ========================================================================== */
   .exhibitsd-gallery__filter-btn {
    font-family: "Saira Stencil One", sans-serif !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 1em !important;
    padding: 5px 7px !important;
    height: 26px;
    color: #ffffff !important;
    background-color: var(--exhibitsd-accent) !important;
    border: 1px solid transparent;
    text-transform: uppercase !important;
    text-decoration: none !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
   }

.exhibitsd-gallery__filter-group-button-box .exhibitsd-gallery__filter-btn {
    font-family: "Noto Sans" !important;
    font-size: 16px !important;
    color: white !important;
    font-weight: 500 !important;
    line-height: .5em !important;
    background: none !important;
    padding: 8px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}

/* Ensure active state overrides the default styles */
.exhibitsd-gallery__filter-group-button-box .exhibitsd-gallery__filter-btn--active,
.exhibitsd-gallery__filter-group-button-box .exhibitsd-gallery__filter-btn[aria-pressed="true"] {
    background-color: #F05523 !important;
    border-color: #F05523 !important;
    color: #ffffff !important;
}

.exhibitsd-gallery__filter-group--categories {
    display: flex;
    gap: 8px;
}

.exhibitsd-gallery__filter-btn:hover {
    background-color: #F05523 !important;
    border-color: #F05523 !important;
    color: #ffffff !important;
}

.exhibitsd-gallery__filter-btn--active, .exhibitsd-gallery__filter-btn--active:hover,
.exhibitsd-gallery__filter-btn[aria-pressed="true"]:hover {
    background-color: #F05523 !important;
    border-color: #F05523 !important;
    color: #ffffff !important;
}

/* Disabled state for reciprocal filtering */
.exhibitsd-gallery__filter-btn--disabled,
.exhibitsd-gallery__filter-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    color: #999999 !important;
    text-decoration: line-through !important;

}

.exhibitsd-gallery__filter-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

.exhibitsd-gallery__filter-group-titlebox {

}

.exhibitsd-gallery__filter-group-titlebox h2 {
    font-family: "Saira Stencil One", Sans-serif !important;
    font-size: 24px !important;
    font-style: normal !important;
    line-height: 1em !important;
    color: white !important;
    text-transform: uppercase !important;
}

.exhibitsd-gallery__filter-group-titlebox .exhibitsd-gallery__filter-group-description {
    font-family: "Noto Sans" !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.5em !important;
    color: white !important;
    
}

/* ==========================================================================
   CLEAR BUTTONS
   ========================================================================== */

.exhibitsd-gallery__clear-tags,
.exhibitsd-gallery__clear-all {
    margin-top: 12px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--exhibitsd-radius);
    background-color: transparent;
    color: var(--exhibitsd-accent);
    font-family: 'Noto Sans' !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1em !important;
    text-transform: uppercase !important;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--exhibitsd-transition);
}

.exhibitsd-gallery__clear-tags:hover,
.exhibitsd-gallery__clear-all:hover {
    color: var(--exhibitsd-accent-hover);
}


/* ==========================================================================
   ACTIVE FILTERS DISPLAY
   ========================================================================== */

.exhibitsd-gallery__active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: var(--exhibitsd-radius);
}

.exhibitsd-gallery__active-filters-label {
    font-size: var(--exhibitsd-font-size-sm);
    font-weight: 600;
    color: var(--exhibitsd-secondary);
}

.exhibitsd-gallery__active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exhibitsd-gallery__active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: var(--exhibitsd-accent);
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
}

.exhibitsd-gallery__active-filter-remove {
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.exhibitsd-gallery__active-filter-remove:hover {
    opacity: 1;
}

@media screen and (max-width: 1024px) {
    .exhibitsd-gallery__filter-group {
        display: block;
    }

}

/* ==========================================================================
   RESULTS COUNT
   ========================================================================== */

.exhibitsd-gallery__results-count {
    margin-top: 16px;
    font-size: var(--exhibitsd-font-size-sm);
    color: var(--exhibitsd-text-light);
}

.exhibitsd-gallery__count-number {
    font-weight: 600;
    color: var(--exhibitsd-text);
}


/* ==========================================================================
   GALLERY GRID
   ========================================================================== */

.exhibitsd-gallery__grid {
    display: grid;
    gap: var(--exhibitsd-gap);
}

/* Column variations */
.exhibitsd-gallery__grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.exhibitsd-gallery__grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.exhibitsd-gallery__grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive grid */
@media (max-width: 1024px) {
    .exhibitsd-gallery__grid--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .exhibitsd-gallery__grid--cols-4,
    .exhibitsd-gallery__grid--cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .exhibitsd-gallery__grid--cols-4,
    .exhibitsd-gallery__grid--cols-3,
    .exhibitsd-gallery__grid--cols-2 {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   GALLERY CARDS
   ========================================================================== */

.exhibitsd-gallery__card {
    background:none !important;
    border-radius: var(--exhibitsd-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--exhibitsd-transition), 
                box-shadow var(--exhibitsd-transition),
                opacity var(--exhibitsd-transition);
}

.exhibitsd-gallery__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Hidden state for filtered cards */
.exhibitsd-gallery__card--hidden {
    display: none !important;
}

/* Fade out animation for hiding */
.exhibitsd-gallery__card--fading {
    opacity: 0;
    transform: scale(0.95);
}


/* ==========================================================================
   BLOG CARD LAYOUT
   ========================================================================== */

/* Blog Card specific overrides */
.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__card {
    padding-bottom: 0 !important;
    height: auto !important;
    border-radius: 0px !important;
    display: flex;
    flex-direction: column;
}

.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__card-image {
    position: relative;
    aspect-ratio: 16/9; /* Standard blog image ratio */
    overflow: hidden;
    width: 100%;
}

.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--exhibitsd-transition);
}

.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__card:hover .exhibitsd-gallery__card-img {
    transform: scale(1.05);
}

.exhibitsd-gallery__card-content {
    position: absolute !important;
    bottom: 5px; 
    left: 5px; 
}

.exhibitsd-gallery__card-content--blog {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    padding: 0 10px 10px !important;
    background: none !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.exhibitsd-gallery__card-content--blog .exhibitsd-gallery__card-title a {
    color: black !important;
    font-size: 24px !important;
    line-height: 0em !important;
    text-transform: none !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-weight: 600 !important;
}

.exhibitsd-gallery__card-content--blog .exhibitsd-gallery__card-title a:hover {
    color: #F05523 !important;
}

.exhibitsd-gallery__card-meta {
    margin-bottom: 12px;
    font-size: 14px;
    color: #444444 !important;
}

.exhibitsd-gallery__card-excerpt {
    margin: 12px 0 20px;
    font-size: 16px;
    line-height: 1.6;
    color: black !important;
    flex-grow: 1;
}
  
.exhibitsd-gallery__card-read-more {
    display: inline-block;
    background: #0055BB !important;
    color: white !important;
    font-family: 'Saira Stencil One', Sans-serif !important;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    margin-top: auto;
    padding: 6px 10px;
    border-radius: 0px !important;
    width: fit-content;
}

.exhibitsd-gallery__card-read-more:hover {
    color: var(--exhibitsd-accent-hover);
    text-decoration: none;
    background: #F05523 !important;
}


/* Adjust filter group for blog header */
.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__filter-group {
    align-items: center;
}

.exhibitsd-gallery[data-post-type="post"] .exhibitsd-gallery__filter-label {
    margin-bottom: 0;
    margin-right: 20px;
}

.exhibitsd-gallery__card-link {
    display: block;
    text-decoration: none;
}

.exhibitsd-gallery__card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
}

.exhibitsd-gallery__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--exhibitsd-transition);
}

.exhibitsd-gallery__card:hover .exhibitsd-gallery__card-img {
    transform: scale(1.05);
}

.exhibitsd-gallery__card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    color: #999;
    font-size: var(--exhibitsd-font-size-sm);
}


/* ==========================================================================
   CARD OVERLAY
   ========================================================================== */

.exhibitsd-gallery__card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--exhibitsd-overlay);
    opacity: 0;
    transition: opacity var(--exhibitsd-transition);
}

.exhibitsd-gallery__card:hover .exhibitsd-gallery__card-overlay {
    opacity: 1;
}

.exhibitsd-gallery__card-view {
    padding: 10px 24px;
    background-color: #ffffff;
    border-radius: var(--exhibitsd-radius);
    color: var(--exhibitsd-primary);
    font-size: var(--exhibitsd-font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(10px);
    transition: transform var(--exhibitsd-transition);
}

.exhibitsd-gallery__card:hover .exhibitsd-gallery__card-view {
    transform: translateY(0);
}


/* ==========================================================================
   CARD CONTENT
   ========================================================================== */

/* Categories */
.exhibitsd-gallery__card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.exhibitsd-gallery__card-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--exhibitsd-accent);
}

/* Title */
.exhibitsd-gallery__card-title {
    margin: 0 0 8px;
    font-size: var(--exhibitsd-font-size-base);
    font-weight: 600;
    line-height: .5em !important;
    margin: 10px 0;
}

.exhibitsd-gallery__card-content--blog .exhibitsd-gallery__card-title {
    margin: 0 0 8px;
    font-size: var(--exhibitsd-font-size-base);
    font-weight: 600;
    line-height: 1.5em !important;
    margin: 10px 0 30px;
}

.exhibitsd-gallery__card-title a {
    color: var(--exhibitsd-text);
    text-decoration: none;
    transition: color var(--exhibitsd-transition);
    font-family: "Protest Guerrilla", Sans-serif;
    font-size: 18px;
    font-weight: 400;
    text-transform: uppercase;
    color: #ffffff !important;
}


.exhibitsd-gallery__card-title a:hover {
    color: var(--exhibitsd-accent) !important;
}

/* Excerpt */
.exhibitsd-gallery__card-excerpt {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.5;
    color: black !important;
}

.exhibitsd-gallery__cat-icon {
    width: 69px;
    height: 69px;
    position:absolute;
    top: 5px;
    left: 5px;
    transition: transform 0.2s ease;
}

.exhibitsd-gallery__cat-icon:hover {
    cursor: pointer;
    transform: scale(1.1);
}

/* Tags */
.exhibitsd-gallery__card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.exhibitsd-gallery__card-tag {
    padding: 4px 10px;
    background-color: var(--exhibitsd-accent) !important;
    border-radius: 0px;
    font-size: 0.7rem;
    color: #ffffff !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.exhibitsd-gallery__card-tag:hover {
    background-color: #F05523 !important;
}


/* ==========================================================================
   NO RESULTS
   ========================================================================== */

.exhibitsd-gallery__no-results {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--exhibitsd-text-light) !important;
}


/* ==========================================================================
   LOADING INDICATOR
   ========================================================================== */

.exhibitsd-gallery__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    text-align: center;
    color: var(--exhibitsd-text-light) !important;
}

.exhibitsd-gallery__loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--exhibitsd-border);
    border-top-color: var(--exhibitsd-accent);
    border-radius: 50%;
    animation: exhibitsd-spin 0.8s linear infinite;
}

@keyframes exhibitsd-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Fade in animation for cards */
@keyframes exhibitsd-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exhibitsd-gallery__card {
    animation: exhibitsd-fadeIn 0.4s ease forwards;
}

/* Stagger animation delay for cards */
.exhibitsd-gallery__card:nth-child(1) { animation-delay: 0.05s; }
.exhibitsd-gallery__card:nth-child(2) { animation-delay: 0.1s; }
.exhibitsd-gallery__card:nth-child(3) { animation-delay: 0.15s; }
.exhibitsd-gallery__card:nth-child(4) { animation-delay: 0.2s; }
.exhibitsd-gallery__card:nth-child(5) { animation-delay: 0.25s; }
.exhibitsd-gallery__card:nth-child(6) { animation-delay: 0.3s; }
.exhibitsd-gallery__card:nth-child(7) { animation-delay: 0.35s; }
.exhibitsd-gallery__card:nth-child(8) { animation-delay: 0.4s; }


.exhibitsd-gallery__card {
    width : 100%;
    height: 0;
    padding-bottom: 62.5%;
    position:relative;
    border-radius: 0 !important;
}

.exhibitsd-gallery__card > div { position: relative; }

.exhibitsd-gallery__card-background {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover !important; /* Ensures image covers area */
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1.1); /* Ensures 110% size for wiggle room */
    will-change: transform;
}

.exhibitsd-gallery__card-background a { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; }