/* =========================================================
   Patty Channel — Design tokens & shared components
   สไตล์: เจ้าหญิง / ลูกคุณหนู — ชมพูกลีบกุหลาบ ครีมงาช้าง ทองแชมเปญ
   ========================================================= */
:root {
  /* สี */
  --ivory: #FFF9F4;
  --cream: #FBF1EA;
  --blush: #F8E3E8;
  --petal: #F0C7D3;
  --rose: #D88AA2;
  --berry: #A3466B;
  --berry-deep: #84365A;
  --plum: #4A2A3A;
  --ink-soft: #7C5B6A;
  --gold: #C6A15F;
  --gold-soft: #E8D6AE;
  --gold-line: linear-gradient(90deg, #E8D6AE, #C6A15F 50%, #E8D6AE);
  --sage: #8BA592;

  /* ฟอนต์ */
  --f-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --f-script: 'Pinyon Script', 'Cormorant Garamond', cursive;
  --f-hand: 'Charm', 'IBM Plex Sans Thai Looped', cursive;
  --f-body: 'IBM Plex Sans Thai Looped', 'Noto Sans Thai', system-ui, sans-serif;

  /* รูปทรง */
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow-soft: 0 10px 30px -14px rgba(132, 54, 90, .28);
  --shadow-card: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 40px -22px rgba(74, 42, 58, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--plum);
  background: var(--ivory);
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--berry); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-scroll { overflow: hidden; }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 3px; border-radius: 6px; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.35em;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; letter-spacing: .01em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #B3557B, var(--berry));
  color: #fff; box-shadow: 0 8px 18px -8px rgba(163, 70, 107, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:hover { background: linear-gradient(180deg, #A84E73, var(--berry-deep)); }
.btn.ghost { background: #fff; border-color: var(--petal); color: var(--berry); }
.btn.ghost:hover { background: var(--blush); }
.btn.gold { background: #fff; border-color: var(--gold); color: #8A6A2E; }
.btn.danger { background: #fff; border-color: #E7B9C1; color: #B23A55; }
.btn.danger:hover { background: #FCEEF1; }
.btn.sm { min-height: 34px; padding: .3em .95em; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--petal); background: #fff; color: var(--berry);
  font-size: 1rem; line-height: 1;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }

/* ---------- หัวใจ (รูปทรงให้คะแนน) ---------- */
.hearts { position: relative; display: inline-flex; vertical-align: middle; line-height: 0; }
.hearts-base, .hearts-fill { display: inline-flex; gap: 2px; white-space: nowrap; }
.hearts-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; }
.hearts svg { width: 16px; height: 16px; flex: none; }
.hearts-base svg { fill: #F3DDE3; }
.hearts-fill svg { fill: var(--rose); }
.hearts.sm svg { width: 13px; height: 13px; }
.hearts.lg svg { width: 26px; height: 26px; }
.hearts.lg .hearts-base, .hearts.lg .hearts-fill { gap: 5px; }
svg.mini { width: 12px; height: 12px; fill: var(--rose); vertical-align: -1px; }

/* ---------- ช่องภาพ Demo ---------- */
.demo-ph {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background:
    repeating-linear-gradient(135deg, rgba(216,138,162,.10) 0 12px, rgba(255,255,255,.0) 12px 24px),
    linear-gradient(160deg, #FBE9EE, #F6DCE3);
  color: var(--berry); text-align: center;
}
.demo-ph span { font-family: var(--f-display); font-weight: 600; letter-spacing: .32em; font-size: 1.05rem; padding-left: .32em; }
.demo-ph small { font-size: .72rem; color: var(--ink-soft); padding: 0 8px; }

/* ---------- โพลารอยด์ ---------- */
.polaroid {
  position: relative; margin: 0;
  background: #fff; padding: 10px 10px 0;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(74,42,58,.12), 0 14px 28px -14px rgba(74,42,58,.45);
}
.polaroid .pol-img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--blush); }
.polaroid .pol-img img { width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption {
  font-family: var(--f-hand); font-size: 1rem; color: var(--ink-soft);
  text-align: center; padding: 8px 4px 12px; line-height: 1.3;
}
.polaroid.mini { width: 120px; padding: 6px 6px 0; }
.polaroid.mini figcaption { font-size: .82rem; padding: 4px 2px 6px; }
.tape {
  position: absolute; top: -10px; left: 50%; width: 74px; height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(240, 199, 211, .72);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(74, 42, 58, .42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--plum); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: .92rem; box-shadow: var(--shadow-soft); max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- ฟอร์ม ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .field-label { font-size: .86rem; font-weight: 500; color: var(--ink-soft); }
.input, .field input[type="text"], .field input[type="url"], .field input[type="password"], .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid #EBD3DB; border-radius: var(--r-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(216,138,162,.22);
}
.hint { font-size: .8rem; color: var(--ink-soft); margin: 0; }

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