/* Tokens and type scale follow the RiceSense admin (ricesense-ui/src/styles/global.css). */
:root {
  font-family: 'Noto Sans Thai', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-synthesis: none;
  color: #18231d;
  background: #f4f6f4;
  --green-950: #102d1a;
  --green-900: #163b24;
  --green-800: #20522f;
  --green-700: #2e6b3c;
  --green-100: #e8f2e9;
  --green-50: #f2f8f2;
  --line: #e2e8e3;
  --muted: #68736c;
  --ink: #33453a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 20; padding: 8px 12px; border-radius: 8px; background: var(--green-900); color: #fff; font-size: 13px; }
.skip-link:focus { top: 12px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 10px 30px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar__brand { display: flex; align-items: center; }
.topbar__brand img { display: block; width: 117px; height: auto; }
.language-switch { display: flex; padding: 3px; border-radius: 8px; background: #f0f3f0; }
.language-switch a { min-width: 40px; padding: 8px 10px; border-radius: 6px; color: #6a746d; font-size: 12px; font-weight: 700; text-align: center; }
.language-switch a.active { background: #fff; color: var(--green-900); box-shadow: 0 1px 5px #ccd4cd; }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px; }
.page-header { margin-bottom: 14px; }
.page-header h1, .hero h1 { margin: 0 0 6px; color: #17261c; font-size: 28px; line-height: 1.3; }
.page-header p, .hero p { margin: 0; max-width: 760px; color: var(--muted); font-size: 15px; line-height: 1.7; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(26, 51, 34, .025); }
.card h2 { margin: 0; color: var(--green-950); font-size: 16px; line-height: 1.4; }

.hero { padding: 26px 0 24px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card--link { display: grid; gap: 8px; align-content: start; transition: border-color .18s ease, box-shadow .18s ease; }
.card--link:hover { border-color: #9aad9c; box-shadow: 0 8px 30px rgba(23, 58, 35, .07); }
.card--link p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.7; }
.card__action { color: var(--green-800); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.notice-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.notice-meta b { margin-right: 4px; color: var(--green-950); font-weight: 600; }
.notice-meta a { color: var(--green-800); font-weight: 600; }
.notice-meta a:hover, .footer a:hover { text-decoration: underline; }
.notice-draft { margin: 0 0 20px; padding: 11px 14px; border: 1px solid #f0d9a8; border-radius: 10px; background: #fff8e8; color: #7a5410; font-size: 13px; line-height: 1.6; }

.notice-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.notice-toc { position: sticky; top: 90px; display: grid; gap: 12px; }
.notice-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.notice-toc a { display: block; padding: 7px 9px; border-radius: 8px; color: #4f5e54; font-size: 13px; line-height: 1.5; }
.notice-toc a:hover { background: var(--green-50); color: var(--green-900); }
.notice-sections { display: grid; gap: 16px; min-width: 0; }
.notice-section { display: grid; gap: 14px; min-width: 0; scroll-margin-top: 90px; }
.notice-text { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.notice-subheading { margin: 4px 0 -4px; color: var(--green-900); font-size: 14px; }
.notice-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }

.notice-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.notice-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; }
.notice-table th, .notice-table td { padding: 11px 14px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: top; line-height: 1.6; }
.notice-table thead th { background: #fafbfa; color: #778078; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.notice-table tbody th { width: 34%; color: var(--green-950); font-weight: 600; }
.notice-table td { color: #49554d; }
.notice-table tbody tr:last-child th, .notice-table tbody tr:last-child td { border-bottom: 0; }

.footer { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 20px 30px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; }
.footer span { color: var(--green-950); font-weight: 600; }
.footer a { color: var(--green-800); }

@media (max-width: 900px) {
  .notice-layout { grid-template-columns: minmax(0, 1fr); }
  .notice-toc { position: static; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar { min-height: 60px; padding: 10px 16px; }
  .topbar__brand img { width: 104px; }
  .language-switch a { min-width: 44px; padding: 11px 10px; }
  .page { padding: 20px 16px; }
  .page-header h1, .hero h1 { font-size: 24px; }
  .card { padding: 16px; }
  .footer { padding: 18px 16px; }
  /* Tables become stacked rows with their column names as labels */
  .notice-table table { min-width: 0; }
  .notice-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .notice-table tbody, .notice-table tr, .notice-table tbody th, .notice-table td { display: block; width: auto; }
  .notice-table tr { padding: 12px 14px; border-bottom: 1px solid #edf0ed; }
  .notice-table tbody tr:last-child { border-bottom: 0; }
  .notice-table tbody th, .notice-table td { padding: 0; border: 0; }
  .notice-table tbody th { margin-bottom: 6px; }
  .notice-table td + td { margin-top: 6px; }
  .notice-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
