/* Biến giao diện và thiết lập chung. */
:root {
  font-family: Arial, 'Segoe UI', sans-serif;
  color: #163c36;
  background: #eef5f3;
  font-size: 16px;
  --green: #087568;
  --line: #d6e5df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #d99a21;
  outline-offset: 3px;
}
a {
  color: var(--green);
}
button {
  color: inherit;
}
/* Đầu trang và nhận diện website. */
header {
  min-height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(115deg, #ffffff, #eaf6f1);
  gap: 15px;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-icon {
  flex: none;
  font-size: 36px;
  background: var(--green);
  color: white;
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 13px;
}
h1 {
  font-size: 21px;
  font-weight: 400;
  margin: 0 0 7px;
}
h1 strong {
  font-weight: 750;
}
.brand p {
  font-size: 11px;
  letter-spacing: 0.2px;
  line-height: 1.7;
  margin: 0;
  color: #5e726a;
}
.header-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}
.draft {
  font-size: 13px;
  color: #746333;
  background: #faf4e4;
  border: 1px solid #e8dec0;
  padding: 7px 10px;
  border-radius: 6px;
}
.outline {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.outline:hover {
  background: #edf4f0;
}
/* Bố cục chính, tìm kiếm và bộ lọc. */
main {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100dvh - 91px);
  min-height: 590px;
}
aside {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.search-area {
  padding: 25px 23px 18px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: #758880;
}
h2 {
  font-size: 23px;
  margin: 10px 0 20px;
  letter-spacing: -0.5px;
}
.searchbox {
  display: flex;
  align-items: center;
  background: #f3f6f5;
  border: 1px solid #d4dfda;
  border-radius: 9px;
  padding: 0 12px;
  gap: 8px;
}
.searchbox span {
  font-size: 28px;
  color: #57786c;
}
.searchbox input {
  min-width: 0;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: none;
  outline: none;
  color: #16392f;
}
.searchbox:focus-within {
  outline: 2px solid var(--green);
  background: #fff;
  box-shadow: 0 0 0 5px #08756812;
}
.search-hint {
  font-size: 12px;
  color: #657b72;
  margin: 10px 0 20px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.filter {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe7e2;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  min-height: 44px;
}
.filter[aria-pressed='true'] {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.filter:hover {
  border-color: var(--green);
}
.filter i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color);
  display: block;
}
.filter[aria-pressed='true'] i {
  background: white;
}
/* Danh sách địa điểm và thông tin nguồn. */
.list-heading {
  padding: 16px 23px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--green);
  padding: 2px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.results {
  overflow: auto;
  flex: 1;
  padding: 0 12px 12px;
}
.place {
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid transparent;
  border-bottom: 1px solid #edf1ee;
  padding: 16px 11px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 8px;
}
.place:hover {
  background: #f6f9f7;
}
.place[aria-pressed='true'] {
  background: #e5f4ee;
  border-color: #91c8b8;
  box-shadow: inset 3px 0 var(--green);
}
.place-icon {
  width: 37px;
  height: 37px;
  flex: none;
  border-radius: 10px;
  color: var(--color);
  background: color-mix(in srgb, var(--color) 10%, white);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.place strong {
  font-size: 15px;
  line-height: 1.5;
  display: block;
}
.place small {
  font-size: 13px;
  color: #6a7e74;
  display: block;
  margin-top: 4px;
  line-height: 1.5;
}
.place .place-type {
  color: var(--color);
  font-size: 12px;
  margin-top: 6px;
}
footer {
  padding: 12px 23px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: #6b7d75;
}
footer .text-button {
  font-size: 12px;
}
/* Bản đồ và thanh công cụ. */
.map-section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 12px;
  border: 1px solid #d6e0db;
  border-radius: 13px;
  overflow: hidden;
  background: #e9efe9;
  box-shadow: 0 8px 28px #183b2912;
}
.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 17px;
  background: white;
  gap: 10px;
}
.map-toolbar > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.map-toolbar strong {
  font-size: 14px;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.map-toolbar .outline {
  flex: none;
  min-height: 44px;
}
.map-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #0d594d;
  border-radius: 50%;
  flex: none;
}
.map-body {
  flex: 1;
  min-height: 260px;
  position: relative;
}
iframe {
  border: 0;
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
}
#map {
  position: absolute;
  inset: 0;
}
.map-note {
  padding: 11px 16px;
  background: #fff;
  font-size: 13px;
  color: #586e63;
  line-height: 1.5;
  border-top: 1px solid var(--line);
}
.map-fallback {
  background: #f8faf9;
  padding: 8px 16px;
  font-size: 12px;
  color: #617568;
}
/* Thẻ thông tin địa điểm. */
.detail {
  position: absolute;
  bottom: 104px;
  right: 20px;
  width: 340px;
  max-height: 48%;
  overflow: auto;
  padding: 21px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 7px 35px #102c342f;
  border: 1px solid #dce5df;
}
.detail h2 {
  font-size: 20px;
  line-height: 1.4;
  margin: 12px 25px 8px 0;
}
.detail p {
  font-size: 14px;
  color: #5a7065;
  line-height: 1.6;
  margin: 8px 0;
}
.tag {
  font-size: 12px;
  display: inline-block;
  border-radius: 5px;
  padding: 5px 9px;
  background: #edf4f0;
  color: var(--color);
  font-weight: 700;
}
.detail-close {
  min-width: 44px;
  min-height: 44px;
  position: absolute;
  right: 11px;
  top: 11px;
  border: 0;
  background: none;
  font-size: 25px;
  line-height: 1;
  padding: 8px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0 10px;
}
.actions a {
  border-radius: 7px;
  padding: 12px 13px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
}
.actions .primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.detail .source {
  font-size: 12px;
}
.detail .caution {
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: #84612c;
}
/* Trạng thái trống và hỗ trợ truy cập. */
.empty {
  padding: 30px 12px;
  text-align: center;
  color: #65776f;
  line-height: 1.7;
}
.skip {
  position: absolute;
  left: 10px;
  top: -100px;
  background: white;
  padding: 10px;
  z-index: 5;
}
.skip:focus {
  top: 10px;
}
/* Hộp thoại thông tin và mã nhúng. */
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
  max-width: 680px;
  width: calc(100% - 32px);
  color: #173931;
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #0a211b88;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 21px;
}
#dialog-content {
  font-size: 15px;
  line-height: 1.7;
}
#dialog-content textarea {
  width: 100%;
  height: 145px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  overflow-wrap: anywhere;
}
#dialog-content .notice {
  background: #faf4e4;
  border-radius: 8px;
  padding: 12px;
}
/* Chế độ nhúng và bố cục theo kích thước màn hình. */
.embed header {
  height: 72px;
}
.embed main {
  height: calc(100dvh - 72px);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  main {
    grid-template-columns: 360px minmax(0, 1fr);
  }
  .detail {
    width: 370px;
  }
}
@media (max-width: 900px) {
  header {
    padding: 0 18px;
  }
  .draft {
    display: none;
  }
  main {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .search-area {
    padding: 20px 16px;
  }
  .map-section {
    margin: 10px;
  }
  .detail {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 130px;
    max-height: 48%;
  }
  .map-toolbar strong {
    font-size: 13px;
  }
  .map-toolbar {
    padding: 10px;
  }
  .map-toolbar .outline {
    font-size: 12px;
    padding: 9px;
  }
  .map-note {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 86px;
    padding: 12px 14px;
  }
  .brand-icon {
    width: 38px;
    height: 40px;
    font-size: 29px;
  }
  h1 {
    font-size: clamp(15px, 3.5vw, 19px);
    line-height: 1.4;
    margin-bottom: 5px;
  }
  .brand p {
    font-size: 12px;
    letter-spacing: 0;
  }
  .header-actions .outline {
    font-size: 12px;
    padding: 9px;
  }
  .brand {
    gap: 9px;
  }
  main {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  aside {
    display: contents;
  }
  .search-area {
    padding: 16px 14px 12px;
    order: 0;
    background: white;
  }
  .search-area h2 {
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 21px;
  }
  .search-hint {
    margin-bottom: 12px;
  }
  .filters {
    gap: 7px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 3px 2px 7px;
    scrollbar-width: thin;
    scrollbar-color: #91c8b8 transparent;
  }
  .filter {
    flex: none;
    padding: 8px 11px;
    font-size: 13px;
  }
  .map-section {
    order: 1;
    margin: 8px 6px 5px;
    min-height: 0;
    overflow: hidden;
  }
  .map-body {
    height: clamp(360px, 62svh, 680px);
    flex: none;
  }
  .map-toolbar {
    border-radius: 12px 12px 0 0;
  }
  .map-note {
    border-radius: 0;
  }
  .map-fallback {
    border-radius: 0 0 12px 12px;
  }
  .detail {
    position: relative;
    inset: auto;
    width: auto;
    max-height: none;
    margin: 10px;
    border: 1px solid var(--line);
    box-shadow: none;
  }
  .list-heading {
    order: 2;
    padding: 17px 23px 10px;
    border: 0;
  }
  .results {
    order: 3;
    overflow: visible;
    padding: 0 12px 15px;
    background: white;
  }
  .place {
    padding: 15px 11px;
  }
  footer {
    order: 4;
  }
  .embed main {
    height: auto;
  }
  .map-section:focus {
    outline: none;
  }
  .map-toolbar strong {
    font-size: 14px;
  }
  .text-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .embed header {
    height: auto;
  }
  dialog {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .place,
  .filter,
  .outline,
  .searchbox,
  .actions a {
    transition:
      background 0.18s ease,
      border-color 0.18s ease,
      box-shadow 0.18s ease,
      transform 0.18s ease;
  }
  .detail:not([hidden]),
  dialog[open] {
    animation: appear 0.2s ease-out;
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .outline:hover,
  .filter:hover,
  .actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px #08756818;
  }
}
@media (max-width: 760px) and (orientation: landscape) {
  .map-body {
    height: max(320px, 80svh);
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
