/* Doctor Profile Mobile Optimization */

.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;
    }
}
