/* ===========================================================
   Howdy, Neighbor — "neighborhood feed" theme
   Facebook/Twitter-style light social UI, still location-first
   =========================================================== */

:root {
  --hn-bg: #f0f2f5;
  --hn-surface: #ffffff;
  --hn-border: #e4e6eb;
  --hn-text: #050505;
  --hn-text-muted: #65676b;
  --hn-primary: #1877f2;   /* Facebook blue */
  --hn-primary-dark: #145dbf;
  --hn-accent: #f4a259;    /* porch-light orange, used sparingly for the location badge */
  --hn-radius: 14px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--hn-bg);
  color: var(--hn-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 2rem;
}

.container {
  max-width: 1200px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

a { color: var(--hn-primary); text-decoration: none; }
a:hover { color: var(--hn-primary-dark); }

/* ---------- Top navbar (Facebook-style) ---------- */
.navbar {
  background-color: var(--hn-surface) !important;
  border-bottom: 1px solid var(--hn-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.navbar .container {
  gap: 0.5rem;
}
.navbar-brand {
  color: var(--hn-primary) !important;
  font-weight: 800;
  font-size: 1.2rem;
  white-space: nowrap;
}
.navbar-brand::before { content: "🏡 "; }
.navbar-dark .navbar-toggler { border-color: var(--hn-border); }
.navbar-collapse {
  flex-grow: 1;
}
.navbar-nav {
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 0.15rem;
}
.nav-item {
  white-space: nowrap;
}
.nav-link {
  color: var(--hn-text) !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4rem 0.7rem !important;
  font-size: 0.92rem;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background-color: rgba(24,119,242,0.08); color: var(--hn-primary) !important; }
.nav-link.active {
  color: var(--hn-primary) !important;
  background-color: rgba(24,119,242,0.12);
}
.nav-link.text-danger { color: #e0245e !important; }
.nav-link.text-warning { color: #ffab00 !important; }

/* ---------- Layout shell ---------- */
.feed-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 992px) {
  .feed-shell { grid-template-columns: 2.2fr 1fr; align-items: start; }
}
.feed-sidebar { position: sticky; top: 1rem; }

@media (max-width: 575.98px) {
  .navbar-brand {
    font-size: 1.15rem;
  }
  .navbar-nav {
    gap: 0.15rem;
  }
  .nav-link {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.9rem;
  }
  .location-badge {
    display: none !important;
  }
  .composer form,
  .post-actions,
  .d-flex.justify-content-center.gap-2,
  .message-header,
  .message-user {
    flex-wrap: wrap;
  }
  .composer form {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
  }
  .composer .btn,
  .d-flex.justify-content-center.gap-2 .btn,
  .message-shell .btn,
  .message-header .btn {
    width: 100%;
  }
  .feed-shell {
    gap: 0.9rem;
  }
  .post-card,
  .card,
  .profile-card,
  .message-shell {
    border-radius: 16px;
  }
  .post-header {
    align-items: flex-start;
  }
  .post-actions {
    gap: 0.65rem;
  }
  .chat-box {
    min-height: 50vh;
  }
  .message {
    max-width: 92%;
  }
}

/* ---------- Location badge ---------- */
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(244,162,89,0.15);
  color: #a15d1a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* ---------- Cards (posts, panels) ---------- */
.card {
  background-color: var(--hn-surface);
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius);
  color: var(--hn-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.card .display-6 { color: var(--hn-primary); font-weight: 800; }

/* ---------- Composer (post box) ---------- */
.composer {
  background: var(--hn-surface);
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.composer .form-control {
  border-radius: 999px;
  background: var(--hn-bg);
  border: 1px solid #e5e7eb;
}
.composer .btn { border-radius: 999px; padding-inline: 1.25rem; }

/* ---------- Feed posts ---------- */
.post-card {
  background: var(--hn-surface);
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius);
  padding: 1rem 1rem 0.9rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover {
  box-shadow: 0 6px 18px rgba(24,119,242,0.08);
}
.post-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.post-author { font-weight: 700; }
.post-meta { font-size: 0.8rem; color: var(--hn-text-muted); }
.post-body {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 1rem;
  color: #1d2433;
}
.post-actions {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  align-items: center;
}
.post-actions a,
.post-actions button,
.show-more-comments {
  color: var(--hn-text-muted);
  font-weight: 600;
}
.post-actions a:hover,
.post-actions button:hover,
.show-more-comments:hover { color: var(--hn-primary); }
.post-card.mine { border-color: rgba(24,119,242,0.25); background: #f8fbff; }

.comment-hidden {
  transition: all 0.2s ease;
}

.comment-edit-form,
.post-edit-form {
  background: #f8f9fb;
  border: 1px solid var(--hn-border);
  border-radius: 12px;
  padding: 0.75rem;
}

.show-more-comments {
  padding: 0;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.post-actions .btn-link,
.post-actions .btn {
  text-decoration: none;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  background-color: var(--hn-surface);
  color: var(--hn-text);
  border: 1px solid #ccd0d5;
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--hn-primary);
  box-shadow: 0 0 0 0.2rem rgba(24,119,242,0.15);
}
.form-floating > label { color: var(--hn-text-muted); }

/* ---------- Buttons ---------- */
.btn-primary {
  background-color: var(--hn-primary);
  border-color: var(--hn-primary);
  font-weight: 700;
  border-radius: 8px;
}
.btn-primary:hover { background-color: var(--hn-primary-dark); border-color: var(--hn-primary-dark); }
.btn-outline-light {
  color: var(--hn-primary);
  border-color: var(--hn-primary);
  background: #eef4fd;
  font-weight: 700;
}
.btn-outline-light:hover { background-color: var(--hn-primary); color: #fff; }

/* ---------- Avatars ---------- */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--hn-primary), #66a3ff);
}
.avatar.sm { width: 40px; height: 40px; min-width: 40px; font-size: 0.95rem; }
.avatar.md { width: 56px; height: 56px; min-width: 56px; font-size: 1.2rem; }
.avatar.lg { width: 88px; height: 88px; min-width: 88px; font-size: 1.9rem; }

/* ---------- DM bubbles (Twitter/Messenger style, kept for pm.php) ---------- */
.chat-box {
  background: var(--hn-bg);
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius);
}
.message { display: flex; gap: 0.6rem; align-items: flex-start; max-width: 80%; }
.message.me { align-self: flex-end; flex-direction: row-reverse; }
.message .bubble { padding: 10px 15px; border-radius: 16px; }
.message.me .bubble { background: var(--hn-primary); color: #fff; border-bottom-right-radius: 4px; }
.message.other .bubble { background: var(--hn-surface); border: 1px solid var(--hn-border); border-bottom-left-radius: 4px; }
.msg-meta { font-size: 0.7rem; color: var(--hn-text-muted); margin-top: 2px; }

/* ---------- Nearby-neighbor list (sidebar widget) ---------- */
.nearby-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hn-border);
}
.nearby-item:last-child { border-bottom: none; }
.nearby-name { font-weight: 700; font-size: 0.92rem; }
.nearby-sub { font-size: 0.78rem; color: var(--hn-text-muted); }

/* ---------- Profile ---------- */
.profile-card {
  background-color: var(--hn-surface);
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius);
}
.profile-cover {
  height: 120px;
  border-radius: var(--hn-radius) var(--hn-radius) 0 0;
  background: linear-gradient(120deg, var(--hn-primary), #66a3ff 60%, var(--hn-accent));
}

/* ---------- Misc ---------- */
hr { border-color: var(--hn-border); opacity: 1; }
.table { --bs-table-bg: var(--hn-surface); color: var(--hn-text); }
.text-body-secondary { color: var(--hn-text-muted) !important; }
