/* ปฏิทินวันพระ: the support and privacy pages. Saffron like the app icon; Thai system fonts. */
:root {
  --bg:#FFF8F0; --card:#FFFFFF; --ink:#22180F; --ink-2:#5A4A3C; --line:#F0DFCC; --accent:#E8710A; --accent-text:#B85500;
  color-scheme:light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#17120D; --card:#211A13; --ink:#F6EEE6; --ink-2:#C9B9A8; --line:#3A2E22; --accent-text:#FFA654; color-scheme:dark; }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:400 17px/1.75 "Sukhumvit Set", Thonburi, "Noto Sans Thai", "Leelawadee UI", -apple-system, system-ui, sans-serif; -webkit-font-smoothing:antialiased; }
main { max-width:720px; margin:0 auto; padding:40px 16px 64px; }
a { color:var(--accent-text); text-underline-offset:3px; }
header { display:flex; align-items:center; gap:16px; margin-bottom:28px; }
header img { width:72px; height:72px; border-radius:16px; flex:none; }
h1 { margin:0; font-size:30px; line-height:1.25; }
header p { margin:2px 0 0; color:var(--ink-2); }
h2 { margin:40px 0 10px; font-size:22px; line-height:1.35; }
h3 { margin:24px 0 6px; font-size:18px; }
p, li { color:var(--ink-2); }
p { margin:0 0 12px; }
ul { margin:0 0 12px; padding-left:22px; }
strong { color:var(--ink); }
.box { margin:0 0 24px; padding:18px 20px; background:var(--card); border:1px solid var(--line); border-radius:16px; }
.box p:last-child { margin-bottom:0; }
nav { display:flex; flex-wrap:wrap; gap:8px 20px; margin-top:48px; padding-top:20px; border-top:1px solid var(--line); font-size:15px; }
.en { margin-top:56px; padding-top:8px; border-top:1px solid var(--line); }
.en, .en * { font-family:-apple-system, system-ui, "Segoe UI", sans-serif; }

/* วันพระ pages (made by tools/gen_pages.py) */
table { width:100%; table-layout:fixed; border-collapse:collapse; margin:0 0 12px; background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; font-size:16px; }
th, td { padding:9px 12px; text-align:left; vertical-align:top; border-bottom:1px solid var(--line); }
th:first-child { width:42%; }
th { color:var(--ink-2); font-weight:500; font-size:14px; }
tr:last-child td { border-bottom:0; }
td:first-child { white-space:nowrap; color:var(--ink); font-weight:600; }
tr.fest td:first-child { font-weight:400; color:var(--ink-2); }
.tag { display:inline-block; margin-left:4px; padding:0 8px; border-radius:999px; background:#B35300; color:#fff; font-size:13px; line-height:1.7; white-space:nowrap; }
.chips { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:15px; }
.next { text-align:center; }
.next .when { margin:0; color:var(--accent-text); font-weight:600; }
.next .date { margin:2px 0; color:var(--ink); font-size:24px; font-weight:700; line-height:1.4; }
.next .lunar { margin:0; }
.app { display:flex; gap:16px; align-items:flex-start; margin-top:28px; }
.app img { border-radius:12px; flex:none; }
.app p { margin-bottom:6px; }
.button { display:inline-block; padding:6px 16px; border-radius:999px; background:#B35300; color:#fff; font-weight:600; text-decoration:none; }
.button + .soon { margin-left:8px; }
.soon { color:var(--ink-2); font-size:15px; }
@media (max-width:480px) { th, td { padding:8px 9px; } .app { flex-direction:column; } }

/* ปฏิทิน, ตรุษจีน and ปีชง pages (tools/gen_pages.py) */
table.list th:first-child { width:46%; }
table.list.three th:first-child { width:34%; }
table.list.three td:first-child { white-space:normal; }
table.list.years th:first-child, table.list.years th:last-child { width:16%; }
table.list.years td { white-space:nowrap; padding-left:8px; padding-right:4px; }
.note, .legend { font-size:14px; }
.legend span { margin-right:12px; }
.legend .hol { color:#C62828; font-weight:600; }
.legend .wp::before { content:""; display:inline-block; width:8px; height:8px; margin-right:4px; border-radius:50%; background:var(--accent); vertical-align:middle; }
.month { break-inside:avoid; }
table.cal { table-layout:fixed; font-size:15px; text-align:center; }
table.cal th, table.cal td { width:14.28%; padding:5px 2px 4px; text-align:center; border-bottom:1px solid var(--line); white-space:normal; }
table.cal th:first-child { width:14.28%; }
table.cal th:first-child, table.cal td.sun b { color:#C62828; }
table.cal td:first-child { font-weight:400; color:var(--ink-2); }
table.cal td b { display:block; color:var(--ink); font-weight:600; line-height:1.3; }
table.cal td small { display:block; font-size:10.5px; line-height:1.3; color:var(--ink-2); white-space:nowrap; }
table.cal td.hol { background:rgba(198,40,40,.08); }
table.cal td.hol b { color:#C62828; }
/* A day off on one list only (หยุดเฉพาะราชการ or ราชการไม่หยุด): red number, dotted underline, no tint */
table.cal td.hol.one { background:none; }
table.cal td.hol.one b, .legend .hol.one { text-decoration:underline dotted; text-underline-offset:3px; }
.legend .hol.one { font-weight:400; }
table.cal td.wp small { color:var(--accent-text); font-weight:700; }
table.cal td.wp b::after { content:""; display:inline-block; width:6px; height:6px; margin-left:3px; border-radius:50%; background:var(--accent); vertical-align:middle; }
.events { list-style:none; padding:0; margin:0 0 16px; font-size:15px; }
.events li { margin:2px 0; }
.events li b { display:inline-block; min-width:96px; color:var(--ink); font-weight:600; }
.events li.hol { color:#C62828; }
.events li.cn { color:#AD1457; }
.events li.fest { color:var(--accent-text); font-weight:600; }
.events li.obs, .legend .obs { color:var(--ink-2); }   /* วันสำคัญ: not a day off, never red */
.trio { display:flex; justify-content:space-around; text-align:center; gap:8px; }
.trio p { margin:0; }
.trio .when { color:var(--accent-text); font-weight:600; }
.trio .date { color:var(--ink); font-size:20px; font-weight:700; }
.checker label { display:block; margin-bottom:8px; color:var(--ink); font-weight:600; }
.checker input { font:inherit; padding:5px 10px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--ink); }
button.button { border:0; font:inherit; font-weight:600; cursor:pointer; }

/* วันหยุด pages (tools/gen_pages.py) */
table.list.dates th:first-child { width:30%; }
table.list.wrap td:first-child { white-space:normal; }
td .sub { display:block; font-size:14px; font-weight:400; color:var(--ink-2); }
tr.weekend td:first-child { font-weight:400; color:var(--ink-2); }
.checker select { font:inherit; padding:5px 10px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--ink); }
.checker .row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; }
.checker .row + label { margin-top:14px; }
.checker label.inline { display:inline-flex; align-items:center; gap:6px; margin:0; font-weight:400; }
.checker details { margin-top:14px; font-size:15px; }
.checker summary { cursor:pointer; color:var(--accent-text); }
.checker details label { display:flex; align-items:baseline; gap:8px; margin:6px 0 0; font-weight:400; color:var(--ink-2); }
.plans { margin:0; padding-left:22px; }
.plans li { margin:0 0 10px; }
.plans li:last-child { margin-bottom:0; }
.plans b { color:var(--ink); }
.plans .sub { display:block; font-size:15px; }
@media (prefers-color-scheme: dark) {
  table.cal th:first-child, table.cal td.sun b, table.cal td.hol b, .events li.hol, .legend .hol { color:#FF8A80; }
  .events li.cn { color:#F48FB1; }
}
@media print {
  body { background:#fff; font-size:12px; }
  main { max-width:none; padding:0; }
  .noprint, .app, nav, .chips, header img, .next, .checker { display:none !important; }
  table.cal td small { font-size:8px; }
}

/* Calendar feeds on the วันพระ hub (tools/gen_pages.py ics_howto) and the support page */
.feeds { list-style:none; padding:0; }
.feeds li { margin:0 0 12px; padding:12px 16px; background:var(--card); border:1px solid var(--line); border-radius:12px; }
.feeds .sub { display:block; font-size:14px; color:var(--ink-2); }

/* The feed link and its copy button on /thai-calendar/wan-phra/subscribe/ (tools/gen_pages.py subscribe_page) */
.copy { display:flex; gap:8px; align-items:center; }
.copy input { flex:1; min-width:0; font:inherit; font-size:15px; padding:5px 10px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--ink); }
.copy button { flex:none; }

/* The app at a glance, at the top of the support page: screenshots and the main features */
.hero-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:0 0 4px; }
.hero-actions .button + .soon { margin-left:0; }
.button { padding:10px 20px; }
.shots { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px; margin:24px 0; padding:0; list-style:none; }
.shots li { margin:0; }
.shots img { display:block; width:100%; height:auto; border-radius:14px; border:1px solid var(--line); }
@media (max-width:560px) {
  .shots { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; gap:10px; margin-inline:-16px; padding:0 16px 6px; scrollbar-width:none; }
  .shots::-webkit-scrollbar { display:none; }
  .shots li { flex:0 0 66%; scroll-snap-align:center; }
}
.features { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; margin:0 0 28px; padding:0; list-style:none; }
.features li { margin:0; padding:14px 16px; background:var(--card); border:1px solid var(--line); border-radius:14px; font-size:15.5px; line-height:1.6; }
.features strong { display:block; margin-bottom:2px; font-size:16.5px; }
@media (max-width:560px) { .features { grid-template-columns:minmax(0,1fr); } }
/* bigger tap targets for the footer links */
nav { row-gap:0; }
nav a { display:inline-block; padding:9px 0; }
/* readable lunar dates in the month grid on phones, and bigger checkboxes in the leave planner */
table.cal td small { font-size:12px; }
.checker input[type=checkbox] { width:20px; height:20px; padding:0; margin:0; flex:none; accent-color:#B35300; }
@media print { table.cal td small { font-size:8px; } }
.soon { white-space:nowrap; }

/* the footer on the generated pages: links grouped by topic (tools/gen_pages.py page) */
nav.sitemap { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:20px 24px; }
nav.sitemap div { display:flex; flex-direction:column; align-items:flex-start; }
nav.sitemap p { margin:0 0 2px; color:var(--ink); font-weight:600; }
nav.sitemap a { padding:6px 0; line-height:1.4; }
@media (max-width:640px) { nav.sitemap { grid-template-columns:repeat(2, minmax(0,1fr)); } }
