/* =========================================================
   ห้าเหมียวกับหนึ่งเรา (Five cats & Me) — ห้าหางข้างใจ
   ชุดสีหลัก: ครีมนม #FFF8EF · ส้มอิฐ #C5683D · น้ำตาลเข้ม #3B2923 · เขียวเสจอ่อน #DCE5D5
   (ชื่อตัวแปร blue/green/yellow/pink คงไว้เพื่อไม่ต้องแก้ HTML — ค่าสีจริงอยู่ในตระกูลเสจและส้มอิฐ)
   ========================================================= */
:root {
  --cream: #FFF8EF;        /* ครีมนม — พื้นหลังเว็บ */
  --cream-2: #F3E8DA;
  --ink: #3B2923;          /* น้ำตาลเข้ม — ตัวหนังสือ */
  --ink-soft: #75594D;
  --white: #ffffff;
  --brick: #C5683D;        /* ส้มอิฐ — ปุ่มและจุดเด่น */
  --brick-dark: #9C4E2B;
  --sage: #DCE5D5;         /* เขียวเสจอ่อน — พื้นหลังการ์ด/หมวดหมู่ */

  /* ตระกูลเสจ */
  --blue: #BFCFB4;
  --blue-soft: #EAF0E5;
  --blue-deep: #55704C;
  --green: #A9BD9C;
  --green-soft: var(--sage);
  --green-deep: #4F6A47;
  /* ตระกูลส้มอิฐ */
  --yellow: var(--brick);
  --yellow-soft: #F7E3D7;
  --yellow-deep: var(--brick-dark);
  --pink: #DE9470;
  --pink-soft: #F7E3D7;
  --pink-deep: #A9532E;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(122, 86, 52, .12);
  --shadow-sm: 0 4px 14px rgba(122, 86, 52, .10);
  --max: 1160px;
  --font-head: "Kanit", sans-serif;
  --font-body: "Kanit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 88px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(197, 104, 61, .08) 0 160px, transparent 161px),
    radial-gradient(circle at 92% 30%, rgba(220, 229, 213, .55) 0 200px, transparent 201px),
    radial-gradient(circle at 15% 78%, rgba(220, 229, 213, .45) 0 180px, transparent 181px);
  background-attachment: fixed;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-deep); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
strong { font-weight: 500; }

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head p { color: var(--ink-soft); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-size: .9rem; letter-spacing: .04em;
  padding: 4px 14px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--yellow-deep);
  margin-bottom: 12px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 238, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(122, 86, 52, .08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 1.35rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--blue) 0 25%, var(--green) 0 50%, var(--yellow) 0 75%, var(--pink) 0);
  box-shadow: var(--shadow-sm);
}
.brand-logo svg { width: 26px; height: 26px; }
.brand small { display: block; font-size: .72rem; font-family: var(--font-body); color: var(--ink-soft); font-weight: 300; line-height: 1; }

.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 16px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 400;
  color: var(--ink); text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
.nav-links a:hover { background: var(--yellow-soft); transform: translateY(-1px); }
.nav-links a[aria-current="page"] { background: var(--ink); color: var(--cream); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 14px;
  background: var(--yellow-soft); cursor: pointer; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 12px; right: 12px; height: 2.5px; border-radius: 2px;
  background: var(--ink); content: ""; transition: transform .25s, opacity .25s;
}
.nav-toggle span { top: 50%; transform: translateY(-50%); }
.nav-toggle span::before { left: 0; right: 0; top: -7px; }
.nav-toggle span::after { left: 0; right: 0; top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: 12px 16px 20px;
    background: var(--cream); box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .25s, opacity .25s;
  }
  .nav-open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 18px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-head); font-size: 1rem; text-decoration: none;
  color: var(--white); background: var(--brick);
  box-shadow: 0 6px 0 var(--brick-dark);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--brick-dark); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--brick-dark); }
.btn-pink { background: var(--ink); color: var(--cream); box-shadow: 0 6px 0 #1e1310; }
.btn-pink:hover { box-shadow: 0 8px 0 #1e1310; }
.btn-pink:active { box-shadow: 0 2px 0 #1e1310; }
.btn-ghost { background: var(--white); color: var(--ink); box-shadow: 0 6px 0 rgba(59, 41, 35, .15); }
.btn-ghost:hover { box-shadow: 0 8px 0 rgba(59, 41, 35, .15); }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 100px); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 .hl {
  background: linear-gradient(transparent 60%, var(--pink-soft) 60%);
  padding: 0 4px;
}
.hero p.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: center; width: 100%; }
.hero-art .blob {
  position: absolute; inset: 0;
  border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
  background: linear-gradient(135deg, var(--blue-soft), var(--pink-soft));
  animation: morph 12s ease-in-out infinite;
}
.hero-art img {
  position: absolute; inset: 9%;
  width: 82%; height: 82%; object-fit: cover;
  border-radius: 50% 50% 46% 54% / 55% 48% 52% 45%;
  border: 8px solid var(--white); box-shadow: var(--shadow);
}
.float-tag {
  position: absolute; padding: 10px 16px; border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow);
  font-family: var(--font-head); font-size: .92rem; line-height: 1.3;
  animation: bob 4s ease-in-out infinite;
}
.float-tag b { display: block; font-size: 1.3rem; font-weight: 500; }
.float-tag.t1 { top: 6%; left: -4%; border-bottom: 4px solid var(--green); }
.float-tag.t2 { bottom: 8%; right: -4%; border-bottom: 4px solid var(--pink); animation-delay: -2s; }
@keyframes morph {
  50% { border-radius: 42% 58% 45% 55% / 55% 45% 55% 45%; }
}
@keyframes bob { 50% { transform: translateY(-10px); } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { max-width: 340px; }
  .float-tag.t1 { left: 0; }
  .float-tag.t2 { right: 0; }
}

/* Page hero (sub pages) */
.page-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); text-align: center; }
.page-hero p { max-width: 640px; margin-inline: auto; color: var(--ink-soft); font-size: 1.08rem; }
.page-hero .paws { font-size: 1.6rem; letter-spacing: .3em; }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.7rem;
  margin-bottom: 16px;
}
.card p:last-child { margin-bottom: 0; }

.bg-blue { background: var(--blue-soft); }
.bg-green { background: var(--green-soft); }
.bg-yellow { background: var(--yellow-soft); }
.bg-pink { background: var(--pink-soft); }

/* Fact tiles */
.fact {
  border-radius: var(--radius); padding: 24px; text-align: center;
  position: relative; overflow: hidden;
}
.fact .num { font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; line-height: 1.2; }
.fact .label { font-size: .95rem; color: var(--ink-soft); }
.fact .emoji { font-size: 2rem; display: block; margin-bottom: 4px; }
.fact.bg-blue .num { color: var(--blue-deep); }
.fact.bg-green .num { color: var(--green-deep); }
.fact.bg-yellow .num { color: var(--yellow-deep); }
.fact.bg-pink .num { color: var(--pink-deep); }

/* Split (image + text) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.split-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.split-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .split.reverse > :first-child { order: 0; }
}

.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { position: relative; padding-left: 34px; margin-bottom: 10px; }
.check-list li::before {
  content: "🐾"; position: absolute; left: 0; top: 0; font-size: 1.05rem;
}

/* Timeline */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 36px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 4px; border-radius: 4px;
  background: linear-gradient(var(--blue), var(--green), var(--yellow), var(--pink));
}
.tl-item { position: relative; margin-bottom: 26px; background: var(--white); padding: 20px 24px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.tl-item::before {
  content: ""; position: absolute; left: -33px; top: 24px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); border: 4px solid var(--pink);
}
.tl-item .when { font-family: var(--font-head); color: var(--pink-deep); font-size: .95rem; }
.tl-item h3 { margin-bottom: .25em; }
.tl-item p { margin: 0; }

/* Body language chips */
.signal {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--white); padding: 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.signal .sig-icon { flex: 0 0 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; }
.signal h3 { font-size: 1.08rem; margin-bottom: .2em; }
.signal p { margin: 0; font-size: .96rem; color: var(--ink-soft); }

/* Source / reference box */
.source-box {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: var(--white); border: 2px dashed var(--blue); border-radius: var(--radius);
  padding: 20px 24px; font-size: .95rem;
}
.source-box .tag { font-family: var(--font-head); background: var(--blue-soft); color: var(--blue-deep); padding: 4px 12px; border-radius: 999px; }

/* TICA section */
.tica {
  background: linear-gradient(135deg, var(--blue-soft), var(--green-soft));
  border-radius: calc(var(--radius) * 1.5);
  padding: clamp(28px, 5vw, 56px);
}
.breed-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.breed-chips span {
  background: var(--white); padding: 8px 16px; border-radius: 999px; font-family: var(--font-head); font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.breed-chips span b { color: var(--pink-deep); margin-right: 6px; font-weight: 500; }

/* Wave divider */
.wave { display: block; width: 100%; height: 60px; }

/* ---------- Five cats page ---------- */
.cat-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 40px; }
.cat-nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px;
  border-radius: 999px; background: var(--white); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink); font-family: var(--font-head);
  transition: transform .2s;
}
.cat-nav a:hover { transform: translateY(-3px); }
.cat-nav img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.cat-profile {
  display: grid; grid-template-columns: 380px 1fr; gap: 40px; align-items: center;
  background: var(--white); border-radius: calc(var(--radius) * 1.4);
  padding: clamp(20px, 4vw, 40px); margin-bottom: 40px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; scroll-margin-top: 96px;
  border-top: 10px solid var(--accent);
}
.cat-profile::after {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  right: -80px; bottom: -80px; background: var(--accent-soft); z-index: 0;
}
.cat-profile > * { position: relative; z-index: 1; }
.cat-profile:nth-child(even) { grid-template-columns: 1fr 380px; }
.cat-profile:nth-child(even) .cat-photo { order: 2; }
.cat-photo { position: relative; }
.cat-photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50% 50% 44% 56% / 52% 46% 54% 48%;
  object-position: 50% 8%; /* รูปแนวตั้ง: เก็บหัวแมวไว้ ไม่ให้หูโดนตัด */
  border: 8px solid var(--accent-soft);
}
.cat-photo .badge {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--ink); white-space: nowrap;
  padding: 6px 18px; border-radius: 999px; font-family: var(--font-head); box-shadow: var(--shadow-sm);
}
.cat-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.cat-name h2 { margin: 0; }
.cat-name .jp { font-family: var(--font-head); color: var(--ink-soft); font-size: 1.1rem; }
.cat-meaning { color: var(--ink-soft); margin-bottom: 18px; }
.cat-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.cat-meta div { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.cat-meta small { display: block; color: var(--ink-soft); font-size: .8rem; }
.cat-meta b { font-family: var(--font-head); font-weight: 500; }
.traits { display: grid; gap: 10px; margin: 18px 0; }
.trait { display: grid; grid-template-columns: 110px 1fr 36px; gap: 12px; align-items: center; font-size: .95rem; }
.trait .bar { height: 10px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.trait .bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.trait .val { font-family: var(--font-head); text-align: right; }
.cat-quote {
  background: var(--cream); border-left: 5px solid var(--accent); padding: 12px 18px; border-radius: 0 14px 14px 0;
  font-style: normal; margin: 0;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span { font-size: .85rem; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--accent); }

.accent-blue { --accent: var(--blue); --accent-soft: var(--blue-soft); }
.accent-green { --accent: var(--green); --accent-soft: var(--green-soft); }
.accent-yellow { --accent: var(--yellow); --accent-soft: var(--yellow-soft); }
.accent-pink { --accent: var(--pink); --accent-soft: var(--pink-soft); }
.accent-mix { --accent: #C7B3A6; --accent-soft: #F1E9E3; }
.accent-yellow .badge { color: var(--white); }

@media (max-width: 900px) {
  .cat-profile, .cat-profile:nth-child(even) { grid-template-columns: 1fr; text-align: left; }
  .cat-profile:nth-child(even) .cat-photo { order: 0; }
  .cat-photo { max-width: 320px; margin: 0 auto; width: 100%; }
}
@media (max-width: 480px) {
  .cat-meta { grid-template-columns: 1fr 1fr; }
  .trait { grid-template-columns: 90px 1fr 30px; font-size: .9rem; }
}

/* ---------- Care page ---------- */
.care-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 32px; }
.care-tabs button {
  border: 0; cursor: pointer; padding: 10px 20px; border-radius: 999px;
  font-family: var(--font-head); font-size: 1rem; color: var(--ink);
  background: var(--white); box-shadow: var(--shadow-sm); transition: background .2s, transform .2s;
}
.care-tabs button:hover { transform: translateY(-2px); }
.care-tabs button[aria-selected="true"] { background: var(--green); }
.care-panel[hidden] { display: none; }
.care-panel { animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; translate: 0 12px; } }

.warn {
  background: var(--pink-soft); border-radius: var(--radius); padding: 24px 28px;
  border: 2px solid var(--pink);
}
.warn h3 { color: var(--pink-deep); }
.toxic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.toxic-list li { background: var(--white); padding: 10px 14px; border-radius: 12px; font-size: .95rem; }

.age-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.age-steps .step { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); position: relative; }
.age-steps .step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -14px; left: 22px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head);
  background: var(--yellow); box-shadow: var(--shadow-sm);
}
.age-steps .step h3 { margin-top: 8px; font-size: 1.1rem; }
.age-steps .step p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
@media (max-width: 860px) { .age-steps { grid-template-columns: 1fr 1fr; row-gap: 28px; } }
@media (max-width: 480px) { .age-steps { grid-template-columns: 1fr; } }

.checklist-box { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.checklist-box .progress { height: 14px; border-radius: 999px; background: var(--cream-2); overflow: hidden; margin: 10px 0 20px; }
.checklist-box .progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow), var(--pink)); transition: width .4s; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .checklist { grid-template-columns: 1fr; } }
.checklist label {
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  padding: 12px 16px; border-radius: 14px; background: var(--cream); transition: background .2s;
}
.checklist input { width: 20px; height: 20px; accent-color: var(--green-deep); flex: 0 0 auto; }
.checklist input:checked + span { text-decoration: line-through; color: var(--ink-soft); }
.checklist label:has(input:checked) { background: var(--green-soft); }

/* ป้ายบอกแหล่งที่มาของข้อมูล */
.cite {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  font-size: .74rem; line-height: 1.6; padding: 0 9px; border-radius: 999px;
  background: var(--sage); color: var(--green-deep); text-decoration: none; white-space: nowrap;
}
a.cite:hover { background: var(--green); color: var(--ink); }
.card h3 .cite { font-family: var(--font-body); font-weight: 400; }

.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 6px 0 12px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--cream-2); }
.data-table th { font-family: var(--font-head); font-weight: 500; background: var(--cream); }
.data-table tr:last-child td { border-bottom: 0; }

.mini-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.mini-facts .fact { padding: 18px 14px; }
.mini-facts .num { font-size: 1.35rem; }
@media (max-width: 760px) { .mini-facts { grid-template-columns: 1fr 1fr; } }

.org-card { display: flex; flex-direction: column; }
.org-card .btn { margin-top: auto; align-self: flex-start; }
.org-card .org-links { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 4px; font-size: .95rem; }
.org-card .org-links a { color: var(--brick-dark); }

/* การ์ดที่กดดูรายละเอียดได้ + ป๊อปอัป */
[data-detail] { cursor: pointer; transition: transform .25s, box-shadow .25s; }
[data-detail]:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
[data-detail]:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
.card[data-detail], .step[data-detail] { display: flex; flex-direction: column; }
[data-detail] > .more {
  margin-top: auto; padding-top: 12px; align-self: flex-start;
  font-family: var(--font-head); font-size: .92rem; color: var(--brick-dark);
  display: inline-flex; align-items: center; gap: 6px;
}
[data-detail] > .more::after { content: "→"; transition: transform .2s; }
[data-detail]:hover > .more::after { transform: translateX(4px); }

.detail-dialog {
  width: min(760px, calc(100% - 24px)); max-height: min(86vh, 900px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--white); color: var(--ink); box-shadow: 0 30px 80px rgba(30, 20, 15, .35);
  overflow: hidden;
}
.detail-dialog[open] { display: flex; flex-direction: column; animation: dlgIn .25s ease; }
.detail-dialog::backdrop { background: rgba(40, 28, 22, .55); backdrop-filter: blur(2px); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.dd-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: var(--cream); border-bottom: 1px solid var(--cream-2);
}
.dd-head .icon { margin: 0; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 auto; }
.dd-head h2 { margin: 0; font-size: clamp(1.2rem, 3.5vw, 1.5rem); flex: 1; }
.dd-close {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; flex: 0 0 auto;
  background: var(--white); color: var(--ink); font-size: 1.2rem; box-shadow: var(--shadow-sm);
}
.dd-close:hover { background: var(--yellow-soft); }
.dd-body { padding: 20px 24px 26px; overflow-y: auto; }
.dd-body h3 { font-size: 1.08rem; margin: 22px 0 8px; color: var(--brick-dark); }
.dd-body h3:first-child { margin-top: 0; }
.dd-body p, .dd-body li { font-size: .97rem; }
.dd-body .check-list li { margin-bottom: 6px; }
.dd-body .data-table { font-size: .9rem; }
.dd-body .table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.dd-body .note {
  background: var(--sage); border-radius: 14px; padding: 12px 16px; font-size: .92rem; margin-top: 18px;
}
.dd-body .timeline-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dd-body .timeline-mini li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 14px; background: var(--cream); border-radius: 12px; }
.dd-body .timeline-mini b { font-family: var(--font-head); font-weight: 500; color: var(--brick-dark); }
@media (max-width: 600px) {
  .dd-body .data-table, .dd-body .data-table tbody, .dd-body .data-table tr, .dd-body .data-table td { display: block; }
  .dd-body .data-table tr:first-child { display: none; }
  .dd-body .data-table tr { background: var(--cream); border-radius: 14px; padding: 6px 14px; margin-bottom: 10px; }
  .dd-body .data-table td { border: 0; padding: 6px 0; border-bottom: 1px dashed var(--cream-2); }
  .dd-body .data-table td:last-child { border-bottom: 0; }
  .dd-body .data-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; font-family: var(--font-head); font-size: .8rem; color: var(--ink-soft);
  }
}
@media (max-width: 520px) {
  .dd-body { padding: 16px 16px 22px; }
  .dd-body .timeline-mini li { grid-template-columns: 1fr; gap: 2px; }
}
body.dialog-open { overflow: hidden; }

/* ---------- Gallery ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 32px; }
.filters button {
  border: 0; cursor: pointer; padding: 9px 20px; border-radius: 999px;
  font-family: var(--font-head); font-size: .98rem; color: var(--ink);
  background: var(--white); box-shadow: var(--shadow-sm); transition: background .2s, transform .2s;
}
.filters button:hover { transform: translateY(-2px); }
.filters button.active { background: var(--brick); color: var(--white); }

.masonry { columns: 3 280px; column-gap: 18px; }
.masonry figure {
  break-inside: avoid; margin: 0 0 18px; position: relative; overflow: hidden;
  border-radius: var(--radius); background: var(--cream-2); box-shadow: var(--shadow-sm); cursor: zoom-in;
  animation: fadeUp .5s ease both;
}
.masonry figure[hidden] { display: none; }
.masonry img { width: 100%; height: auto; transition: transform .5s; }
.masonry figure:hover img { transform: scale(1.06); }
.masonry figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(52, 38, 28, .75));
  color: var(--white); font-family: var(--font-head); font-size: 1rem;
  transform: translateY(30%); opacity: 0; transition: transform .3s, opacity .3s;
}
.masonry figure:hover figcaption, .masonry figure:focus-visible figcaption { transform: none; opacity: 1; }
@media (hover: none) { .masonry figcaption { transform: none; opacity: 1; } }
.masonry figure:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(40, 30, 22, .88); padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox figure { margin: 0; max-width: min(1000px, 100%); text-align: center; color: var(--white); }
.lightbox img { max-height: 76vh; width: auto; margin: 0 auto; border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lightbox figcaption { margin-top: 14px; }
.lightbox figcaption b { font-family: var(--font-head); font-size: 1.2rem; font-weight: 500; display: block; }
.lightbox figcaption small { opacity: .8; }
.lightbox figcaption a { color: var(--yellow-soft); }
.lb-btn {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--white); color: var(--ink); font-size: 1.5rem; display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 620px) {
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.admin-card { text-align: center; }
.admin-avatar {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 14px; overflow: hidden;
  border: 6px solid var(--pink-soft);
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; text-align: left; }
.contact-list li { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 14px; }
.contact-list .ci { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--white); font-size: 1.2rem; flex: 0 0 auto; }
.contact-grid > * { min-width: 0; }
.contact-list li > div { min-width: 0; overflow-wrap: anywhere; }
.contact-list small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }

.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-family: var(--font-head); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 2px solid var(--cream-2);
  background: var(--cream); font: inherit; color: var(--ink); transition: border-color .2s, background .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: var(--white); }
.field .err { color: var(--pink-deep); font-size: .85rem; min-height: 1.2em; display: block; margin-top: 4px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--pink); }
.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.topic-pills input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.topic-pills label {
  margin: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-family: var(--font-body);
  background: var(--cream); border: 2px solid var(--cream-2); transition: all .2s;
}
.topic-pills input:checked + label { background: var(--yellow-soft); border-color: var(--yellow); }
.topic-pills input:focus-visible + label { outline: 3px solid var(--blue); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px));
  background: var(--ink); color: var(--cream); padding: 14px 22px; border-radius: 16px;
  box-shadow: var(--shadow); z-index: 120; transition: transform .35s cubic-bezier(.2, .9, .3, 1.3);
  width: max-content; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }

.faq details {
  background: var(--white); border-radius: var(--radius-sm); padding: 0 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-family: var(--font-head); font-size: 1.05rem;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--pink-deep); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; margin: 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #eadccd; padding: 56px 0 28px; margin-top: 40px; position: relative; }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 8px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--green) 0 50%, var(--yellow) 0 75%, var(--pink) 0);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--pink); font-size: 1.05rem; }
.site-footer a { color: #eadccd; text-decoration: none; }
.site-footer a:hover { color: var(--pink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .brand { color: var(--cream); margin-bottom: 12px; }
.site-footer .brand small { color: #c7b4a3; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 36px; padding-top: 20px; font-size: .88rem; color: #c7b4a3; text-align: center; }

/* ---------- Misc ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 32px; }
.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: var(--brick); color: var(--white); font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .25s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--cream); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   หน้าเมนูอาหาร (menu.html)
   ========================================================= */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.menu-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; animation: fadeUp .5s ease both; transition: transform .25s, box-shadow .25s;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.menu-media { aspect-ratio: 4 / 3; background: var(--sage); display: grid; place-items: center; overflow: hidden; }
.menu-card.cat-wet .menu-media, .menu-card.cat-homemade .menu-media { background: var(--yellow-soft); }
.menu-media img { width: 100%; height: 100%; object-fit: cover; }
.menu-media span { font-size: 4rem; }
.menu-body { padding: 18px 20px 22px; }
.menu-body h3 { margin: 8px 0 6px; }
.menu-body p { margin: 0; color: var(--ink-soft); font-size: .95rem; white-space: pre-line; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--sage); color: var(--green-deep); }
.chip-muted { background: var(--cream-2); color: var(--ink-soft); }
.menu-state { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--ink-soft); background: var(--white); border-radius: var(--radius); }

/* =========================================================
   ระบบหลังบ้าน (admin.html)
   ========================================================= */
.admin-body { min-height: 100vh; }
.btn-sm { padding: 8px 16px; font-size: .92rem; box-shadow: 0 4px 0 var(--brick-dark); }
.btn-ghost.btn-sm, .btn-pink.btn-sm { box-shadow: 0 4px 0 rgba(59, 41, 35, .15); }
.btn-danger { background: #B4412A; color: var(--white); box-shadow: 0 6px 0 #7E2B1B; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* หน้าล็อก */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.lock[hidden], .admin-app[hidden] { display: none; }
.lock-card {
  width: min(420px, 100%); background: var(--white); border-radius: calc(var(--radius) * 1.3);
  padding: 36px 28px 28px; text-align: center; box-shadow: var(--shadow);
  border-top: 8px solid var(--brick);
}
.lock-card h1 { font-size: 1.8rem; margin: 14px 0 4px; }
.lock-logo { width: 64px; height: 64px; margin: 0 auto; }
.lock-logo svg { width: 38px; height: 38px; }
.pin-inputs { display: flex; justify-content: center; gap: 8px; border: 0; padding: 0; margin: 24px 0 8px; }
.pin-inputs input {
  width: 46px; height: 56px; text-align: center; font: 500 1.5rem var(--font-head); color: var(--ink);
  border: 2px solid var(--cream-2); border-radius: 14px; background: var(--cream); transition: border-color .2s, background .2s;
}
.pin-inputs input:focus { outline: none; border-color: var(--brick); background: var(--white); }
.pin-inputs input:disabled { opacity: .5; }
@media (max-width: 380px) { .pin-inputs { gap: 6px; } .pin-inputs input { width: 40px; height: 50px; } }
.pin-error { min-height: 1.6em; color: #B4412A; font-size: .92rem; margin: 0 0 10px; }
.lock-card .btn { width: 100%; }
.lock-back { display: inline-block; margin-top: 16px; font-size: .92rem; color: var(--ink-soft); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* แถบบน */
.admin-bar { position: sticky; top: 0; z-index: 50; background: rgba(255, 248, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--cream-2); }
.admin-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; flex-wrap: wrap; padding: 8px 0; }
.admin-bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-soft); }
.db-status i { width: 10px; height: 10px; border-radius: 50%; background: var(--cream-2); }
.db-status[data-state="ok"] i { background: #4F9A4F; }
.db-status[data-state="error"] i { background: #B4412A; }
.db-status[data-state="loading"] i { background: var(--brick); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.admin-main { padding: 32px 0 64px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 4px; }
.admin-head p { margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.admin-stats .fact { padding: 16px; }
@media (max-width: 520px) { .admin-stats { gap: 8px; } .admin-stats .fact { padding: 12px 6px; } .admin-stats .label { font-size: .8rem; } }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-toolbar input, .admin-toolbar select {
  padding: 10px 14px; border-radius: 12px; border: 2px solid var(--cream-2); background: var(--white); font: inherit; color: var(--ink);
}
.admin-toolbar input { flex: 1 1 220px; }
.admin-toolbar input:focus, .admin-toolbar select:focus { outline: none; border-color: var(--brick); }
.admin-alert { background: #FBE3DC; border: 2px solid #E7A28C; color: #7E2B1B; border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; }
.admin-alert[hidden] { display: none; }

.admin-list { display: grid; gap: 14px; }
.admin-item {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; align-items: center;
  background: var(--white); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--brick);
}
.admin-item.is-hidden { border-left-color: var(--cream-2); opacity: .75; }
.admin-thumb { width: 84px; height: 84px; border-radius: 14px; background: var(--sage); display: grid; place-items: center; overflow: hidden; font-size: 2.2rem; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-info { min-width: 0; }
.admin-info h3 { margin: 0 0 6px; font-size: 1.1rem; }
.admin-info p { margin: 6px 0 0; font-size: .92rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn-del:hover { background: #FBE3DC; }
.admin-empty { text-align: center; padding: 40px 16px; color: var(--ink-soft); background: var(--white); border-radius: var(--radius-sm); }
@media (max-width: 720px) {
  .admin-item { grid-template-columns: 64px 1fr; }
  .admin-thumb { width: 64px; height: 64px; font-size: 1.8rem; }
  .admin-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* สวิตช์เปิด/ปิด */
.switch-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; user-select: none; position: relative; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--cream-2); position: relative; transition: background .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch-row input:checked + .switch { background: #4F9A4F; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--brick); outline-offset: 2px; }
.switch-row input:disabled + .switch { opacity: .5; }

/* ฟอร์มในป๊อปอัป */
.detail-dialog form { display: contents; }
.dd-body.form { display: grid; gap: 14px; }
.dd-body .field label { font-size: .95rem; }
.dd-body .field textarea { min-height: 110px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.img-preview { margin-top: 10px; max-height: 160px; border-radius: 12px; object-fit: cover; }
.img-preview[hidden] { display: none; }
.confirm-dialog { width: min(440px, calc(100% - 24px)); }
.toast-error { background: #7E2B1B; }

/* =========================================================
   แอนิเมชัน (js/anim.js เป็นตัวควบคุมส่วนที่ต้องใช้สคริปต์)
   ทุกอย่างปิดเองเมื่อผู้ใช้ตั้งค่า "ลดการเคลื่อนไหว" ในเครื่อง
   ========================================================= */

/* เปลี่ยนหน้าแบบนุ่มนวล (เบราว์เซอร์ที่รองรับ View Transitions) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vtOut .28s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vtIn .45s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes vtOut { to { opacity: 0; translate: 0 -12px; } }
@keyframes vtIn { from { opacity: 0; translate: 0 16px; } }

/* แถบความคืบหน้าการเลื่อนหน้า */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, var(--sage), var(--green), var(--brick));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* หัวเว็บย่อเมื่อเลื่อนลง */
.site-header { transition: box-shadow .3s, background .3s; }
.site-header .nav { transition: height .3s; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(59, 41, 35, .08); background: rgba(255, 248, 239, .96); }
.site-header.scrolled .nav { height: 62px; }
@media (max-width: 1024px) { .site-header.scrolled .nav-links { top: 62px; } }

/* โลโก้แมวกะพริบตา */
.brand-logo svg circle { transform-box: fill-box; transform-origin: center; animation: catBlink 5s infinite; }
.brand-logo svg circle:nth-of-type(2) { animation-delay: .04s; }
@keyframes catBlink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.1); } }
.brand:hover .brand-logo { animation: wiggle .6s ease; }
@keyframes wiggle { 25% { rotate: -10deg; } 50% { rotate: 8deg; } 75% { rotate: -4deg; } }

/* ปุ่ม: แสงวิ่งผ่านเมื่อชี้ */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  translate: -120% 0; transition: translate .6s ease;
}
.btn:hover::after { translate: 120% 0; }

/* ===== Hero หน้าแรก: ค่อย ๆ ปรากฏตอนเปิดหน้า ===== */
.hero, .page-hero { position: relative; isolation: isolate; }
.hero-grid > :first-child > * { animation: enterUp .9s cubic-bezier(.2, .8, .2, 1) both; }
.hero-grid > :first-child > :nth-child(1) { animation-delay: .05s; }
.hero-grid > :first-child > :nth-child(2) { animation-delay: .18s; }
.hero-grid > :first-child > :nth-child(3) { animation-delay: .32s; }
.hero-grid > :first-child > :nth-child(4) { animation-delay: .46s; }
.hero-art { animation: popIn 1.1s .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.page-hero .container > * { animation: enterUp .8s cubic-bezier(.2, .8, .2, 1) both; }
.page-hero .container > :nth-child(2) { animation-delay: .12s; }
.page-hero .container > :nth-child(3) { animation-delay: .24s; }
.page-hero .paws { display: inline-block; animation: enterUp .8s both, floaty 3.5s 1s ease-in-out infinite; }
@keyframes enterUp { from { opacity: 0; translate: 0 30px; filter: blur(8px); } to { opacity: 1; translate: 0 0; filter: none; } }
@keyframes popIn { from { opacity: 0; scale: .7; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes floaty { 50% { translate: 0 -8px; } }

/* ตัวอักษรไฮไลต์ไล่สี */
.hero h1 .hl {
  /* ชั้นบน = ไล่สีตัวอักษร, ชั้นล่าง = แถบไฮไลต์ */
  background: linear-gradient(90deg, var(--brick), #D98B65, var(--green-deep), var(--brick)), linear-gradient(transparent 60%, var(--pink-soft) 60%);
  background-size: 300% 100%, 100% 100%;
  -webkit-background-clip: text, border-box; background-clip: text, border-box;
  -webkit-text-fill-color: transparent; animation: shimmerText 6s linear infinite;
}
@keyframes shimmerText { to { background-position: 300% 0, 0 0; } }

/* ภาพ hero ขยับตามเมาส์ (ตั้งค่า --px/--py จากสคริปต์) */
.hero-art img { translate: calc(var(--px, 0) * 14px) calc(var(--py, 0) * 14px); transition: translate .4s ease-out; }
.hero-art .blob { translate: calc(var(--px, 0) * -10px) calc(var(--py, 0) * -10px); transition: translate .5s ease-out; }
.hero-art .float-tag { translate: calc(var(--px, 0) * 22px) calc(var(--py, 0) * 22px); transition: translate .3s ease-out; }

/* อุ้งเท้าลอยเป็นพื้นหลัง */
.paw-field { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.paw-field i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23C5683D'%3E%3Cellipse cx='32' cy='42' rx='14' ry='12'/%3E%3Cellipse cx='14' cy='26' rx='6' ry='8'/%3E%3Cellipse cx='26' cy='16' rx='6' ry='8'/%3E%3Cellipse cx='38' cy='16' rx='6' ry='8'/%3E%3Cellipse cx='50' cy='26' rx='6' ry='8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: pawDrift var(--d) var(--delay) ease-in-out infinite;
}
@keyframes pawDrift {
  0% { opacity: 0; translate: 0 40px; rotate: var(--r); }
  20%, 70% { opacity: var(--o); }
  100% { opacity: 0; translate: 0 -120px; rotate: calc(var(--r) + 25deg); }
}

/* ===== เผยเนื้อหาตอนเลื่อนถึง ===== */
/* กลุ่มการ์ด: ทยอยขึ้นทีละใบ (--i ตั้งจากสคริปต์) */
.stagger:not(.in) > * { opacity: 0; }
.stagger.in > * { animation: staggerIn .75s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.reveal.stagger { opacity: 1; transform: none; filter: none; }
@keyframes staggerIn { from { opacity: 0; translate: 0 28px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ภาพแยกส่วน: เปิดเหมือนม่าน */
.split-img.reveal { clip-path: inset(14% 14% 14% 14% round var(--radius)); transform: scale(1.04); filter: none; transition: clip-path 1.1s cubic-bezier(.2, .8, .2, 1), transform 1.4s cubic-bezier(.2, .8, .2, 1), opacity .6s; }
.split-img.reveal.in { clip-path: inset(0 round var(--radius)); transform: none; }
/* ไทม์ไลน์: เลื่อนเข้าจากซ้าย */
.tl-item.reveal { transform: translateX(-36px); }
.tl-item.reveal.in { transform: none; }
.timeline::before { transform-origin: top; animation: growLine 1.6s cubic-bezier(.2, .8, .2, 1) both; animation-play-state: paused; }
.timeline.in::before { animation-play-state: running; }
@keyframes growLine { from { scale: 1 0; } }

/* การ์ดเอียง 3 มิติ + แสงสะท้อน (เฉพาะเมาส์) */
.tilt { position: relative; transform-style: preserve-3d; will-change: transform; }
.tilt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .5), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.tilt.tilting::before { opacity: 1; }
.tilt.tilting { transition: transform .12s ease-out, box-shadow .25s; box-shadow: 0 18px 40px rgba(122, 86, 52, .18); }

/* ===== แถบข้อเท็จจริงวิ่ง (หน้าแรก) ===== */
.marquee {
  background: var(--brick); color: var(--cream); overflow: hidden; padding: 14px 0;
  rotate: -1.5deg; margin: 0 -2%; box-shadow: var(--shadow);
}
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-head); font-size: 1.05rem; padding: 0 28px; white-space: nowrap; display: inline-flex; align-items: center; gap: 28px; }
.marquee span::after { content: "🐾"; font-size: .9rem; opacity: .8; }
@keyframes marquee { to { translate: -50% 0; } }

.marquee-wrap { overflow-x: clip; padding: 14px 0; margin-bottom: 44px; }
.site-footer { overflow-x: clip; }

/* ===== แมวเดินบนขอบ footer ===== */
.footer-cat {
  position: absolute; top: -44px; left: 0; font-size: 2.2rem; line-height: 1; pointer-events: none;
  animation: catWalk 34s linear infinite;
}
.footer-cat span { display: inline-block; animation: catStep .5s ease-in-out infinite alternate; }
@keyframes catWalk { from { translate: 100vw 0; } to { translate: -80px 0; } }
@keyframes catStep { to { translate: 0 -3px; rotate: -3deg; } }

/* ===== อุ้งเท้าเด้งตรงที่คลิก ===== */
.paw-pop {
  position: fixed; z-index: 300; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23C5683D'%3E%3Cellipse cx='32' cy='42' rx='14' ry='12'/%3E%3Cellipse cx='14' cy='26' rx='6' ry='8'/%3E%3Cellipse cx='26' cy='16' rx='6' ry='8'/%3E%3Cellipse cx='38' cy='16' rx='6' ry='8'/%3E%3Cellipse cx='50' cy='26' rx='6' ry='8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: pawPop .7s cubic-bezier(.2, .9, .3, 1.3) forwards;
}
@keyframes pawPop {
  0% { scale: .2; opacity: .9; }
  60% { scale: 1.1; opacity: .8; }
  100% { scale: 1; opacity: 0; translate: 0 -24px; }
}

@media (prefers-reduced-motion: reduce) {
  .paw-field, .footer-cat, .scroll-progress { display: none; }
  .hero h1 .hl { -webkit-text-fill-color: currentColor; background: linear-gradient(transparent 60%, var(--pink-soft) 60%); }
  .split-img.reveal, .tl-item.reveal { clip-path: none; transform: none; }
}

/* ===== หลังบ้าน: แท็บ + ฟอร์มแก๊งแมว ===== */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; padding: 6px; background: var(--white); border-radius: 999px; box-shadow: var(--shadow-sm); width: fit-content; max-width: 100%; }
.admin-tabs button {
  border: 0; cursor: pointer; padding: 10px 20px; border-radius: 999px; background: transparent;
  font: 400 1rem var(--font-head); color: var(--ink); transition: background .2s, color .2s;
}
.admin-tabs button:hover { background: var(--cream); }
.admin-tabs button[aria-selected="true"] { background: var(--ink); color: var(--cream); }
[role="tabpanel"][hidden] { display: none; }

.dd-body .form-section { margin: 10px 0 -4px; padding-top: 12px; border-top: 1px dashed var(--cream-2); font-size: 1rem; }
.dd-body .form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .form-row-3 { grid-template-columns: 1fr; } }

.range-field { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: 12px; }
.range-field label { font-family: var(--font-head); font-size: .95rem; }
.range-field input { accent-color: var(--brick); width: 100%; }
.range-field output { font-family: var(--font-head); text-align: right; color: var(--brick-dark); }

.photo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); grid-auto-rows: 56px; gap: 6px; height: 136px; overflow-y: auto; padding: 4px; background: var(--cream); border-radius: 12px; }
.photo-picker button { position: relative; height: 56px; border: 3px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--cream-2); }
.photo-picker button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-picker button:hover { border-color: var(--sage); }
.photo-picker button.selected { border-color: var(--brick); }
.admin-info h3 small { font-family: var(--font-body); font-weight: 300; font-size: .85rem; }

/* หน้าแก๊งแมว: เก็บการขึ้นบรรทัดใหม่จากฟอร์ม */
.cat-bio { white-space: pre-line; }

/* ===== หลังบ้าน: แก้เนื้อหาหน้าเว็บ + แกลเลอรี ===== */
.chip-warn { background: #FBE3DC; color: #7E2B1B; }
.content-stats { font-size: .9rem; align-self: center; }
.content-hint { font-size: .88rem; margin: -6px 0 16px; }
.content-hint code { background: var(--cream-2); padding: 1px 6px; border-radius: 6px; font-size: .85rem; }
.content-group { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; }
.content-group > summary {
  cursor: pointer; list-style: none; padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
  font-family: var(--font-head); font-size: 1.02rem;
}
.content-group > summary::-webkit-details-marker { display: none; }
.content-group > summary::after { content: "+"; font-size: 1.4rem; color: var(--brick); margin-left: 8px; transition: rotate .2s; }
.content-group[open] > summary { border-bottom: 1px solid var(--cream-2); }
.content-group[open] > summary::after { rotate: 45deg; }
.content-group > summary small { margin-left: auto; font-family: var(--font-body); font-size: .82rem; }
.content-body { padding: 6px 18px 12px; display: grid; gap: 4px; }
.content-field { padding: 12px 0; border-bottom: 1px dashed var(--cream-2); display: grid; gap: 6px; }
.content-field:last-child { border-bottom: 0; }
.content-field.is-edited { border-left: 4px solid var(--brick); padding-left: 12px; margin-left: -16px; }
.content-field label { font-family: var(--font-head); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.content-field textarea, .content-field input {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--cream-2); background: var(--cream);
  font: inherit; color: var(--ink); resize: vertical;
}
.content-field textarea:focus, .content-field input:focus { outline: none; border-color: var(--brick); background: var(--white); }
.content-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.content-orig { font-size: .78rem; margin-right: auto; min-width: 0; overflow-wrap: anywhere; }
.content-img { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; }
.content-img img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--cream-2); }

.gallery-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gal-status { align-self: center; margin-right: auto; }
.gal-list { display: grid; gap: 10px; }
.gal-row {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center;
  background: var(--white); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm);
}
.gal-thumb { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--cream-2); display: grid; place-items: center; font-size: 1.8rem; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-fields { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 8px; min-width: 0; }
.gal-fields input, .gal-fields select {
  width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--cream-2); background: var(--cream); font: inherit; font-size: .9rem; color: var(--ink);
}
.gal-fields input:focus, .gal-fields select:focus { outline: none; border-color: var(--brick); background: var(--white); }
.gal-btns { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) {
  .gal-row { grid-template-columns: 64px 1fr; }
  .gal-thumb { width: 64px; height: 64px; }
  .gal-fields { grid-template-columns: 1fr; }
  .gal-btns { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
