/* ── Page title (desktop + mobile) ─────────────────────────────────────── */

.tutors-title-wrap {
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem 1rem 0.85rem;
    gap: 0.85rem;
}

.tutors-title-wrap .tutors-title-accent {
    margin-left: auto;
    margin-right: auto;
}

.tutors-title-mark {
    width: 2.85rem;
    height: 2.85rem;
    color: #fff;
    background: #3A648A;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.tutors-title-mark--sm {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.4rem;
    font-size: 0.95rem;
}

.tutors-title-text {
    position: relative;
    line-height: 1;
    min-width: 0;
}

.tutors-title-kicker {
    color: #3A648A;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
}

.tutors-page-title {
    color: #21374C;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.tutors-title-wrap .tutors-page-title {
    font-size: 2rem;
    margin-top: 0.2rem;
}

.tutors-title-accent {
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.55rem;
    background: #3A648A;
    border-radius: 2px;
}

.tutors-mobile-title-row {
    display: flex;
    gap: 0.5rem;
}

.tutors-mobile-title .tutors-title-kicker {
    margin-bottom: 0.15rem;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
}

.tutors-mobile-title .tutors-page-title {
    font-size: 1.25rem;
}

/* ── Page layout (desktop sidebar vs mobile stack, CSS-breakpoint driven) ─ */
/* Both the desktop sidebar/filter-card markup and the mobile filter-bar/
   bottom-sheet markup are always rendered. Visibility is decided by a
   custom "filter-tier" breakpoint at 1024px — chosen because it needs to
   sit between Bootstrap's stock lg (992px, too low: the 350px sidebar
   would be cramped) and xl (1200px, too high: tablets like iPad landscape
   at 1024px have room for the sidebar). Card-column count is decided
   separately, by the "Card grid" breakpoints below, so a device can be in
   the 2-column tier while still showing either filter UI. */

.tutor-page-wrap {
    max-width: 100%;
    overflow-x: hidden;
}

.tutor-content-row {
    display: flex;
    flex-direction: column;
}

.tutor-results-col {
    min-width: 0;
    width: 100%;
}

.tutor-sidebar-col {
    display: none;
    width: 100%;
}

.tutor-mobile-explore-row {
    /* Visible by default via Bootstrap's .row (display: flex); hidden at the desktop filter tier below. */
}

@media (min-width: 1024px) {
    /* !important guards these against source-order accidents: several of
       these elements' own component rules (further down the file, e.g.
       .tutor-mobile-filter-bar) also set `display`, and without !important
       whichever declaration comes LAST in the file wins regardless of
       which media query it's in. */
    .tutors-title-wrap {
        display: flex !important;
    }

    .tutors-mobile-title-row,
    .tutor-mobile-filter-bar,
    .tutor-mobile-explore-row {
        display: none !important;
    }

    .tutor-content-row {
        flex-direction: row;
    }

    .tutor-results-col {
        flex: 1 1 auto;
    }

    .tutor-sidebar-col {
        display: block !important;
        flex: 0 0 350px;
        width: 350px;
    }
}

/* ── Card grid ──────────────────────────────────────────────────────────── */

.tutor-listing-grid {
    margin-left: 0;
    margin-right: 0;
}

.tutor-card-col {
    display: flex;
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

/* Each tutor renders both a desktop-styled and a mobile-styled card;
   only one is shown at a time, per the 1024px filter tier above. */
.tutor-card-col--mobile {
    display: flex;
}

.tutor-card-col--desktop {
    display: none;
}

@media (min-width: 1024px) {
    .tutor-card-col--mobile {
        display: none !important;
    }

    .tutor-card-col--desktop {
        display: flex !important;
    }
}

/* Ensure card fills its column */
.tutor-listing-grid .tutor-card-col .tutor-card,
.tutor-listing-grid .tutor-card-col .tutor-card-mobile {
    width: 100%;
}

/* Tablet and up: 2 cards per row */
@media (min-width: 768px) {
    .tutor-listing-grid .tutor-card-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Small-laptop and up: 3 cards per row */
@media (min-width: 1280px) {
    .tutor-listing-grid .tutor-card-col {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}

/* ── Tutor card (desktop) ───────────────────────────────────────────────── */

.tutor-card {
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tutor-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.tutor-card-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f1f3f5;
}

.tutor-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tutor-card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tutor-card-badge i {
    margin-right: 0.25rem;
}

.tutor-card-badge--sm {
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
}

.tutor-card-badge--verified {
    color: #155724;
    background-color: #D4EDDA;
    border: 1px solid #A3D9B1;
}

.tutor-card-badge--unverified {
    color: #856404;
    background-color: #FFF3CD;
    border: 1px solid #F3D98B;
}

.tutor-card-name {
    font-weight: 600;
    color: #21374C;
}

.tutor-card-title {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.tutor-card-meta {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 4.4rem;
}

.tutor-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #21374C;
    gap: 0.5rem;
}

.tutor-card-meta-row--third {
    color: #6c757d;
    font-size: 0.8rem;
}

.tutor-card-rating {
    color: #f5a623;
    font-weight: 600;
}

.tutor-card-experience,
.tutor-card-teaching-mode {
    color: #495057;
}

.tutor-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(33, 55, 76, 0.08);
}

.tutor-card-price {
    font-weight: 600;
    color: #21374C;
}

.tutor-card-cta {
    display: inline-flex;
    align-items: center;
}

/* ── Tutor card (mobile) ────────────────────────────────────────────────── */
/* Same top-photo layout as desktop, just narrower (single column). */

.tutor-card-mobile {
    display: flex;
    flex-direction: column;
}

.tutor-card-mobile-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f1f3f5;
}

.tutor-card-mobile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Mobile filter bar (tutor-scoped copy of the shared pill pattern) ────── */

.tutor-mobile-filter-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.65rem 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(33, 55, 76, 0.06);
    border-bottom: 1px solid rgba(33, 55, 76, 0.08);
    box-shadow: 0 2px 6px rgba(33, 55, 76, 0.06);
}

.tutor-mobile-filter-icon {
    width: 2.15rem;
    height: 2.15rem;
    margin-right: 0.5rem;
    color: #3A648A;
    background: rgba(58, 100, 138, 0.12);
    border: 1px solid rgba(58, 100, 138, 0.18);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tutor-mobile-filter-scroll {
    display: flex;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tutor-mobile-filter-scroll::-webkit-scrollbar {
    display: none;
}

.tutor-mobile-filter-scroll > * {
    margin-right: 0.5rem;
}

.tutor-mobile-filter-scroll > *:last-child {
    margin-right: 0;
}

.tutor-mobile-filter-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 4.75rem;
    max-width: 82vw;
    height: 2.2rem;
    padding: 0.35rem 2rem 0.35rem 0.85rem;
    color: #21374C;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem 0.75rem;
    border: 1px solid rgba(58, 100, 138, 0.22);
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

input.tutor-mobile-filter-select {
    background-image: none;
    padding-right: 0.85rem;
}

.tutor-mobile-filter-select:focus {
    color: #21374C;
    border-color: #3A648A;
    box-shadow: 0 0 0 0.15rem rgba(58, 100, 138, 0.18);
}

.tutor-mobile-filter-select.is-active {
    color: #fff;
    background-color: #3A648A;
    border-color: #3A648A;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

input.tutor-mobile-filter-select.is-active {
    background-image: none;
}

.tutor-mobile-filter-select::placeholder {
    color: inherit;
    opacity: 0.85;
}

.tutor-mobile-filter-reset {
    height: 2.2rem;
    padding: 0.35rem 0.9rem;
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    background: #6c757d;
    border: 1px solid #6c757d;
}

/* ── Mobile overflow safety net ────────────────────────────────────────── */

@media (max-width: 767.98px) {
    #paginationArea .pagination {
        flex-wrap: wrap;
        row-gap: 0.4rem;
    }
}

/* ────────────────────────────────────────────────────────────────────── */
/* Mobile Subject/Skill bottom sheet ───────────────────────────────────*/
.tutor-filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .tutor-filter-sheet.d-none {
        display: none !important;
    }

.tutor-filter-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(33, 55, 76, 0.45);
}

.tutor-filter-sheet__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.3rem;
    box-shadow: 0 6px 18px rgba(33, 55, 76, 0.15);
    /* Important: allow autocomplete to extend outside modal */
    overflow: visible;
}

.tutor-filter-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #21374C;
    background: #fff;
    border-bottom: 1px solid rgba(33, 55, 76, 0.08);
    border-radius: 0.3rem 0.3rem 0 0;
    flex-shrink: 0;
}

.tutor-filter-sheet__close {
    background: none;
    border: none;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}

.tutor-filter-sheet__body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    background: #fff;
    border-radius: 0 0 0.3rem 0.3rem;
    /* Important: don't clip autocomplete results */
    overflow: visible;
}
