:root {
  --brand: #0f766e;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f7faf9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.06);
  font-family: 'Noto Sans Lao', 'Noto Sans Thai', 'Noto Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.65; font-size: 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; font-style: normal; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; flex: none; }
.brand strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.search { margin-left: auto; flex: 0 1 320px; }
.search input { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: var(--bg); }
.search input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); background: #fff; }
.lang-switch { position: relative; }
.lang-switch summary { cursor: pointer; list-style: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch ul { position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 150px; }
.lang-switch li a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--ink); }
.lang-switch li a[aria-current] { background: color-mix(in srgb, var(--brand) 12%, #fff); font-weight: 600; }
.main-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.main-nav a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--ink); font-size: 0.93rem; }
.main-nav a:hover { background: var(--bg); text-decoration: none; }

main.wrap { padding: 24px 0 48px; min-height: 60vh; }

/* Hero carousel (advertisements / campaigns) */
.hero-carousel { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; background: #dfeee9; }
.hero-track { display: flex; transition: transform 0.6s ease; }
.banner-hero { flex: 0 0 100%; position: relative; aspect-ratio: 21 / 8; }
.banner-hero img { width: 100%; height: 100%; object-fit: cover; }
.banner-hero a, .banner-hero > .banner-text { display: block; height: 100%; color: inherit; }
.banner-text { position: absolute; left: 0; bottom: 0; right: 0; padding: 28px 32px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); display: grid; gap: 6px; justify-items: start; }
.banner-text strong { font-size: clamp(1.2rem, 3vw, 2rem); line-height: 1.2; }
.banner-hero:not(:has(img)) .banner-text { position: static; height: 100%; align-content: center; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0ea5e9)); }
.hero-dots { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 6px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 0.55); cursor: pointer; padding: 0; }
.hero-dots button[aria-current='true'] { background: #fff; width: 24px; border-radius: 6px; }

/* Topics */
.topic-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 28px; }
.topic { --chip: var(--brand); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--chip); color: var(--ink); }
.topic:hover { text-decoration: none; box-shadow: var(--shadow); }
.topic span { color: var(--muted); font-size: 0.85rem; }

/* Cards */
.section-title { font-size: 1.25rem; margin: 8px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 28px; }
.grid-featured { grid-template-columns: 2fr 1fr; grid-auto-rows: auto; }
.grid-featured .card-big { grid-row: span 2; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s; }
.card:hover { transform: translateY(-2px); }
.card-link { color: inherit; display: flex; flex-direction: column; height: 100%; }
.card-link:hover { text-decoration: none; }
.card-img { aspect-ratio: 16 / 9; background: #e6f2ef; display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-big .card-img { aspect-ratio: 16 / 10; }
.card-placeholder { font-size: 2.4rem; color: color-mix(in srgb, var(--brand) 45%, #fff); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.card-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.card-big .card-body h3 { font-size: 1.35rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 0.82rem; }
.chip { --chip: var(--brand); justify-self: start; font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: var(--chip); background: color-mix(in srgb, var(--chip) 12%, #fff); }

/* Layout with ad column */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.with-sidebar:has(.sidebar) { grid-template-columns: minmax(0, 1fr) 300px; }
.sidebar { display: grid; gap: 16px; align-content: start; position: sticky; top: 120px; }
.banner { position: relative; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.banner::before { content: attr(data-ad); position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 0.68rem; padding: 1px 8px; border-radius: 999px; background: rgb(255 255 255 / 0.85); color: var(--muted); }
.banner a { color: inherit; display: block; }
.banner a:hover { text-decoration: none; }
.banner-side .banner-text, .banner-strip .banner-text { position: static; color: var(--ink); background: none; padding: 14px 16px; }
.banner-strip { margin: 8px 0 28px; }
.banner-strip img { width: 100%; max-height: 220px; object-fit: cover; }

/* Article */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.page-head.center { text-align: center; padding: 60px 0; }
.lead { font-size: 1.1rem; color: #334155; }
.article { background: #fff; border-radius: var(--radius); padding: clamp(18px, 4vw, 40px); box-shadow: var(--shadow); }
.article.narrow { max-width: 860px; margin-inline: auto; }
.article h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.25; margin: 4px 0 10px; }
.crumbs { font-size: 0.85rem; color: var(--muted); }
.cover { margin: 20px 0; }
.cover img { border-radius: 12px; width: 100%; }
.prose { font-size: 1.05rem; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5em; }
.prose img { border-radius: 10px; margin: 1em auto; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); border-radius: 0 10px 10px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 0.85rem; background: var(--bg); padding: 2px 10px; border-radius: 999px; }
.disclaimer { margin-top: 28px; padding: 12px 16px; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 0.88rem; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 24px; }

/* Footer */
.site-footer { background: #0b3b37; color: #d7ebe8; padding-top: 36px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer-grid p { margin: 6px 0; }
.site-footer .muted { color: #a8c9c4; }
.footer-links { list-style: none; padding: 0; margin: 6px 0; }
.social { display: flex; gap: 12px; }
.copyright { border-top: 1px solid rgb(255 255 255 / 0.12); margin-top: 24px; padding: 14px 0 20px; font-size: 0.82rem; color: #a8c9c4; }

@media (max-width: 900px) {
  .with-sidebar:has(.sidebar) { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .grid-featured { grid-template-columns: 1fr; }
  .grid-featured .card-big { grid-row: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .banner-hero { aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  .header-row { flex-wrap: wrap; }
  .search { order: 3; flex: 1 1 100%; }
  .brand small { display: none; }
  .lang-switch { margin-left: auto; }
}
