:root {
  --bg: #c5ecfb;
  --ink: #16324a;
  --muted: #4d6d82;
  --gold: #c6a035;
  --gold-soft: #e8d48b;
  --sky: #4dc8f5;
  --sky-deep: #12b0e8;
  --line: #06c755;
  --card: #ffffff;
  --border: #8fd9f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); }
h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
main { flex: 1; }

.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.site-header { border-bottom: 2px solid var(--gold); background: #b3e6fa; }
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  margin: 0;
}
.logo-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.logo-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.logo-sub {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav a { text-decoration: none; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-btn {
  display: inline-flex;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 5px;
  line-height: 0;
}
.lang-btn img {
  display: block;
  width: 28px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(22, 50, 74, 0.18);
}
.lang-btn.is-active {
  border-color: var(--gold);
  background: transparent;
}

body.lang-th {
  font-family: "Noto Sans Thai", "Source Sans 3", system-ui, sans-serif;
}
body.lang-th h1,
body.lang-th h2,
body.lang-th h3 {
  font-family: "Noto Serif Thai", "Cormorant Garamond", Georgia, serif;
}
body.lang-th .logo-sub {
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 0.72rem;
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.9rem; }
.btn-line { background: var(--line); }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 70vh;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy { padding: 3rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--sky-deep); }
.lede, .meta { color: var(--muted); }

.section { padding: 2.5rem 1.5rem 3rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.section.narrow { max-width: 640px; }
.section-head { margin-bottom: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }

.card-grid, .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.gallery-grid.large { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.card img, .gallery-grid img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.gallery-grid figure { margin: 0; }
.gallery-grid figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

.book-form { display: grid; gap: 1rem; }
.book-form label { display: grid; gap: 0.35rem; font-weight: 500; }
.book-form input, .book-form select, .book-form textarea {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.plain { padding-left: 1.1rem; }
.flash-wrap { padding: 1rem 1.5rem 0; }
.flash { padding: 0.7rem 1rem; border-radius: 10px; }
.flash-ok { background: #d9f3e3; }
nav a[aria-current="page"] {
  font-weight: 700;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.1rem;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr.is-hidden td { opacity: 0.5; }
.admin-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}
.admin-preview {
  max-width: 280px;
  border-radius: 12px;
}
.admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.admin-actions form { margin: 0; }
.visit-points { color: var(--muted); padding-left: 1.1rem; }

.inbox { display: grid; gap: 1rem; }
.inbox-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
}
.inbox-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.section-calendar { max-width: 1240px; }
.cal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.cal-toolbar h1 { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.cal-month { margin: 0; font-weight: 600; min-width: 9rem; text-align: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.cal-layout.has-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}
.calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-weekdays {
  background: #e7f6fd;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-weekdays div { padding: 0.55rem 0.4rem; text-align: center; }
.cal-day {
  min-height: 108px;
  padding: 0.4rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-outside { background: #f3fbff; color: #9bb4c4; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-daynum { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; }
.cal-events { display: grid; gap: 0.25rem; }
.cal-event { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem; align-items: stretch; }
.cal-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
  background: var(--line);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.cal-chip {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  border-radius: 6px;
  padding: 0.28rem 0.4rem;
  text-decoration: none;
  overflow: hidden;
  color: var(--ink);
}
.cal-time {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.cal-who {
  font-size: 0.68rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip.pending { background: #f3dc96; }
.cal-chip.contacted { background: #7ec8ea; }
.cal-chip.confirmed { background: #8fd4a8; }
.cal-chip.cancelled { background: #d7dee4; opacity: 0.75; }
.cal-chip.cancelled .cal-time,
.cal-chip.cancelled .cal-who { text-decoration: line-through; }
.cal-chip.is-selected { outline: 2px solid var(--ink); }
.cal-detail-time,
.appt-time {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  margin: 0.15rem 0 0.45rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cal-detail { position: sticky; top: 1rem; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; min-height: unset; }
  .hero img { height: 240px; }
  .row { grid-template-columns: 1fr; }
  .site-header, .site-footer { flex-wrap: wrap; }
  .cal-layout.has-detail { grid-template-columns: 1fr; }
  .cal-day { min-height: 86px; }
}
