/**
 * Pro Frontend Filters — sidebar, filter groups, CTA button styles.
 *
 * @package MBA_Gallery_Pro
 */

/* ═══════════════════════════════════════════════════════════════════════════
   GALLERY LAYOUT WITH SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.medbeafgallery-gallery-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.medbeafgallery-gallery-layout .medbeafgallery-main-content {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.medbeafgallery-filter-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 32px; /* Admin bar height */
}

.medbeafgallery-filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.medbeafgallery-filter-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.medbeafgallery-filter-sidebar-toggle {
    all: unset;
    display: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.medbeafgallery-filter-sidebar-toggle:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Filter Groups */
.medbeafgallery-filter-groups {
    padding: 8px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.medbeafgallery-filter-group {
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.medbeafgallery-filter-group:last-child {
    border-bottom: none;
}

.medbeafgallery-filter-group-title {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.medbeafgallery-filter-group-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Checkbox Labels */
.medbeafgallery-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
}

.medbeafgallery-filter-checkbox:hover {
    background: #f3f4f6;
}

.medbeafgallery-filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--medbeafgallery-primary-solid, #2563eb);
    cursor: pointer;
    flex-shrink: 0;
}

.medbeafgallery-filter-checkbox-label {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CTA BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.medbeafgallery-cta-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--medbeafgallery-primary-solid, #2563eb);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, filter 0.2s;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
}

.medbeafgallery-cta-button:hover {
    background: var(--medbeafgallery-primary-solid, #1d4ed8);
    filter: brightness(0.9);
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none !important;
}

.medbeafgallery-cta-button:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
    .medbeafgallery-gallery-layout {
        flex-direction: column;
    }

    /* v1.0.10: on tablet & mobile, stack the filter sidebar BELOW the gallery
       (main content) instead of above it. Both are direct flex children, so
       flex `order` controls the stacking without touching the DOM. */
    .medbeafgallery-gallery-layout .medbeafgallery-main-content {
        order: 1;
    }
    .medbeafgallery-gallery-layout .medbeafgallery-filter-sidebar {
        order: 2;
    }

    /* Safari (iPadOS) does not stretch flex children on the cross-axis when
       align-items: flex-start is set on a column-direction flex container.
       Explicitly set width so the gallery grid can calculate its columns. */
    .medbeafgallery-gallery-layout .medbeafgallery-main-content {
        width: 100%;
    }

    .medbeafgallery-filter-sidebar {
        width: 100%;
        position: static;
    }

    .medbeafgallery-filter-sidebar-toggle {
        display: flex;
    }

    .medbeafgallery-filter-groups.collapsed {
        display: none;
    }
}

@media (max-width: 600px) {
    .medbeafgallery-filter-sidebar {
        border-radius: 8px;
    }

    .medbeafgallery-filter-group {
        padding: 10px 16px;
    }

    .medbeafgallery-filter-sidebar-header {
        padding: 12px 16px;
    }
}
