/* ═══════════════════════════════════════════════════════════════════
   VNATION V7.1 · Refinement polish
   - Threaded Citizen Service Board mobile fit
   - Living-city ambient panel mobile fit
   - Homepage First-Visit Primer polish + mobile
   - Footer contact strip
   - Universal mobile safety (no horizontal scroll, 44px touch targets,
     safe long-word wrapping, scaled hero, comfortable spacing).
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Global mobile safety ──────────────────────────────────────── */
html, body { overflow-x: hidden; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
.container, .v6-narrow { padding-left: clamp(14px, 3vw, 24px); padding-right: clamp(14px, 3vw, 24px); }

/* Long-word / long-URL wrapping on every text-carrying surface */
.v6-service-title, .v6-service-body, .v6-reply-text, .v5-mom-body,
.v6-today-card p, .v7-primer-card p, .walker-note, .ambient-host-line {
  overflow-wrap: anywhere; word-break: break-word;
}

/* ─── Footer contact strip ──────────────────────────────────────── */
.v6-foot-contact {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px 0 0; padding: 8px 14px;
  border-radius: 999px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.22);
  font-size: .92rem;
}
.v6-foot-contact i { color: #D4AF37; }
.v6-foot-contact a {
  color: #F5D25F; text-decoration: none; font-weight: 500;
}
.v6-foot-contact a:hover { text-decoration: underline; }
.foot-bottom-sep { opacity: .35; margin: 0 6px; }
.foot-bottom a { color: #F5D25F; text-decoration: none; }
.foot-bottom a:hover { text-decoration: underline; }

/* ─── First-Visit Primer polish ─────────────────────────────────── */
@media (max-width: 900px) {
  .v7-primer { padding: 20px 0 8px; }
  .v7-primer-grid { gap: 14px; }
  .v7-primer-card { padding: 22px 20px; border-radius: 16px; }
  .v7-primer-card h3 { font-size: 1.2rem; }
  .v7-primer-card p  { font-size: .93rem; }
  .v7-primer-cta { width: 100%; justify-content: center; padding: 12px 18px; }
  .v7-primer-links { gap: 8px 18px; }
}

/* ─── Threaded Citizen Service Board ────────────────────────────── */
@media (max-width: 640px) {
  .v6-service-card { padding: 16px; border-radius: 14px; }
  .v6-service-head { flex-wrap: wrap; gap: 10px; }
  .v6-service-title { font-size: 1.05rem; }
  .v6-service-status { order: 3; margin-top: 4px; align-self: flex-start; }
  .v6-service-solved { font-size: .88rem; padding: 8px 12px; }

  .v6-thread { padding-left: 0; border-left: none; margin-top: 14px; }
  .v6-reply { padding: 10px 12px; }
  .v6-reply-head { gap: 4px; font-size: .82rem; }
  .v6-reply-accepted { padding: 2px 7px; font-size: .66rem; }
  .v6-reply-text { font-size: .92rem; }
  .v6-accept-btn { width: 100%; justify-content: center; }

  .v6-reply-form { padding: 14px; }
  .v6-reply-form .textarea { min-height: 84px; }
  .v6-reply-form-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .v6-reply-form .btn { width: 100%; justify-content: center; min-height: 44px; }
}

/* ─── Living-city ambient panel ─────────────────────────────────── */
@media (max-width: 720px) {
  .city-ambient { padding: 18px; border-radius: 14px; margin-bottom: 24px; }
  .ambient-tod {
    display: flex; width: 100%; justify-content: center;
    font-size: .68rem; padding: 6px 12px; margin-bottom: 14px;
  }
  .ambient-grid { grid-template-columns: 1fr; gap: 12px; }
  .ambient-host, .ambient-checkin { padding: 14px; }
  .ambient-host { grid-template-columns: 40px 1fr; gap: 10px; }
  .ambient-host-avatar { width: 40px; height: 40px; }
  .ambient-host-name { font-size: 1rem; }
  .ambient-host-line { font-size: .92rem; }

  .ambient-checkin-form .btn { width: 100%; justify-content: center; min-height: 44px; }
  .walker-line .muted { display: block; margin-top: 2px; }
}

/* ─── City hero on very small screens ───────────────────────────── */
@media (max-width: 520px) {
  .city-hero-v2 { min-height: 68vh; }
  .ch-title { font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1.05; }
  .ch-sub   { font-size: .95rem; }
  .ch-motto { font-size: .95rem; padding: 0 6px; }
  .city-live-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cl-item { padding: 10px 8px !important; }
  .cl-value { font-size: 1rem !important; }
  .cl-label { font-size: .68rem !important; }
}

/* ─── Moments feed mobile fit ───────────────────────────────────── */
@media (max-width: 720px) {
  .v6-mom-layout { grid-template-columns: 1fr !important; gap: 18px !important; }
  .v6-mom-rail { position: static !important; }
  .v5-mom-tabs {
    display: flex; overflow-x: auto; gap: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .v5-mom-tab {
    flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap;
  }
  .v5-mom-card { padding: 16px; border-radius: 14px; }
  .v5-mom-actions { flex-wrap: wrap; gap: 10px; }
  .v5-mom-reactions { flex-wrap: wrap; }
}

/* ─── Navigation on mobile — safe overflow ──────────────────────── */
@media (max-width: 520px) {
  .nav-inner { padding: 0 12px !important; }
  .brand-text { font-size: 1rem !important; letter-spacing: .18em; }
  .nav-tools { gap: 6px !important; }
  .nav-avatar-name { display: none !important; }
}

/* ─── 44px minimum touch target on interactive elements ─────────── */
@media (max-width: 720px) {
  .btn, .nav-icon-btn, .v5-mom-react, .v5-mom-bookmark,
  .v5-mom-comment-open, .v5-mom-share, .lb-btn, .hotspot {
    min-height: 44px; min-width: 44px;
  }
  .btn.btn-sm { min-height: 40px; }
  input.input, textarea.textarea, select.input { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }
  textarea.textarea { min-height: 80px; }
}

/* ─── Arrival hero mobile refinement ────────────────────────────── */
@media (max-width: 520px) {
  .v6-arrival { padding: 32px 0 24px !important; }
  .v6-arrival-title { line-height: .95; }
  .v6-arrival-brand { font-size: clamp(3rem, 15vw, 5rem) !important; letter-spacing: .06em; }
  .v6-arrival-welcome { font-size: 1.15rem !important; }
  .v6-arrival-tagline { font-size: .95rem; }
  .v6-arrival-lead { font-size: .95rem; }
  .v6-arrival-ctas { flex-direction: column; gap: 10px; }
  .v6-arrival-ctas .btn { width: 100%; justify-content: center; }
  .v6-arrival-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px 16px !important;
  }
  .v6-arrival-stat { padding-left: 12px; }
  .v6-arrival-stat b { font-size: 1.05rem !important; }
  .v6-arrival-stat span { font-size: .72rem !important; }
  .v6-arrival-secondary a { padding: 6px 10px; border-radius: 999px; background: rgba(5,9,20,.35); }
}

/* ─── Composer forms full-width buttons ─────────────────────────── */
@media (max-width: 520px) {
  .v6-composer-body .flex-between {
    flex-direction: column; align-items: stretch; gap: 12px;
  }
  .v6-composer-body .flex-between .btn { width: 100%; justify-content: center; }
}

/* ─── City discussion form mobile ───────────────────────────────── */
@media (max-width: 520px) {
  .cd-form-foot { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .cd-submit-btn { width: 100%; justify-content: center; }
}

/* ─── Prevent nav avatar menu overflow on small screens ─────────── */
@media (max-width: 520px) {
  .nav-avatar-menu {
    right: 8px !important; left: 8px !important;
    width: auto !important; max-width: none !important;
  }
  .nav-am-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ─── Reduce motion honour ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .v7-primer-card, .v6-reply, .ambient-host, .walker-avatar,
  .v6-today-card, .v6-service-card { transition: none !important; }
  .v6-today-card:hover, .v6-service-card:hover,
  .v7-primer-card:hover { transform: none !important; }
}

/* ─── Focus visibility for keyboard users ───────────────────────── */
.btn:focus-visible, .input:focus-visible, .textarea:focus-visible,
select.input:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid #F5D25F; outline-offset: 2px;
  border-radius: inherit;
}
