/* ==========================================================
   Acon Plus — Custom Article Styles (SPPB + Joomla)
   File: custom-article.css
   Purpose: Enhance magazine-style articles and fix spacing issues
   Author: Acon Plus Web Team
   Date: 2025-10
   ========================================================== */

/* === Scope only to SPPB + Joomla article pages === */
body:has(.lp-article) {
  --acon-green: #16a34a;
  --accent: #2e6fff;
  --orange: #ff7a18;
  --ink: #101828;
  --muted: #5b6574;
}

/* ==========================================================
   1. Fix Joomla Title ↔ SPPB Heading Spacing (Final version)
   ========================================================== */
body:has(.lp-article) .page-header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border: none !important;
}

body:has(.lp-article) .page-header h1,
body:has(.lp-article) .article-header h1.article-title {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  font-size: 2rem !important;
  line-height: 1.25 !important;
  color: var(--acon-green) !important;
}

.lp-article .sppb-section-title,
.lp-article .sppb-addon-title {
  margin-top: 6px !important;
  margin-bottom: 10px !important;
  line-height: 1.3 !important;
  font-weight: 700;
}

/* ลดช่องไฟ SPPB Global Section (เฉพาะภายในบทความ) */
.lp-article .sppb-section,
.lp-article .sppb-row-container,
.lp-article .sppb-container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ==========================================================
   2. Layout & Magazine Structure
   ========================================================== */
.lp-article.magazine {
  max-width: 980px;
  margin: auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.lp-article.magazine h2 {
  border-left: 5px solid var(--acon-green);
  padding-left: 10px;
  margin: 1.5rem 0 .8rem;
  font-weight: 700;
}

.lp-article.magazine p {
  line-height: 1.7;
  margin-bottom: .8rem;
  color: var(--ink);
}

/* ==========================================================
   3. Table of Contents + Anchors
   ========================================================== */
.lp-article .toc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.2rem;
}

.lp-article .toc h3 {
  color: var(--acon-green);
  margin: 0 0 6px;
}

.lp-article .toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lp-article .toc li {
  margin: 6px 0;
}

.lp-article .toc a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}
.lp-article .toc a:hover {
  text-decoration: underline;
}

/* ==========================================================
   4. Contact Section (Uniform Style)
   ========================================================== */
.lp-article .contact-card {
  text-align: center;
  margin-top: 2rem;
}

.lp-article .contact-card h2 {
  background: var(--acon-green);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
}

.lp-article .cta-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.lp-article .cta-buttons a {
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 16px;
}

.lp-article .cta-line {
  background: #06c755;
  color: #003100;
}

.lp-article .cta-call {
  background: #e8fff1;
  color: #0b3d1a;
  border: 1px solid #baf3cf;
}

/* ==========================================================
   5. Responsive + Typography
   ========================================================== */
@media (max-width: 768px) {
  .lp-article.magazine {
    padding: 1rem;
  }
  body:has(.lp-article) .page-header h1 {
    font-size: 1.6rem !important;
  }
}
