/* Town home v3 — "chapters" (test variant, ?home=chapters). Loaded ONLY when the variant is on
   (index.php $home3), so nothing here can touch the live home or any other page.
   The wrapper is `.home2.home3`: it inherits the v2 home styles, and everything below re-skins
   the reused sections into ONE card system (same shell, same header, same empty state). */

/* ---- page frame: the rail is retired on this home; content gets the full width ---- */
body.home3-on .app{grid-template-columns:minmax(0,1fr);max-width:1180px}
body.home3-on .side{display:none}
.home3{--h3-r:16px;--h3-shadow:0 1px 2px rgba(16,24,40,.04),0 1px 3px rgba(16,24,40,.06);padding:18px 24px 56px;gap:16px}
.home3 .h3-preview{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);background:var(--surface);border:1px dashed var(--line-2);border-radius:12px;padding:8px 14px}
.home3 .h3-preview a{color:var(--green);font-weight:700}

/* ---- HERO: the town's album cover (existing hero left, photo mosaic right) ---- */
.home3 .h3-hero{display:grid;grid-template-columns:1.65fr 1fr;gap:8px;height:420px;border-radius:20px;overflow:hidden}
.home3 .h3-hero-main{position:relative;min-width:0}
.home3 .h3-hero-main .home-hero{height:100%;min-height:0;border-radius:0;margin:0}
.home3 .h3-hero-main .hh-title{font-size:52px;line-height:1}
.home3 .h3-mosaic{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:8px;min-width:0}
.home3 .h3-tile{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;padding:14px;color:#fff;text-decoration:none;min-height:0}
.home3 .h3-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.home3 .h3-photo::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 45%,rgba(0,0,0,.62))}
.home3 .h3-photo .h3-by{position:absolute;top:10px;left:10px;z-index:1;font-size:11px;font-weight:700;background:rgba(0,0,0,.5);border-radius:999px;padding:3px 8px}
.home3 .h3-photo .h3-cap{position:relative;z-index:1;font-family:var(--display);font-weight:700;font-size:14px;line-height:1.2}
.home3 .h3-wanted{background:var(--surface);color:var(--text);border:2px dashed #cfd6dc;align-items:center;justify-content:center;text-align:center;gap:3px;transition:background .15s,border-color .15s}
.home3 .h3-wanted:hover{border-color:var(--green);background:#f0f8f3}
.home3 .h3-wanted b{font-family:var(--display);font-size:14px}
.home3 .h3-wanted small{font-size:11.5px;color:var(--muted)}
.home3 .h3-cam{width:38px;height:38px;border-radius:50%;background:#eafaf1;display:grid;place-items:center;font-size:18px;margin-bottom:4px}
.home3 .h3-add{background:#f0f8f3;border-color:#9fd8b8}
.home3 .h3-add .h3-cam{background:var(--green);color:#fff;font-weight:700}

/* ---- sticky chapter nav: the page's table of contents ---- */
.home3 .h3-nav{position:sticky;top:var(--h3-hdr,0px);z-index:30;display:flex;align-items:center;gap:6px;margin:0 -24px;padding:8px 24px;background:rgba(243,245,246,.92);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.home3 .h3-nav a{font-weight:700;font-size:14px;padding:8px 14px;border-radius:999px;color:var(--muted);white-space:nowrap}
.home3 .h3-nav a.on{background:var(--text);color:#fff}
.home3 .h3-nav a:not(.on):not(.h3-post):hover{background:#e6eaed}
.home3 .h3-nav .h3-post{margin-left:auto;background:var(--green);color:#fff;padding:9px 18px}

/* ---- chapters ---- */
.home3 .h3-chap{display:flex;flex-direction:column;gap:14px;padding-top:14px;scroll-margin-top:calc(var(--h3-hdr,0px) + 60px)}
.home3 .h3-chap-h{display:flex;align-items:baseline;gap:12px;padding:0 2px;flex-wrap:wrap}
.home3 .h3-n{font-family:var(--display);font-weight:800;font-size:13px;color:#fff;background:var(--green);border-radius:8px;padding:3px 8px;position:relative;top:-5px}
.home3 .h3-chap-h h2{font-family:var(--display);font-size:32px;font-weight:800;letter-spacing:-.02em;line-height:1.1}
.home3 .h3-chap-h p{color:var(--muted);font-size:15px}
.home3 .h3-more{margin-left:auto;font-weight:700;font-size:13.5px;color:var(--green);white-space:nowrap}
.home3 .h3-grid{display:grid;gap:14px;align-items:start}
.home3 .h3-g21{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
.home3 .h3-g11{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.home3 .h3-stack{display:flex;flex-direction:column;gap:14px;min-width:0}

/* ---- THE card: every block on the page ---- */
.home3 .h3-card{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--h3-r);box-shadow:var(--h3-shadow);overflow:hidden;min-width:0}
.home3 .h3-ch{display:flex;align-items:center;gap:10px;padding:14px 18px 10px}
.home3 .h3-ic{width:28px;height:28px;flex:none;border-radius:8px;background:#eafaf1;display:grid;place-items:center;font-size:15px}
.home3 .h3-ch h3{font-family:var(--display);font-size:17px;font-weight:800;letter-spacing:-.01em}

/* Reused sections sit INSIDE a card: strip their own card chrome… */
.home3 .h3-wrap>section,.home3 .h3-wrap>.town-about,.home3 .h3-wrap>.town-news,.home3 .h3-wrap>.home-basics,.home3 .h3-wrap>.tt-neighbors,.home3 .h3-wrap .rk-rail{margin:0;border:0;border-radius:0;box-shadow:none;background:none}
.home3 .h3-wrap>.h2sec,.home3 .h3-wrap>.town-news,.home3 .h3-wrap>.home-basics,.home3 .h3-wrap>.tt-neighbors{padding:0 18px 16px}
/* …and turn their kicker+title headings into the same card header */
.home3 .h3-wrap .h2-head{margin:0 -18px 4px;padding:14px 18px 10px;align-items:center}
.home3 .h3-wrap .h2-kicker{display:none}
.home3 .h3-wrap .h2-head h2,.home3 .h3-wrap .hb-head h3,.home3 .h3-wrap .town-news h2{font-family:var(--display);font-size:17px;font-weight:800;letter-spacing:-.01em;color:var(--text)}
.home3 .h3-wrap .h2-head h2::before,.home3 .h3-wrap .hb-head h3::before,.home3 .h3-wrap .ta-head h3::before,.home3 .h3-wrap .rk-rail .ch h4::before{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#eafaf1;font-size:15px;margin-right:10px;vertical-align:middle}
.home3 .h3-posts .h2-head h2::before{content:"💬"}
.home3 .h3-events .h2-head h2::before{content:"📅"}
.home3 .h3-news .h2-head h2::before{content:"📰"}
.home3 .h3-places .h2-head h2::before{content:"📍"}
.home3 .h3-basics .hb-head h3::before{content:"🗓️"}
.home3 .h3-about .ta-head h3::before{content:"🏛️"}
.home3 .h3-ranks .rk-rail .ch h4::before{content:"🏆"}
.home3 .h3-nbmap .h2-head h2::before{content:"🧭"}
.home3 .h3-wrap .h2-head a,.home3 .h3-wrap .hb-head a{font-size:13px;font-weight:700;color:var(--green)}

/* posts + events: rows with hairlines instead of cards-in-a-card */
.home3 .h3-wrap .h2card{gap:0}
.home3 .h3-wrap .h2card .post,.home3 .h3-wrap .h2card .home-event{border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;margin:0;padding:14px 0;background:none}
.home3 .h3-wrap .h2card>:first-child{border-top:0;padding-top:4px}
.home3 .h3-wrap .h2card .post:hover,.home3 .h3-wrap .h2card .home-event:hover{box-shadow:none}
.home3 .h3-wrap .home-event .datebox{background:var(--green);color:#fff;width:46px;height:50px}
/* the ONE empty state */
.home3 .empty-nudge{margin:0;border:1.5px dashed #d5dce2;border-radius:12px;background:none;box-shadow:none;padding:12px 14px}
.home3 .feed-hint{margin:0}


/* weather: the strip becomes the card body */
.home3 .h3-wx .wx-preview{margin:0;border:0;box-shadow:none;background:none;padding:0 18px 14px;border-radius:0}

/* news */
.home3 .h3-news .town-news{padding:0 18px 12px}
.home3 .h3-news .news-credit{font-size:11.5px}

/* the weekly: the green lead of chapter 1 */
.home3 .tw{margin:0;border:0;border-radius:var(--h3-r);background:linear-gradient(135deg,#0e9f57,#0b7f45);color:#fff;box-shadow:var(--h3-shadow)}
.home3 .tw *{color:inherit}
.home3 .tw .tw-kick,.home3 .tw .tw-dateline,.home3 .tw .tw-foot{opacity:.85}
.home3 .tw .tw-more{color:#fff;font-weight:700}
.home3 .tw a{color:#fff}

/* album / shot list */
.home3 .h3-progress{display:flex;align-items:center;gap:12px;font-size:13.5px;color:var(--muted);padding:0 18px 12px}
.home3 .h3-progress b{color:var(--text)}
.home3 .h3-bar{flex:1;height:8px;border-radius:99px;background:var(--line);overflow:hidden;min-width:60px}
.home3 .h3-bar i{display:block;height:100%;background:var(--green);border-radius:99px;min-width:8px}
.home3 .h3-shots{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;padding:0 18px 18px}
.home3 .h3-shot{aspect-ratio:1/1;border-radius:12px;position:relative;overflow:hidden;background:var(--surface-2);border:1.5px dashed #d5dce2;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8px;gap:4px;color:var(--text)}
.home3 .h3-shot:hover{border-color:var(--green);background:#f0f8f3}
.home3 .h3-emo{font-size:22px}
.home3 .h3-shot b{font-size:12.5px;line-height:1.2;position:relative;z-index:1}
.home3 .h3-shot small{font-size:11px;color:var(--green);font-weight:700;position:relative;z-index:1}
.home3 .h3-shot.done{border:0;justify-content:flex-end;color:#fff}
.home3 .h3-shot.done img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.home3 .h3-shot.done::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 40%,rgba(0,0,0,.65))}
.home3 .h3-shot.done small{color:#fff}
.home3 .h3-tick{position:absolute;top:8px;right:8px;z-index:1;width:22px;height:22px;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:800}

/* places */
.home3 .h3-places .place-list{grid-template-columns:1fr 1fr;gap:0 18px}
.home3 .h3-places .place-row{border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;background:none;margin:0;padding:12px 0}

/* know: about, ranks, basics, neighbors */
.home3 .h3-about .town-about{padding:0}
.home3 .h3-about .ta-head{padding:14px 18px 10px;margin:0}
.home3 .h3-about .ta-head h3{font-family:var(--display);font-size:17px;font-weight:800}
.home3 .h3-about .ta-facts{margin:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0}
.home3 .h3-about .ta-extract,.home3 .h3-about .ta-site,.home3 .h3-about .ta-credit{padding-left:18px;padding-right:18px}
.home3 .h3-about .ta-credit{padding-bottom:14px}
.home3 .h3-ranks .rk-rail .ch{padding:14px 18px 10px;border:0}
.home3 .h3-ranks .rk-rail .ch h4{font-family:var(--display);font-size:17px;font-weight:800}
.home3 .h3-ranks .rk-rail .card-content{padding:0 18px 16px}
.home3 .h3-nbmap .tt-nb-card{border:0;box-shadow:none;padding:0;background:none}
.home3 .h3-towns{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 18px}
.home3 .h3-towns a{border:1px solid var(--line-2);border-radius:999px;padding:6px 12px;font-size:13.5px;font-weight:600;color:var(--text)}
.home3 .h3-towns small{color:var(--faint);font-weight:500;margin-left:5px}

/* ---- tablet / phone ---- */
@media (max-width:900px){
  .home3{padding:12px 14px 48px}
  .home3 .h3-g21,.home3 .h3-g11{grid-template-columns:minmax(0,1fr)}
  .home3 .h3-shots{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:640px){
  .home3 .h3-hero-main .hh-title{font-size:38px}
  .home3 .h3-nav{margin:0 -14px;padding:8px 14px;overflow-x:auto;scrollbar-width:none}
  .home3 .h3-nav::-webkit-scrollbar{display:none}
  .home3 .h3-nav .h3-post{display:none}
  .home3 .h3-chap-h h2{font-size:26px}
  .home3 .h3-chap-h p{order:3;width:100%}
  .home3 .h3-prog-note{display:none}
  .home3 .h3-places .place-list{grid-template-columns:1fr}
}

/* fixes after first live render */
.home3 .tw .tw-foot{background:rgba(0,0,0,.12);border-top:1px solid rgba(255,255,255,.18);color:#fff}
.home3 .tw .tw-body{border-color:rgba(255,255,255,.18)}
.home3 .h3-about .ta-facts{padding:12px 18px;gap:24px}
/* phone: the site header is already pinned (~166px), so a second pinned bar would eat a quarter
   of the screen — the chapter nav scrolls with the page there and acts as jump links. */
@media (max-width:640px){.home3 .h3-nav{position:static}}

/* ================= v2 (after Jamie's first live review) ================= */

/* equal-height pairs: side-by-side cards always end on the same line */
.home3 .h3-eq{align-items:stretch}
.home3 .h3-eq>.h3-card{height:100%}

/* neighbors card: composer on top, posts in an even grid (an odd last post spans the row) */
.home3 .h3-posts .h3-composer .ic-wrap{margin:0;padding:14px 18px 4px}
.home3 .h3-posts .h3-composer .ic-chips{margin-top:10px}
.home3 .h3-posts>.h2sec{border-top:1px solid var(--line);margin-top:12px}
.home3 .h3-posts .h2card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.home3 .h3-posts .h2card>.post{border:1px solid var(--line);border-radius:12px;background:var(--surface-2);padding:14px 16px;min-width:0}
.home3 .h3-posts .h2card>.post:first-child{padding-top:14px;border-top:1px solid var(--line)}
.home3 .h3-posts .h2card>.post:last-child:nth-child(odd){grid-column:1/-1}

/* news: three headlines across instead of a tall column */
.home3 .h3-news .news-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 22px}
.home3 .h3-news .news-story{border-bottom:0;padding:6px 0 10px;flex-direction:column;gap:8px}
.home3 .h3-news .news-story img{width:100%;height:120px;object-fit:cover;border-radius:10px}

/* weather card fills its half */
.home3 .h3-wx{display:flex;flex-direction:column}
.home3 .h3-wx .wx-preview{flex:1;display:flex;flex-direction:column;justify-content:center}

/* ---- Know: numbers, where, neighbors, explainers ---- */
.home3 .h3-num-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 18px 16px}
.home3 .h3-num{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-width:0}
.home3 .h3-num small{display:block;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.home3 .h3-num b{display:block;font-size:14.5px;margin-top:2px;overflow-wrap:anywhere}
.home3 .h3-num.empty{background:none;border-style:dashed}
.home3 .h3-num button,.home3 .h3-num a{margin-top:2px;padding:0;font-weight:700;font-size:13.5px;color:var(--green);background:none;border:0;cursor:pointer}

.home3 .h3-where{display:flex;flex-direction:column}
.home3 .h3-where .corner-map,.home3 .h3-where .corner-media{margin:0 18px;flex:1;min-height:220px;border-radius:12px;overflow:hidden;background:var(--surface-2);border:1px solid var(--line);display:flex;flex-direction:column;cursor:pointer}
.home3 .h3-where .corner-map img{flex:1;width:100%;min-height:0;object-fit:contain;padding:10px}
.home3 .h3-where .corner-map figcaption{font-size:11px;color:var(--faint);padding:0 12px 8px}
.home3 .h3-where .map-note{display:none} /* site.js writes a redundant "Location map" label here */
.home3 .h3-where-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:12px 18px 16px;font-size:13px;color:var(--muted)}
.home3 .h3-where-foot a{font-weight:700;color:var(--green)}
.home3 .h3-nbmap{display:flex;flex-direction:column}
.home3 .h3-nbmap .tt-neighbors{flex:1;display:flex;flex-direction:column}
.home3 .h3-nbmap .tt-nb-card{flex:1;display:flex;flex-direction:column;border:0;box-shadow:none;background:none;border-radius:12px;overflow:hidden}
.home3 .h3-nbmap .tt-nb-map{flex:1;border:1px solid var(--line);border-radius:12px}

.home3 .h3-exp-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:0 18px 18px}
.home3 .h3-exp{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px;min-width:0}
.home3 .h3-exp:hover{border-color:#9fd8b8}
.home3 .h3-exp.live{background:#f0f8f3;border-color:#cdebd9}
.home3 .h3-exp-main{display:flex;gap:10px;align-items:flex-start;color:var(--text);min-width:0}
.home3 .h3-exp-ic{width:32px;height:32px;flex:none;border-radius:9px;background:var(--surface-2);display:grid;place-items:center;font-size:16px}
.home3 .h3-exp-tx{min-width:0}
.home3 .h3-exp-tx b{display:block;font-size:14px;line-height:1.25}
.home3 .h3-exp-tx small{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.home3 .h3-exp-add{align-self:flex-start;font-size:12.5px;font-weight:700;color:var(--green);background:#eafaf1;border:0;border-radius:999px;padding:4px 10px;cursor:pointer;white-space:nowrap}

/* ---- tablet + phone: cover on top, the four album tiles as ONE even row beneath ---- */
@media (max-width:900px){
  .home3 .h3-hero{grid-template-columns:1fr;height:auto;border-radius:16px}
  .home3 .h3-hero-main{height:360px}
  .home3 .h3-mosaic{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:none}
  .home3 .h3-mosaic .h3-tile{height:120px;padding:10px 8px}
  .home3 .h3-exp-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .home3 .h3-news .news-list{grid-template-columns:minmax(0,1fr)}
  .home3 .h3-news .news-story{flex-direction:row;border-bottom:1px solid var(--line);padding:12px 0}
  .home3 .h3-news .news-story img{width:88px;height:66px}
  .home3 .h3-eq>.h3-card{height:auto}
}
@media (max-width:640px){
  .home3 .h3-hero-main{height:300px}
  .home3 .h3-mosaic{gap:6px}
  .home3 .h3-mosaic .h3-tile{height:auto;aspect-ratio:1/1;padding:6px 4px;gap:2px}
  .home3 .h3-mosaic .h3-cam{width:30px;height:30px;font-size:15px;margin-bottom:2px}
  .home3 .h3-mosaic .h3-tile b,.home3 .h3-mosaic .h3-cap{font-size:11.5px;line-height:1.15}
  .home3 .h3-mosaic .h3-tile small,.home3 .h3-mosaic .h3-by{display:none}
  .home3 .h3-posts .h2card{grid-template-columns:minmax(0,1fr)}
  .home3 .h3-num-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .home3 .h3-num:last-child{grid-column:1/-1}
  .home3 .h3-exp-grid{grid-template-columns:minmax(0,1fr)}
  .home3 .h3-exp{flex-direction:row;align-items:center;justify-content:space-between}
}
/* weekly mast rule: site.css draws a 2px ink line; soften per style */
.home3 .tw .tw-mast{border-bottom:1px solid rgba(255,255,255,.22)}
.home3 .h3-num{text-align:left}

/* ---- schools (v3) ---- */
.home3 .h3-sch-top{display:flex;gap:12px;align-items:stretch;flex-wrap:wrap;padding:0 18px 12px}
.home3 .h3-sch-rank{display:flex;align-items:center;gap:12px;background:#f0f8f3;border:1px solid #cdebd9;border-radius:12px;padding:10px 16px;color:var(--text)}
.home3 .h3-sch-rank b{font-family:var(--display);font-size:28px;font-weight:800;color:var(--green);line-height:1}
.home3 .h3-sch-rank span{font-weight:700;font-size:14px;line-height:1.25}
.home3 .h3-sch-rank small{display:block;font-weight:500;font-size:12px;color:var(--muted)}
.home3 .h3-sch-rank.neutral span{color:var(--green)}
.home3 .h3-sch-facts{display:flex;gap:10px;flex:1;min-width:0}
.home3 .h3-sch-facts span{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:10px 14px;min-width:0}
.home3 .h3-sch-facts small{display:block;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.home3 .h3-sch-facts b{display:block;font-size:14.5px;margin-top:2px}
.home3 .h3-sch-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px;padding:0 18px}
.home3 .h3-sch{display:flex;gap:12px;align-items:center;padding:11px 0;border-top:1px solid var(--line);color:var(--text);min-width:0}
.home3 .h3-sch-ic{width:36px;height:36px;flex:none;border-radius:10px;background:var(--surface-2);display:grid;place-items:center;font-size:17px}
.home3 .h3-sch-tx{min-width:0}
.home3 .h3-sch-tx b{display:block;font-size:14.5px;line-height:1.25}
.home3 .h3-sch-tx small{display:block;font-size:12.5px;color:var(--muted)}
.home3 .h3-star{color:#b7791f;font-size:12.5px;white-space:nowrap}
.home3 .h3-src{font-size:11.5px;color:var(--faint);padding:10px 18px 14px}
@media (max-width:640px){
  .home3 .h3-sch-list{grid-template-columns:minmax(0,1fr)}
  .home3 .h3-sch-rank{flex:1 1 100%}
}
/* Town numbers holds ZIP + area code only (district moved to Schools): stack them so the card
   matches the Ranks card beside it */
.home3 .h3-num-grid{grid-template-columns:minmax(0,1fr)}
.home3 .h3-num{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px}
.home3 .h3-num b,.home3 .h3-num button,.home3 .h3-num a{margin-top:0;text-align:right}
@media (max-width:640px){.home3 .h3-num-grid{grid-template-columns:minmax(0,1fr)}.home3 .h3-num:last-child{grid-column:auto}}

/* rankings "All →" in the same green link style as every other card header */
.home3 .h3-ranks .rk-rail .ch a{color:var(--green);font-size:13.5px;font-weight:700;opacity:1}
