/* PostJob Homes — property search, post form, photos, gallery, maps. Mobile-first; uses the
   tokens and components from style.css. Loaded only on Homes pages (and the dashboard). */

/* ---------- Shared bits ---------- */
.notice-success { background: var(--green-soft); color: var(--green-dark); }
.field-label { font-weight: 700; font-size: .9rem; margin: 0 0 8px; color: var(--ink); }
.badge-rent { background: var(--green-soft); color: var(--green-dark); }
.badge-sale { background: #f3e8ff; color: #6b21a8; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag-good { background: var(--green-soft); color: var(--green-dark); border-color: #c4ead4; }
.tag-warn { background: var(--orange-soft); color: #8a4500; border-color: #fbd9b0; }

/* Radio / checkbox pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--ink-2); transition: border-color .15s, background .15s, color .15s; user-select: none; }
.pill:hover span { border-color: var(--blue); }
.pill input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.pill input:focus-visible + span { outline: 3px solid rgba(26, 110, 245, .4); outline-offset: 2px; }
.pills-lg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pills-lg .pill span { display: flex; width: 100%; padding: 11px 12px; font-size: .92rem; border-radius: 12px; }
.pills-sm { gap: 6px; }
.pills-sm .pill span { padding: 5px 11px; font-size: .82rem; }

/* Rent / sale choice */
.deal-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.deal-option { position: relative; cursor: pointer; }
.deal-option input { position: absolute; opacity: 0; }
.deal-option span { display: grid; gap: 2px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.deal-option b { font-size: 1.05rem; }
.deal-option small { color: var(--muted); font-size: .8rem; }
.deal-option input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.deal-option input:focus-visible + span { outline: 3px solid rgba(26, 110, 245, .45); }

/* ---------- Maps ---------- */
.map-box { position: relative; height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #e8eef5 linear-gradient(135deg, #eef3f8 25%, #e5ecf3 25%, #e5ecf3 50%, #eef3f8 50%, #eef3f8 75%, #e5ecf3 75%) 0 0 / 24px 24px; z-index: 0; }
.map-box > p { padding: 14px; margin: 0; }
.loc-error { margin: 8px 0 0; }
.map-box.is-set { border-color: var(--green); }
.map-results { height: min(70vh, 560px); margin-bottom: 14px; }
.map-area { height: 220px; }
.map-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pj-pin { background: none; border: 0; }
.pj-pin svg { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.pj-price-pin { background: none; border: 0; }
.pj-price-pin span { display: inline-block; white-space: nowrap; background: var(--blue); color: #fff; font: 800 .78rem/1 var(--font); padding: 6px 8px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); position: relative; }
.pj-price-pin span::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--blue); }
.leaflet-container { font-family: var(--font); }

/* ---------- Search ---------- */
.homes-kicker { margin: 0 0 4px; font-size: .8rem; font-weight: 800; letter-spacing: .04em; color: var(--blue); text-transform: uppercase; }
.city-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.city-chips::-webkit-scrollbar { display: none; }
.city-chips .chip { flex: none; padding: 6px 12px; font-size: .85rem; background: var(--surface); text-decoration: none; }
.city-chips .chip small { color: var(--muted); font-weight: 700; margin-left: 2px; }
.city-chips .chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.city-chips .chip.is-on small { color: rgba(255, 255, 255, .7); }
.seg-sm button { padding: 6px 12px; font-size: .82rem; }
.grid-homes { display: grid; gap: 14px; grid-template-columns: 1fr; }
.homes-safety { margin-top: 16px; background: var(--surface-2); }
.homes-safety p { margin: 0; }

/* Property card */
.prop-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; transition: box-shadow .18s, transform .18s; }
.prop-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.prop-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.prop-media img { width: 100%; height: 100%; object-fit: cover; }
.prop-noimg { display: grid; place-items: center; height: 100%; font-size: 2.6rem; }
.prop-count { position: absolute; right: 8px; bottom: 8px; background: rgba(11, 26, 51, .75); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.prop-verified { position: absolute; left: 8px; top: 8px; background: rgba(15, 157, 88, .95); color: #fff; font-size: .72rem; font-weight: 800; padding: 4px 8px; border-radius: 6px; }
.prop-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.prop-price { margin: 0; font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.prop-price small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.prop-title { margin: 0; font-size: .98rem; line-height: 1.3; }
.prop-title a { color: var(--ink); }
.prop-title a::after { content: ""; position: absolute; inset: 0; }
.prop-title a:hover { color: var(--blue); text-decoration: none; }
.prop-spec { margin: 0; font-size: .86rem; color: var(--ink-2); }
.prop-loc { margin: 0; display: flex; align-items: center; gap: 4px; font-size: .86rem; color: var(--ink-2); }
.prop-loc .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.prop-loc b { color: var(--blue); }
.prop-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prop-foot { margin: 6px 0 0; font-size: .76rem; color: var(--muted); }

/* ---------- Detail page ---------- */
.prop-article { padding: 0; overflow: hidden; }
.prop-article > :not(.gallery):not(.pay-box):not(.posted-banner):not(.notice) { margin-left: 16px; margin-right: 16px; }
.prop-article > .pay-box, .prop-article > .posted-banner, .prop-article > .notice { margin: 14px 16px; }
.prop-article > h2 { margin-top: 18px; }
.prop-article > :last-child { margin-bottom: 18px; }
.prop-head { padding-top: 14px; display: grid; gap: 6px; }
.prop-head h1 { margin: 0; font-size: 1.35rem; }
.prop-price-lg { font-size: 1.5rem; }
.gallery { position: relative; background: #0b1a33; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; max-height: 70vh; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: contain; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; pointer-events: none; }
.gallery-empty { display: grid; place-items: center; aspect-ratio: 16 / 9; font-size: 3rem; background: var(--surface-2); }
.photo-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5, 10, 20, .96); color: #fff; }
.photo-dialog[open] { display: grid; place-items: center; }
.photo-dialog img { max-width: 100vw; max-height: 86vh; object-fit: contain; }
.photo-close, .photo-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.photo-close { top: 12px; right: 12px; }
.photo-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.photo-next { right: 10px; top: 50%; transform: translateY(-50%); }
.photo-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; margin: 0; font-size: .85rem; opacity: .8; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Post form: photos ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.ph-grid:empty { display: none; }
.ph-tile { position: relative; margin: 0; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--green); background: var(--surface-2); min-height: 120px; }
.ph-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph-tile figcaption { padding: 6px 8px; font-size: .76rem; font-weight: 700; color: var(--green-dark); background: var(--green-soft); }
.ph-tile.is-bad { border-color: var(--orange); }
.ph-tile.is-bad figcaption { color: #8a4500; background: var(--orange-soft); }
.ph-tile.is-loading { border-color: var(--line-2); display: grid; align-content: end; }
.ph-tile.is-loading figcaption { color: var(--ink-2); background: var(--surface); }
.ph-tile.is-error { border-color: var(--red); display: grid; align-content: center; }
.ph-tile.is-error figcaption { color: var(--red); background: var(--red-soft); padding: 12px 34px 12px 10px; }
.ph-progress { height: 6px; background: var(--line); margin: 0 8px 8px; border-radius: 3px; overflow: hidden; }
.ph-progress span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.ph-cover { position: absolute; left: 6px; top: 6px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.ph-btn { position: absolute; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(11, 26, 51, .78); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ph-del { right: 6px; }
.ph-make-cover { left: 6px; font-size: .9rem; }
.ph-take { cursor: pointer; }
.ph-take.disabled { opacity: .6; pointer-events: none; }
.tips { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- Dashboard ---------- */
.homes-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.homes-card-head h2 { margin: 0; }
.home-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.home-row:first-child { border-top: 0; }
.home-row-img { display: grid; place-items: center; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface-2); font-size: 1.8rem; }
.home-row-img img { width: 100%; height: 100%; object-fit: cover; }
.home-row-body { min-width: 0; display: grid; gap: 2px; }
.home-row-body h3 { margin: 0; font-size: .95rem; }
.home-row-body p { margin: 0; }
.home-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

@media (min-width: 600px) {
  .pills-lg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-homes { grid-template-columns: repeat(2, 1fr); }
  .ph-grid { grid-template-columns: repeat(3, 1fr); }
  .prop-head h1 { font-size: 1.6rem; }
  .map-box { height: 320px; }
  .map-area { height: 260px; }
}
@media (min-width: 900px) {
  .gallery-item { aspect-ratio: 16 / 10; }
}
@media (min-width: 1200px) {
  .grid-homes { grid-template-columns: repeat(3, 1fr); }
}
