/* =============================================================
   bando.css — giao diện "Bản Đồ Quê Em"
   Dùng chung biến màu của css/app.css và hoa văn của css/hoatiet.css.
   Nút to, chữ to: trẻ dùng trên máy tính bảng trong lớp.
   ============================================================= */

.bd .bd-h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--green-800, #0f5132); }
.bd .bd-dem { font-weight: 600; color: var(--ink-soft, #4a5a52); font-size: .95rem; }

/* ---------------- chọn tỉnh ---------------- */

.bd-home-luoi { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 16px; align-items: start; }
.bd-home-luoi > .panel { margin-top: 0; }
@media (max-width: 820px) { .bd-home-luoi { grid-template-columns: 1fr; } }

.bd-vn svg { display: block; width: 100%; height: auto; max-height: 72vh; background: #e6f3fb; border-radius: 12px; }
.bd-vn path { stroke: #fff; stroke-width: .8; stroke-linejoin: round; }
.bd-vn path.khong { fill: #d5dbd7; }
.bd-vn path.co { fill: var(--green-600, #1b8255); cursor: pointer; transition: fill .15s; }
.bd-vn path.co:hover, .bd-vn path.co:focus { fill: #f08c00; outline: none; }
.bd-vn text { font: 700 9.5px "Segoe UI", Roboto, Arial, sans-serif; fill: #fff; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: rgba(7, 39, 28, .75); stroke-width: 2.2px; }
.bd-vn text.dao, .bd-vn text.bien { fill: #29607f; stroke: none; font-weight: 600; font-style: italic; font-size: 9px; }
.bd-vn text.dao { fill: #0b4f8a; font-weight: 800; font-style: normal; }
.bd-vn text.bien { font-size: 13px; fill: #7fb0cc; letter-spacing: 2px; }
.bd-vn circle.dao { fill: #1b8255; }

.bd-tinh-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bd-tinh-the {
  appearance: none; font: inherit; text-align: left; cursor: pointer; padding: 0 0 10px; overflow: hidden;
  background: var(--paper, #fff); border: 1.5px solid var(--line, #dbe5de); border-radius: var(--radius-sm, 12px);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; min-height: 86px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.bd-tinh-the:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.bd-tinh-the:focus-visible { outline: 3px solid var(--focus, #fbbf24); outline-offset: 2px; }
.bd-tinh-the:disabled { opacity: .5; cursor: not-allowed; }
.bd-tinh-ten { font-weight: 800; font-size: 1.08rem; padding: 6px 12px 0; color: var(--ink, #17251f); }
.bd-tinh-phu { font-size: .82rem; color: var(--ink-soft, #4a5a52); padding: 0 12px; }

.bd-nhan-truong { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; font-weight: 600; flex: 1 1 320px; }
.bd input[type="text"], .bd input[type="search"], .bd textarea {
  font: inherit; width: 100%; padding: 10px 14px; min-height: 46px;
  border: 1.5px solid var(--line, #dbe5de); border-radius: var(--radius-sm, 12px); background: #fff; color: var(--ink, #17251f);
}
.bd input:focus, .bd textarea:focus { outline: 3px solid var(--focus, #fbbf24); outline-offset: 1px; }

/* ---------------- thanh công cụ ---------------- */

.bd-thanh-tren { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bd-thanh-tren .panel-title { margin: 0; flex: 0 0 auto; }
.bd-tim { position: relative; flex: 1 1 280px; }
.bd-tim-kq {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200; max-height: 60vh; overflow: auto;
  background: #fff; border: 1.5px solid var(--line, #dbe5de); border-radius: var(--radius-sm, 12px); box-shadow: var(--shadow-lg);
}
.bd-tim-kq button {
  appearance: none; font: inherit; display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left;
  padding: 10px 14px; min-height: 46px; background: none; border: 0; border-bottom: 1px solid var(--line, #dbe5de); cursor: pointer;
}
.bd-tim-kq button:hover, .bd-tim-kq button:focus { background: var(--green-50, #f2f8f4); outline: none; }
.bd-tim-kq button span { font-size: .82rem; color: var(--ink-soft, #4a5a52); }
.bd-tim-khong { padding: 12px 14px; color: var(--ink-soft, #4a5a52); font-size: .92rem; }

.bd-nut-hang { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.bd .btn.dang-bat { background: var(--amber-100, #fef3c7); border-color: #f59e0b; color: var(--amber-900, #92400e); box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }
.bd-ve-thanh { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line, #dbe5de); }
.bd-mau { appearance: none; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line, #dbe5de); cursor: pointer; margin-right: 6px; padding: 0; }
.bd-mau.bat { box-shadow: 0 0 0 3px var(--ink, #17251f); transform: scale(1.08); }

.bd-bao { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm, 12px); background: var(--green-100, #e4f1ea); font-weight: 600; }
.bd-bao.canh-bao { background: var(--amber-100, #fef3c7); color: var(--amber-900, #92400e); }
.bd-bao.tot { background: #d3f9d8; color: #1b5e20; }
.bd-bao.giu { background: #e7f5ff; color: #0b4f8a; }

/* ---------------- khung bản đồ ---------------- */

.bd-o-bando {
  position: relative; margin-top: 14px; border-radius: 6px; overflow: hidden; background: #dfeaf2;
  box-shadow: var(--shadow); max-width: 1180px; margin-left: auto; margin-right: auto;
}
.bd-map { height: min(72vh, 760px); min-height: 420px; background: #eaf2f7; font: inherit; z-index: 0; }
.bd-o-bando.toan-man { position: fixed; inset: 0; z-index: 2000; margin: 0; max-width: none; border-radius: 0; }
.bd-o-bando.toan-man .bd-map { height: 100%; min-height: 0; }
body.bd-khoa-cuon { overflow: hidden; }

.bd-map.bd-che-do-them, .bd-map.bd-che-do-nha, .bd-map.bd-che-do-ve,
.bd-map.bd-che-do-them .leaflet-interactive, .bd-map.bd-che-do-nha .leaflet-interactive, .bd-map.bd-che-do-ve .leaflet-interactive { cursor: crosshair; }
.bd-map.bd-che-do-ve { touch-action: none; }
.bd-nhan-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

.bd-dk { position: absolute; right: 10px; top: 10px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.bd-dk button {
  appearance: none; width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--line, #dbe5de);
  background: #fff; font-size: 1.45rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm); color: var(--green-900, #0b3d2c);
  font-weight: 800; padding: 0;
}
.bd-dk button:hover { background: var(--green-50, #f2f8f4); }
.bd-dk button:active { transform: scale(.95); }
.bd-dk button:disabled { opacity: .4; cursor: default; }
.bd-dk button:focus-visible { outline: 3px solid var(--focus, #fbbf24); outline-offset: 2px; }
.bd-dang-nap {
  position: absolute; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20px; background: rgba(242, 246, 243, .92); font-weight: 700; font-size: 1.15rem; color: var(--green-800, #0f5132);
}
.bd-dang-nap[hidden] { display: none; }
.bd .leaflet-control-scale-line { font-size: 12px; border-color: #444; background: rgba(255, 255, 255, .8); }

/* ---------------- ghim ảnh văn hoá ---------------- */

.bd-ghim { background: none; border: 0; }
.bd-ghim-vong {
  position: absolute; left: 2px; top: 0; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--m, #c2255c); background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.bd-ghim-vong img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-ghim::after {
  content: ""; position: absolute; left: 21px; top: 49px; border: 7px solid transparent; border-top: 11px solid var(--m, #333);
  border-top-color: #333; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3));
}
.bd-ghim-nho {
  position: absolute; right: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 2px solid var(--m, #c2255c); font-size: .72rem; display: flex; align-items: center; justify-content: center;
}
.bd-ghim-vong:not(:has(img)) + .bd-ghim-nho { display: none; }
.bd-z-thap .bd-ghim { transform-origin: 28px 62px; }
.bd-z-thap .bd-ghim .bd-ghim-vong { width: 36px; height: 36px; left: 10px; top: 16px; border-width: 3px; font-size: 1.05rem; }
.bd-z-thap .bd-ghim .bd-ghim-nho { display: none; }

.bd-nha-ghim { background: none; border: 0; }
.bd-nha-ghim span {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50% 50% 50% 6px;
  background: #fff; border: 3px solid #e03131; font-size: 1.4rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.bd-nhay span { display: block; width: 60px; height: 60px; border-radius: 50%; border: 4px solid #e03131; animation: bd-nhay 1.2s ease-out infinite; }
@keyframes bd-nhay { from { transform: scale(.25); opacity: 1; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bd-nhay span { animation: none; } }

/* ---------------- chip, chú giải ---------------- */

.bd-chip-hang { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-chip {
  appearance: none; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; min-height: 42px; padding: 6px 14px;
  border-radius: 999px; border: 1.5px solid var(--line, #dbe5de); background: #fff; color: var(--ink-soft, #4a5a52);
  display: inline-flex; align-items: center; gap: 4px;
}
span.bd-chip { cursor: default; min-height: 32px; padding: 3px 12px; }
.bd-chip.bat { background: color-mix(in srgb, var(--m, #146c43) 14%, #fff); border-color: var(--m, #146c43); color: var(--ink, #17251f); }
.bd-chip:focus-visible { outline: 3px solid var(--focus, #fbbf24); outline-offset: 2px; }

.bd-chu-giai { margin-top: 14px; }
.bd-chu-giai summary { cursor: pointer; font-weight: 700; min-height: 42px; display: flex; align-items: center; }
.bd-cg { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; font-size: .92rem; }
.bd-cg li { display: flex; align-items: center; gap: 10px; }
.bd-cg-duong { display: inline-block; width: 34px; flex: 0 0 34px; border-radius: 2px; }
.bd-cg-kh { width: 34px; flex: 0 0 34px; text-align: center; font-style: normal; }

.bd-xa-o { margin-top: 14px; padding-left: 26px; }
.bd-xa-o[hidden] { display: none; }

/* ---------------- bộ sưu tập ---------------- */

.bd-bst { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.bd-the {
  appearance: none; font: inherit; text-align: left; cursor: pointer; padding: 0 0 10px; overflow: hidden;
  background: #fff; border: 1.5px solid var(--line, #dbe5de); border-radius: var(--radius-sm, 12px); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 3px;
}
.bd-the:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.bd-the:focus-visible { outline: 3px solid var(--focus, #fbbf24); outline-offset: 2px; }
.bd-the-anh {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
  background: color-mix(in srgb, var(--m, #146c43) 16%, #fff); border-bottom: 4px solid var(--m, #146c43);
}
.bd-the-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-the-ten { font-weight: 800; padding: 6px 10px 0; }
.bd-the-phu { font-size: .8rem; color: var(--ink-soft, #4a5a52); padding: 0 10px; }

/* ---------------- hộp thoại ---------------- */

.bd-hop {
  position: fixed; inset: 0; z-index: 3000; background: rgba(7, 39, 28, .55); display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto;
}
.bd-hop[hidden] { display: none; }
.bd-hop-than {
  background: #fff; border-radius: var(--radius, 16px); box-shadow: var(--shadow-lg); width: min(760px, 100%);
  max-height: calc(100vh - 32px); overflow: auto; padding: 22px;
}
.bd-nhap-luoi { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 640px) { .bd-nhap-luoi { grid-template-columns: 1fr; } }
.bd-nhap-anh {
  aspect-ratio: 4 / 3; border: 2px dashed var(--line, #dbe5de); border-radius: var(--radius-sm, 12px); overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--ink-soft, #4a5a52); background: var(--green-50, #f2f8f4);
}
.bd-nhap-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-nhan { display: block; font-weight: 700; font-size: .92rem; margin: 12px 0 5px; }
.bd-nhan:first-child { margin-top: 0; }
.bd-loi { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm, 12px); background: var(--red-100, #fee2e2); color: var(--red-700, #b42318); font-weight: 600; }
.bd-xem-anh {
  border-radius: var(--radius-sm, 12px); overflow: hidden; background: color-mix(in srgb, var(--m, #146c43) 14%, #fff);
  display: flex; align-items: center; justify-content: center; font-size: 4rem; min-height: 160px; margin-bottom: 14px;
}
.bd-xem-anh img { width: 100%; max-height: 56vh; object-fit: contain; display: block; background: #111; }
.bd-xem-nhan { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.bd-xem-ke { font-size: 1.05rem; white-space: pre-wrap; }
.bd-nguon { margin-top: 16px; }

/* ---------------- in bản đồ ---------------- */
@media print {
  body.bd-dang-in .app-header, body.bd-dang-in .app-footer, body.bd-dang-in .banner,
  body.bd-dang-in .ht-dai-dau-trang, body.bd-dang-in .view:not(#view-bando),
  body.bd-dang-in #bd-home, body.bd-dang-in .bd-nut-hang, body.bd-dang-in .bd-tim, body.bd-dang-in #bd-ve-home,
  body.bd-dang-in .bd-dk, body.bd-dang-in .bd-bao, body.bd-dang-in .bd-ve-thanh, body.bd-dang-in .bd-hop,
  body.bd-dang-in #bd-lop, body.bd-dang-in #bd-loc, body.bd-dang-in .bd-h3 { display: none !important; }
  body.bd-dang-in .panel { box-shadow: none; border: 0; padding: 4px 0; margin: 6px 0; }
  body.bd-dang-in .bd-o-bando { box-shadow: none; break-inside: avoid; }
  body.bd-dang-in .bd-map { height: 150mm; min-height: 0; }
  body.bd-dang-in .bd-chu-giai > summary { display: none; }
  body.bd-dang-in .bd-chu-giai > div { display: block !important; }
  body.bd-dang-in .bd-o-bando, body.bd-dang-in .bd-the-anh, body.bd-dang-in .bd-map canvas, body.bd-dang-in .bd-map img {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* thuộc tính hidden phải thắng display:flex/grid ở trên */
.bd [hidden] { display: none !important; }

/* đầu trang dính (sticky) không che mất mép trên bản đồ khi cuộn tới */
.bd-o-bando, .bd-xa-o { scroll-margin-top: 24px; }

.bd-tinh-nhan { color: #0b6fa4 !important; font-weight: 600; }
