/* POPNIX Flood - ส่งเป็นภาพ (assets/js/shot.js) + ป้ายสำหรับแคปจอในหน้าต่างของหน้าแรก
   ใช้ token ที่มีทั้งใน water.css (หน้าแรก) และ lite.css (หน้าที่ server เรนเดอร์): --bg --core --text --strong --muted --accent --accent-ink --line-2
   ไม่มีแถบสีหนาด้านซ้าย, ข้อความไทยหลายบรรทัด line-height >= 1.4, ปุ่มสูงอย่างน้อย 44px, ภาพเคลื่อนไหวปิดใต้ prefers-reduced-motion (ท้ายไฟล์) */

/* ---------- หน้าต่างภาพ (ทางสำรองเมื่อเครื่องแชร์ไฟล์ไม่ได้: เบราว์เซอร์ในแอป LINE/Facebook บน Android, คอมพิวเตอร์) ---------- */
.shot-ov { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(3, 10, 15, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow-y: auto; overscroll-behavior: contain;
    animation: shotFade .25s ease both; }
.shot-ov-box { position: relative; width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: 18px 18px 16px; border-radius: 26px; background: var(--core); color: var(--text);
    border: 1px solid var(--line-2); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .6); animation: shotRise .35s cubic-bezier(.2, .8, .2, 1) both; }
.shot-ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.shot-ov-head h2 { margin: 0; font-size: 1.2rem; line-height: 1.4; color: var(--strong); font-weight: 700; }
.shot-ov-tip { margin: 2px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.shot-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--strong); cursor: pointer; }
.shot-x svg, .shot-b svg, .shot-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.shot-ov-fig { position: relative; margin: 0 0 14px; display: grid; place-items: center; min-height: 160px; border-radius: 16px; overflow: hidden; background: #071219; }
.shot-ov-fig img { display: block; width: 100%; height: auto; max-height: min(64dvh, 64vh); object-fit: contain; -webkit-touch-callout: default; user-select: auto; }
.shot-ov.is-story .shot-ov-fig img { width: auto; max-width: 100%; }
.shot-ov-load { position: absolute; color: #c9dae3; font-size: .95rem; }
.shot-ov-load[hidden] { display: none; }
.shot-ov-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.shot-b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 auto; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
    background: var(--bg); color: var(--strong) !important; font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.shot-b.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.shot-b:focus-visible, .shot-x:focus-visible, .shot-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.shot-ov-msg { margin: 10px 0 0; min-height: 1.4em; color: var(--muted); font-size: .9rem; line-height: 1.45; text-align: center; word-break: break-all; }
@keyframes shotFade { from { opacity: 0; } }
@keyframes shotRise { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ---------- แถวส่งต่อของหน้าที่ server เรนเดอร์ (/province/) ---------- */
.shot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.shot-row > b { flex-basis: 100%; font-size: .85em; font-weight: 600; color: var(--muted); }
.shot-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 13px; border-radius: 999px; border: 1px solid var(--line-2);
    background: var(--core); color: var(--strong) !important; font: inherit; font-size: .92em; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: border-color .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.shot-btn:hover { border-color: var(--accent); } .shot-btn:active { transform: scale(.97); }
.shot-btn.shot-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.shot-btn[hidden] { display: none; }
.shot-btn.is-busy svg { animation: shotSpin .9s linear infinite; }
.shot-btn.is-ready { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); animation: shotPop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.shot-msg { flex-basis: 100%; margin: 2px 0 0 !important; min-height: 1.4em; font-size: .88em; line-height: 1.45; color: var(--muted); word-break: break-word; }
@keyframes shotSpin { to { transform: rotate(360deg); } }
@keyframes shotPop { 50% { transform: scale(1.05); } }

/* ---------- หน้าแรก: หน้าต่างแชร์ (share.js) ปุ่มหลัก 4 ปุ่มแถวเดียวทุกจอ + ขนาดภาพ + ทางอื่นเป็นปุ่มเล็ก ---------- */
/* แผ่นแชร์บนมือถือเป็น flex column ที่สูงไม่เกิน 92dvh: ห้ามหดภาพตัวอย่าง (เดิมถูกหดจนเห็นแค่ครึ่งบนของการ์ด) ให้ภาพเล็กลงตามจอแทน */
#shModal .modal-content > * { flex-shrink: 0; }
#shModal .sh-card img { max-height: min(44dvh, 360px); width: auto; max-width: 100%; }
#shModal .sh-main { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#shModal .sh-main .sh-btn { min-height: 76px; line-height: 1.4; text-align: center; }
#shModal .sh-main .sh-btn:disabled { opacity: .7; cursor: progress; }
.sh-fmt { display: flex; justify-content: center; gap: 6px; margin: -4px 0 12px; }
.sh-fmt button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer; }
.sh-fmt button[aria-pressed="true"] { background: var(--accent-soft, rgba(31, 111, 153, .11)); border-color: var(--accent); color: var(--strong); font-weight: 600; }
.sh-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.sh-more .sh-mini { min-height: 44px; padding: 0 12px; }
.sh-more .sh-mini[hidden] { display: none; }
.sh-more .fa-line { color: #06c755; } .sh-more .fa-facebook { color: #1877f2; }
@media (max-width: 640px) {
    #shModal .sheet-head h3 { font-size: 1.25rem; line-height: 1.4; }
    #shModal .sheet-head p { font-size: .88rem; }
    #shModal .sh-main { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } #shModal .sh-main .sh-btn { font-size: .78rem; padding: 8px 2px; min-height: 70px; }
    .sh-more .sh-mini { font-size: .8rem; padding: 0 10px; }
}

/* ---------- หน้าแรก: ป้ายท้ายหน้าต่างจุดวัด/กล้อง/ถนน ให้ภาพแคปจอบอกที่มาและเว็บ (ติดขอบล่างของหน้าต่างเสมอ อยู่ในภาพแคปจอมือถือ) ---------- */
.shot-mark { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 14px;
    margin: 16px -24px -24px; padding: 10px 24px 12px; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--r-shell, 28px) var(--r-shell, 28px);
    background: var(--core); font-size: 13px; line-height: 1.45; color: var(--muted); }
.shot-src { min-width: 0; }
.shot-brand { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--strong); letter-spacing: .01em; white-space: nowrap; }
.shot-brand img { width: 16px; height: 16px; border-radius: 4px; }
/* ภาพกล้อง: ชื่อเว็บมุมขวาล่างบนตัวภาพ (คนมักครอปภาพแคปจอเหลือแค่ภาพ) */
.cc-big::after { content: "flood.pop.in.th"; position: absolute; right: 10px; bottom: 10px; z-index: 3; padding: 3px 9px; border-radius: 999px; pointer-events: none;
    background: rgba(4, 14, 20, .62); color: #f0f6f9; font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: .02em; }
.cc-big:has(.cc-none)::after { display: none; }
/* กล้องที่จุดวัดน้ำท่วมถนน: ความลึก ณ จุดวัดใต้กล้อง */
.shot-depth { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 10px 0 0 !important; padding: 10px 14px; border-radius: 16px; background: var(--shell, rgba(18, 52, 70, .045));
    line-height: 1.45; color: var(--text); }
.shot-depth[hidden] { display: none; }
.shot-depth b { font-size: 1.15rem; color: var(--strong); }
.shot-depth small { flex-basis: 100%; color: var(--muted); font-size: .84rem; }
@media (max-width: 640px) {   /* หน้าต่างเป็นแผ่นจากขอบล่างที่เลื่อนในตัวเอง (water.css): sticky นับจากขอบใน (padding) ของแผ่น จึงเลื่อนลงเท่า padding ให้ติดขอบจอจริง */
    .shot-mark { bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 14px -18px calc(-20px - env(safe-area-inset-bottom)); padding: 9px 18px calc(10px + env(safe-area-inset-bottom)); border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .shot-ov, .shot-ov-box, .shot-btn.is-ready, .shot-btn.is-busy svg { animation: none !important; }
    .shot-btn { transition: none; }
}
