/* Base */
.dfg-wrap--horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    color: #111827;
}

/* Toolbar */
.dfg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 10px 12px;
}

.dfg-toolbar-left {
    flex: 1 1 220px;
}

.dfg-toolbar-right {
    flex: 2 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.dfg-toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.dfg-toolbar-group--compact {
    min-width: auto;
}

.dfg-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.dfg-input {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 7px 10px;
    font-size: 13px;
    background: #ffffff;
    min-width: 0;
}

.dfg-input:focus {
    outline: none;
    border-color: #111827;
}

.dfg-input--search {
    width: 100%;
}

.dfg-select {
    padding-right: 28px;
}

/* Clear button */
.dfg-clear-btn {
    border-radius: 999px;
    border: 1px solid #5baf42;
    padding: 7px 10px;
    font-size: 12px;
    background: #5baf42;
    cursor: pointer;
    color: #fff;
	margin-top: 26px;
}

.dfg-clear-btn:hover {
    background: #000;
}

/* Gallery */
.dfg-gallery {
    width: 100%;
}

.dfg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dfg-item {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.dfg-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 10px rgba(15,23,42,0.06);
    transform: translateY(-2px);
}

.dfg-item.dfg-hide {
    display: none;
}

.dfg-paged-hide {
    display: none;
}

/* Equal-height thumbnails */
.dfg-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 66.66%; /* 3:2 ratio */
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    overflow: hidden;
}

.dfg-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Meta */
.dfg-meta {
    padding: 10px 12px 12px;
}

.dfg-item-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 500;
}

.dfg-item-cats {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.dfg-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
}

/* Load more */
.dfg-load-more-wrap {
    margin-top: 16px;
    text-align: center;
}

.dfg-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid #5baf42;
    background: #5baf42;
    font-size: 13px;
    cursor: pointer;
    color: #fff;
}

.dfg-load-more-btn:hover {
    background: #000;
}

.dfg-load-more-hidden {
    display: none;
}

/* Lightbox */
.dfg-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.dfg-lightbox.is-open {
    display: flex;
}

.dfg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.dfg-lightbox-inner {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dfg-lightbox-close {
    align-self: flex-end;
    margin-bottom: 6px;
    background: #f9fafb;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 4px 10px;
    font-size: 18px;
    cursor: pointer;
}

.dfg-lightbox-body {
    background: #000;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.dfg-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto 8px auto;
}

.dfg-lightbox-caption {
    color: #e5e7eb;
}

.dfg-lightbox-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 500;
}

.dfg-lightbox-cats {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive: tablets */
@media (max-width: 1024px) {
    .dfg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
	.dfg-clear-btn {
		margin-top: 0px;
	}
}

/* Responsive: mobile / small tablets */
@media (max-width: 768px) {
    .dfg-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .dfg-toolbar-left,
    .dfg-toolbar-right {
        flex: 1 1 100%;
    }

    .dfg-toolbar-right {
        justify-content: flex-start;
    }

    .dfg-toolbar-group {
        min-width: 48%;
    }

    .dfg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive: small mobile */
@media (max-width: 480px) {
    .dfg-toolbar-group {
        min-width: 100%;
    }

    .dfg-grid {
        grid-template-columns: 1fr;
    }
}
