/* Beautiful Portfolio Gallery Styles - Minimal Text Filter Bar */
.bpg-gallery {
    --bpg-gap: 20px;
    --bpg-radius: 10px;
    --bpg-primary: #0284c7; /* Sky blue solid */
    --bpg-primary-hover: #0369a1;
    --bpg-navy: #0f172a;
    --bpg-border: #dbeafe;
    --bpg-bg-inactive: #ffffff;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    margin: 24px 0;
    direction: rtl;
}

.bpg-gallery *, .bpg-gallery *::before, .bpg-gallery *::after {
    box-sizing: border-box;
}

/* Toolbar: Filter Bar + Search Input */
.bpg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

/* Category Filter Bar - Option 1: Compact Text Buttons */
.bpg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bpg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    outline: none;
    /* Inactive State: white background, #dbeafe border, navy text */
    background-color: var(--bpg-bg-inactive);
    border: 1px solid var(--bpg-border);
    color: var(--bpg-navy);
}

.bpg-filter-btn:hover {
    border-color: #93c5fd;
    background-color: #f0f7ff;
}

.bpg-filter-btn.is-active {
    /* Active State: sky-blue solid background and white text */
    background-color: var(--bpg-primary);
    border-color: var(--bpg-primary);
    color: #ffffff;
}

.bpg-filter-count {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    line-height: 1.2;
}

.bpg-filter-btn.is-active .bpg-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Search Box */
.bpg-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    max-width: 100%;
}

.bpg-search-input {
    width: 100%;
    padding: 7px 34px 7px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--bpg-border);
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--bpg-navy);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bpg-search-input:focus {
    border-color: var(--bpg-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.bpg-search-icon {
    position: absolute;
    right: 10px;
    font-size: 0.9rem;
    color: #64748b;
    pointer-events: none;
}

/* Responsive Grid Items (Works beside sidebar) */
.bpg-items {
    display: grid;
    grid-template-columns: repeat(var(--bpg-cols, 3), minmax(0, 1fr));
    gap: var(--bpg-gap);
    transition: opacity 0.2s ease;
}

@media (max-width: 1024px) {
    .bpg-items {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .bpg-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .bpg-search-wrapper {
        width: 100%;
    }
    .bpg-items {
        grid-template-columns: 1fr;
    }
}

.bpg-item {
    background: #ffffff;
    border-radius: var(--bpg-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bpg-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.bpg-lightbox-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.bpg-lightbox-trigger img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.bpg-lightbox-trigger:hover img {
    transform: scale(1.04);
}

.bpg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

.bpg-lightbox-trigger:hover .bpg-overlay,
.bpg-lightbox-trigger:focus .bpg-overlay {
    opacity: 1;
}

.bpg-zoom-icon {
    font-size: 24px;
    color: #ffffff;
}

.bpg-item-caption {
    padding: 12px 14px;
    text-align: right;
}

.bpg-item-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    color: #0f172a;
    font-weight: 700;
}

.bpg-item-desc {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

.bpg-empty, .bpg-no-results {
    text-align: center;
    padding: 30px;
    background: #f8fafc;
    border-radius: var(--bpg-radius);
    color: #64748b;
    font-size: 0.95rem;
    grid-column: 1 / -1;
}

/* Lightbox Modal (Accessible) */
.bpg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bpg-lightbox[hidden] {
    display: none;
}

.bpg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
}

.bpg-lightbox-content {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.bpg-lightbox-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.bpg-lightbox-close:hover {
    background: rgba(15, 23, 42, 0.9);
}

.bpg-lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    max-height: 70vh;
    overflow: hidden;
}

.bpg-lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.bpg-lightbox-caption {
    padding: 14px 18px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #ffffff;
    text-align: right;
    max-height: 20vh;
    overflow-y: auto;
}
