/* css/discover.css */
/* discover.css: club discovery (home strip, /clubs), global search (/search),
   Saved (/saved) and the Following tab's post cards. Uses the design tokens
   only, so every look (Afterglow, Lite, Punch) carries it. */

/* ---------- the search field link (home and page topbars) ---------- */
.search-pill {
  display: inline-flex; align-items: center; gap: 10px; height: var(--hit); padding: 0 12px; flex: none;
  border-radius: var(--r-pill); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  transition: color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.search-pill:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.search-pill svg { flex: none; }
@media (max-width: 639px) { .search-pill { width: var(--hit); padding: 0; justify-content: center; background: transparent; box-shadow: none; color: var(--text); } }
@media (min-width: 640px) { .search-pill { min-width: 240px; } }
.topbar .search-pill + .icon-btn, .topbar .search-pill + .btn { margin-left: 4px; }

/* ---------- "Clubs for you" strip on home (shares app.js's .club-strip arrows) ---------- */
.dc-strip .dc-strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 var(--gutter); margin-bottom: 8px; }
@media (min-width: 640px) { .dc-strip .dc-strip-head { padding: 0; } }
.dc-strip-all { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--accent-text); }
.dc-strip-all:hover { text-decoration: underline; }
.dc-strip .strip-arrow { top: calc(50% + 14px); }
.dc-tile {
  flex: 0 0 264px; scroll-snap-align: start; display: grid; grid-template-rows: 156px auto; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border);
}
.dc-tile-cover {
  grid-row: 1; grid-column: 1; position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 10px 12px; color: #fff; background-size: cover; background-position: center; overflow: hidden;
}
.dc-tile-cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.7) 100%); }
.dc-tile-name { font: 400 17px/1.15 var(--font-display); text-shadow: 0 1px 10px rgba(0,0,0,.5); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px 76px; min-height: 52px; }
.dc-tile .dc-tile-icon { width: 48px !important; height: 48px !important; margin: 0 0 -24px 14px; border-radius: 14px !important; }
:root[data-look] .club-icon.club-mono.dc-tile-icon, :root .club-icon.club-mono.dc-tile-icon { font-size: 17px !important; }
.dc-tile-foot .btn { flex: none; }
.dc-tile:hover .dc-tile-cover { filter: saturate(1.1) brightness(1.05); }
.dc-strip .dc-more { flex: 0 0 132px !important; height: auto !important; min-height: 150px; border-radius: var(--r-lg) !important; }

.dc-live {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(10,10,14,.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.dc-meta { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- /clubs and the search page ---------- */
.dc-main > :not(.topbar) { margin-left: var(--gutter); margin-right: var(--gutter); }
@media (min-width: 640px) { .dc-main > :not(.topbar) { margin-left: 0; margin-right: 0; } }
.dc-main .topbar .btn span { white-space: nowrap; }
@media (max-width: 639px) { .dc-main .topbar .btn-strong span { display: none; } .dc-main .topbar .btn-strong { width: var(--hit); padding: 0; justify-content: center; } }
.dc-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: var(--sp-5) 0 var(--sp-3); }
.dc-sec-title { font: 400 var(--fs-xl)/1.15 var(--font-display); margin: 0; }
.dc-sec-head p { margin: 2px 0 0; font-size: var(--fs-sm); }
.dc-section { margin-bottom: var(--sp-5); }
.dc-section > .dc-sec-title { margin: var(--sp-5) 0 var(--sp-3); }

.dc-topics { margin-top: var(--sp-4) !important; }

.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: var(--sp-5) var(--sp-4); }
@media (max-width: 560px) { .dc-grid { grid-template-columns: 1fr; gap: var(--sp-4); } }
.dc-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
@media (hover: hover) { .dc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--border-strong); } }
.dc-cover {
  position: relative; isolation: isolate; aspect-ratio: 16 / 9; display: flex; align-items: flex-start; padding: 12px;
  background-size: cover; background-position: center; grid-row: 1; grid-column: 1;
}
.dc-cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0) 45%, rgba(0,0,0,.25)); }
.dc-body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: 34px 18px 16px; min-width: 0; }
/* the club's icon sits on the photo's bottom edge, like a profile picture on its banner */
.dc-icon, .mc-icon {
  grid-row: 1; grid-column: 1; align-self: end; justify-self: start; z-index: 1;
  width: 56px !important; height: 56px !important; margin: 0 0 -26px 16px; border-radius: 16px !important;
  outline: 3px solid var(--surface);
}
.dc-name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-name a:hover { text-decoration: underline; }
.dc-about { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-foot { display: flex; align-items: center; gap: 4px; margin-top: 8px; min-width: 0; }
.dc-tags { flex: 1; min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.dc-tag { font-size: var(--fs-xs); color: var(--accent-text); white-space: nowrap; font-weight: var(--fw-semi); }
.dc-tag:hover { text-decoration: underline; }
.dc-save { width: 36px; height: 36px; color: var(--muted); }
@media (max-width: 560px) {
  .dc-body { padding: 32px 16px 14px; }
}

/* ---------- /search ---------- */
.search-form { position: relative; min-width: 0; }
.search-field {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted);
}
.search-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--primary), 0 0 0 4px var(--accent-wash); color: var(--text); }
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); outline: none; }
.search-field input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--border); max-height: 70vh; overflow-y: auto;
}
.sg-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); min-width: 0; }
.search-suggest .is-active .sg-row, .sg-row:hover { background: var(--surface-2); }
.sg-thumb { width: 40px; height: 40px; flex: none; border-radius: 10px; background-size: cover; background-position: center; background-color: var(--surface-3); }
.sg-text { flex: 1; display: grid; min-width: 0; }
.sg-text b, .sg-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-sub { font-size: var(--fs-xs); color: var(--muted); }
.sg-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.sg-all { justify-content: center; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--accent-text); }
.search-jump { margin-top: var(--sp-3) !important; }
.search-hello { margin-top: var(--sp-6) !important; }
.search-people .row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------- /saved ---------- */
.saved-intro { margin-top: var(--sp-1) !important; font-size: var(--fs-sm); }
.saved-jump { margin: var(--sp-3) 0 !important; }
.saved-sec { margin: var(--sp-5) 0 0; }
.saved-sec .section-title { margin-bottom: var(--sp-2); }
.saved-pinned .rows { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--accent-wash); }
.saved-row .row { display: flex; align-items: center; gap: 12px; }
.saved-row .grow { min-width: 0; display: grid; }
.saved-row .title { font-weight: var(--fw-semi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-row .sub { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-thumb { flex: none; }
.saved-thumb .cover { display: block; width: 64px; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; }
.saved-thumb .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.saved-thumb .mesh-chip { width: 48px; height: 48px; border-radius: 12px; background-size: cover; background-position: center; font-size: 16px; }
.saved-pin { color: var(--muted); }
.saved-pin[aria-pressed="true"] { color: var(--accent-text); }
.saved-pin[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Following tab: a post by someone you follow ---------- */
.post-card { padding: 14px 16px 10px; }
.post-card .pc-by { display: flex; align-items: center; gap: 12px; }
.post-card .who { display: grid; min-width: 0; }
.post-card .meta { font-size: var(--fs-xs); color: var(--muted); }
.post-card .meta a { color: var(--text); font-weight: var(--fw-semi); }
.post-body { display: block; margin: 10px 0 4px; font-size: var(--fs-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.post-foot { display: flex; justify-content: flex-end; }

/* Browse, search and Saved have no side column: use the width, centred. */
@media (min-width: 1000px) {
  :is(.page-clubs, .page-search) .shell { grid-template-columns: minmax(0, 1040px); }
  .page-saved .shell { grid-template-columns: minmax(0, 760px); }
}
.search-field input:focus, .search-field input:focus-visible { outline: none; box-shadow: none; }
.post-more { margin-top: 0; padding-top: 6px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); -webkit-line-clamp: 3; }

/* Home: "Finish setting up" while a new account's welcome steps wait (onboard.go). */
.onboard-resume { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg); color: #fff; text-decoration: none; box-shadow: var(--shadow-pop, none);
  /* A light veil over the gradient keeps the white text readable on its orange end (light themes). */
  background: linear-gradient(rgba(20, 8, 40, .16), rgba(20, 8, 40, .16)), var(--pop-grad); text-shadow: 0 1px 2px rgba(20, 8, 40, .25); }
.onboard-resume:hover { filter: brightness(1.04); }
.onboard-resume:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.onboard-resume b { display: block; }
.onboard-resume .sub { display: block; font-size: var(--fs-sm); }

/* Your areas (region clubs, round 019): first, ringed in the area's colour. */

/* Suggestions from the matching engine (recs_serve.go): "Not interested"
   on a tile or card, and the plain reason on a card. */
.dc-tile { position: relative; }
.dc-tile .rec-x {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px;
  color: #fff; background: rgb(0 0 0 / .35); border-radius: 999px;
}
.dc-tile .rec-x:hover, .dc-tile .rec-x:focus-visible { background: rgb(0 0 0 / .55); }
.dc-card .rec-x { color: var(--faint); }
.dc-why { margin: 0; font-size: var(--fs-sm); }
.about-like { margin-top: var(--sp-2); }
.people-list .rec-x { color: var(--faint); flex: none; }

/* ---------- /clubs tabs: Discover | My clubs (real URLs, Back works) ---------- */
.clubs-tabs { display: flex; gap: 6px; margin-top: var(--sp-3) !important; border-bottom: 1px solid var(--border); }
.clubs-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin-bottom: -1px;
  font-weight: var(--fw-semi); color: var(--muted); border-bottom: 2px solid transparent;
}
.clubs-tab:hover { color: var(--text); }
.clubs-tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent, var(--primary)); }
.clubs-tab-n { font-size: var(--fs-xs); color: var(--faint); font-weight: var(--fw-medium); }

/* ---------- My clubs: big cards, the wallpaper big and the icon on its edge ---------- */
.my-clubs { margin-top: var(--sp-4) !important; }
.my-clubs-note { color: var(--muted); margin: 0 0 var(--sp-4); }
.my-clubs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: var(--sp-4); }
.my-clubs-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.my-clubs-search .input, .my-clubs-search .input:focus { border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0; padding-left: 0; height: 42px; flex: 1; min-width: 0; }
.my-clubs-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent, var(--primary)); }
.my-clubs-sort { display: inline-flex; gap: 6px; }
.my-clubs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: var(--sp-5) var(--sp-4); }
@media (max-width: 560px) { .my-clubs-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-3); } }
.mc-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
@media (hover: hover) { .mc-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--border-strong); } }
.mc-card.is-area { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--area, var(--primary)) 70%, transparent); }
.mc-cover { grid-row: 1; grid-column: 1; aspect-ratio: 16 / 9; background-size: cover; background-position: center; position: relative; display: flex; justify-content: flex-end; align-items: flex-start; padding: 10px; }
.mc-unread { position: static; }
.mc-body { padding: 34px 16px 16px; min-width: 0; }
.mc-name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-name a::after { content: ""; position: absolute; inset: 0; } /* the whole card opens the club */
.mc-meta { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .mc-icon { width: 44px !important; height: 44px !important; margin: 0 0 -20px 12px; border-radius: 13px !important; }
  .mc-body { padding: 26px 12px 12px; }
  .mc-name { font-size: var(--fs-sm); }
  .mc-meta { font-size: var(--fs-xs); }
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: var(--sp-5) 0 !important; }
.dc-tile .dc-tile-cover { padding-bottom: 30px; }

