:root {
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --brand-light: #ccfbf1;
  --accent: #f97316;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-900: #0f172a;
  --radius-sm: .5rem;
  --radius-md: .75rem;
  --radius-lg: 1.1rem;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --ease: 180ms cubic-bezier(.4, 0, .2, 1);
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gray-900);
}

.brand-logo {
  width: 2.3rem;
  height: 2.3rem;
  object-fit: contain;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.district-select-wrap,
.province-select-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: .5rem 1rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.district-select-wrap:focus-within,
.province-select-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.district-select-wrap i,
.province-select-wrap i {
  color: var(--brand);
  font-size: .95rem;
}

.district-select,
.province-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .9rem;
  color: var(--gray-900);
  cursor: pointer;
  max-width: 9.5rem;
}

.district-select:focus,
.province-select:focus {
  outline: none;
}

/* ---------- ปุ่มสลับภาษา ---------- */
.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: .5rem 1rem;
  font-size: .9rem;
  color: var(--gray-900);
  transition: border-color var(--ease), background var(--ease);
}

.lang-switcher-btn:hover,
.lang-switcher-btn:focus {
  border-color: var(--accent);
  background: #fff;
  color: var(--gray-900);
}

.lang-switcher-btn i {
  color: var(--accent);
}

/* Google Translate widget: skin เอง ซ่อน UI เริ่มต้นของ Google ทั้งหมด (banner/tooltip/highlight)
   หมายเหตุ: Google เปลี่ยนชื่อคลาสของ iframe แบนเนอร์เป็น hash แบบสุ่ม (เช่น VIpgJd-ZVi9od-ORHb-OEVmcd)
   ตั้งแต่หลังจากที่เขียน .goog-te-banner-frame ไว้ครั้งแรก ทำให้ selector เดิมไม่ match อะไรเลยและแบนเนอร์
   โผล่มาบังส่วนหัวเว็บทันทีที่กดปุ่มเปลี่ยนภาษา — คงไว้เผื่อบางเวอร์ชัน/บางภาษายังใช้ class เดิมอยู่
   แต่เพิ่ม iframe.skiptranslate (คลาส marker ของ Google เองที่ยังคงที่ไม่เปลี่ยน) เป็นตัวจับหลักแทน */
.goog-te-banner-frame,
iframe.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
}
body {
  top: 0 !important;
}
.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}
#google_translate_element {
  display: none !important;
}

/* ---------- Layout ---------- */
.page-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 2rem;
}

/* ---------- Category filter chips ---------- */
.filter-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: .75rem .9rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .55rem;
  overflow-x: auto;
}

.category-chip {
  --chip-color: #0d6efd;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1.5px solid var(--chip-color);
  color: var(--chip-color);
  background: #fff;
  border-radius: var(--radius-full);
  padding: .38rem .9rem .38rem .5rem;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.category-chip .chip-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--chip-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  transition: background var(--ease), color var(--ease);
}

.category-chip.active {
  background: var(--chip-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.category-chip.active .chip-icon {
  background: rgba(255, 255, 255, .28);
  color: #fff;
}

.category-chip:not(.active) {
  opacity: .55;
}

.category-chip:hover {
  transform: translateY(-1px);
}

.chip-skeleton {
  flex: 0 0 auto;
  width: 6.5rem;
  height: 2.1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Map ---------- */
.map-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

#map {
  height: min(62vh, 620px);
  min-height: 380px;
  width: 100%;
  background: var(--gray-100);
}

.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, .75);
  z-index: 500;
  pointer-events: none;
  transition: opacity var(--ease);
}

.map-loading.d-none { display: none; }

.map-loading .spinner-border {
  color: var(--brand);
}

.map-pin {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .35);
  border: 2.5px solid #fff;
  animation: pin-drop .35s cubic-bezier(.34, 1.56, .64, 1);
}

.map-pin i {
  transform: rotate(45deg);
  color: #fff;
  font-size: 1rem;
}

@keyframes pin-drop {
  from { transform: rotate(-45deg) translateY(-14px) scale(.5); opacity: 0; }
  to { transform: rotate(-45deg) translateY(0) scale(1); opacity: 1; }
}

.place-marker-tooltip {
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.place-marker-tooltip::before {
  border-top-color: #fff;
}

.place-marker-tooltip-card {
  width: 170px;
}

.place-marker-tooltip-card img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.place-marker-tooltip-noimg {
  width: 100%;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-300);
  font-size: 1.6rem;
}

.place-marker-tooltip-name {
  padding: .5rem .6rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-empty-badge {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: .5rem 1.1rem;
  font-size: .85rem;
  color: var(--gray-600);
  box-shadow: var(--shadow-sm);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ---------- Place detail (offcanvas) ---------- */
.offcanvas {
  border: none;
}

.place-share-btn {
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: background var(--ease), color var(--ease);
}

.place-share-btn:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

/* ---------- เนื้อหา rich text ที่เขียนผ่าน Quill editor (รายละเอียดสถานที่/ไทม์ไลน์) ---------- */
.rich-content {
  line-height: 1.75;
  word-break: break-word;
}
.rich-content p { margin: 0 0 .85rem; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h1, .rich-content h2, .rich-content h3,
.rich-content h4, .rich-content h5, .rich-content h6 {
  margin: 1.1rem 0 .6rem;
  font-weight: 700;
  color: var(--gray-900);
}
.rich-content h1:first-child, .rich-content h2:first-child, .rich-content h3:first-child { margin-top: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 .85rem; padding-left: 1.4rem; }
.rich-content li { margin-bottom: .3rem; }
.rich-content a { color: var(--brand-dark); text-decoration: underline; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: .5rem 0; }
.rich-content blockquote {
  margin: .85rem 0;
  padding: .6rem 1rem;
  border-left: 3px solid var(--brand);
  background: var(--gray-50);
  color: var(--gray-600);
}
.rich-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius-md);
  margin: .5rem 0;
  border: none;
}

.place-panel-image-wrap {
  margin: -1rem -1rem 0;
  height: 220px;
  overflow: hidden;
  background: var(--gray-100);
}

.place-panel-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-category-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.place-description {
  color: var(--gray-600); /* mb-4 removed */
  line-height: 1.7;
}

.place-info-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.place-info-row .info-icon {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-info-row .info-text {
  padding-top: .25rem;
  font-size: .92rem;
}

.btn-gmap {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .8rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-decoration: none;
  transition: transform var(--ease), box-shadow var(--ease);
  box-shadow: var(--shadow-sm);
}

.btn-gmap:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* ---------- ลิสต์สถานที่ตามหมวดหมู่ (ใต้แผนที่) ---------- */
.place-list-section {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 1.1rem 1.25rem 1.25rem;
  margin-top: 1rem;
}

.place-list-group + .place-list-group {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--gray-100);
}

.place-list-header {
  --chip-color: #0d6efd;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 .75rem;
}

.place-list-header .chip-icon {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--chip-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

.place-list-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .55rem;
}

.place-list-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-900);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.place-list-item i {
  color: var(--brand);
  font-size: .85rem;
  flex-shrink: 0;
}

.place-list-item:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-1px);
}

/* ---------- Banner slider (สไลด์ประชาสัมพันธ์) ---------- */
.banner-section {
  margin-top: 1.5rem;
}

/* สไลด์บนสุด (ต่อจากเมนู) — คนละ section กับสไลด์เดิมที่อยู่ระหว่างแผนที่กับข่าวสาร */
.banner-section-top {
  margin-top: 0;
}

.banner-section-top-inner {
  padding-top: 1.1rem;
  padding-bottom: 0;
}

.banner-carousel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.banner-carousel .carousel-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.banner-carousel .carousel-caption {
  background: linear-gradient(0deg, rgba(15, 23, 42, .65), transparent);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  bottom: 0;
  left: 0;
  right: 0;
  padding: .75rem 1rem .6rem;
  font-size: .85rem;
  text-align: left;
}

@media (max-width: 767.98px) {
  .banner-carousel .carousel-item img {
    height: 170px;
  }
}

/* ---------- News ---------- */
.news-section {
  margin-top: 1.5rem;
}

.news-section-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .9rem;
}

.news-section-header .icon-badge {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-md);
  background: var(--brand-light);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.news-section-header .btn-see-all {
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.news-section-header .btn-see-all:hover {
  text-decoration: underline;
}

.news-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scroll-snap-type: x proximity;
}

.news-card {
  flex: 0 0 270px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.news-category-badge {
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  padding: .15rem .55rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

.news-card:hover,
.news-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
  outline: none;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .6rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.news-card:hover .news-read-more i {
  transform: translateX(2px);
}

.news-read-more i {
  transition: transform var(--ease);
  font-size: .75rem;
}

.news-card .news-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.news-card .news-thumb-empty {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gray-300);
}

.news-card-body {
  padding: .9rem 1rem 1.1rem;
}

.news-date {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--brand-dark);
  background: var(--brand-light);
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: var(--radius-full);
  margin-bottom: .5rem;
}

.news-card-body h3 {
  font-size: .98rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: var(--gray-900);
}

.news-card-body p {
  font-size: .85rem;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.55;
}

.news-empty {
  color: var(--gray-500);
  font-size: .9rem;
  padding: 1rem 0;
}

.news-skeleton-card {
  flex: 0 0 270px;
  height: 260px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ---------- News detail modal ---------- */
.news-modal-content {
  border: none;
  border-radius: var(--radius-lg);
}

.news-modal-image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 320px;
}

.news-modal-image-wrap img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.news-modal-content-text {
  color: var(--gray-600);
  line-height: 1.8;
  margin-top: .75rem;
}

/* ---------- All News Page ---------- */
.all-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}
/* ---------- หน้าอ่านข่าวเต็ม (news.php) ---------- */
.news-detail-page {
  max-width: 760px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Timeline in Offcanvas */
#placeTimelineContainer {
  border-top: 1px solid var(--gray-200);
  padding-top: 1.5rem;
}
.timeline-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--brand-dark);
}
.timeline-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  padding: 1rem;
  transition: box-shadow var(--ease), background-color var(--ease);
}
.timeline-card-highlight {
  background-color: var(--brand-light);
  box-shadow: 0 0 0 2px var(--brand);
}
.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .25rem;
}
.timeline-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-900);
}
.timeline-card-meta {
  margin-bottom: .75rem;
}
.timeline-card-date {
  font-size: .75rem;
  color: var(--gray-500);
}
.timeline-card-author {
  font-size: .75rem;
  color: var(--gray-500);
  margin-left: .5rem;
}
.timeline-card-content {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.7;
}
.timeline-empty {
  text-align: center;
  color: var(--gray-500);
  font-size: .9rem;
  padding: 1rem;
  background: var(--gray-100);
  border-radius: var(--radius-md);
}
.timeline-share-btn {
  font-size: .9rem;
  color: var(--gray-500);
  background: none;
  border: none;
  padding: 0 .25rem;
  cursor: pointer;
}
.timeline-share-btn:hover {
  color: var(--brand);
}

.news-detail-card {
  box-shadow: var(--shadow-lg);
}

.news-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .6rem;
  color: var(--gray-900);
}

.news-detail-location {
  color: var(--gray-500);
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.news-view-count {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

#newsDetailMap {
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

@media (max-width: 767.98px) {
  .news-detail-title {
    font-size: 1.2rem;
  }
}

/* ---------- Leaflet overrides ---------- */
.leaflet-popup-content,
.leaflet-container {
  font-family: 'Sarabun', sans-serif;
}

.leaflet-control-zoom a {
  border-radius: var(--radius-sm) !important;
}

@media (max-width: 767.98px) {
  #map {
    height: 52vh;
  }
  .news-card {
    flex-basis: 220px;
  }
}


.owner-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-full);
  padding: .55rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.owner-portal-btn:hover {
  color: #fff;
  transform: translateY(-1px);
}

.timeline-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .75rem;
  margin-top: .9rem;
}

.timeline-gallery-item {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.timeline-gallery-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

/* ---------- ระบบจัดการสถานที่ของเจ้าของ/แอดมิน (place-manager.php) ---------- */
.mgr-page {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.mgr-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}

.mgr-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255, 255, 255, .18);
  padding: .35rem .85rem;
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.mgr-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}

.mgr-hero p {
  margin: 0;
  opacity: .92;
  font-size: .92rem;
  max-width: 46rem;
}

.mgr-hero-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.mgr-hero-actions .btn {
  border-radius: var(--radius-full);
  font-size: .88rem;
  font-weight: 600;
}

.mgr-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.mgr-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
}

.mgr-sticky {
  position: sticky;
  top: 5.5rem;
}

.mgr-place-list a {
  display: block;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--gray-900);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  margin-bottom: .65rem;
  transition: border-color var(--ease), background var(--ease);
}

.mgr-place-list a:hover {
  border-color: var(--brand);
}

.mgr-place-list a.active {
  background: var(--brand-light);
  border-color: var(--brand);
}

.mgr-place-name {
  font-weight: 600;
}

.mgr-place-meta {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .15rem;
}

.mgr-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.mgr-helper {
  color: var(--gray-500);
  font-size: .88rem;
}

.mgr-thumb {
  width: 100%;
  max-width: 220px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--gray-200);
}

.mgr-coord-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .6rem;
}

.mgr-coord-display {
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.mgr-map {
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

/* หมายเหตุสำคัญ: Quill mount แล้ว div ต้นฉบับ (.mgr-editor) จะ "กลายเป็น" .ql-container เอง
   (ไม่ใช่ wrapper ที่ครอบ .ql-container ไว้ข้างใน) ส่วน .ql-toolbar จะถูกแทรกเป็น sibling
   ก่อนหน้า .mgr-editor แทน — ต้องใช้ compound selector (.mgr-editor.ql-container ไม่มีเว้นวรรค)
   ไม่ใช่ descendant selector (.mgr-editor .ql-container มีเว้นวรรค) มิฉะนั้นจะไม่ match อะไรเลย
   สำคัญที่สุด: ต้องบังคับ height:auto ทับ default ของ Quill (.ql-container{height:100%})
   เพราะถ้าปล่อยไว้จะเกิด circular height กับ Bootstrap .row (flex + align-items:stretch)
   ทำให้กล่อง editor คำนวณความสูงผิดเพี้ยนเล็กกว่าที่ปั้นจริงมาก จนปุ่มถัดไปดันมาทับกล่อง editor
   (บั๊กที่ผู้ใช้รายงานว่า "text editor ทับปุ่ม") */
.mgr-editor {
  background: #fff;
  border-radius: var(--radius-md);
}

.mgr-editor.ql-container {
  height: auto;
  overflow: visible;
  border-color: var(--gray-200);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem;
}

.mgr-editor .ql-editor {
  min-height: 160px;
}

.ql-toolbar.ql-snow:has(+ .mgr-editor) {
  border-color: var(--gray-200);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  font-family: 'Sarabun', sans-serif;
}

.mgr-update {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  margin-top: 1.1rem;
  background: var(--gray-50);
}

.mgr-update-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
}

.mgr-update-images img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.mgr-public-link {
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  word-break: break-all;
  color: var(--brand-dark);
  text-decoration: none;
}

.mgr-public-link:hover {
  text-decoration: underline;
}

.mgr-copy-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  padding: 0 .2rem;
  cursor: pointer;
}

.mgr-copy-btn:hover {
  color: var(--brand);
}

.mgr-empty {
  text-align: center;
  color: var(--gray-500);
  font-size: .9rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--gray-300);
}

@media (max-width: 991.98px) {
  .mgr-grid {
    grid-template-columns: 1fr;
  }
  .mgr-sticky {
    position: static;
  }
}

/* ---------- หน้าเข้าสู่ระบบเจ้าของสถานที่ (place-owner-login.php) ---------- */
.auth-shell {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: linear-gradient(180deg, var(--brand-light) 0%, var(--gray-50) 55%);
}

.auth-card {
  width: min(100%, 520px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  border: 1px solid var(--gray-200);
}

.auth-top {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.auth-logo {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--radius-md);
  background: var(--brand-light);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.auth-benefits {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  gap: .6rem;
}

.auth-benefits li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .88rem;
  color: var(--gray-600);
}

.auth-benefits i {
  color: var(--brand);
  margin-top: .15rem;
}

.google-signin-shell {
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  background: var(--gray-50);
  margin-top: .25rem;
}

/* ---------- Footer (ใช้ร่วมกันทุกหน้าเว็บสาธารณะ + หน้าสมาชิก) ---------- */
.site-footer {
  background: var(--gray-900);
  color: #cbd5e1;
  margin-top: 3rem;
}

.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  max-width: 24rem;
}

.site-footer-logo {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: .6rem;
  background: #fff;
  padding: .3rem;
}

.site-footer-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}

.site-footer-tagline {
  font-size: .85rem;
  color: #94a3b8;
  margin-top: .2rem;
  line-height: 1.5;
}

.site-footer-links {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  font-size: .88rem;
}

.site-footer-links-title {
  color: #fff;
  font-weight: 600;
  font-size: .8rem;
  margin-bottom: .2rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.site-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color var(--ease);
}

.site-footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1.1rem 1.25rem;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8rem;
  color: #94a3b8;
}

@media (max-width: 575.98px) {
  .site-footer-inner {
    flex-direction: column;
  }
  .site-footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
