/* Home page v2 - docs/design/pages-h/W1_Home.html (desktop) and W1_Home_m.html (phones), visual system H.
   Depends on tokens.css + components.css (+ theme-velvet.css). Colours are tokens only. Phones (<= 900px): two city
   cards, two comments, the search stacks, and a bottom tab bar (.cg-htabs) joins the header. */

.cg-home { display: block; padding-bottom: 64px; }

/* ---- Headings (Instrument Serif italic, large sizes only) ------------------------------------------- */
.cg-hh1 { font: italic var(--w-regular) 66px/1 var(--font-display); letter-spacing: -.015em; max-width: 860px; }
.cg-hh2 { font: italic var(--w-regular) 42px/1.05 var(--font-display); }
[data-theme="velvet"] .cg-hh1, [data-theme="velvet"] .cg-hh2, [data-theme="velvet"] .cg-hcity__name,
[data-theme="velvet"] .cg-hcity__stat strong { color: var(--heading); }

/* ---- Hero ---------------------------------------------------------------------------------------------- */
.cg-hhero__in { display: flex; flex-direction: column; align-items: center; gap: 26px; text-align: center; padding-block: 60px 52px; }
.cg-hlive { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--live-tint); color: var(--on-live); font-size: 14px; font-weight: var(--w-strong); }
.cg-hlive i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--live-dot); }
.cg-hlead { margin: 0; max-width: 640px; font-size: 18px; line-height: 1.55; color: var(--ink-muted); }

.cg-hsearch { width: 100%; max-width: 700px; display: flex; flex-direction: column; gap: 8px; }
.cg-hsearch__box { position: relative; display: flex; align-items: center; gap: 8px; height: 66px; padding: 0 8px 0 24px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow-map); color: var(--ink-caption); }
.cg-hsearch__box:focus-within { border-color: var(--accent); }
.cg-hsearch__ic { flex: none; display: inline-flex; }
.cg-hsearch__box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: var(--w-strong) 17px/1 var(--font-sans); color: var(--ink); outline: none; }
.cg-hsearch__box input::placeholder { color: var(--ink-caption); font-weight: var(--w-regular); opacity: 1; }
.cg-body .cg-hsearch__loc { flex: none; height: 50px; font-size: 15px; }
.cg-body .cg-hsearch__go { flex: none; height: 50px; font-size: 16px; }
.cg-body .cg-hsearch__loc--below { display: none; }
.cg-hsearch__list { text-align: left; }

.cg-hpop { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 15px; }
.cg-hpop__lab { padding-right: 4px; color: var(--ink-muted); font-weight: var(--w-strong); }
.cg-body .cg-hpop a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--surface);
  border: 1px solid var(--border); color: var(--ink); font-weight: var(--w-strong); white-space: nowrap; }
.cg-body .cg-hpop a:hover { background: var(--surface-warm); }

/* ---- Latest comments band ------------------------------------------------------------------------------ */
.cg-hticker { background: var(--surface-warm); border-block: 1px solid var(--surface-divider); }
.cg-hticker__in { display: flex; align-items: center; gap: 30px; min-height: 52px; overflow: hidden; white-space: nowrap; font-size: 14px; color: var(--ink-muted); }
.cg-hticker__lab { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: var(--w-strong); }
.cg-hticker__lab i { width: 8px; height: 8px; border-radius: 50%; background: var(--live-dot); }
.cg-hticker__item { flex: none; }
.cg-body .cg-hticker__item a { font-weight: var(--w-strong); }
.cg-hticker__item time { color: var(--ink-caption); }

/* ---- Sections ------------------------------------------------------------------------------------------ */
.cg-hsec { padding-top: 60px; }
.cg-hsec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.cg-hsec__head--base { align-items: baseline; justify-content: flex-start; gap: 6px 16px; }
.cg-hsec__title { display: flex; flex-direction: column; gap: 6px; }
.cg-hsec__sub { font-size: 15px; color: var(--ink-muted); }
.cg-body a.cg-hmore { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: var(--w-strong); white-space: nowrap; }

/* ---- Popular cities (text cards: no photos to show, so no placeholder images) --------------------------- */
.cg-hcities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 24px; align-items: start; }
.cg-body a.cg-hcity { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); min-width: 0; }
.cg-body a.cg-hcity:hover { background: var(--surface-warm); color: var(--ink); }
.cg-hcity__top { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cg-hcity__name { font: italic var(--w-regular) 36px/1.05 var(--font-display); overflow-wrap: anywhere; }
.cg-hcity__country { font-size: 14px; font-weight: var(--w-strong); color: var(--ink-caption); }
.cg-hcity__stat { display: inline-flex; align-items: baseline; gap: 8px; align-self: flex-start; padding: 9px 16px 8px; border-radius: var(--radius-m); background: var(--surface-warm); }
.cg-hcity__stat strong { font: italic var(--w-regular) 30px/1 var(--font-display); }
.cg-hcity__stat em { font-style: normal; font-size: 14px; font-weight: var(--w-strong); color: var(--ink-muted); }
.cg-hcity__q { font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.cg-hcity__q time { color: var(--ink-caption); white-space: nowrap; }

/* ---- Why members see more -------------------------------------------------------------------------------- */
.cg-hwhy { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.cg-hpitch { grid-column: span 5; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 36px; border-radius: var(--radius-xxl); background: var(--surface-warm); }
.cg-hpitch__eyebrow { font-size: 15px; font-weight: var(--w-strong); color: var(--ink-muted); }
.cg-hpitch p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-muted); }
.cg-hpitch p strong { color: var(--ink); }
.cg-hchecks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--ink); }
.cg-hchecks li { display: flex; align-items: center; gap: 10px; }
.cg-hchecks li span { flex: none; display: inline-flex; color: var(--live); }
.cg-hpitch__acts { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.cg-body .cg-hpitch .cg-btn--soft { background: var(--surface); }
.cg-body .cg-hpitch .cg-btn--soft:hover { background: var(--surface-warm-strong); }
.cg-hfeats { grid-column: span 7; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cg-hfeat { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius-xl); background: var(--surface); }
.cg-hfeat strong { font-size: 18px; }
.cg-hfeat p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-muted); }
.cg-hfeat__ic { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-warm-strong); color: var(--ink); }
.cg-hfeat__ic--live { background: var(--live-tint); }
.cg-hfeat__ic--live i { width: 12px; height: 12px; border-radius: 50%; background: var(--live-dot); }

/* ---- Browse cities + sponsored ---------------------------------------------------------------------------- */
.cg-hbrowse { display: flex; gap: 28px; align-items: flex-start; }
.cg-hbrowse__main { flex: 1; min-width: 0; }
.cg-hbrowse__ad { flex: none; width: 300px; }
.cg-hbrowse__ad--solo { margin-inline: auto; }
.cg-hlist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 26px; margin-top: 20px; font-size: 15px; }
.cg-body .cg-hlist a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--ink); font-weight: var(--w-strong); min-width: 0; }
.cg-hlist__name { min-width: 0; display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-hlist__name small { font-size: 13px; font-weight: var(--w-regular); color: var(--ink-caption); overflow: hidden; text-overflow: ellipsis; }
.cg-hlist__n { flex: none; color: var(--ink-caption); font-weight: var(--w-regular); }
.cg-body .cg-hlist a:hover .cg-hlist__name { text-decoration: underline; text-decoration-color: var(--accent); }
.cg-body .cg-hlist a.cg-hlist__all { color: var(--link); }
@media (max-width: 1180px) {
  .cg-hlist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Bottom tab bar (phones) -------------------------------------------------------------------------------- */
.cg-htabs { display: none; }

@media (max-width: 1000px) {
  .cg-hwhy { grid-template-columns: minmax(0, 1fr); }
  .cg-hpitch, .cg-hfeats { grid-column: auto; }
  .cg-hcities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cg-hbrowse { flex-direction: column; align-items: stretch; }
  .cg-hbrowse__ad { width: 100%; max-width: 300px; margin-inline: auto; }
  .cg-hlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cg-home { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .cg-hh1 { font-size: 46px; }
  .cg-hh2 { font-size: 30px; }
  .cg-hhero__in { align-items: stretch; text-align: left; gap: 14px; padding-block: 12px 22px; }
  .cg-hlive { align-self: flex-start; font-size: 13px; padding: 4px 12px; white-space: normal; }
  .cg-hlead { font-size: 16px; }
  .cg-hsearch { max-width: none; }
  .cg-hsearch__box { height: 56px; padding: 0 5px 0 16px; gap: 10px; }
  .cg-hsearch__box input { font-size: 16px; }
  .cg-body .cg-hsearch__go { height: 44px; padding: 0 20px; font-size: 15px; }
  .cg-body .cg-hsearch__loc--in { display: none; }
  .cg-body .cg-hsearch__loc--below { display: inline-flex; height: 48px; font-size: 15px; }
  .cg-body .cg-hsearch__loc--below[hidden] { display: none !important; }
  .cg-hpop { justify-content: flex-start; gap: 6px; font-size: 14px; }
  .cg-hpop__lab { display: none; }
  .cg-body .cg-hpop a { padding: 0 15px; }
  .cg-hticker__in { flex-direction: column; align-items: flex-start; gap: 0; padding-block: 12px 4px; min-height: 0; }
  .cg-hticker__item { display: block; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 44px; }
  .cg-hticker__item:nth-of-type(n+3) { display: none; }
  .cg-hsec { padding-top: 22px; }
  .cg-hsec__head { align-items: baseline; flex-wrap: nowrap; }
  .cg-hsec__title .cg-hsec__sub { display: none; }
  .cg-hcities { margin-top: 12px; gap: 10px; }
  .cg-hcity:nth-child(n+5) { display: none; }
  .cg-body a.cg-hcity { padding: 16px; gap: 10px; border-radius: var(--radius-l); }
  .cg-hcity__name { font-size: 28px; }
  .cg-hcity__q { display: none; }
  .cg-hcity__stat { padding: 7px 12px 6px; }
  .cg-hcity__stat strong { font-size: 24px; }
  .cg-hpitch { padding: 20px; border-radius: var(--radius-xl); gap: 10px; }
  .cg-hpitch .cg-hchecks, .cg-hfeats { display: none; }
  .cg-hpitch p { font-size: 15px; }
  .cg-hpitch__acts .cg-btn { flex: 1; }
  .cg-hpitch .cg-btn--soft { display: none; }
  .cg-hlist { grid-template-columns: minmax(0, 1fr); }
  .cg-hlist a:nth-child(n+9):not(.cg-hlist__all) { display: none; }

  .cg-htabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow-sheet); }
  .cg-body .cg-htabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px;
    color: var(--ink-caption); font-size: 13px; font-weight: var(--w-strong); }
  .cg-body .cg-htabs a[aria-current] { color: var(--accent); }
  body.cg-page-home .cg-footer .cg-wrap { padding-bottom: calc(24px + 76px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Hero line: members out this month + events coming up ------------------------------------------------------ */
.cg-hnow { margin: -6px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-size: 15px; color: var(--ink-muted); }
.cg-hnow b { font-weight: var(--w-strong); color: var(--ink); }
.cg-hnow__faces { display: inline-flex; }
.cg-hnow__faces .cg-hm__av { width: 28px; height: 28px; margin: 0 0 0 -8px; border: 2px solid var(--ground); }
.cg-hnow__faces .cg-hm__av:first-child { margin-left: 0; }
.cg-hnow__faces svg { width: 15px; height: 15px; }

/* ---- Chips on the Popular cities cards ------------------------------------------------------------------------ */
.cg-hchips { display: flex; flex-wrap: wrap; gap: 8px; }
.cg-hchip { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--ink); font-size: 13px; font-weight: var(--w-strong); line-height: 1.2; white-space: nowrap; }
/* --link, not --accent: --accent on the tint failed WCAG AA contrast (Lighthouse); --link is 5.7:1 on the light theme. */
.cg-hchip--ev { background: var(--accent-tint, var(--surface-warm-strong)); color: var(--link); }

/* ---- Tonight on CruisingGays: events card + join / member card -------------------------------------------------- */
[data-theme="velvet"] .cg-htn__h { color: var(--heading); }
.cg-htn { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 24px; align-items: start; }
.cg-htn__card { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-xxl); background: var(--surface); min-width: 0; }
.cg-htn__card:only-child { grid-column: 1 / -1; }
.cg-htn__join, .cg-htn__members { background: var(--surface-warm); }
.cg-htn__h { margin: 0; font: italic var(--w-regular) 32px/1.1 var(--font-display); }
.cg-htn__hrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.cg-htn__live { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: var(--w-strong); color: var(--on-live); }
.cg-htn__live b { font-weight: var(--w-strong); }
.cg-htn__live i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--live-dot); }
.cg-htn__faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cg-htn__faces .cg-hm__av { width: 100%; height: auto; aspect-ratio: 1; margin: 0; }
.cg-htn__faces svg { width: 44%; height: 44%; }
.cg-htn__pitch { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-muted); }
.cg-htn__members .cg-hm__acts, .cg-htn__join .cg-hm__acts { margin-top: auto; }

.cg-hev { list-style: none; margin: 0; padding: 0; }
.cg-hev li + li { border-top: 1px solid var(--surface-divider); }
.cg-body a.cg-hev__row { display: flex; align-items: center; gap: 16px; padding: 14px 0; color: var(--ink); min-width: 0; }
.cg-hev__date { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; padding: 6px 0 5px; border-radius: var(--radius-m); background: var(--surface-warm); line-height: 1.1; }
.cg-hev__date small { font-size: 11px; font-weight: var(--w-strong); color: var(--ink-caption); letter-spacing: .04em; }
.cg-hev__date strong { font: italic var(--w-regular) 24px/1.1 var(--font-display); }
[data-theme="velvet"] .cg-hev__date strong { color: var(--heading); }
.cg-hev__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-hev__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.cg-hev__name { font-size: 16px; font-weight: var(--w-strong); color: var(--link); overflow-wrap: anywhere; }
.cg-body a.cg-hev__row:hover .cg-hev__name { text-decoration: underline; text-decoration-color: var(--accent); }
.cg-hev__now { flex: none; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--live-tint); color: var(--on-live); font-size: 12px; font-weight: var(--w-strong); white-space: nowrap; }
.cg-hev__city { font-size: 13px; color: var(--ink-caption); }
.cg-hev__all { align-self: flex-start; margin-top: auto; }

/* Member card: nickname tiles inside the card (4 per row) */
.cg-hm__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
.cg-hm__grid > li { min-width: 0; }
.cg-body a.cg-hm__card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: var(--radius-m); color: var(--ink); text-align: center; min-width: 0; }
.cg-body a.cg-hm__card:hover { background: var(--surface); color: var(--ink); }
.cg-body a.cg-hm__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cg-hm__av { position: relative; flex: none; width: 64px; height: 64px; margin-bottom: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--avatar-6); color: var(--ink-muted); }
.cg-hm__av svg { width: 50%; height: 50%; }
.cg-hm__av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.cg-hm__ini { font: var(--w-strong) 20px/1 var(--font-sans); color: var(--ink); letter-spacing: .02em; }
.cg-hm__dot { position: absolute; right: 1px; bottom: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--live-dot); border: 2px solid var(--surface-warm); }
.cg-hm__name { display: block; max-width: 100%; font-size: 14px; font-weight: var(--w-strong); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-hm__city { display: block; max-width: 100%; font-size: 12px; color: var(--ink-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-hm__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 6px; }
/* Varied warm tints like the Members page (one tint on a whole grid reads as a wall); Velvet keeps its own avatar tokens. */
.cg-hm__av--a1 { background: var(--avatar-1); } .cg-hm__av--a2 { background: var(--avatar-2); } .cg-hm__av--a3 { background: var(--avatar-3); }
.cg-hm__av--a4 { background: var(--avatar-4); } .cg-hm__av--a5 { background: var(--avatar-5); } .cg-hm__av--a6 { background: var(--avatar-6); }
:root:not([data-theme="velvet"]) .cg-hm__av--a1 { background: #ffe1d2; }
:root:not([data-theme="velvet"]) .cg-hm__av--a2 { background: #fcd3e2; }
:root:not([data-theme="velvet"]) .cg-hm__av--a3 { background: #f3d6ef; }
:root:not([data-theme="velvet"]) .cg-hm__av--a4 { background: #ffe7c2; }
:root:not([data-theme="velvet"]) .cg-hm__av--a5 { background: #f7d0c6; }
:root:not([data-theme="velvet"]) .cg-hm__av--a6 { background: #e6dbf6; }

@media (max-width: 1000px) {
  .cg-htn { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .cg-hnow { justify-content: flex-start; font-size: 14px; margin-top: 0; }
  .cg-htn { margin-top: 14px; gap: 14px; }
  .cg-htn__card { padding: 20px; border-radius: var(--radius-xl); }
  .cg-htn__h { font-size: 28px; }
  .cg-hm__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cg-hm__av { width: 60px; height: 60px; }
  .cg-htn__faces { gap: 8px; }
  .cg-hev__name { font-size: 15px; }
  .cg-hchip { font-size: 12px; }
}
