/*
Theme Name: Farm
Description: ฟาร์มของหนู — the website of the toddler game (game guide + articles for parents). Pastel, rounded, Mali font.
Version: 1.0
Text Domain: farm
*/
:root { --bg: #FFF6EA; --card: #FFFFFF; --ink: #5B3B2E; --soft: #8E6F60; --peach: #FFB98A; --coral: #E06F4E; --mint: #A8E6CF;
  --sky: #A6D8FF; --butter: #FFE08A; --pink: #FFB3C7; --leaf: #5FBF73; --shadow: 0 8px 0 rgba(107,74,58,.10); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Mali", system-ui, sans-serif; font-size: 18px; line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,246,234,.92); backdrop-filter: blur(8px); border-bottom: 2px solid #F3E2CC; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 22px; white-space: nowrap; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.nav a:hover, .nav a.on { background: #FCE7D2; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; background: var(--coral); color: #fff; font-weight: 700;
  padding: 12px 26px; border-radius: 999px; box-shadow: 0 6px 0 #B9533A; transition: transform .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn.small { padding: 7px 16px; font-size: 16px; box-shadow: 0 4px 0 #B9533A; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 6px 0 #EAD6C0; }
@media (max-width: 760px) { .top .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; } .nav { order: 3; width: 100%; justify-content: center; margin: 0; } .top .btn.small { margin-left: auto; } }
/* hero */
.hero { position: relative; border-radius: 0 0 40px 40px; overflow: hidden; min-height: min(78vh, 620px); display: flex; align-items: flex-start; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .wrap { position: relative; width: 100%; padding-top: clamp(28px, 7vh, 80px); }
.hero .box { max-width: 520px; background: rgba(255,255,255,.86); border-radius: 28px; padding: 26px 30px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: clamp(34px, 5vw, 54px); line-height: 1.2; }
.hero p { margin: 0 0 18px; color: var(--soft); }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
/* sections */
section { padding: 56px 0 8px; }
h2.sec { font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 6px; }
.lead { color: var(--soft); margin: 0 0 24px; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.why div { background: var(--card); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.why b { display: block; font-size: 20px; } .why span { font-size: 34px; }
.why p { margin: 4px 0 0; font-size: 16px; color: var(--soft); line-height: 1.6; }
/* game cards */
.tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 8px 18px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 #EAD6C0; }
.tabs button.on { background: var(--butter); }
/* games page: categories like the game menu */
.catchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.catchips a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; border-radius: 999px; padding: 6px 16px; box-shadow: 0 4px 0 rgba(107,74,58,.10); }
.article .gcat { padding: 0; scroll-margin-top: 84px; } /* not the big padding of the front page sections */
.article .gcat h2 { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; border-radius: 24px; padding: 4px 20px;
  margin: 26px 0 16px; font-size: clamp(20px, 5vw, 24px); line-height: 1.5; }
.gcat h2 small { font-size: 15px; color: var(--soft); white-space: nowrap; }
@media (max-width: 760px) { /* phones: the chips scroll sideways in one row */
  .catchips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 4px; padding: 2px 20px 10px; scrollbar-width: none; }
  .catchips a { white-space: nowrap; font-size: 15px; } }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.game { background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.game .shot { aspect-ratio: 16 / 10; background: #FCE7D2; position: relative; }
.game .shot img { width: 100%; height: 100%; object-fit: cover; }
.game .age { position: absolute; top: 10px; left: 10px; background: #fff; border-radius: 999px; padding: 0 12px; font-size: 14px; font-weight: 700; }
.game .age.big { background: var(--butter); }
.game .body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game h3 { margin: 0; font-size: 21px; }
.game .skills { display: flex; gap: 6px; flex-wrap: wrap; }
.game .skills i { font-style: normal; font-size: 13px; background: #E8F7EF; color: #2E7D4F; border-radius: 999px; padding: 1px 10px; }
.game p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.game .tip { color: var(--soft); font-size: 14.5px; background: #FFF6EA; border-radius: 12px; padding: 6px 10px; margin-top: auto; }
/* articles */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.post-card { background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s; }
.post-card:hover { transform: translateY(-3px); }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card div { padding: 16px 20px 20px; }
.post-card h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.45; }
.post-card p { margin: 0; color: var(--soft); font-size: 15.5px; line-height: 1.6; }
/* article / page */
.article { max-width: 760px; margin: 0 auto; padding: 28px 20px 40px; }
.article .cover { border-radius: 28px; overflow: hidden; margin: 0 0 24px; box-shadow: var(--shadow); }
.article h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.35; margin: 8px 0 6px; }
.article .meta { color: var(--soft); font-size: 15px; margin-bottom: 18px; }
.article h2 { font-size: 26px; margin: 32px 0 8px; }
.article li { margin: 6px 0; }
.farm-tip { background: #FFF1C9; border-radius: 18px; padding: 14px 18px; margin: 22px 0; }
.farm-lyrics div + div { margin-top: 14px; }
.farm-lyrics { background: #fff; border: 2px solid #FFE08A; border-radius: 18px; padding: 16px 20px; margin: 14px 0 22px; line-height: 1.9; font-size: 1.05em; }
.farm-note { font-size: 14.5px; color: var(--soft); border-top: 2px dashed #F0DCC6; padding-top: 14px; margin-top: 30px; }
.farm-inline-game { display: inline-block; margin: 8px 0; background: var(--mint); color: #1F5E3D; text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 999px; }
/* play band + footer */
.band { margin: 60px 0 0; background: linear-gradient(120deg, #FFD9B8, #FFE9A8); border-radius: 32px; padding: 30px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.band h3 { margin: 0; font-size: 26px; } .band p { margin: 0; color: var(--soft); }
footer { margin-top: 60px; padding: 30px 0 40px; background: #FCEBD8; color: var(--soft); font-size: 15px; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--ink); }
.pager { display: flex; gap: 10px; justify-content: center; margin: 30px 0; }
@media (max-width: 760px) {
  .hero { display: block; min-height: 0; border-radius: 0 0 28px 28px; background: #FFF6EA; }
  .hero img.bg { position: static; aspect-ratio: 16 / 10; height: auto; }
  .hero .wrap { padding-top: 0; margin-top: -40px; padding-bottom: 8px; }
  .hero .box { max-width: none; }
  .why { grid-template-columns: 1fr 1fr; gap: 12px; }
  .why div { padding: 14px; } .why b { font-size: 17px; } .why p { font-size: 14.5px; }
  section { padding-top: 40px; }
}
