/*
 * DT Feature Grid Block Styles
 * v3.1: All features and fixes included
 */
/*
 * DT Feature Grid Block Styles
 * v3.1: All features and fixes included
 */

/* ===================================================================
   Width Container Classes
=================================================================== */
.dtfg-width-1600 { max-width: 1600px; margin-left: auto; margin-right: auto; }
.dtfg-width-1400 { max-width: 1400px; margin-left: auto; margin-right: auto; }
.dtfg-width-1300 { max-width: 1300px; margin-left: auto; margin-right: auto; }
.dtfg-width-1200 { max-width: 1200px; margin-left: auto; margin-right: auto; }
.dtfg-width-1000 { max-width: 1000px; margin-left: auto; margin-right: auto; }
.dtfg-width-800 { max-width: 800px; margin-left: auto; margin-right: auto; }
.dtfg-width-full { max-width: 100%; }


.dt-feature-grid-section {
    padding: 60px 20px;
.dt-feature-grid-section {
    padding: 60px 20px;
    background-color: var(--dtfg-main-bg);
    font-family: Arial, sans-serif;
}

/* ===================================================================
   Header Section (Static & Interactive)
=================================================================== */
.dt-feature-grid-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px auto;
}

/* NEW: Header Left Align */
.dt-feature-grid-header.dt-header-align-left {
    text-align: left;
    /* max-width is handled by the inline style in PHP */
}

.dt-feature-grid-title {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--dtfg-header-title);
    margin-bottom: 20px;
    line-height: 1.2;
}

.dt-feature-grid-description {
    font-size: 1.1em;
    color: var(--dtfg-header-desc);
    margin-bottom: 30px;
    line-height: 1.6;
}

.dt-feature-grid-cta {
    margin-top: 30px;
}

/* Main CTA Button (in Header) */
.dt-feature-grid-button {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--dtfg-cta-bg);
    color: var(--dtfg-cta-text);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.dt-feature-grid-button:hover {
    opacity: 0.9;
}

/* ===================================================================
   Main Grid Layout (Static & Interactive)
=================================================================== */
.dt-feature-grid-layout {
    display: flex;
    gap: 20px;
    /* max-width is now handled by inline style in PHP */
    margin: 0 auto;
    align-items: stretch; 
}

.dt-feature-grid-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dt-feature-grid-center {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px; 
    
    position: relative;
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: #fff;
}

/* ===================================================================
   Feature Box Panels (Static & Interactive)
=================================================================== */
.dt-feature-grid-box {
    background-color: var(--dtfg-feature-box-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* NEW: Panel Image */
.dt-feature-grid-box-image {
    text-align: center;
    margin-bottom: 20px;
}

.dt-feature-grid-box-image img {
    width: 100px; 
    height: 100px; 
    border-radius: 50%; /* Makes it circular */
    object-fit: cover;
    display: inline-block;
    background-color: #f0f0f0; /* Fallback bg */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* NEW: Panel Content Alignment (STRONG RULES) */
.dt-feature-grid-section .dt-feature-grid-box.dt-panel-align-center .dt-feature-grid-box-title,
.dt-feature-grid-section .dt-feature-grid-box.dt-panel-align-center .dt-feature-grid-box-content,
.dt-feature-grid-section .dt-feature-grid-box.dt-panel-align-center .dt-feature-grid-box-content p {
    text-align: center;
}


.dt-feature-grid-box-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--dtfg-feature-title);
    margin-top: 0;
    margin-bottom: 10px;
}
/* This ensures raw text (in a <p>) looks like the old h3 */
.dt-feature-grid-box-title p {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
}

.dt-feature-grid-box-content {
    font-size: 0.95em;
    color: var(--dtfg-feature-text);
    line-height: 1.6;
}
.dt-feature-grid-box-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}
.dt-feature-grid-box-content .button,
.dt-feature-grid-box-content .wp-block-button { 
    margin-top: 15px;
}

/* ===================================================================
   STATIC MODE: Center Content
=================================================================== */
.dt-feature-grid-static-content {
     width: 100%;
     height: 100%;
     padding: 20px;
     box-sizing: border-box;
     display: flex;
     align-items: center;
     justify-content: center;
}

.dt-feature-grid-center-image,
.dt-feature-grid-center-video-direct {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    display: block;
    border-radius: 15px;
}

.dt-feature-grid-center-video {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: 15px;
    overflow: hidden;
}
.dt-feature-grid-center-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dt-feature-grid-center-product {
     width: 100%;
     height: 100%;
     padding: 20px;
     box-sizing: border-box;
     overflow-y: auto;
     border-radius: 15px;
     overflow: hidden;
}

/* ===================================================================
   INTERACTIVE MODE Styles
=================================================================== */

.dt-feature-grid-interactive-mode .dt-feature-grid-static-content {
    display: none;
}

.dt-feature-grid-interactive-button {
    display: none; /* Hidden by default */
    margin-top: 15px;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    
    background: var(--dtfg-int-btn-bg, #ffffff);
    color: var(--dtfg-int-btn-text, #333);
    border: 1px solid #ddd; 
}

.dt-feature-grid-interactive-mode .dt-feature-grid-interactive-button {
    display: inline-block;
}

.dt-feature-grid-interactive-button:hover {
    filter: brightness(95%);
    border-color: #ccc;
}

.dt-feature-grid-interactive-button.active {
    background: var(--dtfg-int-btn-bg-active, #333);
    color: var(--dtfg-int-btn-text-active, #fff);
    border-color: var(--dtfg-int-btn-bg-active, #333);
}

.dt-feature-central-media {
    display: none; /* Hidden by default */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dt-feature-grid-interactive-mode .dt-feature-central-media {
    display: block;
}

.dt-feature-media-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    visibility: hidden;
    padding: 20px; 
    box-sizing: border-box;
}

.dt-feature-media-item.active {
    opacity: 1;
    visibility: visible;
}

.dt-feature-media-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 15px;
}

.dt-feature-media-item .video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 15px;
    overflow: hidden;
}

.dt-feature-media-item .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dt-feature-media-item .shortcode-wrapper {
    width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 15px;
    overflow: hidden;
}


/* ===================================================================
   Responsive Adjustments
=================================================================== */
@media (max-width: 1024px) {
    .dt-feature-grid-title {
        font-size: 2em;
    }
    .dt-feature-grid-description {
        font-size: 1em;
    }
    .dt-feature-grid-button {
        padding: 12px 25px;
    }
    .dt-feature-grid-box {
        padding: 20px;
    }
    .dt-feature-grid-box-title {
        font-size: 1.2em;
    }
}

@media (max-width: 768px) {
    .dt-feature-grid-layout {
        flex-direction: column;
        gap: 40px;
        align-items: stretch;
    }
    .dt-feature-grid-center {
        order: -1;
        min-height: 300px;
    }
    .dt-feature-grid-column.left-column {
        order: 0; 
    }
    .dt-feature-grid-column.right-column {
        order: 1; 
    }
    .dt-feature-grid-section {
        padding: 40px 15px;
    }
    .dt-feature-grid-header {
        margin-bottom: 40px;
    }
    .dt-feature-grid-title {
        font-size: 1.8em;
    }
    .dt-feature-grid-center-image,
    .dt-feature-grid-center-video,
    .dt-feature-grid-center-video-direct,
    .dt-feature-grid-center-product {
        max-width: 100%; 
    }
    .dt-feature-media-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .dt-feature-grid-title {
        font-size: 1.5em;
    }
    .dt-feature-grid-button {
        width: 100%;
        text-align: center;
    }
    .dt-feature-grid-interactive-button {
        width: 100%;
        text-align: center;
    }
}