/*
 * City guide pages. Same reasoning as game-locator.css: Tailwind does not scan
 * public/, and the semantic tokens in global.css already flip under .dark.
 */

.cg-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 5rem 1.15rem 4.5rem;
}

.cg-back {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* Hotkey badge: `[` goes back to the palette (nav-keys.js). */
.cg-key {
  display: inline-block;
  margin-left: 0.45rem;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--color-fg-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: 0.3rem;
  padding: 0.05rem 0.4rem;
  line-height: 1.4;
  vertical-align: 1px;
}

@media (hover: none), (pointer: coarse) {
  .cg-key {
    display: none;
  }
}

.cg-back a,
.cg-where a {
  color: var(--color-link);
  text-decoration: none;
}

.cg-back a:hover,
.cg-where a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.cg-head {
  margin-bottom: 2.5rem;
}

/* The row carries the title size so the bubble can be sized off it. */
.cg-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.3rem;
}

.cg-title {
  font-size: 1em;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-fg-strong);
  margin: 0;
}

/* "Suggest a Spot": ~44% smaller than the city name (20% smaller than the
   previous 0.7em bubble), right-aligned on its line. */
.cg-feedback {
  flex: none;
  appearance: none;
  font: inherit;
  font-size: 0.56em;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--color-fg);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 0.36em 0.72em;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.cg-feedback:hover,
.cg-feedback:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-fg-strong);
  outline: none;
}

@media (max-width: 30rem) {
  .cg-title-row {
    flex-wrap: wrap;
  }
}

.cg-where {
  color: var(--color-fg-muted);
  font-size: 0.95rem;
  margin: 0;
}

.cg-blurb {
  color: var(--color-fg);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0.9rem 0 0;
}

/* Shown on cities that carry a stated reason for a short guide. */
.cg-reduced {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-surface-sunken);
  border-radius: 0 0.4rem 0.4rem 0;
  color: var(--color-fg-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.cg-section {
  margin-bottom: 2.75rem;
}

.cg-h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cg-h2-label {
  min-width: 0;
}

/*
 * Section and tag icons. The ligature only matches the lowercase name, so the
 * uppercase headings and tags must not reach it; the fixed width and hidden
 * overflow keep the name from spilling out before the font arrives.
 */
.cg-h2-icon,
.cg-tag-icon {
  flex: none;
  display: inline-block;
  width: 1em;
  overflow: hidden;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.cg-h2-icon {
  font-size: 1.15rem;
}

.cg-tag-icon {
  font-size: 0.85rem;
}

.cg-tool {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: -0.15rem 0 0;
  color: var(--color-fg-muted);
  border-radius: 0.3rem;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}

.cg-tool:hover,
.cg-tool:focus-visible {
  color: var(--color-accent);
  outline: none;
}

.cg-tool-svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

@media (pointer: coarse) {
  .cg-tool {
    width: 1.75rem;
    height: 1.75rem;
  }

  .cg-tool-svg {
    width: 1.3rem;
    height: 1.3rem;
  }
}

.cg-venues {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: venue;
}

.cg-venue {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cg-venue-body {
  flex: 1;
  min-width: 0;
}

/* Reddit-style vote column, left of every venue. */
.cg-vote {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2rem;
  margin-top: -0.15rem;
}

.cg-vote-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: color 0.12s, background-color 0.12s, transform 0.12s;
}

.cg-vote-btn:hover,
.cg-vote-btn:focus-visible {
  color: var(--color-fg-strong);
  background: var(--color-surface-sunken);
  outline: none;
}

.cg-vote-btn:active {
  transform: scale(1.25);
}

.cg-vote-n {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-fg-muted);
  line-height: 1.2;
  min-width: 1.6rem;
  text-align: center;
}

.cg-venue.is-up .cg-vote-btn[data-vote="1"],
.cg-venue.is-up .cg-vote-n {
  color: var(--color-accent);
}

.cg-venue.is-down .cg-vote-btn[data-vote="-1"],
.cg-venue.is-down .cg-vote-n {
  color: var(--color-link);
}

@media (pointer: coarse) {
  .cg-vote-btn {
    font-size: 0.9rem;
    padding: 0.45rem 0.6rem;
  }
}

.cg-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: 0.25rem;
  padding: 0.08rem 0.4rem;
}

.cg-venue.is-new {
  animation: cg-arrive 1.8s ease-out;
}

@keyframes cg-arrive {
  from { background: var(--color-accent-soft); }
  to { background: transparent; }
}

.cg-more {
  appearance: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-link);
  background: transparent;
  border: 0;
  padding: 0.6rem 0;
  cursor: pointer;
}

.cg-more:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.cg-venue:last-child {
  border-bottom: 0;
}

.cg-venue-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.cg-venue-name {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--color-fg-strong);
}

.cg-venue-name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-strong);
}

.cg-venue-name a:hover {
  border-bottom-color: var(--color-fg-muted);
}

.cg-nights {
  flex: none;
  display: flex;
  gap: 0.3rem;
}

.cg-night {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

.cg-vibe {
  display: block;
  color: var(--color-fg-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.15rem;
}

.cg-updated {
  color: var(--color-fg-muted);
  font-size: 0.82rem;
  margin-top: 3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--color-border);
}

/* Hub page listing */
.cg-hub {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem 1.25rem;
}

.cg-hub li {
  padding: 0.3rem 0;
}

.cg-hub a {
  display: block;
  font-weight: 600;
  color: var(--color-fg-strong);
  text-decoration: none;
}

.cg-hub a:hover {
  color: var(--color-link);
}

/* ---- Feedback drawer ----
 * Right-aligned panel over a dimmed page. `hidden` gates existence; .is-open
 * drives the slide so the transition can run after the attribute flips.
 */
.cg-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.cg-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}

.cg-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(26rem, 100%);
  overflow-y: auto;
  background: var(--color-surface-raised);
  border-left: 1px solid var(--color-border);
  box-shadow: -16px 0 40px rgb(0 0 0 / 0.25);
  padding: 1.5rem 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}

.cg-drawer.is-open .cg-drawer-backdrop {
  opacity: 1;
}

.cg-drawer.is-open .cg-drawer-panel {
  transform: none;
}

.cg-drawer-open {
  overflow: hidden;
}

.cg-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cg-drawer-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-fg-strong);
  margin: 0;
}

.cg-drawer-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.cg-drawer-x:hover,
.cg-drawer-x:focus-visible {
  color: var(--color-fg-strong);
  background: var(--color-surface-sunken);
  outline: none;
}

.cg-drawer-sub {
  color: var(--color-fg-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}

/* Title, then a strong heading per step, then options, then the muted
   placeholders: four clear levels, and room between the steps. */
.cg-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.cg-field {
  display: block;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.cg-label {
  display: block;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-fg-strong);
  margin-bottom: 0.7rem;
  padding: 0;
}

/* Legends do not reliably take display:flex, so the icon sits inline. */
.cg-label-icon {
  font-size: 1.2rem;
  line-height: 1;
  vertical-align: -0.25em;
  margin-right: 0.4rem;
  color: var(--color-fg-muted);
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.cg-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem;
}

.cg-pill {
  position: relative;
  display: block;
  cursor: pointer;
}

.cg-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cg-pill-face {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-fg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 0.75rem;
  padding: 0.5rem 0.8rem;
  transition: border-color 0.12s, background-color 0.12s, color 0.12s;
}

.cg-pill-icon {
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--color-fg-muted);
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
  transition: color 0.12s;
}

.cg-pill:hover .cg-pill-face {
  border-color: var(--color-fg-muted);
}

.cg-pill input:checked + .cg-pill-face {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.cg-pill input:checked + .cg-pill-face .cg-pill-icon {
  color: inherit;
}

.cg-pill input:focus-visible + .cg-pill-face {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 2px var(--color-focus);
}

.cg-input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-fg-strong);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}

.cg-input:focus {
  outline: none;
  border-color: var(--color-focus);
}

.cg-input::placeholder {
  color: var(--color-fg-muted);
}

/* Honeypot: off-screen, never display:none (some bots skip those). */
.cg-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cg-submit {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  cursor: pointer;
  align-self: stretch;
}

.cg-submit:hover,
.cg-submit:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.cg-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cg-status {
  margin: 1.2rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-fg);
  background: var(--color-surface-sunken);
  border-left: 3px solid var(--color-border-strong);
}

.cg-status.is-ok {
  border-left-color: var(--color-accent);
}

.cg-status.is-no {
  border-left-color: var(--color-link);
}

/* CITY SCORE sits under .cg-head (margin-bottom 2.5rem = 40px) + 4px = 44px.
   Gaps below the header and before the next section are scoped here so
   other .cg-section / .cg-h2 rules stay untouched. */
.cg-scores {
  padding-top: 4px;
  margin-bottom: 46px;
}

.cg-scores .cg-h2 {
  margin-bottom: 14px;
}

.cg-review {
  white-space: pre-wrap;
  color: var(--color-fg);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

.cg-spots {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cg-spot {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cg-spot-name {
  font-weight: 600;
  color: var(--color-fg-strong);
}

.cg-info {
  margin: 0;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.45rem 1rem;
}

.cg-info dt {
  color: var(--color-fg-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}

.cg-info dd {
  margin: 0;
  color: var(--color-fg);
  line-height: 1.5;
}

@media (max-width: 30rem) {
  .cg-info {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .cg-info dt {
    margin-top: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cg-drawer-panel,
  .cg-drawer-backdrop,
  .cg-vote-btn,
  .cg-pill-face,
  .cg-pill-icon {
    transition: none;
  }

  .cg-venue.is-new {
    animation: none;
  }
}
