/* Meet-offline hub — /courses/meet-offline
   Design-system tokens only. No new palette. */

.mo-layout {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px 64px;
    font-family: var(--font-family);
}

/* ── Hero ── */
.mo-hero { padding: 44px 0 28px; }
.mo-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--primary);
}
.mo-h {
    font-size: clamp(24px, 3.6vw, 33px);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--gray-900);
    margin: 11px 0 10px;
    text-wrap: balance;
}
.mo-p {
    color: var(--gray-700);
    font-size: 15px;
    line-height: var(--leading-relaxed, 1.7);
    max-width: 62ch;
    margin: 0;
}
.mo-p a, .mo-signin a { color: var(--primary); font-weight: 600; text-decoration: none; }
.mo-p a:hover, .mo-signin a:hover { text-decoration: underline; }

/* ── Filters ── */
/* Zero-height marker sitting just above the bar. While it is scrolled out of
   view the bar is floating, which is how the shadow below knows to appear. */
.mo-filters-top { height: 1px; }

/* Sticks below the site header, matching the convention page-community.css
   already uses for its own filter bar (top: var(--header-height)). */
.mo-filters {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 18px;
    position: sticky;
    top: calc(var(--header-height, 56px) + 8px);   /* JS overrides with the measured header height */
    z-index: 20;
    transition: box-shadow var(--transition-fast, .18s ease), border-color var(--transition-fast, .18s ease);
}
.mo-filters.is-stuck {
    box-shadow: 0 6px 20px rgba(15, 23, 42, .10);
    border-color: var(--gray-300, #D1D5DB);
}
@media (prefers-reduced-motion: reduce) { .mo-filters { transition: none; } }
.mo-search { position: relative; flex: 1; min-width: 200px; }
.mo-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}
.mo-search input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 13.5px;
    padding: 9px 11px 9px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    color: var(--gray-900);
    background: var(--white);
}
.mo-filters select {
    font: inherit;
    font-size: 13px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    background: var(--white);
    color: var(--gray-900);
    cursor: pointer;
}
.mo-search input:focus, .mo-filters select:focus, .mo-form input:focus, .mo-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.mo-clear { font-size: 12.5px; color: var(--gray-500); text-decoration: none; }
.mo-clear:hover { color: var(--gray-900); text-decoration: underline; }

.mo-btn {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--gray-900);
    cursor: pointer;
}
.mo-btn:hover { border-color: var(--primary); color: var(--primary); }
.mo-btn-go { background: var(--primary); border-color: transparent; color: #fff; }
.mo-btn-go:hover { background: var(--primary-dark, #1D4ED8); color: #fff; }
.mo-btn-go:disabled { opacity: .6; cursor: default; }
.mo-btn-ghost { color: var(--gray-500); }

/* ── Create ── */
.mo-create { margin-bottom: 18px; }
/* Rendered as a <button> for signed-in users and an <a> to sign-in for guests,
   so both look identical — a guest has to SEE the action before being told it
   needs an account. */
.mo-create-open {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg, 12px);
    background: none;
    color: var(--gray-500);
    cursor: pointer;
}
.mo-create-open:hover { border-color: var(--primary); color: var(--primary); }
.mo-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 16px;
}
.mo-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 11px;
    margin-bottom: 11px;
}
.mo-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}
.mo-form input, .mo-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    font: inherit;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    color: var(--gray-900);
    background: var(--white);
    resize: vertical;
}
.mo-opt { font-weight: 500; color: var(--gray-400); }
.mo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mo-form-actions { display: flex; gap: 9px; margin-top: 12px; }
.mo-note { font-size: 11.5px; color: var(--gray-400); margin: 9px 0 0; }
.mo-signin { font-size: 12.5px; color: var(--gray-500); margin: 0 0 16px; line-height: 1.5; text-align: center; }

.mo-msg { font-size: 13px; margin: 0 0 14px; font-weight: 600; }
.mo-msg:empty { margin: 0; }
.mo-msg.ok  { color: #047857; }
.mo-msg.err { color: var(--accent-hover, #B45309); }

/* ── List ── */
.mo-city {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin: 22px 0 11px;
    display: flex;
    align-items: center;
    gap: 9px;
}
.mo-city:first-child { margin-top: 0; }
.mo-city-mine {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--primary);
    background: var(--primary-light, #DBEAFE);
    padding: 2px 9px;
    border-radius: 9999px;
}

/* Two per row. Each city gets its own grid so the "alone on the row" rule below
   is a plain :last-child:nth-child(odd) — with one shared grid the city headers
   would count as children and break that sum. */
.mo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
/* An odd last card would leave a hole, so it takes the whole row instead. */
.mo-grid .mo-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.mo-card {
    display: flex;
    gap: 14px;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 0;
    background: var(--white);
    overflow: hidden;
    min-width: 0;
}

/* ── Map preview ── */
.mo-map {
    flex: 0 0 112px;
    position: relative;
    background: #E8EEF4;
    overflow: hidden;
    text-decoration: none;
}
.mo-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mo-map-none {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 10.5px;
    line-height: 1.4;
    padding: 8px;
}
.mo-map-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -60%);
    color: #B91C1C;
    font-size: 17px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35));
}
.mo-map-attr {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 8px;
    line-height: 1.3;
    color: #4B5563;
    background: rgba(255, 255, 255, .82);
    padding: 1px 4px;
}
.mo-card.is-flagged { opacity: .55; background: var(--gray-50, #F9FAFB); }
.mo-card-main { flex: 1; min-width: 0; padding: 14px 4px 14px 0; }
.mo-place { font-size: 15.5px; font-weight: 700; margin: 0 0 5px; line-height: 1.3; }
.mo-place a { color: var(--gray-900); text-decoration: none; }
.mo-place a:hover { color: var(--primary); }
.mo-ext { font-size: 10px; color: var(--gray-400); margin-left: 3px; vertical-align: 1px; }
/* Time leads at 20px; the date supports it. It used to be 13px grey and was
   the single hardest thing to read on the card. */
.mo-when { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.mo-time { font-size: 20px; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mo-date { font-size: 13.5px; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.mo-rel  { font-size: 12px; color: var(--gray-400); }
.mo-desc { font-size: 13.5px; color: var(--gray-700); line-height: 1.55; margin: 8px 0 0; }
.mo-by { font-size: 12.5px; color: var(--gray-500); line-height: 1.5; margin: 9px 0 0; }
.mo-by strong { color: var(--gray-900); font-weight: 700; }
.mo-people { margin-top: 9px; }
.mo-people-t { font-size: 12.5px; color: var(--gray-500); }
.mo-people-t b { color: var(--gray-900); font-weight: 700; }
.mo-flagged { font-size: 12px; font-weight: 700; color: var(--accent-hover, #B45309); margin-top: 8px; }

.mo-card-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 7px;
    min-width: 118px;
    padding: 14px 14px 14px 0;
}
.mo-tally { text-align: center; line-height: 1.15; margin-bottom: 2px; }
.mo-tally-n { display: block; font-size: 21px; font-weight: 800; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.mo-tally-l { display: block; font-size: 11px; color: var(--gray-500); }
.mo-tally-anon { display: block; font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.mo-go {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    cursor: pointer;
}
.mo-go:hover { background: var(--primary); color: #fff; }
.mo-go.is-on { background: #047857; border-color: #047857; color: #fff; }
.mo-no {
    font-size: 11px;
    padding: 6px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border);
    background: none;
    color: var(--gray-400);
    cursor: pointer;
}
.mo-no:hover { color: var(--error, #B91C1C); border-color: var(--error, #B91C1C); }

.mo-empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--gray-500);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg, 12px);
}
.mo-empty i { font-size: 22px; color: var(--primary); display: block; margin-bottom: 10px; }
.mo-empty p { margin: 0; font-size: 14px; }

.mo-btn:focus-visible, .mo-go:focus-visible, .mo-no:focus-visible,
.mo-create-open:focus-visible, .mo-clear:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .mo-card { flex-direction: column; gap: 0; }
    .mo-map { flex: 0 0 96px; width: 100%; }
    .mo-card-main { padding: 13px 14px 0; }
    .mo-card-side { flex-direction: row; align-items: center; width: 100%; padding: 12px 14px 13px; }
    .mo-tally { text-align: left; margin: 0 auto 0 0; }
    .mo-tally-n { display: inline; font-size: 17px; }
    .mo-tally-l, .mo-tally-anon { display: inline; margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .mo-btn, .mo-go, .mo-no, .mo-create-open { transition: none; }
}

/* ── Lazy scroll sentinel ── */
.mo-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 22px;
    font-size: 13px;
    color: var(--gray-400);
}
.mo-more[hidden] { display: none; }
.mo-more-spin {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: moSpin .7s linear infinite;
}
@keyframes moSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mo-more-spin { animation: none; } }

/* One column once two would be cramped. */
@media (max-width: 720px) {
    .mo-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Maps-link preview inside the create form ── */
.mo-prev {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    margin-bottom: 11px;
    background: var(--gray-50, #F9FAFB);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
}
.mo-prev[hidden] { display: none; }
.mo-prev-map {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    border-radius: 6px;
    object-fit: cover;
    background: var(--gray-100);
}
.mo-prev-map:not([src]) { visibility: hidden; }
.mo-prev-txt { font-size: 12.5px; color: var(--gray-500); line-height: 1.5; }
.mo-prev-txt.ok  { color: #047857; font-weight: 600; }
.mo-prev-txt.err { color: var(--accent-hover, #B45309); font-weight: 600; }

/* ── "N people near you are studying" row, above the invite button ── */
/* Presence bar and invite button share one row. The bar flexes, the button
   keeps its natural width; below ~640px they stack. */
.mo-topline {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
/* With no presence bar the button is alone and takes the full width, exactly
   as it did before this row existed. */
.mo-topline > .mo-create-open:only-child { flex: 1 1 100%; }
.mo-topline > .mo-create-open {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.mo-people-bar {
    flex: 1 1 340px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 15px;
    background: var(--primary-light, #DBEAFE);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-lg, 12px);
}
.mo-people-faces { display: flex; align-items: center; flex: 0 0 auto; }
.mo-pf {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--white);
    margin-right: -8px;
    flex: 0 0 auto;
    object-fit: cover;
    background: var(--gray-100);
}
.mo-pf-i {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.mo-pf-more { background: var(--white); color: var(--primary); font-size: 10.5px; font-weight: 800;
              display: grid; place-items: center; }
.mo-people-bar-t { font-size: 13.5px; color: var(--gray-700); line-height: 1.5; flex: 1; min-width: 180px; }
.mo-people-bar-t b { color: var(--gray-900); font-weight: 800; }
.mo-people-bar-t a { color: var(--primary); font-weight: 700; text-decoration: none; }
.mo-people-bar-t a:hover { text-decoration: underline; }

/* The headline count itself */
.mo-h-n { color: var(--primary); }
/* Guests see a crowd, not people: no initial, no name, no face. */
.mo-pf-ghost {
    display: grid;
    place-items: center;
    background: #93B4F5;
    color: var(--white);
    font-size: 11px;
}

@media (max-width: 640px) {
    /* Stacked: the button goes full width again rather than sitting narrow. */
    .mo-topline > .mo-create-open { flex: 1 1 100%; }
    .mo-people-bar { flex: 1 1 100%; }
}

/* ── Filter bar: one row on phones ─────────────────────────────────────────
   The bar had no mobile rules at all — one flex-wrap layout served every
   width, so at 390px the four controls wrapped onto three rows (168px, 20% of
   the screen) with the 57px submit button alone on the last one.

   Desktop is deliberately untouched: .mo-filters-row and .mo-filter-adv use
   display:contents there, so the search box, both selects and the button stay
   direct flex children of .mo-filters exactly as before. */
.mo-filters-row,
.mo-filter-adv { display: contents; }

.mo-filter-toggle { display: none; }   /* phones only */

.mo-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: -8px 0 16px; }
.mo-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8;
    font-size: 12px; font-weight: 700; text-decoration: none; line-height: 1.4;
}
.mo-chip:hover { background: #DBEAFE; }
.mo-chip i { font-size: 10px; opacity: .8; }

@media (max-width: 640px) {
    .mo-filters { padding: 9px; gap: 0; }

    /* Search and the filter button share one row. */
    .mo-filters-row { display: flex; gap: 8px; align-items: center; width: 100%; }
    .mo-search { flex: 1 1 auto; min-width: 0; }   /* min-width:200px would force a wrap */

    .mo-filter-toggle {
        display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
        padding: 10px 13px; border-radius: 9px;
        background: var(--white); border: 1px solid var(--border);
        color: var(--gray-700, #374151);
        font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
    }
    .mo-filter-toggle[aria-expanded="true"] {
        background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8;
    }
    .mo-filter-n {
        background: var(--primary, #2563EB); color: #fff;
        border-radius: 999px; font-size: 10px; font-weight: 800;
        padding: 1px 6px; font-variant-numeric: tabular-nums;
    }

    /* The selects only exist once the reader asks for them. */
    .mo-filter-adv { display: none; }
    .mo-filter-adv.is-open {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        width: 100%; margin-top: 8px;
    }
    .mo-filter-adv select { width: 100%; min-width: 0; }
    /* JS auto-submits on change, so the button is dead weight on a phone —
       kept in the DOM for no-JS, hidden from the layout. */
    .mo-filter-adv .mo-btn-submit { display: none; }
    .mo-filter-adv .mo-clear { grid-column: 1 / -1; text-align: center; padding: 4px 0; }

    .mo-chips { margin: 10px 0 14px; }
}

/* Visually hidden but read aloud. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
