/* ============================================
   mobile-native.css
   Native-app mobile patterns for peterpan.net
   Layered on top of style.css — mobile first,
   desktop inherits gracefully.
   ============================================ */

/* ── View Transitions (Chromium/Safari TP) ── */
@view-transition { navigation: auto; }

/* ── Viewport overflow safety: prevent horizontal body scroll when
   rails use negative margins to break out of containers.
   `clip` (better than `hidden`) still lets sticky positioning work. ── */
html, body {
  overflow-x: clip;
  max-width: 100vw;
}

/* Long words (URLs, addresses) never force horizontal overflow */
h1, h2, h3, h4, h5, h6, p, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ── Dark-mode token overrides (body-wide) ── */
@media (prefers-color-scheme: dark) {
  :root {
    --slate-50:  #0b1120;
    --slate-100: #111827;
    --slate-200: #1f2937;
    --slate-300: #374151;
    --slate-400: #6b7280;
    --slate-500: #9ca3af;
    --slate-600: #d1d5db;
    --slate-700: #e5e7eb;
    --slate-800: #f3f4f6;
    --slate-900: #f9fafb;
    --white: #0f172a;
    --green-50: #052e26;
    --green-100: #064e3b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 10px -2px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 28px -6px rgba(0,0,0,0.55);
    --shadow-xl: 0 24px 48px -10px rgba(0,0,0,0.65);
  }
  body { background: #0b1120; color: #e5e7eb; }
  .site-header,
  .stats-bar { background: rgba(17,24,39,0.85); border-bottom-color: #1f2937; }
  .property-card,
  .mission-card,
  .event-card,
  .sidebar-card,
  .contact-info-card,
  .team-card { background: #111827; color: #e5e7eb; }
  .property-card h3,
  .mission-card h3,
  .event-card h3 { color: #f3f4f6; }
  .bottom-nav { background: rgba(17,24,39,0.92); border-top-color: #1f2937; }
  .chip { background: #111827; border-color: #1f2937; color: #d1d5db; }
  .chip.is-active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
  .search-pill { background: #111827; border-color: #1f2937; color: #e5e7eb; }
  .search-pill input { color: #e5e7eb; }
  .search-pill input::placeholder { color: #6b7280; }
  .sheet { background: #111827; color: #e5e7eb; }
  .sheet-handle { background: #374151; }
  .fab { box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
  .data-table th { background: #1f2937; color: #d1d5db; }
  .data-table td { border-bottom-color: #1f2937; color: #d1d5db; }
  .detail-item,
  .mission-box { background: #1f2937; }
  .filter-btn { background: #111827; color: #d1d5db; border-color: #1f2937; }
  .card-location,
  .card-detail { color: #9ca3af; }
  p { color: #d1d5db; }
}

/* ── Global: native-feel press behavior on every interactive surface ── */
a, button, .chip, .property-card, .mission-card, .event-card,
.bottom-nav-item, .filter-btn, .fab, .sheet-action, .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a:active, button:active, .chip:active, .property-card:active,
.mission-card:active, .event-card:active, .bottom-nav-item:active,
.filter-btn:active, .fab:active, .sheet-action:active, .btn:active {
  transform: scale(0.97);
  transition: transform 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  a:active, button:active, .chip:active, .property-card:active,
  .mission-card:active, .event-card:active, .bottom-nav-item:active,
  .filter-btn:active, .fab:active, .sheet-action:active, .btn:active {
    transform: none;
  }
  .sheet, .sheet::backdrop { transition: none !important; }
}

/* ── Safe-area helpers ── */
.site-header { padding-top: env(safe-area-inset-top, 0); }
.site-header .header-inner { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.bottom-nav { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ── App-style morphing header ── */
.site-header {
  transition: background 200ms ease, box-shadow 200ms ease, height 200ms ease;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 8px 24px -12px rgba(0,0,0,0.14);
}
.site-header.is-scrolled .header-inner { height: 56px; }
.site-header.is-scrolled .logo-text span { display: none; }
.site-header .header-inner { transition: height 200ms ease; }
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(11,17,32,0.82); }
}

/* ── Horizontal rails (scroll-snap) ── */
.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 24px;
  padding: 4px 24px 20px;
  margin: 0 -24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.rail::-webkit-scrollbar { display: none; }

.rail > * {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex: 0 0 auto;
}

/* Rail card sizing per rail type */
.rail--stats > .stat-card { width: 190px; }
.rail--pillars > .mission-card { width: 280px; max-width: 80vw; }
.rail--properties > .property-card { width: 300px; max-width: 82vw; }
.rail--events > .event-card { width: 300px; max-width: 82vw; }
.rail--cities > .city-chip { /* inline-sized */ }

/* Desktop: rails become grids */
@media (min-width: 900px) {
  .rail {
    display: grid;
    gap: 24px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0;
    margin: 0;
  }
  .rail--stats    { grid-template-columns: repeat(4, 1fr); }
  .rail--pillars  { grid-template-columns: repeat(3, 1fr); }
  .rail--properties { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .rail--events   { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .rail--cities   { grid-template-columns: none; display: flex; flex-wrap: wrap; justify-content: center; }
  .rail--stats > .stat-card,
  .rail--pillars > .mission-card,
  .rail--properties > .property-card,
  .rail--events > .event-card { width: auto; max-width: none; }
}

/* ── Stat card (rail variant) ── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.stat-card h3 {
  font-family: 'Inter', sans-serif;
  color: var(--green-700);
  font-size: 1.45rem;
  font-weight: 800;
  /* Numeric content should never break mid-word */
  overflow-wrap: normal;
  word-wrap: normal;
  white-space: nowrap;
}
.stat-card p {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  color: var(--slate-500);
}

/* ── Section headers, tighter spacing on mobile ── */
.section-mobile { padding: 40px 0; }
@media (min-width: 900px) {
  .section-mobile { padding: 80px 0; }
}

.rail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 24px;
}
.rail-header h2 {
  font-size: 1.35rem;
  margin: 0;
}
.rail-header .rail-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-700);
  white-space: nowrap;
}
@media (min-width: 900px) {
  .rail-header { padding: 0; margin-bottom: 24px; }
  .rail-header h2 { font-size: 1.8rem; }
}

/* ── City chip rail ── */
.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 100px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
}
.city-chip i { color: var(--green-600); }
.city-chip .count {
  background: var(--green-50);
  color: var(--green-800);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .city-chip { background: #111827; border-color: #1f2937; color: #e5e7eb; }
  .city-chip .count { background: #064e3b; color: #d1fae5; }
}

/* ── Sticky chip filter bar (properties page) ── */
.chip-bar {
  position: sticky;
  top: 56px;
  z-index: 60;
  background: rgba(248,250,252,0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 12px 0;
  margin: 0 -24px 16px;
  border-bottom: 1px solid var(--slate-200);
}
@media (min-width: 900px) {
  .chip-bar { top: 72px; }
}
/* Rail nested inside chip-bar: don't double-offset — chip-bar already broke out */
.chip-bar .rail {
  padding: 0 24px 4px;
  margin: 0;
}
@media (max-width: 899px) {
  .chip-bar .rail { padding: 0 20px 4px; }
}
@media (prefers-color-scheme: dark) {
  .chip-bar { background: rgba(11,17,32,0.9); border-bottom-color: #1f2937; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}
.chip:hover { border-color: var(--green-500); }
.chip.is-active {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
  transform: scale(1.04);
  box-shadow: 0 6px 16px -6px rgba(6,78,59,0.5);
}

/* ── Search pill (properties page) ── */
.search-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 100px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.search-pill i.fa-magnifying-glass { color: var(--slate-400); }
.search-pill input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--slate-800);
}
.search-pill .clear-btn {
  display: none;
  background: var(--slate-200);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  color: var(--slate-600);
  font-size: 12px;
  align-items: center;
  justify-content: center;
}
.search-pill.has-value .clear-btn { display: inline-flex; }

/* ── Property list (mobile variant for /properties) ── */
.property-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 900px) {
  .property-list { display: none; }
}
.property-list-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  min-height: 128px;
}
.property-list-item .thumb {
  position: relative;
  background: var(--slate-200);
}
.property-list-item .thumb img,
.property-list-item .thumb iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.property-list-item .thumb .card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.62rem;
  padding: 2px 8px;
}
.property-list-item .info {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.property-list-item .info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--slate-900);
  line-height: 1.3;
}
.property-list-item .info .meta {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin: 2px 0;
}
.property-list-item .info .price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-700);
  margin-top: 4px;
}
@media (prefers-color-scheme: dark) {
  .property-list-item { background: #111827; }
  .property-list-item .info h3 { color: #f3f4f6; }
}

/* ── Grid wrapper: show only on desktop ── */
#propertyGrid { display: none; }
@media (min-width: 900px) {
  #propertyGrid { display: grid; }
}

/* ── Skeleton shimmer ── */
.skeleton {
  background: linear-gradient(90deg,
    var(--slate-100) 0%,
    var(--slate-200) 50%,
    var(--slate-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-lg);
  min-height: 220px;
  flex: 0 0 300px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.rail--loaded .skeleton { display: none; }

/* ── Floating Action Button ── */
.fab {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px -6px rgba(6,78,59,0.55), 0 4px 10px rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 90;
  text-decoration: none;
  transition: transform 220ms cubic-bezier(.2,.9,.35,1.3), opacity 180ms ease;
}
.fab.is-hidden {
  transform: translateY(120%) scale(0.6);
  opacity: 0;
  pointer-events: none;
}
.fab:hover { background: var(--green-800); color: #fff; }
@media (min-width: 900px) {
  .fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ── Bottom Sheet (uses <dialog>) ── */
.sheet {
  border: none;
  padding: 0;
  margin: 0 auto 0;
  width: 100%;
  max-width: 720px;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  background: var(--white);
  color: var(--slate-800);
  position: fixed;
  inset: auto 0 0 0;
  box-shadow: 0 -20px 48px -12px rgba(0,0,0,0.32);
  overflow: hidden;
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 320ms cubic-bezier(.2,.9,.35,1.05),
    opacity 220ms ease,
    overlay 320ms ease allow-discrete,
    display 320ms ease allow-discrete;
}
.sheet[open] {
  transform: translateY(0);
  opacity: 1;
}
@starting-style {
  .sheet[open] {
    transform: translateY(100%);
    opacity: 0;
  }
}
.sheet::backdrop {
  background: rgba(0,0,0,0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background 260ms ease,
    backdrop-filter 260ms ease,
    overlay 260ms ease allow-discrete,
    display 260ms ease allow-discrete;
}
.sheet[open]::backdrop {
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@starting-style {
  .sheet[open]::backdrop {
    background: rgba(0,0,0,0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
  }
}

.sheet-handle-wrap {
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.sheet-handle {
  width: 44px;
  height: 5px;
  background: var(--slate-300);
  border-radius: 100px;
}
.sheet-body {
  padding: 8px 20px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: calc(92dvh - 28px);
  -webkit-overflow-scrolling: touch;
}
.sheet-body::-webkit-scrollbar { width: 4px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 4px; }

.sheet-hero {
  position: relative;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--slate-200);
}
.sheet-hero img,
.sheet-hero iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.sheet-hero .sheet-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sheet h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 4px;
}
.sheet .sheet-loc {
  color: var(--slate-500);
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.sheet-grid .cell {
  background: var(--slate-100);
  border-radius: 10px;
  padding: 10px 12px;
}
.sheet-grid .cell .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--slate-500);
  margin-bottom: 2px;
}
.sheet-grid .cell .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800);
}
.sheet-grid .cell .value.accent { color: var(--green-700); }
.sheet p.desc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--slate-600);
  margin: 10px 0 16px;
}
.sheet-mission {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--green-800);
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  .sheet-grid .cell { background: #1f2937; }
  .sheet-grid .cell .value { color: #f3f4f6; }
  .sheet-mission { background: #052e26; border-color: #064e3b; color: #a7f3d0; }
}
.sheet-features {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.sheet-features li {
  font-size: 0.82rem;
  color: var(--slate-600);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}
.sheet-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green-600);
  font-weight: 700;
}
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-200);
}
.sheet-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.sheet-action.primary { background: var(--green-700); color: #fff; }
.sheet-action.secondary { background: var(--slate-100); color: var(--slate-800); }
.sheet-action.icon-only { width: 48px; padding: 12px; justify-content: center; background: var(--slate-100); color: var(--slate-800); }
@media (prefers-color-scheme: dark) {
  .sheet-actions { border-top-color: #1f2937; }
  .sheet-action.secondary, .sheet-action.icon-only { background: #1f2937; color: #e5e7eb; }
}

/* When dialog is open, lock background scroll */
body.sheet-open { overflow: hidden; }

/* ── Contact action-card grid ── */
.contact-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.contact-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 0.8rem;
}
.contact-action i {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  .contact-action { background: #111827; }
  .contact-action i { background: #064e3b; color: #d1fae5; }
}

/* ── Event timeline (mobile) ── */
@media (max-width: 899px) {
  .event-list.timeline {
    position: relative;
    padding-left: 26px;
  }
  .event-list.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--green-100);
  }
  .event-list.timeline .event-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 18px;
    position: relative;
  }
  .event-list.timeline .event-card::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green-600);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--green-100);
  }
}

/* ── Hide the old mobile menu toggle and stacked menu: bottom nav is primary ── */
@media (max-width: 899px) {
  .nav-links { display: none !important; }
  .mobile-toggle { display: none !important; }
  /* Ensure logo+header still balanced without nav */
  .site-header .header-inner { justify-content: space-between; }
  .header-inner nav::after {
    content: '';
    width: 24px;
    height: 24px;
    display: inline-block;
  }
  /* Push content away from bottom nav */
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ── Hero tightening on mobile ── */
@media (max-width: 899px) {
  .hero { padding: 48px 0 52px; }
  .hero h1 { font-size: 1.85rem; line-height: 1.2; }
  .hero p { font-size: 1rem; }
  .hero-buttons { flex-direction: column; gap: 10px; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .section { padding: 40px 0; }
  .section-header { margin-bottom: 24px; }
  .section-header h2 { font-size: 1.5rem; }
  .property-grid { gap: 14px; }
  .mission-grid { gap: 14px; }
}

/* ── Hide back-to-top on mobile (FAB replaces it) ── */
@media (max-width: 899px) {
  .back-to-top { display: none !important; }
}

/* ── Larger tap targets on bottom nav ── */
.bottom-nav-item { min-height: 44px; }

/* ── Utility ── */
.only-mobile { display: block; }
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-mobile { display: none; }
  .only-desktop { display: block; }
}

/* ============================================
   v3 additions — more rails, tighter chrome
   ============================================ */

/* ── Contact action rail variant (info cards + help cards) ── */
.rail--contact-info > *,
.rail--contact-help > * {
  width: 280px;
  max-width: 82vw;
}
@media (min-width: 900px) {
  .rail--contact-info,
  .rail--contact-help {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .rail--contact-info > *,
  .rail--contact-help > * { width: auto; max-width: none; }
}

/* ── Help card pills (contact "How Can We Help") ── */
.help-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  border-left: 4px solid var(--green-600);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.help-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-card p { font-size: 0.82rem; line-height: 1.55; margin: 0; }
.help-card.housing   { border-left-color: var(--green-600);  background: var(--green-50); }
.help-card.housing h4,  .help-card.housing p  { color: var(--green-800); }
.help-card.venue     { border-left-color: var(--amber-500);  background: var(--amber-50); }
.help-card.venue h4,    .help-card.venue p    { color: #92400e; }
.help-card.volunteer { border-left-color: var(--blue-600);   background: var(--blue-100); }
.help-card.volunteer h4,.help-card.volunteer p{ color: #1e3a8a; }
.help-card.partners  { border-left-color: var(--slate-500);  background: var(--slate-100); }
.help-card.partners h4,.help-card.partners p  { color: var(--slate-700); }
@media (prefers-color-scheme: dark) {
  .help-card { background: #111827; }
  .help-card.housing   { background: #052e26; } .help-card.housing h4, .help-card.housing p { color: #a7f3d0; }
  .help-card.venue     { background: #3d2914; } .help-card.venue h4, .help-card.venue p     { color: #fcd34d; }
  .help-card.volunteer { background: #1e2a5f; } .help-card.volunteer h4, .help-card.volunteer p { color: #bfdbfe; }
  .help-card.partners  { background: #1f2937; } .help-card.partners h4, .help-card.partners p  { color: #d1d5db; }
}

/* ── Info pill (contact "How to Reach Us" cells) ── */
.info-pill {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.info-pill .contact-icon { flex-shrink: 0; }
.info-pill h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.info-pill p { font-size: 0.82rem; line-height: 1.55; margin: 0; }
@media (prefers-color-scheme: dark) {
  .info-pill { background: #111827; }
}

/* ── Program pill rail (events page) ── */
.rail--programs > .program-pill { width: 260px; max-width: 80vw; }
@media (min-width: 900px) {
  .rail--programs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .rail--programs > .program-pill { width: auto; max-width: none; }
}
.program-pill {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--green-600);
}
.program-pill h4 { font-family: 'Inter', sans-serif; margin-bottom: 6px; font-size: 0.98rem; }
.program-pill p { font-size: 0.82rem; line-height: 1.55; }
.program-pill.amber  { border-left-color: var(--amber-500); }
.program-pill.blue   { border-left-color: var(--blue-600); }
@media (prefers-color-scheme: dark) {
  .program-pill { background: #111827; }
}

/* ── Events page horizontal rail variant (upcoming events) ── */
.rail--upcoming > .event-card {
  width: 300px;
  max-width: 82vw;
  display: flex;
  gap: 16px;
  padding: 18px;
  align-items: flex-start;
}
@media (min-width: 900px) {
  .rail--upcoming {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
  .rail--upcoming > .event-card { width: auto; max-width: none; }
}

/* ── Scrollable bottom nav (handles more than 5 items) ── */
.bottom-nav.scrollable {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  justify-content: flex-start;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: none;
}
.bottom-nav.scrollable::-webkit-scrollbar { display: none; }
.bottom-nav.scrollable .bottom-nav-item {
  flex: 0 0 72px;
  scroll-snap-align: center;
  min-width: 64px;
}
@media (min-width: 900px) {
  .bottom-nav.scrollable { display: none; }
}

/* ── Tightened header for sub-pages (mobile) ── */
@media (max-width: 899px) {
  .site-header .header-inner { height: 56px; }
  .site-header .logo-icon { width: 36px; height: 36px; }
  .site-header .logo-text { font-size: 1.05rem; }
  .site-header .logo-text span { display: none; }
}

/* ── Tighter section rhythm on mobile ── */
@media (max-width: 899px) {
  .section,
  .section-mobile { padding: 28px 0; }
  .rail-header { margin-bottom: 12px; padding: 0 20px; }
  .rail-header h2 { font-size: 1.2rem; }
  .rail-header .rail-link { font-size: 0.8rem; }
  .hero { padding: 32px 0 36px; }
  .hero h1 { font-size: 1.65rem; }
  .hero p { font-size: 0.95rem; margin-bottom: 22px; }
  .hero-badge { padding: 5px 12px; font-size: 0.72rem; margin-bottom: 14px; }
  .stats-bar { padding: 14px 0; }
  .rail { padding: 4px 20px 14px; margin: 0 -20px; }
  .section-header { margin-bottom: 18px; }
  .section-header h2 { font-size: 1.35rem; }
  .section-header p  { font-size: 0.9rem; }
}

/* ── Horizontal footer rail on mobile (collapsed columns) ── */
@media (max-width: 899px) {
  .site-footer {
    padding: 32px 0 20px;
  }
  .footer-grid {
    display: block;
    margin-bottom: 20px;
  }
  .footer-brand {
    margin-bottom: 20px;
    text-align: center;
  }
  .footer-brand .logo { justify-content: center; }
  .footer-brand p { font-size: 0.82rem; max-width: 320px; margin: 8px auto 0; }
  .footer-cols-rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 24px;
    margin: 0 -24px;
    scrollbar-width: none;
    scroll-padding: 0 24px;
  }
  .footer-cols-rail::-webkit-scrollbar { display: none; }
  .footer-cols-rail > .footer-col {
    scroll-snap-align: start;
    flex: 0 0 220px;
    background: rgba(255,255,255,0.04);
    padding: 16px 18px;
    border-radius: 14px;
  }
  .footer-col h4 { margin-bottom: 10px; font-size: 0.78rem; }
  .footer-col ul li { margin-bottom: 8px; }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 0.75rem;
  }
}
@media (max-width: 480px) {
  .footer-cols-rail {
    padding: 8px 12px;
    margin: 0 -12px;
    scroll-padding: 0 12px;
  }
}
@media (min-width: 900px) {
  .footer-cols-rail {
    display: contents;
  }
}

/* ============================================
   Property detail view — rail variants
   ============================================ */

/* ── Sidebar cards as rail on mobile ── */
@media (max-width: 899px) {
  .property-content {
    display: block;
    padding: 20px 0;
    gap: 0;
  }
  .property-sidebar {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    padding: 4px 20px 16px;
    margin: 16px -20px 24px;
    scrollbar-width: none;
    position: static;
  }
  .property-sidebar::-webkit-scrollbar { display: none; }
  .property-sidebar > .sidebar-card {
    flex: 0 0 260px;
    max-width: 80vw;
    scroll-snap-align: start;
    margin-bottom: 0;
  }
  .property-main h2 { font-size: 1.2rem; }
  .property-main p { font-size: 0.95rem; }
}

/* ── Feature list as chip rail on mobile ── */
@media (max-width: 899px) {
  .feature-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 20px;
    padding: 4px 20px 14px;
    margin: 14px -20px 0;
    scrollbar-width: none;
  }
  .feature-list::-webkit-scrollbar { display: none; }
  .feature-list li {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 10px 16px 10px 34px;
    background: var(--white);
    border-radius: 100px;
    box-shadow: var(--shadow-sm);
    border: none;
    font-size: 0.82rem;
    color: var(--slate-700);
    white-space: nowrap;
    position: relative;
  }
  .feature-list li::before {
    content: '✓';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--green-600);
    font-weight: 700;
    font-size: 0.82rem;
  }
}
@media (prefers-color-scheme: dark) and (max-width: 899px) {
  .feature-list li { background: #111827; color: #e5e7eb; }
}

/* ── Similar properties as rail on mobile ── */
@media (max-width: 899px) {
  #similarGrid {
    display: flex !important;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    padding: 4px 20px 16px;
    margin: 0 -20px;
    grid-template-columns: none !important;
    scrollbar-width: none;
  }
  #similarGrid::-webkit-scrollbar { display: none; }
  #similarGrid > .property-card {
    flex: 0 0 280px;
    max-width: 80vw;
    scroll-snap-align: start;
  }
}

/* ── Neighborhood card rail (injected with .neighborhood-rail class) ── */
.neighborhood-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
@media (max-width: 899px) {
  .neighborhood-rail {
    display: flex !important;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    padding: 4px 20px 16px;
    margin: 0 -20px;
    grid-template-columns: none !important;
    scrollbar-width: none;
  }
  .neighborhood-rail::-webkit-scrollbar { display: none; }
  .neighborhood-rail > * {
    flex: 0 0 280px;
    max-width: 82vw;
    scroll-snap-align: start;
  }
}

/* ── Compact sidebar card on mobile rail ── */
@media (max-width: 899px) {
  .sidebar-card { padding: 18px; }
  .sidebar-card h4 { font-size: 0.9rem; margin-bottom: 12px; padding-bottom: 10px; }
  .value-display { padding: 14px 0; }
  .value-display .amount { font-size: 1.8rem; }
}

/* ── Property hero: shorter on mobile ── */
@media (max-width: 899px) {
  .property-hero { height: 240px; }
  .property-hero-overlay { padding: 28px 0 20px; }
  .property-hero-overlay h1 { font-size: 1.35rem; }
  .property-hero-overlay p { font-size: 0.88rem; }
  .breadcrumb { padding: 10px 0; font-size: 0.78rem; }
}

/* ── Morphing header: also tuck logo on scroll ── */
@media (max-width: 899px) {
  .site-header.is-scrolled { background: rgba(255,255,255,0.92); }
  .site-header.is-scrolled .header-inner { height: 48px; }
  .site-header.is-scrolled .logo-icon { width: 30px; height: 30px; }
  .site-header.is-scrolled .logo-text { font-size: 0.95rem; }
}
@media (prefers-color-scheme: dark) and (max-width: 899px) {
  .site-header.is-scrolled { background: rgba(11,17,32,0.92); }
}
