/* ===== Design tokens ===== */
/* Brand blue (#0c3992) matches the live Camp Enoki booking portal's real brandColor setting. */
:root {
  --brand: #0c3992;
  --brand-light: #2a56b8;
  --brand-dark: #082a6e;
  --accent: #e8802e;
  --sand: #f4e3c1;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --text: #1c2333;
  --text-muted: #5a6472;
  --border: #dde3ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(12, 30, 60, 0.10);
  --shadow-lg: 0 16px 48px rgba(12, 30, 60, 0.18);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --brand: #6f9ce8;
  --brand-light: #8fb4f2;
  --brand-dark: #0c3992;
  --accent: #f5a252;
  --bg: #0f1720;
  --surface: #17212c;
  --text: #eef2f8;
  --text-muted: #a9b4c4;
  --border: #263140;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #6f9ce8;
    --brand-light: #8fb4f2;
    --brand-dark: #0c3992;
    --accent: #f5a252;
    --bg: #0f1720;
    --surface: #17212c;
    --text: #eef2f8;
    --text-muted: #a9b4c4;
    --border: #263140;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--brand); text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--text-muted); font-size: 0.95rem; transition: color .15s; }
.nav-links a:hover { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem;
}
.nav-toggle { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  min-height: 44px;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; min-height: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; padding: 90px 0 70px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 12%, var(--bg)) 0%, var(--bg) 100%);
}
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; } }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 16px; color: var(--brand-dark); line-height: 1.15; }
:root[data-theme="dark"] .hero h1 { color: var(--brand-light); }
.hero p { color: var(--text-muted); font-size: 1.08rem; max-width: 46ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===== Sections ===== */
section { padding: 64px 0; }
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 8px; color: var(--brand-dark); }
:root[data-theme="dark"] .section-title { color: var(--brand-light); }
.section-sub { color: var(--text-muted); margin: 0 0 36px; max-width: 60ch; }

.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
/* For content whose item count varies (e.g. Rates can be 1 promo or 6 cottages) —
   cards keep a sane width instead of stretching thin or leaving a lone card marooned. */
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-body { padding: 18px 20px; }
.card img { width: 100%; height: 170px; object-fit: cover; background: var(--sand); }

.amenity-card { text-align: center; padding: 26px 18px; }
.amenity-icon { font-size: 2rem; margin-bottom: 10px; }
.amenity-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.amenity-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.rates-list { display: flex; flex-direction: column; gap: 20px; }
.rate-card { display: flex; flex-direction: row; align-items: flex-start; }
.rate-card-info { flex: 1 1 0; min-width: 0; padding: 20px; }
/* Rates photos are often a full designed promo poster (pricing, contact info, logos
   baked into the graphic), not a candid scenery shot — cropping it (object-fit:cover)
   can cut off real content, so it gets real width and shows at its natural aspect
   ratio instead of being squeezed into a slim fixed-width column. */
.rate-card-photo { width: 42%; max-width: 420px; flex-shrink: 0; padding: 20px 20px 20px 0; }
.rate-card-photo img { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); background: var(--sand); }
@media (max-width: 700px) {
  .rate-card { flex-direction: column-reverse; }
  .rate-card-photo { width: 100%; max-width: none; padding: 16px 16px 0; }
}

.rate-card h3 { margin: 0; font-size: 1.15rem; }
.rate-card .price { color: var(--accent); font-weight: 700; font-size: 1.3rem; margin: 6px 0 0; }
.rate-card .price small { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.rate-card .meta { margin: 6px 0 14px; color: var(--text-muted); font-size: 0.88rem; }
.rate-desc { margin: 0; }
.rate-desc-text {
  margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.6;
  white-space: pre-line; /* respects real line breaks the owner types, e.g. one bullet per line */
}
.rate-desc-text.clamped {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.rate-desc-toggle {
  background: none; border: none; color: var(--brand); font-weight: 600; font-size: 0.82rem;
  cursor: pointer; padding: 8px 0 0; text-decoration: underline;
}

.gallery-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.gallery-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 0.88rem; font-weight: 500; color: var(--text-muted);
}
.gallery-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-item { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.gallery-item img { height: 160px; width: 100%; object-fit: cover; }
.gallery-item .gallery-video-frame { width: 100%; height: 260px; display: block; background: #000; }

.attractions-list { display: flex; flex-direction: column; gap: 20px; }
.attraction-card { display: flex; flex-direction: row; align-items: stretch; }
.attraction-card-info { flex: 1 1 0; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.attraction-media-wrap { width: 42%; max-width: 420px; flex-shrink: 0; padding: 20px 20px 20px 0; }
.attraction-media { width: 100%; height: 100%; min-height: 260px; object-fit: cover; display: block; border: none; border-radius: var(--radius-sm); background: #000; }
@media (max-width: 700px) {
  .attraction-card { flex-direction: column-reverse; }
  .attraction-media-wrap { width: 100%; max-width: none; padding: 16px 16px 0; }
  .attraction-media { min-height: 220px; }
}

.attraction-card h3 { margin: 0; font-size: 1.05rem; }
.attraction-card .distance { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.attraction-card p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

.review-card .card-body { padding: 22px; }
.review-stars { color: var(--accent); letter-spacing: 2px; }
.review-name { font-weight: 600; margin-top: 10px; }
.review-date { color: var(--text-muted); font-size: 0.8rem; }

.contact-block { display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-start; }
.contact-item { display: flex; gap: 12px; align-items: flex-start; }
.contact-item .icon { font-size: 1.3rem; }

footer.site-footer { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); }

/* ===== Chat widget ===== */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 1.6rem; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; transition: transform .18s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .badge {
  position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff;
  font-size: 0.65rem; font-weight: 700; border-radius: 999px; padding: 2px 6px; min-width: 18px; text-align: center;
}

.chat-panel {
  position: fixed; right: 20px; bottom: 96px; z-index: 60;
  width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 140px));
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none; transition: all .18s ease-out;
}
.chat-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.chat-header { background: var(--brand); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.chat-header .title { font-weight: 700; font-size: 1rem; }
.chat-header .subtitle { font-size: 0.78rem; opacity: 0.85; }
.chat-close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 4px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 0.92rem; animation: pop .15s ease-out; white-space: pre-wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-media { margin-top: 8px; border-radius: 10px; overflow: hidden; }
.msg-media img, .msg-media video { width: 100%; border-radius: 10px; }
.msg-media figcaption { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.msg-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-btn {
  border: 1px solid var(--brand); color: var(--brand); background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: 0.82rem; cursor: pointer; font-weight: 600;
}
.msg-btn:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.msg-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-row input {
  flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 11px 16px; font-size: 0.92rem;
  background: var(--bg); color: var(--text);
}
.chat-input-row input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chat-send { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--brand); color: #fff; font-size: 1.1rem; cursor: pointer; }

/* ===== Modal (booking wizard) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 18, 10, 0.5); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 28px;
}
.modal-box h2 { margin: 0 0 4px; color: var(--brand-dark); }
:root[data-theme="dark"] .modal-box h2 { color: var(--brand-light); }
.modal-close-x { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); }

.steps-indicator { display: flex; gap: 6px; margin: 16px 0 22px; }
.steps-indicator span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.steps-indicator span.active { background: var(--brand); }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.95rem; font-family: inherit; min-height: 44px;
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pill-toggle { display: flex; gap: 10px; }
.pill-toggle label {
  flex: 1; text-align: center; border: 1.5px solid var(--border); border-radius: 999px; padding: 10px;
  cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
}
.pill-toggle input { display: none; }
.pill-toggle input:checked + span { color: var(--brand); }
.pill-toggle label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }

.booking-summary { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; font-size: 0.9rem; }
.booking-summary div { display: flex; justify-content: space-between; padding: 4px 0; }
.booking-success { text-align: center; padding: 20px 0; }
.booking-success .icon { font-size: 3rem; }

/* ===== Admin page ===== */
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-header { background: var(--brand); color: #fff; padding: 18px 0; }
.admin-header .wrap { display: flex; justify-content: space-between; align-items: center; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }
.admin-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.admin-toolbar input[type="search"] {
  flex: 1; min-width: 200px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.admin-table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.admin-table th, table.admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.admin-table th { background: color-mix(in srgb, var(--brand) 8%, transparent); font-weight: 700; }
table.admin-table tr:last-child td { border-bottom: none; }
.tag { display: inline-block; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 0.76rem; font-weight: 600; }
.admin-actions { display: flex; gap: 6px; }
.admin-empty { padding: 40px; text-align: center; color: var(--text-muted); }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.admin-tab {
  padding: 9px 14px; border: none; background: transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--text-muted);
}
.admin-tab.active { background: var(--brand); color: #fff; }
.tab-panel { padding-top: 4px; }
.settings-form { max-width: 560px; display: flex; flex-direction: column; gap: 4px; }
.image-field-preview { width: 90px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.auth-gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-gate.hidden { display: none; }
.auth-gate-box { max-width: 360px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow-lg); }
.auth-gate-box h2 { margin: 6px 0 14px; color: var(--brand-dark); }
:root[data-theme="dark"] .auth-gate-box h2 { color: var(--brand-light); }
.auth-gate-box input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.95rem; margin: 14px 0 10px; min-height: 44px; }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 14px; }
.notice.info { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-dark); }
:root[data-theme="dark"] .notice.info { color: var(--brand-light); }

/* Utility */
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.text-center { text-align: center; }

@media (max-width: 720px) {
  .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--surface); flex-direction: column;
    padding: 16px 20px; border-bottom: 1px solid var(--border); display: none; gap: 14px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 1.2rem; cursor: pointer; }
  .form-row-2 { grid-template-columns: 1fr; }
}
