/* NutriLabel — shared styles (index + article pages) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green-dark: #085041;
  --green-mid: #0F6E56;
  --green: #1D9E75;
  --green-light: #5DCAA5;
  --green-pale: #9FE1CB;
  --green-bg: #E1F5EE;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #6b7280;   /* WCAG AA: #9ca3af was 2.54:1 on white */
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --border: rgba(0,0,0,0.09);
  --border-mid: rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --line-green: #06C755;
  --fastwork-orange: #FF6B35;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}
html { scroll-behavior: smooth; }
body { font-family: 'Sarabun', 'Inter', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-brand { font-size: 18px; font-weight: 700; color: var(--green-mid); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-brand span { color: var(--text); font-weight: 400; font-size: 14px; }
.nav-brand img { height: 56px; width: auto; display: block; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: 14px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; font-weight: 500; }
.nav-links a:hover { color: var(--green-mid); }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px;
  background: none; border: 0.5px solid var(--border-mid); border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--green-mid); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.nav-cta {
  background: var(--green) !important; color: #fff !important;
  padding: 8px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; transition: background 0.2s, transform 0.15s !important;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--green-mid) !important; transform: translateY(-1px); }

/* LAYOUT */
.container { max-width: 900px; margin: 0 auto; padding: 0 2rem; }
section { padding: 4.5rem 0; }
.section-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-mid); margin-bottom: 0.5rem; font-weight: 600; }
.section-title { font-size: clamp(22px, 3.5vw, 28px); font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.section-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 2.5rem; }
hr.divider { border: none; border-top: 0.5px solid var(--border); }

.bg-secondary { background: var(--bg-secondary); }

/* FOOTER */
footer { background: var(--green-dark); color: rgba(255,255,255,0.5); text-align: center; padding: 2.5rem 2rem; font-size: 12.5px; line-height: 1.8; }
footer strong { color: rgba(255,255,255,0.85); font-weight: 600; }
footer a { color: rgba(255,255,255,0.55); text-decoration: none; }
footer a:hover { color: var(--green-pale); }

/* LINE CHAT BUBBLE */
.chat-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.chat-tooltip {
  background: #fff; color: var(--text);
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 20px 20px 4px 20px;
  box-shadow: var(--shadow-md);
  white-space: nowrap; opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  border: 0.5px solid var(--border);
}
.chat-bubble:hover .chat-tooltip { opacity: 1; transform: translateY(0); }
.chat-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--line-green);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(6,199,85,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: pulse 2.5s ease-in-out infinite;
}
.chat-btn:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(6,199,85,0.5); animation: none; }
.chat-btn svg { width: 30px; height: 30px; fill: #fff; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(6,199,85,0.4); }
  50% { box-shadow: 0 4px 28px rgba(6,199,85,0.65); }
}


/* RESPONSIVE — shared chrome */
@media (max-width: 900px) {
  nav { padding: 0 1.25rem; height: 64px; }
  .nav-brand img { height: 44px; }
  .nav-right { gap: 0.75rem; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg);
    border-bottom: 0.5px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.9rem 0.25rem; font-size: 15px; border-bottom: 0.5px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-cta { padding: 8px 16px; font-size: 12.5px; }
  .container { padding: 0 1.25rem; }
}

/* ผู้ใช้ที่ตั้งค่า "ลดการเคลื่อนไหว" ไว้ในเครื่อง — หยุดทุก animation
   บางคนเวียนหัว/คลื่นไส้กับภาพเคลื่อนไหว การเด้งตลอดเวลาจึงต้องหยุดให้ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
