/* ==========================================================================
   Speaker Grid & Card Layout (Custom Premium Design)
   ========================================================================== */

/* 1. Grid Container */
.speaker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 60px 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 2. Speaker Card Structure */
.speaker-card {
    background: transparent;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease;
}

.speaker-card:hover {
    transform: translateY(-5px);
}

/* 3. Avatar Section with Background Glow */
.speaker-avatar-wrap {
    position: relative;
    width: 100%;
    height: 340px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
    margin-bottom: -15px;
    /* Overlap white box onto the portrait */
    z-index: 1;
}

.speaker-avatar-bg {
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 70%;
    background: linear-gradient(180deg, rgba(95, 203, 196, 0) 0%, rgba(95, 203, 196, 0.4) 100%);
    border-radius: 16px;
    z-index: 1;
}

.speaker-avatar-img {
    position: relative;
    z-index: 2;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

/* 4. Information Wrappers (White & Dark Purple Boxes) */
.speaker-info-wrap {
    background: #25143a;
    border-radius: 35px 0 16px 16px;
    box-shadow: 0 10px 30px rgba(37, 20, 58, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 2;
    position: relative;
    overflow: visible;
}

/* Doctor's Name (Floating diagonal ribbon style) */
.speaker-name {
    margin: 0 auto 0px;
    background: #ffffff;
    border-radius: 30px 0 30px 0;
    box-shadow: 0 6px 20px rgba(37, 20, 58, 0.08);
    padding: 12px 10px;
    font-size: 16px;
    font-weight: 800;
    color: #3b2361;
    text-align: center;
    line-height: 1.3;
    z-index: 3;
    position: relative;
}

/* Topic Container (Dark Purple bottom area) */
.speaker-topic-box {
    background: #25143a;
    /* Deep purple */
    padding: 15px 20px 32px;
    /* Increased top padding to balance space */
    position: relative;
    overflow: hidden;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bright pink/purple decorative top border line */
.speaker-topic-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #88398b 0%, #391c4d 100%);
}

.speaker-topic-text {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    font-weight: 500;
    /* SVN-Gilroy Medium */
}

/* 5. Skewed Teal Action Button */
.speaker-action {
    position: absolute;
    bottom: -20px;
    /* Centered on the bottom border of the topic box */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 100%;
    text-align: center;
}

.speaker-action .custom-btn-a {
    display: inline-block;
    background-color: #40c4b7 !important;
    /* Vibrant Teal */
    color: #ffffff !important;
    padding: 10px 30px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 0 !important;
    /* Square sharp borders */
    border: none !important;
    box-shadow: 0 4px 12px rgba(64, 196, 183, 0.4) !important;
    transform: skewX(-15deg);
    /* Skew to form a parallelogram */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

/* Restore vertical text inside skewed button */
.speaker-action .custom-btn-a span {
    display: inline-block;
    transform: skewX(15deg);
}

.speaker-action .custom-btn-a:hover {
    background-color: #319e93 !important;
    box-shadow: 0 6px 18px rgba(64, 196, 183, 0.6) !important;
    transform: skewX(-15deg) scale(1.05) !important;
}

/* 6. Responsive adjustments */
@media (max-width: 768px) {
    .speaker-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 40px 20px;
        padding: 0px 20px 20px 20px;
    }

    .speaker-avatar-wrap {
        height: 300px;
    }

    .speaker-name {
        font-size: 18px;
        padding: 18px 10px;
    }

    .speaker-topic-box {
        padding: 18px 15px 28px;
    }

    .speaker-topic-text {
        font-size: 13px;
    }
}