/* ==========================================================================
   BĐS Taxonomy Grid Block Styles
   ========================================================================== */

.bdsdd-tax-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 2rem;
}

/* Common Card Base */
.bdsdd-tax-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none !important;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

.bdsdd-tax-card, .bdsdd-tax-card:hover, .bdsdd-tax-card:focus {
    text-decoration: none !important;
}

.bdsdd-tax-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.bdsdd-tax-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

.bdsdd-tax-card:hover .bdsdd-tax-bg {
    transform: scale(1.05);
}

.bdsdd-tax-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.15);
    z-index: 2;
    transition: background 0.3s ease;
}

.bdsdd-tax-card:hover .bdsdd-tax-overlay {
    background: rgba(0,0,0,0.3);
}

.bdsdd-tax-content,
.bdsdd-tax-content-top,
.bdsdd-tax-content-bottom {
    position: relative;
    z-index: 3;
    padding: 20px;
    color: #fff;
}

.bdsdd-tax-title {
    margin: 0;
    font-weight: 700;
    color: #fff !important;
    line-height: 1.3;
}

.bdsdd-tax-count {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff !important;
    opacity: 0.9;
    display: block;
    margin-bottom: 4px;
}


/* =========================================
   STYLE 1: Bento Grid
   ========================================= */
.bdsdd-tax-grid.style-1 {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 35px; /* Fine-grained rows for exact proportions */
    grid-auto-flow: dense;
    gap: 12px;
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-card {
    border-radius: 6px;
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 45%);
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-card:hover .bdsdd-tax-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%);
}

.bdsdd-tax-grid.style-1 .bdsdd-bento-item {
    height: 100%;
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 16px;
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-count {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 2px;
    opacity: 0.9;
    letter-spacing: 0.2px;
}

.bdsdd-tax-grid.style-1 .bdsdd-tax-title {
    font-weight: 700;
    line-height: 1.2;
}

/* 
 * Exact 5-Column Interlocking Masonry 
 * Col 1: span 10. Col 5: span 10.
 * Col 2: span 4, span 6.
 * Col 3: span 6, span 4.
 * Col 4: span 5, span 5.
 */

.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+1) { grid-column: 1; grid-row: span 10; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+2) { grid-column: 2; grid-row: span 4; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+3) { grid-column: 2; grid-row: span 6; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+4) { grid-column: 3; grid-row: span 6; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+5) { grid-column: 3; grid-row: span 4; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+6) { grid-column: 4; grid-row: span 5; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+7) { grid-column: 4; grid-row: span 5; }
.bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(8n+8) { grid-column: 5; grid-row: span 10; }

@media (max-width: 992px) {
    .bdsdd-tax-grid.style-1 { 
        grid-template-columns: repeat(3, 1fr); 
        grid-auto-rows: 40px;
    }
    .bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(n) { grid-column: auto; grid-row: span 5; }
    .bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(1n) { grid-row: span 8; }
    .bdsdd-tax-grid.style-1 .bdsdd-bento-item:nth-child(3n) { grid-row: span 6; }
}
@media (max-width: 576px) {
    .bdsdd-tax-grid.style-1 { grid-template-columns: 1fr; grid-auto-rows: 200px; }
    .bdsdd-tax-grid.style-1 .bdsdd-bento-item { grid-column: 1 / -1 !important; grid-row: span 1 !important; }
}


/* =========================================
   STYLE 2: Standard Grid
   ========================================= */
.bdsdd-tax-grid.style-2 {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
    gap: 16px;
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-card {
    border-radius: 2px;
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 50%);
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-card:hover .bdsdd-tax-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 100%);
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-content {
    margin-top: auto;
    padding: 24px;
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-title {
    font-family: "Playfair Display", "Lora", "Merriweather", "Times New Roman", serif;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.bdsdd-tax-grid.style-2 .bdsdd-tax-count {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.85;
}

/* Asymmetrical Spanning Pattern: 2-1-1 / 1-1-2 */
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+1) { grid-column: span 2; }
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+2) { grid-column: span 1; }
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+3) { grid-column: span 1; }
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+4) { grid-column: span 1; }
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+5) { grid-column: span 1; }
.bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(6n+6) { grid-column: span 2; }

@media (max-width: 992px) {
    .bdsdd-tax-grid.style-2 { grid-template-columns: repeat(2, 1fr); }
    .bdsdd-tax-grid.style-2 .bdsdd-standard-item:nth-child(n) { grid-column: span 1; }
}
@media (max-width: 576px) {
    .bdsdd-tax-grid.style-2 { grid-template-columns: 1fr; grid-auto-rows: 200px; }
}


/* =========================================
   STYLE 3: Tall Cards Dark
   ========================================= */
.bdsdd-tax-grid.style-3 {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 240px;
    grid-auto-flow: dense;
    gap: 16px;
}

.bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item {
    border-radius: 0; /* Sharp edges */
}

.bdsdd-tax-grid.style-3 .bdsdd-tax-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.6) 100%);
}

.bdsdd-tax-grid.style-3 .bdsdd-tax-content-top {
    padding: 20px;
}

.bdsdd-tax-grid.style-3 .bdsdd-tax-content-top .bdsdd-tax-title {
    font-weight: 700;
}

.bdsdd-tax-grid.style-3 .bdsdd-tax-count {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 6px;
}

.bdsdd-tax-grid.style-3 .bdsdd-tax-content-bottom {
    margin-top: auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bdsdd-tax-grid.style-3 .bdsdd-more-details {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bdsdd-tax-grid.style-3 .bdsdd-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.9;
}

/* 6-Column Irregular Spanning Pattern */
.bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item { grid-column: span 1; grid-row: span 1; }
.bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(9n+1),
.bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(9n+4),
.bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(9n+5) { grid-column: span 1; grid-row: span 2; }

@media (max-width: 1200px) {
    .bdsdd-tax-grid.style-3 { grid-template-columns: repeat(4, 1fr); }
    .bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
    .bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(6n+1),
    .bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(6n+4) { grid-row: span 2; }
}
@media (max-width: 768px) {
    .bdsdd-tax-grid.style-3 { grid-template-columns: repeat(2, 1fr); }
    .bdsdd-tax-grid.style-3 .bdsdd-tall-dark-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
}
@media (max-width: 480px) {
    .bdsdd-tax-grid.style-3 { grid-template-columns: 1fr; grid-auto-rows: 250px; }
}


/* =========================================
   STYLE 4: Tall Cards Light
   ========================================= */
.bdsdd-tax-grid.style-4 {
    grid-template-columns: repeat(6, 1fr);
}

.bdsdd-tax-grid.style-4 .bdsdd-tall-light-item {
    aspect-ratio: 2/3;
}

.bdsdd-tax-grid.style-4 .bdsdd-gradient-light {
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.4) 100%);
}

.bdsdd-tax-grid.style-4 .bdsdd-tax-content-top {
    padding: 16px;
}

.bdsdd-tax-grid.style-4 .bdsdd-tax-content-top .bdsdd-tax-title {
    font-weight: 400;
}

.bdsdd-tax-grid.style-4 .bdsdd-tax-content-bottom {
    margin-top: auto;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 1200px) {
    .bdsdd-tax-grid.style-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .bdsdd-tax-grid.style-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .bdsdd-tax-grid.style-4 { grid-template-columns: repeat(2, 1fr); }
}


/* =========================================
   STYLE 5: Minimal List
   ========================================= */
.bdsdd-tax-grid.style-5 {
    grid-template-columns: repeat(var(--bdsdd-cols, 4), 1fr);
    gap: 24px;
}

.bdsdd-tax-grid.style-5 .bdsdd-minimal-item {
    flex-direction: row;
    align-items: center;
    background: #fff;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.bdsdd-tax-grid.style-5 .bdsdd-minimal-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.bdsdd-tax-grid.style-5 .bdsdd-tax-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 16px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.bdsdd-tax-grid.style-5 .bdsdd-tax-icon img {
    width: 100%;
    height: 100%;
    object-fit: var(--bdsdd-fit, cover);
}

.bdsdd-tax-grid.style-5 .bdsdd-tax-info {
    flex: 1;
}

.bdsdd-tax-grid.style-5 .bdsdd-tax-title {
    color: #1e293b !important;
    margin-bottom: 4px;
    font-weight: 600;
}

.bdsdd-tax-grid.style-5 .bdsdd-tax-count {
    color: #64748b !important;
}

@media (max-width: 1024px) {
    .bdsdd-tax-grid.style-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .bdsdd-tax-grid.style-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .bdsdd-tax-grid.style-5 { grid-template-columns: 1fr; }
}

/* =========================================
   STYLE 6: Hover Accordion
   ========================================= */
.bdsdd-tax-grid.style-6 {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    height: 450px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.bdsdd-tax-grid.style-6 .bdsdd-accordion-item {
    flex: 1;
    border-radius: 12px;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    min-width: 60px;
}

.bdsdd-tax-grid.style-6 .bdsdd-accordion-item:hover {
    flex: 4;
}

.bdsdd-tax-grid.style-6 .bdsdd-tax-content {
    margin-top: auto;
    padding: 24px;
    opacity: 1;
    transition: padding 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.bdsdd-tax-grid.style-6 .bdsdd-accordion-item:hover .bdsdd-tax-content {
    opacity: 1;
}

.bdsdd-tax-grid.style-6 .bdsdd-tax-title {
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 700;
}

.bdsdd-tax-grid.style-6 .bdsdd-tax-count {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, margin 0.4s ease;
    display: block;
    max-height: 0;
}

.bdsdd-tax-grid.style-6 .bdsdd-accordion-item:hover .bdsdd-tax-count {
    opacity: 1;
    transform: translateY(0);
    max-height: 30px;
    margin-top: 4px;
}

.bdsdd-tax-grid.style-6 .bdsdd-tax-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.bdsdd-tax-grid.style-6 .bdsdd-accordion-item:hover .bdsdd-tax-overlay {
    opacity: 1;
}

@media (max-width: 768px) {
    .bdsdd-tax-grid.style-6 { 
        flex-direction: column; 
        height: 600px; 
    }
}

/* =========================================
   STYLE 7: Luxury Glassmorphism
   ========================================= */
.bdsdd-tax-grid.style-7 {
    grid-template-columns: repeat(var(--bdsdd-cols, 3), 1fr);
    gap: 24px;
}

.bdsdd-tax-grid.style-7 .bdsdd-glass-item {
    aspect-ratio: 4/5;
    border-radius: 16px;
    padding: 16px;
    justify-content: flex-end;
}

.bdsdd-tax-grid.style-7 .bdsdd-glass-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    z-index: 3;
    transition: transform 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.bdsdd-tax-grid.style-7 .bdsdd-glass-item:hover .bdsdd-glass-box {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.bdsdd-tax-grid.style-7 .bdsdd-tax-title { color: #fff !important; }
.bdsdd-tax-grid.style-7 .bdsdd-tax-count { color: rgba(255,255,255,0.9) !important; }

@media (max-width: 992px) { .bdsdd-tax-grid.style-7 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .bdsdd-tax-grid.style-7 { grid-template-columns: 1fr; } }


/* =========================================
   STYLE 8: Circle Spotlight
   ========================================= */
.bdsdd-tax-grid.style-8 {
    grid-template-columns: repeat(var(--bdsdd-cols, 4), 1fr);
    gap: 40px 24px;
}

.bdsdd-tax-grid.style-8 .bdsdd-circle-item {
    align-items: center;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}

.bdsdd-tax-grid.style-8 .bdsdd-tax-bg {
    background-size: var(--bdsdd-fit, cover);
    background-position: center;
    background-repeat: no-repeat;
}

.bdsdd-tax-grid.style-8 .bdsdd-circle-item:hover { transform: translateY(-6px); }

.bdsdd-circle-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    border: 4px solid #fff;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
    z-index: 2;
}

.bdsdd-tax-grid.style-8 .bdsdd-circle-item:hover .bdsdd-circle-wrapper {
    border-color: #6366f1;
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.bdsdd-tax-grid.style-8 .bdsdd-tax-info {
    text-align: center;
    z-index: 3;
}

.bdsdd-tax-grid.style-8 .bdsdd-tax-title {
    color: #1e293b !important;
    font-weight: 700;
}

.bdsdd-tax-grid.style-8 .bdsdd-tax-count {
    color: #64748b !important;
    font-size: 0.85rem;
}

@media (max-width: 992px) { .bdsdd-tax-grid.style-8 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px) { .bdsdd-tax-grid.style-8 { grid-template-columns: repeat(2, 1fr); } }
