:root {
  --crimson: #c8102e;
  --blue: #003893;
  --ink: #1d2433;
  --muted: #6b7280;
  --bg: #f7f5f0;
  --card: #ffffff;
  --line: #e8e2d6;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--blue) 0%, #0a2a6b 60%, var(--crimson) 130%);
  color: #fff;
  padding: 26px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { font-size: 44px; line-height: 1; }
.brand h1 { font-size: 30px; letter-spacing: 0.5px; }
.tagline { opacity: 0.85; font-size: 14px; }
.cta-btn {
  background: #fff; color: var(--blue); font-weight: 700; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; white-space: nowrap;
}
.cta-btn:hover { background: #f0e9d8; }

/* Search band */
.search-band { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0 14px; position: sticky; top: 0; z-index: 5; }
.search-row { display: flex; gap: 10px; align-items: center; }
.search-row #search { flex: 1; min-width: 0; }
#search {
  width: 100%; font-size: 17px; padding: 13px 18px; border: 2px solid var(--line);
  border-radius: 999px; outline: none;
}
#search:focus { border-color: var(--blue); }
.filters-toggle {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 10px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
  color: var(--ink); white-space: nowrap;
}
.filters-toggle .fcount {
  background: var(--crimson); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 7px; margin-left: 4px; font-weight: 800;
}

/* Grid */
.count { color: var(--muted); font-size: 14px; margin: 22px 0 12px; }

/* Directory layout with filter sidebar */
.dir-layout { display: flex; gap: 24px; align-items: flex-start; }
.dir-results { flex: 1; min-width: 0; }
.filters {
  flex: 0 0 252px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.filters-head h2 { font-size: 16px; }
.link-btn {
  border: none; background: none; color: var(--blue); font-size: 13px;
  font-weight: 700; cursor: pointer; padding: 4px 0;
}
.link-btn:hover { text-decoration: underline; }
.filter-group { border-top: 1px solid var(--line); padding: 14px 0 16px; }
.filter-group h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin-bottom: 8px;
}
.filter-list { display: flex; flex-direction: column; gap: 2px; }
.fitem {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: none; background: none; text-align: left; font-size: 14px; color: var(--ink);
  padding: 7px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; width: 100%;
}
.fitem:hover { background: #f4f1e8; }
.fitem.active { background: #eef3ff; color: var(--blue); font-weight: 700; }
.fcount-num {
  font-size: 12px; color: var(--muted); background: #f1ede2;
  border-radius: 999px; padding: 1px 9px; font-weight: 700; flex: 0 0 auto;
}
.fitem.active .fcount-num { background: #dbe7ff; color: var(--blue); }
#filter-city {
  width: 100%; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; margin-top: 10px; color: var(--ink);
}
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 6px 2px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }

/* Sidebar ad slot */
.side-ad {
  border: 1px dashed #b9ac8f; border-radius: 10px; background: #fbf8ef;
  padding: 14px; margin-top: 8px; position: relative;
}
.side-ad strong { font-size: 14px; display: block; margin: 8px 0 2px; }
.side-ad p { font-size: 12.5px; color: var(--muted); }
.side-ad a { font-size: 13px; font-weight: 700; color: var(--blue); text-decoration: none; }
.side-ad a:hover { text-decoration: underline; }
.side-ad-tall { min-height: 250px; display: flex; flex-direction: column; justify-content: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.card h2 { font-size: 17px; line-height: 1.3; min-width: 0; }
.badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  background: #eef3ff; color: var(--blue); border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.card .loc { color: var(--muted); font-size: 13.5px; }
.card .desc { font-size: 14px; color: #374151; flex: 1; }
.card .meta { display: flex; gap: 12px; font-size: 13px; }
.card .meta a { color: var(--blue); text-decoration: none; font-weight: 600; }
.card .meta a:hover { text-decoration: underline; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.view-toggle { display: flex; gap: 0; margin-left: auto; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.view-btn {
  border: none; background: #fff; padding: 8px 18px; font-size: 14px;
  font-weight: 700; cursor: pointer; color: var(--muted);
}
.view-btn.active { background: var(--crimson); color: #fff; }

/* Map */
#map-wrap { padding-bottom: 40px; }
#map {
  height: 68vh; min-height: 420px; border-radius: var(--radius);
  border: 1px solid var(--line); z-index: 1;
}
#map .leaflet-tile-pane { filter: sepia(0.12) saturate(0.92); }
.map-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.leaflet-popup-content { font-family: inherit; line-height: 1.5; }
.leaflet-popup-content h3 { font-size: 15px; margin: 2px 0 4px; }
.leaflet-popup-content .badge { margin-bottom: 4px; display: inline-block; }
.leaflet-popup-content p { margin: 3px 0; font-size: 13px; }
.leaflet-popup-content a { color: var(--blue); font-weight: 600; }
.empty a { color: var(--blue); }
.hidden { display: none !important; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-card {
  background: #fff; border-radius: 18px; max-width: 520px; width: 100%;
  padding: 28px; position: relative; max-height: 85vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; border: none; background: none;
  font-size: 28px; cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-card h2 { font-size: 22px; margin-bottom: 4px; padding-right: 30px; }
.modal-card .loc { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.modal-card .desc { margin: 12px 0; }
.detail-row { display: flex; gap: 10px; font-size: 14.5px; padding: 7px 0; border-top: 1px solid #f0ece1; }
.detail-row .k { font-weight: 700; min-width: 86px; color: #4b5563; }
.detail-row a { color: var(--blue); font-weight: 600; text-decoration: none; }
.detail-row a:hover { text-decoration: underline; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 12px; background: #f1ede2; border-radius: 999px; padding: 3px 10px; color: #4b5563; }

/* Footer */
.site-footer { background: #141a28; color: #cbd5e1; padding: 34px 0; font-size: 14px; }
.site-footer strong { color: #fff; }
.site-footer .fine { margin-top: 8px; font-size: 13px; opacity: 0.75; }
.site-footer a { color: #fff; }

@media (max-width: 900px) {
  .dir-layout { flex-direction: column; }
  .dir-results { width: 100%; }
  .filters { display: none; width: 100%; flex: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-block; }
}

@media (max-width: 560px) {
  .brand h1 { font-size: 24px; }
  .brand-mark { font-size: 36px; }
  .site-header { padding: 20px 0; }
  .search-band { padding: 14px 0 12px; }
  .search-row { flex-wrap: wrap; }
  .search-row #search { flex: 1 1 100%; order: -1; }
  .nav-btn { font-size: 14px; padding: 8px 14px; }
  .preview-pill { margin-left: 2px; }
  .modal-card { padding: 22px 18px; }
  .modal-card h2 { font-size: 19px; }
  .count { margin: 16px 0 10px; }
}

/* ---- Monetization MVP ---- */

.main-nav { background: #141a28; }
.nav-inner {
  display: flex; gap: 6px; padding-top: 10px; padding-bottom: 10px;
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-btn {
  border: none; background: transparent; color: #cbd5e1; font-size: 15px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; flex: 0 0 auto;
}
.nav-btn:hover { color: #fff; }
a.nav-btn { text-decoration: none; display: inline-block; }
.nav-btn.active { background: var(--crimson); color: #fff; }
.preview-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  background: #f59e0b; color: #141a28; border-radius: 999px; padding: 2px 8px; margin-left: 4px;
  vertical-align: 2px;
}

.section-title { font-size: 20px; margin: 26px 0 12px; }

/* Ad slot */
.ad-slot {
  border: 1px dashed #b9ac8f; border-radius: var(--radius); background: #fbf8ef;
  margin-top: 22px; padding: 14px 18px; position: relative;
}
.ad-label {
  position: absolute; top: -10px; left: 16px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; background: #b9ac8f; color: #fff;
  border-radius: 4px; padding: 2px 8px;
}
.ad-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ad-body strong { font-size: 16px; }
.ad-body p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ad-cta {
  background: var(--blue); color: #fff; font-weight: 700; text-decoration: none;
  padding: 10px 20px; border-radius: 999px; font-size: 14px; white-space: nowrap;
}
.ad-cta:hover { background: #002a70; }

/* Featured */
.featured-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.featured-card {
  border: 2px solid #d4a017; background: linear-gradient(180deg, #fffdf5 0%, #ffffff 60%);
}
.featured-card.mini .desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.featured-tag {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: #8a6100; background: #fbeec1; border-radius: 6px;
  padding: 3px 10px; margin-bottom: 2px; align-self: flex-start;
}
.featured-tag.inline { margin: 0 0 8px 8px; vertical-align: 3px; }
.featured-cta { font-size: 13.5px; color: var(--muted); margin: 6px 0 4px; }
.featured-cta a { color: var(--blue); font-weight: 700; }

/* Verified badge */
.verified {
  font-size: 12px; font-weight: 700; color: #047857; background: #d1fae5;
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.page-title .verified { font-size: 12px; }

/* Premium profile */
.premium-box {
  border: 2px solid #d4a017; border-radius: 12px; background: #fffdf5;
  padding: 14px; margin: 14px 0;
}
.premium-head { font-weight: 800; color: #8a6100; font-size: 14px; margin-bottom: 10px; }
.photo-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.photo-ph {
  aspect-ratio: 4 / 3; border-radius: 8px;
  background: linear-gradient(135deg, #e8e2d6 0%, #d8cfba 50%, #e8e2d6 100%);
  border: 1px dashed #b9ac8f;
}
.premium-note { font-size: 13px; color: var(--muted); }

/* Boards */
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.board-head .section-title { margin: 18px 0 4px; }
.board-sub { color: var(--muted); font-size: 14px; max-width: 560px; }
.cta-dark { background: var(--crimson); color: #fff; margin-top: 22px; }
.cta-dark:hover { background: #a00d26; }
.demo-banner {
  background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; border-radius: 10px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; margin-top: 22px;
}
.demo-tag {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  background: #f59e0b; color: #141a28; border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
#job-search, #housing-search {
  width: 100%; font-size: 16px; padding: 12px 18px; border: 2px solid var(--line);
  border-radius: 999px; outline: none; margin-top: 14px; background: #fff;
}
#job-search:focus, #housing-search:focus { border-color: var(--blue); }
.job-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.job-pill {
  font-size: 12px; font-weight: 700; background: #eef3ff; color: var(--blue);
  border-radius: 999px; padding: 3px 10px;
}
.apply-btn {
  display: inline-block; margin-top: 6px; background: var(--crimson); color: #fff !important;
  font-weight: 700; text-decoration: none; padding: 9px 20px; border-radius: 999px;
  font-size: 14px; text-align: center; align-self: flex-start;
}
.apply-btn:hover { background: #a00d26; }

/* Event cards */
.event-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.event-card { border-top: 3px solid #d4a017; }
.event-top { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; flex-wrap: wrap; }
.event-top > div { min-width: 0; flex: 1 1 160px; }
.event-top h2 { font-size: 1.12rem; margin: 0; }
.event-date {
  flex: 0 0 auto; width: 58px; text-align: center;
  background: #a5123a; color: #fff; border-radius: 8px; overflow: hidden;
}
.ed-mon { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .3rem 0; background: rgba(0,0,0,.18); }
.ed-day { display: block; font-size: 1.5rem; font-weight: 800; padding: .35rem 0 .45rem; }
.event-when { margin: .2rem 0 0; font-size: .85rem; color: #555; }
.demo-tag {
  margin-left: auto; flex: 0 0 auto; font-size: .7rem; font-weight: 700;
  background: #eee; color: #777; border-radius: 999px; padding: .2rem .6rem;
}
.event-card .loc { font-size: .85rem; color: #555; margin: 0 0 .5rem; }
.event-card .desc { font-size: .92rem; color: #333; margin: 0; }

/* Contact box */
.contact-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 28px 0; }
.contact-sub { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-row label .opt { font-weight: 400; color: var(--muted); }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"], .form-row select, .form-row textarea {
  width: 100%; font-size: 15px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); outline: none; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--blue); }
.form-row textarea { resize: vertical; }
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; opacity: 0; }
.contact-status { font-size: 14px; font-weight: 600; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; }
.contact-status.ok { background: #e6f4ea; color: #137333; }
.contact-status.err { background: #fce8e6; color: #a50e0e; }
.contact-box button.cta-btn { border: none; cursor: pointer; font-family: inherit; }
.contact-box button.cta-btn:disabled { opacity: 0.6; cursor: default; }
