/* Lanna Elephant Care booking + admin: shared tokens.
   Same brand as the marketing site (site-v2): Fraunces for display, Source Sans 3 for UI,
   the "midday" paper stop for pages, dusk forest for the summary, saffron for the main action.
   Fonts and grain are served read-only from the marketing site's /assets. */

@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-var.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-italic-var.woff2") format("woff2"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/assets/fonts/source-sans-3-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

:root {
  /* midday stop */
  --paper: #F4EEDF; --paper-2: #EDE5D1; --paper-3: #E4DAC2;
  --ink: #1E1C15; --soft: #514A3B; --muted: #6E6656; --accent: #9C5507;
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --rule-strong: color-mix(in srgb, var(--ink) 30%, transparent);
  /* morning stop (secondary surfaces) */
  --mist: #DCE3DA;
  /* dusk stop */
  --forest: #0F2219; --forest-2: #17301F; --dusk-ink: #EEE6D2; --dusk-soft: #B5BCAA; --dusk-rule: rgba(238, 230, 210, .18);
  --sun: #E8A93A; --sun-hover: #F1BA55; --sun-ink: #15231B;
  /* states */
  --ok: #2E6B3A; --ok-bg: #E2EBDC; --warn: #8A5A00; --warn-bg: #F6E7C4; --bad: #9B2F0C; --bad-bg: #F5DDD2;

  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-text: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --m: clamp(18px, 5vw, 72px);
  --g: clamp(14px, 1.7vw, 24px);
  --r: 4px;
  --r-lg: 10px;
  --hdr: 64px;
  --ease-out: cubic-bezier(.16, .84, .24, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.55 var(--f-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
p, h1, h2, h3, h4, figure, dl, dd, ul, ol, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--sun); color: var(--sun-ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* grain, as on the marketing site */
.grain::after { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; background: url("/assets/img/grain.png") repeat; background-size: 192px; opacity: .32; mix-blend-mode: soft-light; }

/* type */
.display { font-family: var(--f-display); font-optical-sizing: auto; font-weight: 320; letter-spacing: -.03em; line-height: .95; text-wrap: balance; }
.display em, .h em { font-style: italic; color: var(--accent); font-weight: 340; letter-spacing: -.015em; padding-right: .04em; }
.h { font-family: var(--f-display); font-weight: 360; letter-spacing: -.02em; line-height: 1.08; }
.cap { font: 600 .9rem/1.4 var(--f-text); font-variant-caps: all-small-caps; font-feature-settings: "smcp", "c2sc"; letter-spacing: .09em; color: var(--soft); }
.lede { font-family: var(--f-display); font-weight: 350; font-size: clamp(1.1rem, 1rem + .35vw, 1.28rem); line-height: 1.45; color: var(--soft); max-width: 34em; text-wrap: pretty; }
.small { font-size: .92rem; color: var(--soft); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 48px; padding: 0 1.35em; border-radius: 999px; border: 1px solid transparent; font: 600 1rem/1 var(--f-text); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease-out), background-color .2s, border-color .2s, opacity .2s; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn--sun { background: var(--sun); color: var(--sun-ink); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 24px -14px rgba(120,70,0,.55); }
.btn--sun:not(:disabled):hover { background: var(--sun-hover); transform: translateY(-1px); }
.btn--sun:focus-visible { outline-color: var(--ink); }
.btn--ink { background: var(--forest); color: var(--dusk-ink); }
.btn--ink:not(:disabled):hover { background: var(--forest-2); }
.btn--line { background: transparent; border-color: var(--rule-strong); color: var(--ink); }
.btn--line:not(:disabled):hover { border-color: var(--accent); }
.btn--danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); }
.btn--danger:not(:disabled):hover { background: var(--bad-bg); }
.btn--sm { min-height: 40px; padding: 0 1em; font-size: .95rem; }
.btn--block { width: 100%; }
.btn .spin { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: .2em 0; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .22em; cursor: pointer; }
.linkbtn:hover { text-decoration-color: var(--accent); }

/* form controls */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-weight: 600; font-size: .98rem; }
.hint { font-size: .9rem; color: var(--soft); line-height: 1.4; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r);
  background: color-mix(in srgb, #fff 55%, var(--paper)); color: var(--ink); font-size: 1rem; line-height: 1.35;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink) 50%, transparent); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--bad); }
.field__err { color: var(--bad); font-size: .9rem; font-weight: 600; }
.field__err:empty { display: none; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--forest); }

/* notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--paper-2); font-size: .95rem; line-height: 1.45; }
.notice--bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: #5a1c06; }
.notice--ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: #183d20; }
.notice--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: #4b3100; }
.notice .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; }

/* the honest "concept demo" strip */
.demo { background: var(--forest); color: var(--dusk-ink); font-size: .88rem; line-height: 1.4; }
.demo__in { display: flex; gap: 10px 14px; align-items: baseline; padding: 9px var(--m); flex-wrap: wrap; }
.demo__tag { flex: none; font: 700 .74rem/1 var(--f-text); letter-spacing: .12em; text-transform: uppercase; color: var(--sun-ink); background: var(--sun); padding: 5px 8px 4px; border-radius: 3px; }
.demo__txt { color: var(--dusk-soft); }

.errpage { display: grid; place-items: center; min-height: 100vh; font-family: var(--f-text); }
.errpage main { text-align: center; display: grid; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Thai and Chinese (guest pages; the admin is English only) ----------
   Same rules as the marketing site: Latin stays in Fraunces / Source Sans 3; Thai falls through to the self-hosted
   Noto Serif Thai / Noto Sans Thai subsets (downloaded only when Thai is on the page); Chinese uses system CJK fonts. */
@font-face { font-family: "LEC Thai Serif"; src: url("/assets/fonts/noto-serif-thai-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "LEC Thai Sans"; src: url("/assets/fonts/noto-sans-thai-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
html:lang(th) {
  --f-display: "Fraunces", "LEC Thai Serif", "Leelawadee UI", Tahoma, serif;
  --f-text: "Source Sans 3", "LEC Thai Sans", "Leelawadee UI", Tahoma, sans-serif;
}
html:lang(zh) {
  --f-display: "Fraunces", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --f-text: "Source Sans 3", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}
/* no tracking, no synthetic italics, no synthetic small caps (they shrink caseless scripts) */
html:lang(th) body *, html:lang(zh) body * { letter-spacing: 0; }
html:lang(th), html:lang(zh) { font-synthesis: weight; overflow-wrap: break-word; }
html:lang(zh) { line-break: strict; }
html:lang(th) body { line-height: 1.7; }
html:lang(zh) body { line-height: 1.65; }
html:lang(th) .display { line-height: 1.24; }
html:lang(zh) .display { line-height: 1.12; font-weight: 400; }
html:lang(zh) .display em, html:lang(zh) .h em { font-weight: 400; }
html:lang(th) .h { line-height: 1.3; }
html:lang(th) .lede { line-height: 1.7; }
html:lang(zh) .lede { line-height: 1.7; font-weight: 400; }
html:lang(th) .cap { font-size: .92rem; line-height: 1.6; }
html:lang(zh) .cap { font-size: .9rem; font-weight: 500; letter-spacing: .04em; }
html:lang(th) .btn, html:lang(zh) .btn { white-space: nowrap; }

/* language control: EN | ไทย | 中文 inline; a small menu on narrow screens */
.lang { position: relative; display: flex; align-items: center; margin-left: auto; }
.lang__toggle { display: none; }
.lang__opts { display: flex; align-items: center; }
.lang__opt { position: relative; min-height: 40px; min-width: 40px; padding: 0 .55em; border: 0; border-radius: 999px; background: transparent; color: var(--soft); font: 500 .92rem/1 var(--f-text); cursor: pointer; white-space: nowrap; }
.lang__opt[lang="th"], .lang__cur[lang="th"] { font-family: "Source Sans 3", "LEC Thai Sans", "Leelawadee UI", Tahoma, sans-serif; }
.lang__opt[lang="zh-Hans"], .lang__cur[lang="zh-Hans"] { font-family: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
.lang__opt + .lang__opt::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: .95em; margin-top: -.48em; background: currentColor; opacity: .3; }
.lang__opt:hover { color: var(--ink); }
.lang__opt[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .45em; }
.lang__opt:focus-visible, .lang__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.lang__ic { width: 18px; height: 18px; flex: none; }
.lang__chev { width: 14px; height: 14px; flex: none; transition: transform .25s; }
@media (max-width: 720px) {
  .lang__toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--ink); font: 600 .9rem/1 var(--f-text); cursor: pointer; white-space: nowrap; }
  .lang.is-open .lang__chev { transform: rotate(180deg); }
  .lang__opts { display: none; position: absolute; top: calc(100% + 6px); right: -8px; z-index: 80; flex-direction: column; align-items: stretch; min-width: 132px; padding: 6px; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--rule-strong), 0 14px 30px -12px rgba(0,0,0,.35); }
  .lang.is-open .lang__opts { display: flex; }
  .lang__opt { min-height: 44px; padding: 0 14px; text-align: left; font-size: 1rem; border-radius: 6px; }
  .lang__opt + .lang__opt::before { display: none; }
  .lang__opt:hover { background: var(--paper-2); }
}
