/* ============================================
   Joomla-specific helper overrides
   ============================================ */

/* Article page */
.article-page .article-title,
.article-page .article-headline {
  color: var(--navy-900);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}
.article-page .article-title { font-size: 32px; }
.article-page .article-headline { font-size: 26px; }
.article-page .article-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.article-page .article-hero { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.article-page .article-body { font-size: 17px; line-height: 1.8; color: var(--ink); }
.article-page .article-body h2 { color: var(--navy-900); font-size: 22px; margin-top: 32px; }
.article-page .article-body h3 { color: var(--navy-800); font-size: 19px; }
.article-page .article-body p { margin: 0 0 18px; text-wrap: pretty; }
.article-page .article-body img { border-radius: var(--radius); margin: 16px 0; }

/* High-contrast mode (accessibility) */
body.high-contrast { background: #000 !important; color: #fff !important; }
body.high-contrast .site-header,
body.high-contrast .card,
body.high-contrast .section.alt,
body.high-contrast .section.cream { background: #000 !important; color: #fff !important; border-color: #fff !important; }
body.high-contrast a { color: #ffe14a !important; }
body.high-contrast .btn-primary { background: #ffe14a !important; color: #000 !important; }

/* Logo image (when uploaded via params) — รองรับโลโก้วงรี/แนวนอน */
.brand .emblem-img {
  width: auto;
  height: 78px;
  max-width: 140px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}

/* Default brand emblem when no logo set */
.brand .emblem {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-400), var(--gold-700) 70%);
  display: grid; place-items: center;
  color: var(--navy-900);
  font-weight: 800; font-size: 13px;
  text-align: center; line-height: 1.1;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--gold-700);
  flex-shrink: 0;
}

/* Kong accordion (งานแต่ละกอง) */
.kong-accordion {
  background: #fff;
  border: 1.5px solid var(--gold-600);
  border-radius: var(--radius);
  overflow: hidden;
}
.kong-accordion .acc-item {
  border-bottom: 1px solid var(--line);
}
.kong-accordion .acc-item:last-child { border-bottom: 0; }
.kong-accordion .acc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-2);
  cursor: pointer;
  font-weight: 700; color: var(--navy-900); font-size: 16px;
  user-select: none;
}
.kong-accordion .acc-head::before {
  content: '♦'; color: var(--gold-600); margin-right: 10px;
}
.kong-accordion .acc-head::after {
  content: '+'; color: var(--gold-700);
  font-size: 22px; line-height: 1; font-weight: 400;
  transition: transform 0.2s;
}
.kong-accordion .acc-item.open .acc-head::after { content: '−'; }
.kong-accordion .acc-body {
  display: none;
  padding: 8px 20px 16px 44px;
}
.kong-accordion .acc-item.open .acc-body { display: block; }
.kong-accordion .acc-body ul { list-style: none; margin: 0; padding: 0; }
.kong-accordion .acc-body li { padding: 6px 0; }
.kong-accordion .acc-body li::before {
  content: '◇'; color: var(--gold-600); margin-right: 8px;
}
.kong-accordion .acc-body a { color: var(--navy-700); font-weight: 500; }
.kong-accordion .acc-body a:hover { color: var(--gold-700); }

/* Header logo + brand image fallback */
.brand { color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; color: inherit; }

/* Joomla pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; list-style: none; }
.pagination li a, .pagination li span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy-800);
  font-size: 14px;
  background: #fff;
}
.pagination li.active span,
.pagination li a:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
