/* Course search: results list + map, Yelp-style. Markup in
   templates/core/course_list.html, behaviour in static/js/course_search.js. */
.cs { --ground: #1a1917; --surface: #22211e; --raised: #2a2925; --line: rgba(255,255,255,.08);
      --text: #f2efe8; --muted: rgba(242,239,232,.62); --faint: rgba(242,239,232,.38); --gold: #fbbf24;
      --nav-h: 57px; --bar-h: 64px;
      color: var(--text); }

/* ── Search bar ──────────────────────────────────────────────────────────── */
.cs-bar { position: sticky; top: var(--nav-h); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
          padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: var(--bar-h); }
.cs-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 520px; background: var(--ground);
             border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 0 4px 0 12px; }
.cs-search:focus-within { border-color: rgba(251,191,36,.6); }
.cs-search svg { width: 17px; height: 17px; color: var(--faint); flex-shrink: 0; }
.cs-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 500 14px Inter, system-ui, sans-serif; padding: 10px 0; }
.cs-search input::placeholder { color: var(--faint); }
.cs-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.cs-go { background: var(--gold); color: #141414; border: 0; border-radius: 7px; padding: 7px 14px; font: 800 13px Inter, sans-serif; cursor: pointer; }
.cs-near, .cs-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); color: var(--muted);
                     font: 600 12.5px Inter, sans-serif; padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.cs-near svg { width: 15px; height: 15px; }
.cs-near:hover, .cs-chip:hover { border-color: rgba(255,255,255,.2); color: var(--text); }
.cs-near.is-on { color: #60a5fa; border-color: rgba(96,165,250,.5); }
.cs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #141414; }
.cs-sort { margin-left: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.cs-sort select { background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 600 12.5px Inter, sans-serif; padding: 6px 8px; }
.cs :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── List + map ──────────────────────────────────────────────────────────── */
/* The list stops growing at ~660px so wide screens give the extra room to the map. */
.cs-main { display: grid; grid-template-columns: minmax(400px, min(42%, 660px)) 1fr; }
.cs-list { min-width: 0; border-right: 1px solid var(--line); }
.cs-mapwrap { position: sticky; top: calc(var(--nav-h) + var(--bar-h)); height: calc(100dvh - var(--nav-h) - var(--bar-h)); }
.cs-map { position: absolute; inset: 0; background: #262624; }
.cs-head { padding: 22px 24px 8px; }
.cs-head h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.cs-count { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.cs-results { list-style: none; margin: 0; padding: 0 12px; }
.cs-row { border-bottom: 1px solid var(--line); }
.cs-rowlink { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 18px 12px; color: inherit; text-decoration: none; border-radius: 12px; }
.cs-row:hover .cs-rowlink, .cs-row.is-active .cs-rowlink { background: rgba(255,255,255,.035); }
.cs-row.is-active .cs-rowlink { box-shadow: inset 3px 0 0 var(--gold); }
.cs-photo { width: 150px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cs-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-photo.is-empty { background: var(--surface) var(--empty) center / 28% no-repeat; }
.cs-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cs-name { font-size: 16px; font-weight: 800; line-height: 1.3; }
.cs-n { color: var(--faint); font-weight: 700; }
.cs-rating { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cs-stars { position: relative; display: inline-block; width: 82px; height: 15px; background:
            linear-gradient(90deg, var(--gold) calc(var(--r) / 5 * 100%), rgba(255,255,255,.18) 0);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 82 15'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M7.5 0l2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4L3 13.8l.9-5L.3 5.3l5-.7z'/%3E%3Cuse href='%23s' x='16.6'/%3E%3Cuse href='%23s' x='33.2'/%3E%3Cuse href='%23s' x='49.8'/%3E%3Cuse href='%23s' x='66.4'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
                    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 82 15'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M7.5 0l2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4L3 13.8l.9-5L.3 5.3l5-.7z'/%3E%3Cuse href='%23s' x='16.6'/%3E%3Cuse href='%23s' x='33.2'/%3E%3Cuse href='%23s' x='49.8'/%3E%3Cuse href='%23s' x='66.4'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.cs-muted { color: var(--faint); font-weight: 600; }
.cs-meta { color: var(--muted); font-size: 13px; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cs-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.cs-tag.hot { background: rgba(251,146,60,.14); color: #fb923c; }
.cs-tag.tour { background: rgba(96,165,250,.12); color: #93c5fd; }
.cs-cta { margin-top: auto; padding-top: 6px; color: var(--gold); font-size: 13px; font-weight: 800; }
.cs-dist { color: #93c5fd; font-weight: 700; }
.cs-ask { margin: 12px 12px 4px; padding: 14px 16px; border-radius: 12px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
          color: var(--muted); font-size: 13.5px; line-height: 1.5; list-style: none; }
.cs-ask b { color: var(--text); }
.cs-ask a { color: var(--gold); font-weight: 800; text-decoration: none; margin-left: 4px; }
.cs-empty { padding: 28px 12px; color: var(--muted); }
.cs-empty a, .cs-browse a, .cs-pages a { color: var(--gold); text-decoration: none; font-weight: 700; }
.cs-pages { display: flex; gap: 14px; justify-content: center; align-items: center; padding: 24px; color: var(--faint); font-size: 13px; }
.cs-more { display: block; margin: 20px auto 4px; background: var(--raised); border: 1px solid rgba(255,255,255,.14); color: var(--text);
           font: 700 13px Inter, sans-serif; padding: 10px 18px; border-radius: 10px; cursor: pointer; }
.cs-more:hover { border-color: var(--gold); }
.cs-suggest { margin: 28px 24px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cs-suggest p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cs-suggest .cs-suggest-title { color: var(--text); font-size: 17px; font-weight: 900; margin-bottom: 6px; }
.cs-about { padding: 0 24px 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.cs-about h2 { color: var(--text); font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.cs-browse { padding: 8px 24px 32px; color: var(--faint); font-size: 12.5px; line-height: 1.8; }

/* ── Map pieces ──────────────────────────────────────────────────────────── */
.cs-follow { position: absolute; z-index: 500; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center;
             background: rgba(26,25,23,.92); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 7px 14px;
             font: 600 12.5px Inter, sans-serif; color: var(--text); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap; }
.cs-follow input { accent-color: var(--gold); margin: 0; }
.cs-redo { position: absolute; z-index: 501; top: 14px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #141414; border: 0;
           border-radius: 999px; padding: 9px 18px; font: 800 13px Inter, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
/* A street map turned dark: the look of the original staff map. */
.cs-tiles { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.9) saturate(.35); }
.cs-pinwrap { background: none; border: 0; }
.cs-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 2px solid #1a1917;
          box-shadow: 0 2px 6px rgba(0,0,0,.55); display: grid; place-items: center; transition: transform .12s ease, background .12s; }
.cs-pin span { transform: rotate(45deg); color: #141414; font: 800 11.5px Inter, sans-serif; font-variant-numeric: tabular-nums; }
.cs-pin.is-active { background: #fff; transform: rotate(-45deg) scale(1.3); }
.cs-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid #1a1917; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cs-cluster { width: 36px; height: 36px; border-radius: 10px; background: rgba(42,41,37,.95); border: 1.5px solid rgba(251,191,36,.6); color: var(--text);
              display: grid; place-items: center; font: 800 12.5px Inter, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,.55); }
.cs-me { width: 16px; height: 16px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59,130,246,.25); }
.cs-card .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; background: var(--surface); color: var(--text); border: 1px solid rgba(255,255,255,.14);
                                          border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.6); }
.cs-card .leaflet-popup-content { margin: 0; width: 280px !important; font: 14px/1.4 Inter, sans-serif; }
.cs-card .leaflet-popup-tip { background: var(--surface); border: 1px solid rgba(255,255,255,.14); }
.cs-cardphoto { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--raised) var(--empty) center / 18% no-repeat; }
.cs-cardphoto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-cardbody { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.cs-card .cs-name { font-size: 15px; }
.leaflet-control-attribution { background: rgba(26,25,23,.75) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.cs-sheet { position: absolute; z-index: 600; left: 12px; right: 12px; bottom: 14px; background: var(--surface); border: 1px solid rgba(255,255,255,.14);
            border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.cs-sheet a { display: grid; grid-template-columns: 110px 1fr; color: inherit; text-decoration: none; }
.cs-sheet .cs-cardphoto { aspect-ratio: auto; height: 100%; min-height: 110px; }
.cs-toggle { position: fixed; z-index: 700; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
             display: none; align-items: center; gap: 8px; background: #f2efe8; color: #141414; border: 0; border-radius: 999px; padding: 11px 20px;
             font: 800 14px Inter, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.5); cursor: pointer; }
.cs-toggle svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .cs-pin { transition: none; } }

/* ── Phones: list first, a Map button for a full-screen map ─────────────── */
@media (max-width: 860px) {
  .cs { --bar-h: 0px; }
  .cs-bar { position: static; padding: 12px 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cs-bar::-webkit-scrollbar { display: none; }
  .cs-search { flex: 0 0 min(78vw, 340px); }
  .cs-chips { flex-wrap: nowrap; }
  .cs-sort { margin-left: 0; }
  .cs-main { grid-template-columns: 1fr; }
  .cs-list { border-right: 0; padding-bottom: 80px; }
  .cs-mapwrap { display: none; }
  .cs.is-map .cs-mapwrap { display: block; position: fixed; z-index: 650; inset: var(--nav-h) 0 0 0; height: auto; top: var(--nav-h); }
  .cs.is-map .cs-list { display: none; }
  .cs-toggle[data-ready] { display: inline-flex; }
  /* On the map: the course card sits above the List button; pinch replaces the zoom buttons. */
  .cs-sheet { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .cs .leaflet-control-zoom { display: none; }
  .cs .leaflet-control-attribution { font-size: 9px; }
  .cs-rowlink { grid-template-columns: 104px 1fr; gap: 14px; padding: 16px 6px; }
  .cs-photo { width: 104px; }
  .cs-name { font-size: 15px; }
  .cs-head { padding: 18px 16px 4px; }
  .cs-results { padding: 0 10px; }
  .cs-suggest { margin: 24px 16px; }
  .cs-about, .cs-browse { padding-left: 16px; padding-right: 16px; }
}
