/* =============================================================================
   MT About Grid Widget — mtfe- prefix
   ============================================================================= */

.mtfe-about-grid {
    width: 100%;
    box-sizing: border-box;
}

/* ── Grid container ──────────────────────────────────────────────────────── */

.mtfe-about-grid__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

.mtfe-about-grid__grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mtfe-about-grid__grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.mtfe-about-grid__grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Cell base + scroll-in animation (fade in from top with delay) ─────────── */

.mtfe-about-grid__cell {
    --cell-index: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    border-radius: 24px;
    overflow: hidden;
    padding: 32px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease-out, transform 0.4s ease-out;
    transition-delay: calc(var(--cell-index) * 80ms);
}

.mtfe-about-grid--in-view .mtfe-about-grid__cell,
.elementor-element-edit-mode .mtfe-about-grid__cell {
    opacity: 1;
    transform: translateY(0);
}

.mtfe-about-grid--in-view .mtfe-about-grid__cell:hover,
.elementor-element-edit-mode .mtfe-about-grid__cell:hover {
    transform: translateY(-6px);
    transition-delay: 0ms;
}

/* ── Text cell ───────────────────────────────────────────────────────────── */

.mtfe-about-grid__cell--text {
    /* layout controlled by inline justify-content from editor */
}

/* ── Image cell ──────────────────────────────────────────────────────────── */

.mtfe-about-grid__cell--image {
    padding: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* ── Video cell ──────────────────────────────────────────────────────────── */

.mtfe-about-grid__cell--video {
    padding: 0;
}

/* ── Eyebrow label ───────────────────────────────────────────────────────── */

.mtfe-about-grid__eyebrow {
    margin: 0 0 16px 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.85;
    line-height: 1.4;
}

/* ── Heading ─────────────────────────────────────────────────────────────── */

.mtfe-about-grid__heading {
    margin: 0 0 16px 0;
    line-height: 1.1;
    word-break: break-word;
}

/* ── Description ─────────────────────────────────────────────────────────── */

.mtfe-about-grid__description {
    margin: 0;
    line-height: 1.5;
}

.mtfe-about-grid__description p:last-child {
    margin-bottom: 0;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */

.mtfe-about-grid__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ── Overlay text content (image / video) ────────────────────────────────── */

.mtfe-about-grid__overlay-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    z-index: 2;
    box-sizing: border-box;
}

.mtfe-about-grid__overlay-heading {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    line-height: 1.2;
    word-break: break-word;
}

.mtfe-about-grid__overlay-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* ── Video ───────────────────────────────────────────────────────────────── */

.mtfe-about-grid__video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
    min-height: inherit;
}

.mtfe-about-grid__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mtfe-about-grid__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Editor placeholder for video blocks */
.mtfe-about-grid__video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
    font-family: monospace;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .mtfe-about-grid__grid--cols-3,
    .mtfe-about-grid__grid--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .mtfe-about-grid__grid {
        grid-template-columns: 1fr !important;
    }

    .mtfe-about-grid__cell {
        grid-column: span 1 !important;
    }
}
