/* ============================================================
   ร่มเรือนไทย — brand skin over Bulma 0.9.4
   Warm Thai household palette recovered from the original
   stylesheets (hot pink / magenta / amber over white), rebuilt
   with generous Thai typography, soft cards and a scalloped
   eave motif instead of the old table-and-Flash chrome.
   ============================================================ */

:root {
  --paper:      #fffaf7;
  --paper-warm: #fff4ee;
  --white:      #ffffff;

  --ink:        #2c2028;
  --ink-soft:   #695a63;
  --ink-faint:  #8d7c86;

  --rose:       #ff0066;
  --rose-deep:  #c1004e;
  --rose-ink:   #8e0039;
  --magenta:    #f5037c;

  --amber:      #ff9900;
  --amber-deep: #a86200;

  --blush:      #ffe7f5;
  --blush-2:    #ffd2ef;
  --cream:      #fff3e2;

  --blue:       #0b5fb0;

  --rule:       #f2dde9;
  --rule-soft:  #f8eef4;

  --shadow-sm:  0 1px 2px rgba(140, 50, 100, .05), 0 6px 18px rgba(140, 50, 100, .06);
  --shadow-md:  0 2px 6px rgba(140, 50, 100, .06), 0 20px 44px rgba(140, 50, 100, .11);

  --radius:     18px;
  --radius-sm:  12px;
  --radius-lg:  26px;

  --font-head:  'Noto Serif Thai', Georgia, 'Times New Roman', serif;
  --font-body:  'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --maxw: 1180px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17.5px;              /* Thai needs a larger base than Latin */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.78;              /* generous leading for stacked vowels + tone marks */
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 88% -6%, rgba(255, 231, 245, .85) 0, rgba(255, 231, 245, 0) 46%),
    radial-gradient(circle at 2% 4%, rgba(255, 243, 226, .8) 0, rgba(255, 243, 226, 0) 34%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Thai must never be justified, letter-spaced or upper-cased */
body, p, li, td, th, h1, h2, h3, h4, h5, h6, a, span, div {
  text-align: start;
  letter-spacing: 0;
  text-transform: none;
  word-break: normal;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6,
.brand-name, .rail-title, .foot-title, .hero-eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;               /* >= 1.45 so tone marks never clip */
  margin: 0;
}

a { color: var(--blue); text-decoration: none; transition: color .15s ease, border-color .15s ease; }
a:hover, a:focus { color: var(--rose-deep); }

strong, b { font-weight: 600; color: var(--ink); }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

::selection { background: var(--blush-2); color: var(--rose-ink); }

:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Safeguard: nothing on this site may wait on JavaScript to become visible. */
[data-aos] { opacity: 1 !important; transform: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--rose);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ---------- scalloped eave motif (house-shade signature) ---------- */

.eave {
  height: 13px;
  background-image: radial-gradient(circle at 12px 0, transparent 9px, var(--blush) 9.5px);
  background-size: 24px 13px;
  background-repeat: repeat-x;
}
.eave--flip {
  background-image: radial-gradient(circle at 12px 13px, transparent 9px, var(--blush) 9.5px);
}
.eave--cream { background-image: radial-gradient(circle at 12px 0, transparent 9px, var(--cream) 9.5px); }

/* ---------- header ---------- */

.top-ribbon {
  height: 4px;
  background: linear-gradient(90deg, var(--rose) 0%, var(--magenta) 42%, var(--amber) 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 0 .65rem;
}

.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { color: var(--rose); display: inline-flex; flex: 0 0 auto; }
.brand-name {
  display: block;
  font-size: 1.42rem;
  line-height: 1.5;
  color: var(--rose-ink);
}
.brand:hover .brand-name { color: var(--rose); }
.brand-sub {
  display: block;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--ink-faint);
  font-family: var(--font-body);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 42px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--rose-deep); border-radius: 2px; }
.nav-toggle[aria-expanded="true"] { background: var(--blush); }

.site-nav { display: none; padding-bottom: .85rem; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  padding: .55rem .2rem;
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 500;
  border-bottom: 1px solid var(--rule-soft);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--rose-deep); }

/* Desktop: two-tier masthead — brand row, then a full-width nav bar beneath it.
   Keeps the long Thai labels on a single line instead of wrapping awkwardly. */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .header-bar { padding: 1rem 0 .8rem; }
  .site-nav {
    display: block !important;
    padding-bottom: 0;
    border-top: 1px solid var(--rule-soft);
  }
  .site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.7rem; justify-content: flex-start; }
  .site-nav li.is-secondary { display: none; }
  .site-nav a {
    border-bottom: 2px solid transparent;
    padding: .45rem 0 .6rem;
    font-size: .93rem;
    white-space: nowrap;
  }
  .site-nav a:hover { border-bottom-color: var(--blush-2); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--rose); color: var(--rose-deep); }
}

/* ---------- home hero ---------- */

.home-hero { padding: 2.6rem 0 .5rem; }
.home-hero-grid { display: grid; gap: 1.8rem; align-items: center; }

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 600;
  color: var(--rose-deep);
  background: var(--blush);
  padding: .3rem .85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.home-hero h1 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.05rem);
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: .85rem;
}
.home-hero h1::after {
  content: "";
  display: block;
  width: 74px;
  height: 5px;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--amber));
}
.home-hero .lead {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 1.1rem 0 1.5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .96rem;
  line-height: 1.7;
  padding: .62rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.btn--primary { background: var(--rose); color: #fff; box-shadow: 0 8px 20px rgba(255, 0, 102, .22); }
.btn--primary:hover, .btn--primary:focus { background: var(--rose-deep); color: #fff; }
.btn--ghost { background: var(--white); color: var(--rose-deep); border-color: var(--blush-2); }
.btn--ghost:hover, .btn--ghost:focus { background: var(--blush); color: var(--rose-ink); }

.hero-figure-wrap { position: relative; }
.hero-figure-wrap::before {
  content: "";
  position: absolute;
  inset: 1.5rem -1rem -1.5rem 1.6rem;
  background: linear-gradient(140deg, var(--blush) 0%, var(--cream) 100%);
  border-radius: var(--radius-lg);
  z-index: 0;
}
.hero-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--white);
}
.hero-figure img { width: 100%; }

@media (min-width: 900px) {
  .home-hero { padding: 3.4rem 0 1rem; }
  .home-hero-grid { grid-template-columns: 1.02fr .98fr; gap: 3rem; }
}

/* ---------- interior page hero ---------- */

.page-hero {
  background: linear-gradient(178deg, #fff2f9 0%, rgba(255, 250, 247, 0) 100%);
  padding: 1.6rem 0 2.2rem;
  border-bottom: 1px solid var(--rule-soft);
}
.crumbs {
  font-size: .84rem;
  color: var(--ink-faint);
  margin-bottom: .9rem;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--rose-deep); }
.crumbs .sep { padding: 0 .4rem; color: var(--blush-2); }

.page-hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.3vw, 2.55rem);
  line-height: 1.46;
  max-width: 22ch;
}
.page-hero h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: .85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--amber));
}
.page-hero .lead {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: 1.1rem;
}

.hero-band { margin-top: -1.4rem; margin-bottom: 2.2rem; }
.hero-band .hero-figure { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.hero-band img { width: 100%; max-height: 420px; object-fit: cover; }

/* ---------- article layout ---------- */

.page-body { padding: 1.2rem 0 3.5rem; }
.home-body { padding: 2.4rem 0 3.5rem; }

.prose { max-width: 74ch; }

.prose h2 {
  font-size: clamp(1.3rem, 1.05rem + .8vw, 1.65rem);
  line-height: 1.5;
  color: var(--rose-ink);
  margin: 2.5rem 0 .9rem;
  padding-left: 1rem;
  position: relative;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42em;
  width: 5px;
  height: 1.05em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rose), var(--magenta));
}
.prose h3 {
  font-size: 1.16rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 1.9rem 0 .55rem;
}
.prose p { margin: 0 0 1.15em; line-height: 1.8; }
.prose > p:first-child { margin-top: 0; }

.prose ul, .prose ol { margin: 0 0 1.4em; padding: 0; list-style: none; }
.prose ol { counter-reset: rrt; }
.prose li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: .65em;
  line-height: 1.8;
}
.prose ul > li::before {
  content: "";
  position: absolute;
  left: .28rem;
  top: .78em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, .16);
}
.prose ol > li { counter-increment: rrt; }
.prose ol > li::before {
  content: counter(rrt);
  position: absolute;
  left: 0;
  top: .1em;
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  color: var(--rose-deep);
  background: var(--blush);
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
}

.prose a { border-bottom: 1px solid var(--blush-2); }
.prose a:hover { border-bottom-color: var(--rose); }

/* YMYL / scope disclaimers — must stay visible and obvious wherever they sit */
p.disclaimer {
  background: linear-gradient(180deg, var(--cream), #fffaf3);
  border: 1px solid #ffe0b8;
  border-left: 5px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1.6rem 0 1.8rem;
  font-size: .96rem;
  line-height: 1.78;
  color: #5f4a2e;
}
p.disclaimer strong { color: var(--amber-deep); }
p.disclaimer a { color: var(--amber-deep); border-bottom: 1px solid #ffd9a6; }

/* Disclaimer shown directly under the headline on YMYL pages */
.hero-note { max-width: 68ch; }
.hero-note p.disclaimer { margin-bottom: 0; }

/* inline article figure */
.inline-figure {
  margin: 2.2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--white);
}
.inline-figure img { width: 100%; }

/* Home body: prose keeps a readable measure, the directory grid breaks out wide */
.home-body .prose { max-width: none; }
.home-body .prose > p,
.home-body .prose > h2,
.home-body .prose > h3,
.home-body .prose > ul:not(.section-grid),
.home-body .prose > ol { max-width: 74ch; }
.home-body .inline-figure { max-width: 860px; }

/* ---------- section grid (home directory list) ---------- */

.prose ul.section-grid {
  display: grid;
  gap: .9rem;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 700px) { .prose ul.section-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .prose ul.section-grid { grid-template-columns: repeat(3, 1fr); } }

.prose ul.section-grid > li {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem 1.1rem;
  margin: 0;
  font-size: .95rem;
  line-height: 1.72;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--blush-2);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.prose ul.section-grid > li::before { display: none; }
.prose ul.section-grid > li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--rose);
}
.prose ul.section-grid > li > a {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--rose-ink);
  border-bottom: 0;
  margin-bottom: .35rem;
}
.prose ul.section-grid > li:hover > a { color: var(--rose); }

/* ---------- topic cards (archive page) ---------- */

.topic-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blush-2);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem .35rem;
  margin: 1rem 0 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: border-left-color .16s ease, box-shadow .16s ease;
}
.topic-card:hover { border-left-color: var(--rose); box-shadow: var(--shadow-md); }
.topic-card h3 { margin: 0 0 .4rem; font-size: 1.14rem; }
.topic-card h3 a { color: var(--rose-ink); border-bottom: 0; }
.topic-card h3 a:hover { color: var(--rose); }
.topic-card p { font-size: .96rem; color: var(--ink-soft); margin-bottom: .9rem; }

/* ---------- right rail ---------- */

.rail { margin-top: 2.5rem; }
@media (min-width: 1024px) { .rail { margin-top: .35rem; position: sticky; top: 6.4rem; } }

.rail-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1.1rem;
}
.rail-title {
  font-size: 1.02rem;
  color: var(--rose-ink);
  padding-bottom: .6rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { margin: 0; }
.rail-list a {
  display: block;
  padding: .42rem 0 .42rem .95rem;
  font-size: .93rem;
  line-height: 1.65;
  color: var(--ink-soft);
  position: relative;
}
.rail-list a::before {
  content: "";
  position: absolute;
  left: 0; top: .88em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blush-2);
}
.rail-list a:hover { color: var(--rose-deep); }
.rail-list a:hover::before { background: var(--rose); }
.rail-list a[aria-current="page"] { color: var(--rose-deep); font-weight: 600; }
.rail-list a[aria-current="page"]::before { background: var(--rose); }

.rail-note {
  background: linear-gradient(160deg, var(--blush) 0%, var(--cream) 130%);
  border: 1px solid var(--blush-2);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  font-size: .92rem;
  line-height: 1.75;
  color: var(--rose-ink);
}
.rail-note p { margin: 0; }
.rail-note .rail-note-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.55;
  margin-bottom: .7rem;
}
.rail-note a {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--blush-2);
  border-radius: 999px;
  padding: .26rem .85rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--rose-deep);
}
.rail-note a:hover { background: var(--rose); color: #fff; border-color: var(--rose); }

/* ---------- 404 ---------- */

.notfound { padding: 3.5rem 0 4.5rem; }
.notfound .prose { max-width: 62ch; margin: 0 auto; }
.notfound h1 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.5rem); line-height: 1.46; }
.notfound-mark {
  width: 76px; height: 76px;
  border-radius: 24px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--blush), var(--cream));
  color: var(--rose);
  margin-bottom: 1.4rem;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 2rem;
  background: linear-gradient(180deg, #fff6fb 0%, #fff1f7 100%);
  border-top: 1px solid var(--rule);
}
.footer-inner { padding: 2.6rem 0 1.4rem; display: grid; gap: 2rem; }
@media (min-width: 760px)  { .footer-inner { grid-template-columns: 1.25fr 1fr 1fr; } }
@media (min-width: 1060px) { .footer-inner { grid-template-columns: 1.35fr 1fr 1fr 1fr 1fr; } }

.foot-brand .brand-name { font-size: 1.3rem; }
.foot-about {
  font-size: .92rem;
  line-height: 1.78;
  color: var(--ink-soft);
  margin: .85rem 0 1rem;
  max-width: 40ch;
}
.foot-quick { display: flex; flex-wrap: wrap; gap: .45rem; }
.foot-quick a {
  font-size: .86rem;
  font-weight: 600;
  color: var(--rose-deep);
  background: var(--white);
  border: 1px solid var(--blush-2);
  border-radius: 999px;
  padding: .28rem .8rem;
  line-height: 1.7;
}
.foot-quick a:hover { background: var(--blush); }

.foot-title {
  font-size: .95rem;
  color: var(--rose-ink);
  margin-bottom: .6rem;
  line-height: 1.55;
}
.foot-list { list-style: none; margin: 0; padding: 0; }
.foot-list li { margin-bottom: .3rem; }
.foot-list a { font-size: .9rem; line-height: 1.7; color: var(--ink-soft); }
.foot-list a:hover { color: var(--rose-deep); }

.footer-base {
  border-top: 1px solid var(--rule);
  padding: 1.1rem 0 2rem;
  font-size: .85rem;
  line-height: 1.75;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.2rem;
  justify-content: space-between;
}

/* ---------- Bulma overrides so the frame never fights the Thai type ---------- */

/* .wrap already supplies the page gutter — Bulma's negative column margins would
   push 2px past the viewport on narrow screens, so they are neutralised and the
   inter-column gap is carried by the article column's own padding instead. */
.columns:last-child { margin-bottom: 0; }
.page-body .columns,
.page-body .columns.is-variable { margin-left: 0; margin-right: 0; }
.page-body .columns.is-variable > .column { padding-left: 0; padding-right: 0; }
/* Below the desktop breakpoint the article and the rail stack; Bulma turns .columns
   into a non-wrapping flex row from 769px up, which would put two full-width
   columns side by side. */
@media (max-width: 1023px) {
  .page-body .columns { display: block; }
}
@media (min-width: 1024px) {
  .page-body .columns.is-variable > .column.is-8-desktop { padding-right: 2.5rem; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* print */
@media print {
  .site-header, .site-footer, .rail, .skip-link, .top-ribbon, .eave { display: none !important; }
  body { background: #fff; }
  .prose { max-width: none; }
}
