/**
 * BK Dự Án Grid Widget Styles
 * Author: Bùi Đức Hạnh (https://buhaweb.com/)
 * Kit 4 Global Design System Compliant
 */

.bdh-bk-du-an-grid-wrap {
    position: relative;
    width: 100%;
}

.bdh-bk-du-an-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--bdh-du-an-cols, 4), minmax(0, 1fr));
    column-gap: var(--bdh-du-an-col-gap, 20px);
    row-gap: var(--bdh-du-an-row-gap, 24px);
    width: 100%;
}

/* Card */
.bdh-bk-du-an-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--bdh-du-an-radius, 14px);
    background-color: #0f172a;
    text-decoration: none !important;
    height: var(--bdh-du-an-height, 280px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
    cursor: pointer;
}

/* Image Wrapper */
.bdh-bk-du-an-card-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bdh-bk-du-an-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

/* Hover: Scale In & Scale Out */
.bdh-bk-du-an-card:hover .bdh-bk-du-an-card-thumb img {
    transform: scale(var(--bdh-du-an-hover-scale, 1.08));
}

/* Gradient Overlay */
.bdh-bk-du-an-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(
        to top,
        var(--bdh-du-an-grad-start, rgba(5, 23, 16, 0.95)) 0%,
        var(--bdh-du-an-grad-mid, rgba(5, 23, 16, 0.70)) 42%,
        var(--bdh-du-an-grad-end, rgba(0, 0, 0, 0)) 85%
    );
    opacity: 1;
    transition: opacity 0.45s ease-in-out;
    pointer-events: none;
}

/* Hover: Gradient Disappears */
.bdh-bk-du-an-card:hover .bdh-bk-du-an-card-overlay {
    opacity: var(--bdh-du-an-hover-overlay-opacity, 0);
}

/* Content Container at bottom */
.bdh-bk-du-an-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    box-sizing: border-box;
}

/* Title */
.bdh-bk-du-an-card-title {
    margin: 0 0 4px 0 !important;
    font-size: 15.5px;
    line-height: 1.35;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* Meta lines (Address & Power) */
.bdh-bk-du-an-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.bdh-bk-du-an-card-meta i,
.bdh-bk-du-an-card-meta svg,
.bdh-bk-du-an-card-meta .elementor-icon {
    width: var(--bdh-du-an-icon-size, 14px);
    height: var(--bdh-du-an-icon-size, 14px);
    font-size: var(--bdh-du-an-icon-size, 14px);
    fill: currentColor;
    color: inherit;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
}

.bdh-bk-du-an-card-meta svg {
    width: var(--bdh-du-an-icon-size, 14px);
    height: var(--bdh-du-an-icon-size, 14px);
    fill: currentColor;
}

.bdh-bk-du-an-card-meta span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.bdh-bk-du-an-pagination {
    margin-top: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bdh-bk-du-an-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.bdh-bk-du-an-pagination .page-numbers:hover {
    border-color: #2CAC55;
    color: #2CAC55;
    background: #F0FDF4;
}

.bdh-bk-du-an-pagination .page-numbers.current {
    background: #2CAC55;
    border-color: #2CAC55;
    color: #ffffff;
}

.bdh-bk-du-an-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}
