/* Doctor Profile Mobile Optimization */

/* Doctor Profile Image Styles */
.dr-profile-img-wrap {
    text-align: center;
    margin-bottom: 16px;
}

.dr-profile-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dr-profile-img:hover {
    transform: scale(1.03);
    border-color: #0056b3;
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.15);
}

.dr-profile-img-fallback {
    display: none;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    border: 4px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dr-profile-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
}

/* Tablet / Mobile Landscape */
@media (max-width: 991px) {
    .dr-profile-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile Portrait */
@media (max-width: 767px) {
    .dr-profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        /* Switch to flex so we can order all four content blocks independently */
        display: flex;
        flex-direction: column;
    }

    /* Left column (Doctor info card + Reviews) becomes a flex container too */
    .dr-profile-grid > div:first-child {
        display: contents; /* Collapse the wrapper — its children become direct flex children of the grid */
    }

    /* Right column (About + Expertise) stays as a block but moves first */
    .dr-profile-grid > div:last-child {
        order: 2; /* About + Expertise appear second */
    }

    /* The patient reviews div (second child inside the left column) goes last */
    /* Since we used display:contents, the left column's children are now
       direct flex children. We target the reviews by its margin-top:30px style */
    .dr-profile-grid > div[style*="margin-top: 30px"],
    .dr-profile-grid > div > div[style*="margin-top: 30px"] {
        order: 3; /* Reviews go last — after expertise */
    }

    /* Doctor info card goes first */
    .dr-profile-grid > div[style*="background: #ffffff"],
    .dr-profile-grid > div[style*="border: 1px solid #dee2e6"] {
        order: 1;
    }

    /* Override rigid inline section padding */
    section[style*="padding: 60px"] {
        padding: 30px 15px !important;
    }

    /* Dynamically target and reduce heading element font sizes */
    .dr-profile-grid h1 {
        font-size: 26px !important;
    }
    .dr-profile-grid h2[style*="font-size: 28px"] {
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }
    .dr-profile-grid h2[style*="font-size: 24px"] {
        font-size: 22px !important;
    }

    /* Compress the main information card to save screen real estate */
    .dr-profile-grid > div > div[style*="padding: 24px"] {
        padding: 16px !important;
    }

    /* Small readability improvements for text blocks */
    .dr-profile-grid p {
        font-size: 15px !important;
    }

    /* Adjust buttons */
    .dr-profile-grid a[style*="padding: 14px"] {
        padding: 12px 16px !important;
        font-size: 15px !important;
    }

    /* Responsive doctor profile images for mobile */
    .dr-profile-img {
        width: 180px !important;
        height: 180px !important;
        border-width: 4px !important;
    }

    .dr-profile-img-fallback {
        width: 180px !important;
        height: 180px !important;
        border-width: 4px !important;
    }

    .dr-profile-img-fallback i {
        font-size: 72px !important;
    }

    .dr-profile-img-wrap {
        margin-bottom: 12px !important;
    }
}
