/* J.DaoSiam: shared look for every page. Strawberry milk by day, night sky by night;
   site.js sets data-theme on <html> before first paint and the corner switch overrides the device. */
@font-face { font-family: "Chonburi"; src: url("fonts/chonburi-regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/sarabun-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/sarabun-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  --bg: #f8cfdc;
  --card: #fbe3eb;
  --accent: #c2305f;
  --text: #141114;
  --dim: #6b4c58;
  --sky: 194, 48, 95;
  --glow: rgba(255, 244, 248, .55);
  --display: "Chonburi", Georgia, serif;
  --body: "Sarabun", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121012;
  --card: #1d181c;
  --accent: #f2a2bd;
  --text: #f7e9ef;
  --dim: #a8929c;
  --sky: 242, 162, 189;
  --glow: rgba(242, 162, 189, .22);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); transition: background-color .6s ease, color .6s ease; }
body { font-family: var(--body); min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
header.bar, main, footer { position: relative; z-index: 1; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Theme images: both are stacked in one grid cell; the other theme's fades out. */
.pair { display: grid; justify-items: center; }
.pair img { grid-area: 1 / 1; height: auto; transition: opacity .6s ease; }
:root[data-theme="dark"] .for-light, :root[data-theme="light"] .for-dark { opacity: 0; }

/* The day/night switch, top right on every page. */
.switch { position: fixed; z-index: 2; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: transparent; color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: border-color .3s ease, transform .3s ease; }
.switch:hover { border-color: var(--accent); transform: rotate(-12deg); }
.switch svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .switch .moon, :root[data-theme="light"] .switch .sun { display: none; }

/* Top bar on inner pages: the badge goes home. */
header.bar { display: flex; align-items: center; gap: 12px; padding-block: calc(14px + env(safe-area-inset-top, 0px)) 0; min-height: 72px; }
header.bar a.home { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-size: 18px; }
header.bar .pair img { width: 44px; }

/* Home */
main.home { display: grid; justify-items: center; align-content: center; text-align: center; gap: 28px; padding-block: 72px 48px; }
.seal img { width: min(62vw, 300px); filter: drop-shadow(0 0 48px var(--glow)); }
.word img { width: min(84vw, 460px); }
.seal, .word { animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.word { animation-delay: .25s; margin: 0; }
.thai { font-family: var(--display); color: var(--accent); font-size: clamp(20px, 4.4vw, 28px); letter-spacing: .06em; margin: -8px 0 0; }
.lede { max-width: 32ch; font-size: clamp(17px, 2.4vw, 20px); line-height: 1.6; margin: 0; text-wrap: balance; }
.lede span { display: block; color: var(--dim); font-size: .9em; }
.go { font-family: var(--display); font-size: 18px; text-decoration: none; padding: 10px 22px 12px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: border-color .3s ease, background-color .3s ease; }
.go:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Reading pages: reviews list and single reviews */
main.page { width: 100%; max-width: 720px; margin: 0 auto; padding-block: 24px 64px; display: grid; gap: 28px; align-content: start; }
main.page h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 52px); line-height: 1.1; margin: 0; text-wrap: balance; }
main.page h1 small { display: block; font-size: .5em; color: var(--accent); letter-spacing: .06em; margin-top: 6px; }
.empty { background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 22px; padding: 36px 28px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty p { margin: 0; max-width: 34ch; line-height: 1.6; }
.empty .star { width: 36px; height: 36px; color: var(--accent); }
.cards { display: grid; gap: 18px; padding: 0; margin: 0; list-style: none; }
.cards a { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 18px; padding: 12px; }
.cards img { width: 112px; height: 112px; object-fit: cover; border-radius: 12px; }
.cards h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0; line-height: 1.2; }
.cards p { margin: 4px 0 0; color: var(--dim); font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--dim); font-size: 15px; }
.rating { color: var(--accent); letter-spacing: .1em; }
.prose { font-size: 18px; line-height: 1.7; display: grid; gap: 1em; }
.prose p { margin: 0; }
.hero-photo, .photos img { width: 100%; height: auto; border-radius: 18px; display: block; }
.photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.back { font-family: var(--display); text-decoration: none; }

footer { padding-block: 28px max(28px, env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; font-size: 15px; color: var(--dim); }
footer a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
footer a:hover, footer a:focus-visible { border-color: var(--accent); outline: none; }
footer b { font-weight: 600; color: var(--text); margin-right: 6px; }
/* LINE: phones tap the link, which opens LINE; bigger screens also get a QR code to scan with a phone. */
.line { display: flex; align-items: center; gap: 16px; text-align: left; }
.line > div { display: grid; gap: 4px; }
.line .qr { width: 96px; height: 96px; border-radius: 10px; padding: 4px; background: #fff; }
.line-add { font-family: var(--display); font-size: 17px; }
.line-id b { color: var(--text); margin: 0; user-select: all; }
@media (hover: none) and (pointer: coarse) { .line .qr { display: none; } .line { text-align: center; } }

@keyframes rise { from { opacity: .35; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .seal, .word { animation: none; } html, body, .pair img { transition: none; } }
@media (max-width: 480px) { .cards a { grid-template-columns: 84px 1fr; } .cards img { width: 84px; height: 84px; } }
