/*
 * Doctor.bd Community unified directory layout v13.
 * Loaded after the shared frontend shell so /community follows the same
 * container, rail width, sticky behaviour and card rhythm as other pages.
 */
body.frontend-unified-shell-v12.community-directory-page {
    --community-page-bg: #f4f7fb;
    --community-card-bg: rgba(255, 255, 255, .99);
    --community-card-border: #e1e8f0;
    --community-card-shadow: 0 8px 28px rgba(30, 64, 112, .07);
    --community-card-shadow-hover: 0 14px 34px rgba(30, 64, 112, .11);
    --community-ink: #10213f;
    --community-muted: #667085;
    --community-primary: #0868f7;
    --community-primary-dark: #0757cf;
    background: var(--community-page-bg);
}

body.frontend-unified-shell-v12.community-directory-page .doctorbd-main,
body.frontend-unified-shell-v12.community-directory-page .community-directory-redesign,
body.frontend-unified-shell-v12.community-directory-page .community-directory-shell {
    overflow: visible !important;
    background: var(--community-page-bg) !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-redesign {
    color: var(--community-ink);
    font-weight: 500;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-shell {
    min-height: calc(100vh - var(--db-header-height, 74px));
    padding-top: 18px !important;
    padding-bottom: 40px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-container {
    width: 100%;
    max-width: var(--db-shell-max, 1540px) !important;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
    overflow: visible !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-row,
body.frontend-unified-shell-v12.community-directory-page .community-left-column,
body.frontend-unified-shell-v12.community-directory-page .community-right-column,
body.frontend-unified-shell-v12.community-directory-page .community-feed-column {
    min-width: 0;
    overflow: visible !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-left-column,
body.frontend-unified-shell-v12.community-directory-page .community-right-column {
    width: 100% !important;
    max-width: none !important;
    align-self: stretch !important;
}

/* Remove the older 680/720px feed cap so the middle column matches directories. */
body.doctorbd-app.frontend-unified-shell-v12.community-directory-page.community-premium-page .community-feed-column {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail,
body.frontend-unified-shell-v12.community-directory-page .community-sticky-stack,
body.frontend-unified-shell-v12.community-directory-page .community-side-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail .community-sticky-stack {
    position: static !important;
    top: auto !important;
    display: grid;
    gap: 16px;
    max-height: none !important;
    overflow: visible !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-side-card,
body.frontend-unified-shell-v12.community-directory-page .community-composer,
body.frontend-unified-shell-v12.community-directory-page .community-post,
body.frontend-unified-shell-v12.community-directory-page .community-empty-card,
body.frontend-unified-shell-v12.community-directory-page .community-feed-loader {
    border: 1px solid var(--community-card-border) !important;
    border-radius: 16px !important;
    background: var(--community-card-bg) !important;
    box-shadow: var(--community-card-shadow) !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-composer,
body.frontend-unified-shell-v12.community-directory-page .community-post {
    width: 100%;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.frontend-unified-shell-v12.community-directory-page .community-composer:hover,
body.frontend-unified-shell-v12.community-directory-page .community-post:hover {
    border-color: #cbd8e7 !important;
    box-shadow: var(--community-card-shadow-hover) !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-composer {
    margin-bottom: 16px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-post {
    margin-bottom: 16px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-composer .card-body,
body.frontend-unified-shell-v12.community-directory-page .community-post .card-body {
    padding-right: 20px !important;
    padding-left: 20px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-profile-card,
body.frontend-unified-shell-v12.community-directory-page .community-guidance-card,
body.frontend-unified-shell-v12.community-directory-page .community-join-card,
body.frontend-unified-shell-v12.community-directory-page .community-popular-card {
    overflow: hidden;
}

body.frontend-unified-shell-v12.community-directory-page .community-profile-cover {
    height: 74px;
    border-radius: 15px 15px 0 0;
}

body.frontend-unified-shell-v12.community-directory-page .community-profile-links .list-group-item:last-child {
    border-radius: 0 0 15px 15px;
}

body.frontend-unified-shell-v12.community-directory-page .community-dashboard-button,
body.frontend-unified-shell-v12.community-directory-page .community-join-card .btn {
    min-height: 42px;
    border-color: var(--community-primary);
    border-radius: 9px;
    background: var(--community-primary);
    font-weight: 500;
}

body.frontend-unified-shell-v12.community-directory-page .community-dashboard-button:hover,
body.frontend-unified-shell-v12.community-directory-page .community-dashboard-button:focus,
body.frontend-unified-shell-v12.community-directory-page .community-join-card .btn:hover,
body.frontend-unified-shell-v12.community-directory-page .community-join-card .btn:focus {
    border-color: var(--community-primary-dark);
    background: var(--community-primary-dark);
}

body.frontend-unified-shell-v12.community-directory-page .community-composer-trigger {
    min-height: 50px;
    border-color: #d5dfeb;
    background: #f8fafc;
}

body.frontend-unified-shell-v12.community-directory-page .community-composer-trigger:hover,
body.frontend-unified-shell-v12.community-directory-page .community-composer-trigger:focus {
    border-color: #9fc5ff;
    background: #edf5ff;
    box-shadow: 0 0 0 3px rgba(8, 104, 247, .09);
}

body.frontend-unified-shell-v12.community-directory-page .community-guidance-card .card-body,
body.frontend-unified-shell-v12.community-directory-page .community-popular-card .card-body {
    padding: 18px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-guidance-item,
body.frontend-unified-shell-v12.community-directory-page .community-popular-item {
    line-height: 1.5;
}

body.frontend-unified-shell-v12.community-directory-page .community-guidance-visual {
    height: 132px;
}

body.frontend-unified-shell-v12.community-directory-page .community-join-card .card-body {
    padding: 20px !important;
}

body.frontend-unified-shell-v12.community-directory-page .community-join-visual {
    width: 172px;
    height: 172px;
}

body.frontend-unified-shell-v12.community-directory-page .community-status-alert {
    max-width: 100%;
    margin-bottom: 16px;
    border: 1px solid #b9e7cf;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(27, 127, 79, .07);
}

/* Same three-column rail system as Doctors, Hospitals, Blood and Blog. */
@media (min-width: 1200px) {
    body.frontend-unified-shell-v12.community-directory-page .community-directory-row {
        display: grid !important;
        grid-template-columns: var(--db-sidebar-size, 260px) minmax(0, 1fr) var(--db-sidebar-size, 260px) !important;
        grid-template-areas: "left main right";
        gap: var(--db-shell-gap, 20px) !important;
        align-items: start !important;
        margin: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-row > * {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-left-column {
        grid-area: left;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-feed-column {
        grid-area: main;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-right-column {
        display: block !important;
        grid-area: right;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail {
        position: sticky !important;
        top: var(--db-sticky-offset) !important;
        width: 100% !important;
        max-height: var(--db-sticky-height) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
        z-index: 20;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail:hover,
    body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail:focus-within {
        scrollbar-color: #b8c3d1 transparent;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    body.frontend-unified-shell-v12.community-directory-page .community-directory-row {
        display: grid !important;
        grid-template-columns: var(--db-sidebar-size, 244px) minmax(0, 1fr) !important;
        grid-template-areas: "left main";
        gap: 18px !important;
        align-items: start !important;
        margin: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-row > * {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-left-column {
        grid-area: left;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-feed-column {
        grid-area: main;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-right-column {
        display: none !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-left-rail {
        position: sticky !important;
        top: var(--db-sticky-offset) !important;
        max-height: var(--db-sticky-height) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        z-index: 20;
    }
}

@media (max-width: 991.98px) {
    body.frontend-unified-shell-v12.community-directory-page .community-directory-shell {
        padding-top: 14px !important;
        padding-bottom: 28px !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-container {
        padding-right: 14px;
        padding-left: 14px;
    }

    /* Keep the feed first on tablet/mobile, then show the profile/help rail. */
    body.frontend-unified-shell-v12.community-directory-page .community-directory-row {
        display: flex !important;
        flex-direction: column;
        gap: 16px !important;
        margin: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-row > * {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-feed-column {
        order: 1 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-left-column {
        order: 2 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-right-column {
        display: none !important;
        order: 3 !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-directory-sticky-rail {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 575.98px) {
    body.frontend-unified-shell-v12.community-directory-page .community-directory-container {
        padding-right: 0;
        padding-left: 0;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-side-card {
        margin-right: 10px;
        margin-left: 10px;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-post,
    body.frontend-unified-shell-v12.community-directory-page .community-composer,
    body.frontend-unified-shell-v12.community-directory-page .community-empty-card,
    body.frontend-unified-shell-v12.community-directory-page .community-feed-loader {
        border-right: 0 !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.frontend-unified-shell-v12.community-directory-page .community-composer .card-body,
    body.frontend-unified-shell-v12.community-directory-page .community-post .card-body {
        padding-right: 14px !important;
        padding-left: 14px !important;
    }
}
