/* /home "บ้านฉัน" — loads after /thailand/thailand.css; scoped to body.home */
body.home { --tick: 0px; --top: var(--mast); --bottom: 0px; --over: #c0392b; --below: #2f7fc0; --house: #f5c400; }
.home .hm-setup { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.home .hm-setup select, .home .hm-thr select, .home .hm-thr input { font: 500 15px var(--sans); padding: 7px 8px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); }
.hm-btn { font: 600 15px var(--sans); padding: 9px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--hazard); }
.hm-btn:hover { background: var(--hazard); color: #14161a; }
.hm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 3px double var(--ink); padding-bottom: 10px; margin-bottom: 8px; }
.hm-head h2 { margin: 2px 0 0; font: 800 clamp(24px, 3.2vw, 36px)/1.2 var(--serif); }

.hm-card { border: 1px solid var(--ink); background: var(--card); padding: 14px 16px 12px; margin: 0 0 16px; box-shadow: 4px 4px 0 var(--ink); }
.hm-card.pinned { box-shadow: 4px 4px 0 var(--hazard), 5px 5px 0 var(--ink); }
.hm-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hm-top h4 { margin: 0; font: 700 18px/1.35 var(--serif); }
.hm-top small { display: block; font: 500 12px var(--mono); color: var(--ink-3); margin-top: 2px; }
.hm-pin { flex: none; border: 1px solid var(--ink); background: var(--paper); font: 600 12px var(--mono); padding: 4px 8px; }
.hm-pin.on { background: var(--hazard); color: #14161a; }
.hm-big { margin: 10px 0 2px; font: 800 26px/1.2 var(--serif); }
.hm-big.over { color: var(--over); } .hm-big.below { color: var(--below); }
.hm-big small { font: 500 13px var(--sans); color: var(--ink-2); margin-left: 6px; }
.hm-trend { font: 600 13.5px var(--sans); color: var(--ink-2); }
.hm-trend b.up { color: var(--over); } .hm-trend b.down { color: var(--below); }

/* the horizontal "bank ruler": water fills from the left, the bank is a solid line, the house a flag */
.hm-ruler { position: relative; height: 66px; margin: 14px 0 4px; }
.hm-track { position: absolute; left: 0; right: 0; top: 18px; height: 16px; background: var(--paper-2); border: 1px solid var(--rule); }
.hm-water { position: absolute; left: 0; top: 18px; height: 16px; background: linear-gradient(90deg, #9cc3dd, var(--below)); }
.hm-water.over { background: linear-gradient(90deg, #9cc3dd, var(--below) 60%, var(--over)); }
.hm-bank { position: absolute; top: 10px; height: 32px; width: 3px; background: var(--ink); }
.hm-bank span, .hm-houseflag span { position: absolute; top: -12px; transform: translateX(-50%); white-space: nowrap; font: 600 10.5px var(--mono); }
.hm-bank span { left: 1px; }
.hm-houseflag { position: absolute; top: 34px; width: 2px; height: 16px; background: #14161a; }
.hm-houseflag span { top: 16px; left: 1px; background: var(--house); color: #14161a; padding: 0 4px; }
.hm-scale { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); color: var(--ink-3); }

.hm-thr { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.hm-thr input { width: 5.5em; }
.hm-gap { margin-top: 8px; padding: 8px 10px; background: var(--paper-2); font-size: 14.5px; }
.hm-gap b { font-size: 17px; }
.hm-gap.hit { background: color-mix(in srgb, var(--over) 16%, var(--paper-2)); }
.hm-eta { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.hm-spark { margin-top: 8px; }
.hm-spark svg { display: block; width: 100%; height: 46px; }
.hm-spark small { font: 500 11px var(--mono); color: var(--ink-3); }
.hm-foot { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-top: 8px; }

.hm-up { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.hm-up li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; }
.hm-up li small { display: block; color: var(--ink-3); font-size: 12px; }
.hm-up .v { font: 600 13px var(--mono); text-align: right; }
.hm-up .v.over { color: var(--over); }
.hm-up .t { font: 700 15px var(--mono); width: 1.4em; text-align: center; }
.hm-sum { font: 600 15px var(--sans); margin: 4px 0 8px; }
.hm-alert { margin-top: 22px; }
.hm-warn { border-left: 6px solid var(--over); background: var(--card); padding: 8px 12px; margin: 8px 0 14px; font-size: 14px; }
@media (max-width: 760px) {
  .hm-big { font-size: 22px; }
  .home .hz a[href="/fire/"] { display: none; }
}

/* intro */
.hm-intro { border: 1px solid var(--ink); background: var(--card); padding: 8px 14px; margin: 6px 0 14px; }
.hm-intro summary { cursor: pointer; font: 700 16px var(--serif); }
.hm-intro ul { margin: 8px 0 4px; padding-left: 20px; font-size: 14.5px; }
.hm-intro li { margin: 4px 0; }

/* map */
.hm-mapwrap { position: relative; margin: 0 0 18px; border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
#hmMap { height: min(62vh, 520px); background: var(--paper-2); }
.hm-legend { position: absolute; left: 10px; bottom: 10px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: calc(100% - 20px); padding: 6px 10px; background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--ink); font: 500 12px var(--sans); align-items: center; }
.hm-legend i { font-style: normal; display: inline-block; margin-right: 4px; vertical-align: middle; }
.lg-over, .lg-below { font: 700 10.5px var(--mono); padding: 1px 4px; color: #fff; }
.lg-over { background: var(--over); } .lg-below { background: var(--below); }
.lg-up { width: 22px; height: 0; border-top: 3px dashed var(--hazard); }
.lg-ews { background: #d62d20; color: #fff; width: 16px; height: 16px; border-radius: 50%; text-align: center; font: 700 11px/16px var(--sans); }
.hm-home { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.hm-home::after { content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid var(--hazard); animation: hmpulse 1.8s ease-out infinite; }
@keyframes hmpulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hm-st { width: max-content; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; font: 700 12px/1.2 var(--mono); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); white-space: nowrap; }
.hm-st.over { background: var(--over); } .hm-st.below { background: var(--below); }
.hm-st.pin { outline: 3px solid var(--hazard); }
.hm-st.up { background: var(--paper); color: var(--ink); border-color: var(--hazard); }
.hm-st small { font-weight: 500; opacity: .9; }
.hm-ews { width: 20px; height: 20px; border-radius: 50%; background: #d62d20; color: #fff; display: grid; place-items: center; font: 700 12px var(--sans); border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(214,45,32,.35); }
.hm-flow { stroke-dasharray: 10 8; animation: hmflow 1.2s linear infinite; }
@keyframes hmflow { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .hm-flow, .hm-home::after { animation: none; } }
.hm-tide { display: inline-block; margin-left: 6px; padding: 1px 7px; font: 600 11.5px var(--mono); background: var(--accent-soft); border: 1px solid var(--rule); }
@media (max-width: 760px) { #hmMap { height: 56vh; } .hm-legend { font-size: 11px; gap: 4px 8px; } }

/* place search + pick map */
.hm-search { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.hm-search input { width: 100%; font: 500 15px var(--sans); padding: 8px 10px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); }
.hm-search ul { position: absolute; z-index: 900; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; max-height: 320px; overflow-y: auto; background: var(--paper); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.hm-search li { padding: 7px 10px; cursor: pointer; font-size: 14.5px; }
.hm-search li small { color: var(--ink-3); margin-left: 6px; }
.hm-search li:hover, .hm-search li.on { background: var(--paper-2); }
#pickMap { height: min(50vh, 420px); }
.home .hm-setup select { max-width: 32%; }
@media (max-width: 760px) { .home .hm-setup select { max-width: none; flex: 1 1 100%; } }

/* river cameras near home */
.hm-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 0 0 18px; }
.hm-cam { margin: 0; border: 1px solid var(--ink); background: var(--card); box-shadow: 4px 4px 0 var(--ink); }
.hm-cam img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--paper-2); }
.hm-cam figcaption { padding: 8px 10px; font-size: 14px; line-height: 1.5; }
.hm-camm { width: 24px; height: 24px; display: grid; place-items: center; background: #fff; border: 2px solid #1d6fa5; border-radius: 50%; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.hm-help { margin-top: 12px; padding: 8px 12px; border: 1px dashed var(--ink); font-size: 14px; line-height: 1.6; }
