/* ==========================================================
   Acon Plus — Global Article Preset v1.2.1 (Preset Layer)
   Purpose
   - Unified typography, spacing, tables for ALL Joomla Articles
   - DOES NOT include SPPB Kill Switch (separate file)
   Scope
   - Joomla com_content view-article only
   Updated: 2026-01-10
   ========================================================== */


/* ==========================================================
   1) Tokens
   ========================================================== */
:root{
  --acon-green:#16a34a;
  --acon-green-deep:#0f7a32;
  --acon-orange:#f97316;

  --ink:#101828;
  --muted:#5b6574;

  --surface:#ffffff;
  --surface-2:#f8fafc;

  --line:#e5e7eb;
  --line-2:#eef0f4;

  --radius:14px;
  --shadow:0 8px 18px rgba(16,24,40,.06);
}


/* ==========================================================
   2) Base Typography (Article only)
   ========================================================== */
body.com-content.view-article,
body.com_content.view-article{
  color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,"Noto Sans Thai",sans-serif;
  line-height:1.75;
  font-size:1rem;
  text-rendering:optimizeLegibility;
}


/* ==========================================================
   3) Title and Meta Spacing (Joomla)
   ========================================================== */
body.com-content.view-article .page-header,
body.com-content.view-article .article-header,
body.com_content.view-article .page-header,
body.com_content.view-article .article-header{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
  border:none !important;
}

body.com-content.view-article .page-header h1,
body.com-content.view-article h1.article-title,
body.com-content.view-article h1.jl-article-title,
body.com_content.view-article .page-header h1,
body.com_content.view-article h1.article-title,
body.com_content.view-article h1.jl-article-title{
  margin:0 0 12px !important;
  line-height:1.25 !important;
  letter-spacing:-.01em;
}

body.com-content.view-article p.jl-article-meta,
body.com_content.view-article p.jl-article-meta{
  margin:0 0 10px !important;
  color:var(--muted);
}


/* ==========================================================
   4) Body Spacing Defaults (readability)
   ========================================================== */
body.com-content.view-article .com-content-article__body.jl-margin-top,
body.com_content.view-article .com-content-article__body.jl-margin-top{
  margin-top:12px !important;
}

body.com-content.view-article .com-content-article__body p,
body.com-content.view-article .item-page p,
body.com_content.view-article .com-content-article__body p,
body.com_content.view-article .item-page p{
  margin:0.65em 0;
}

body.com-content.view-article .com-content-article__body a,
body.com-content.view-article .item-page a,
body.com_content.view-article .com-content-article__body a,
body.com_content.view-article .item-page a{
  color:var(--acon-green-deep);
  text-decoration:underline;
  text-underline-offset:2px;
}
body.com-content.view-article .com-content-article__body a:hover,
body.com-content.view-article .item-page a:hover,
body.com_content.view-article .com-content-article__body a:hover,
body.com_content.view-article .item-page a:hover{
  color:var(--acon-green);
}

body.com-content.view-article .com-content-article__body hr,
body.com-content.view-article .item-page hr,
body.com_content.view-article .com-content-article__body hr,
body.com_content.view-article .item-page hr{
  border:none;
  border-top:1px solid var(--line);
  margin:18px 0;
}


/* ==========================================================
   5) Headings inside content (H2-H4)
   ========================================================== */
body.com-content.view-article .com-content-article__body h2,
body.com-content.view-article .item-page h2,
body.com_content.view-article .com-content-article__body h2,
body.com_content.view-article .item-page h2{
  margin:1.2em 0 .45em;
  line-height:1.25;
  letter-spacing:-.01em;
}
body.com-content.view-article .com-content-article__body h3,
body.com-content.view-article .item-page h3,
body.com_content.view-article .com-content-article__body h3,
body.com_content.view-article .item-page h3{
  margin:1.1em 0 .45em;
  line-height:1.3;
}
body.com-content.view-article .com-content-article__body h4,
body.com-content.view-article .item-page h4,
body.com_content.view-article .com-content-article__body h4,
body.com_content.view-article .item-page h4{
  margin:1em 0 .4em;
  line-height:1.35;
  color:var(--ink);
}


/* ==========================================================
   6) Lists and Blockquotes
   ========================================================== */
body.com-content.view-article .com-content-article__body ul,
body.com-content.view-article .com-content-article__body ol,
body.com-content.view-article .item-page ul,
body.com-content.view-article .item-page ol,
body.com_content.view-article .com-content-article__body ul,
body.com_content.view-article .com-content-article__body ol,
body.com_content.view-article .item-page ul,
body.com_content.view-article .item-page ol{
  margin:0.6em 0 0.8em 1.25em;
}

body.com-content.view-article .com-content-article__body li,
body.com-content.view-article .item-page li,
body.com_content.view-article .com-content-article__body li,
body.com_content.view-article .item-page li{
  margin:0.25em 0;
}

body.com-content.view-article .com-content-article__body blockquote,
body.com-content.view-article .item-page blockquote,
body.com_content.view-article .com-content-article__body blockquote,
body.com_content.view-article .item-page blockquote{
  margin:1em 0;
  padding:12px 14px;
  border-left:4px solid var(--acon-green);
  background:var(--surface-2);
  border-radius:10px;
  color:var(--muted);
}


/* ==========================================================
   7) Media (Images and Figures)
   ========================================================== */
body.com-content.view-article .com-content-article__body img,
body.com-content.view-article .item-page img,
body.com_content.view-article .com-content-article__body img,
body.com_content.view-article .item-page img{
  max-width:100%;
  height:auto;
}

body.com-content.view-article .com-content-article__body figure,
body.com-content.view-article .item-page figure,
body.com_content.view-article .com-content-article__body figure,
body.com_content.view-article .item-page figure{
  margin:1em 0;
}

body.com-content.view-article .com-content-article__body figcaption,
body.com-content.view-article .item-page figcaption,
body.com_content.view-article .com-content-article__body figcaption,
body.com_content.view-article .item-page figcaption{
  margin-top:6px;
  color:var(--muted);
  font-size:.95rem;
}


/* ==========================================================
   8) Tables (auto beautify)
   ========================================================== */
body.com-content.view-article .com-content-article__body table,
body.com-content.view-article .item-page table,
body.com_content.view-article .com-content-article__body table,
body.com_content.view-article .item-page table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  margin:14px 0;
}

body.com-content.view-article .com-content-article__body th,
body.com-content.view-article .com-content-article__body td,
body.com-content.view-article .item-page th,
body.com-content.view-article .item-page td,
body.com_content.view-article .com-content-article__body th,
body.com_content.view-article .com-content-article__body td,
body.com_content.view-article .item-page th,
body.com_content.view-article .item-page td{
  padding:10px 12px;
  border-bottom:1px solid var(--line-2);
  text-align:left;
  vertical-align:top;
}

body.com-content.view-article .com-content-article__body thead th,
body.com-content.view-article .item-page thead th,
body.com_content.view-article .com-content-article__body thead th,
body.com_content.view-article .item-page thead th{
  background:var(--surface-2);
  font-weight:800;
}

body.com-content.view-article .com-content-article__body tr:last-child td,
body.com-content.view-article .item-page tr:last-child td,
body.com_content.view-article .com-content-article__body tr:last-child td,
body.com_content.view-article .item-page tr:last-child td{
  border-bottom:none;
}


/* ==========================================================
   END — Preset Layer
   ========================================================== */
