/*
 * Single Article design system — Phase 2 redesign.
 * Tokens reuse the REAL homepage brand values (jnt-green #006837, not the
 * #00A650 in the original brief) so the article page and homepage share
 * one visual identity, per the Phase 1 audit finding. Loaded ONLY on
 * is_single() (see inc/single-article.php) — never touches other pages.
 */

:root {
  --jnt-green: #006837;
  --jnt-darkgreen: #004D28;
  --jnt-dark: #0A1912;
  --jnt-soft-green: #F0FDF4;
  --jnt-text: #111827;
  --jnt-text-soft: #4B5563;
  --jnt-text-muted: #6B7280;
  --jnt-border: #E5E7EB;
  --jnt-soft-gray: #F8FAFC;
  --jnt-warning: #B45309;
  --jnt-warning-soft: #FEF3E2;

  --jnt-space-1: 8px;
  --jnt-space-2: 16px;
  --jnt-space-3: 24px;
  --jnt-space-4: 32px;
  --jnt-space-5: 40px;
  --jnt-space-6: 48px;
  --jnt-space-8: 64px;
  --jnt-space-10: 80px;

  --jnt-radius-sm: 8px;
  --jnt-radius-md: 12px;
  --jnt-radius-lg: 16px;
  --jnt-radius-xl: 20px;
  --jnt-radius-2xl: 24px;

  --jnt-shadow: 0 1px 2px rgba(10, 25, 18, 0.06), 0 1px 8px rgba(10, 25, 18, 0.04);
}

/* ---------- Reading width & base type (article body only) ---------- */

.jnt-article-wrap {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--jnt-text);
  background: #fff;
}

.jnt-article-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .jnt-article-shell { padding: 0 2rem; }
}

/* ---------- Breadcrumb ---------- */

.jnt-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--jnt-text-muted);
  padding: 1.1rem 0;
  max-width: 760px;
  margin: 0 auto;
}
.jnt-breadcrumb a { color: var(--jnt-text-muted); text-decoration: none; }
.jnt-breadcrumb a:hover { color: var(--jnt-green); text-decoration: underline; }
.jnt-breadcrumb .sep { color: #C7CDD4; }
.jnt-breadcrumb .current { color: var(--jnt-text); font-weight: 600; }

/* ---------- Hero ---------- */

.jnt-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 0 var(--jnt-space-5);
}

.jnt-hero-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jnt-green);
  background: var(--jnt-soft-green);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  text-decoration: none;
}

.jnt-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--jnt-text);
  margin: 0 0 1rem;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .jnt-hero h1 { font-size: 48px; }
}

.jnt-hero-excerpt {
  font-size: 17px;
  line-height: 1.6;
  color: var(--jnt-text-soft);
  max-width: 68ch;
  margin: 0 0 1.4rem;
}

.jnt-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 13px;
  color: var(--jnt-text-muted);
  margin-bottom: var(--jnt-space-4);
}
.jnt-hero-meta .dot { color: #C7CDD4; }
.jnt-hero-meta strong { color: var(--jnt-text-soft); font-weight: 600; }

.jnt-hero-image {
  border-radius: var(--jnt-radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--jnt-soft-gray);
  box-shadow: var(--jnt-shadow);
}
.jnt-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Portrait/content-bearing hero (e.g. calculation infographics) — the
   default 16:9 cover crop above is fine for photos but cuts real
   information off a tall diagram. Detected server-side from the actual
   attachment dimensions (single.php); this variant shows the image at
   its full natural size instead, same principle as body-content images. */
.jnt-hero-image.jnt-hero-image--portrait {
  aspect-ratio: auto;
  text-align: center;
  background: var(--jnt-soft-gray);
  max-height: 640px;
}
.jnt-hero-image.jnt-hero-image--portrait img {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 640px;
  object-fit: contain;
}
@media (max-width: 640px) {
  .jnt-hero-image.jnt-hero-image--portrait {
    max-height: 480px;
  }
  .jnt-hero-image.jnt-hero-image--portrait img {
    max-height: 480px;
  }
}

/* ---------- Layout: TOC rail + article ---------- */

.jnt-layout {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--jnt-space-4) 1rem var(--jnt-space-8);
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: var(--jnt-space-4);
}

@media (min-width: 1100px) {
  .jnt-layout {
    max-width: 1040px;
    grid-template-columns: 230px minmax(0, 760px);
  }
}

.jnt-toc-rail { display: none; }

@media (min-width: 1100px) {
  .jnt-toc-rail {
    display: block;
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

.jnt-toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jnt-text-muted);
  margin-bottom: 0.75rem;
}

.jnt-toc-rail nav { display: flex; flex-direction: column; gap: 0.45rem; }
.jnt-toc-rail a {
  font-size: 13.5px;
  color: var(--jnt-text-soft);
  text-decoration: none;
  border-left: 2px solid var(--jnt-border);
  padding: 0.15rem 0 0.15rem 0.75rem;
  line-height: 1.4;
  transition: color 150ms ease, border-color 150ms ease;
}
.jnt-toc-rail a:hover { color: var(--jnt-green); }
.jnt-toc-rail a.is-active {
  color: var(--jnt-green);
  border-color: var(--jnt-green);
  font-weight: 600;
}
.jnt-toc-rail a.jnt-toc-h3 { padding-left: 1.4rem; font-size: 13px; }

/* Mobile accordion TOC */

.jnt-toc-accordion {
  margin-bottom: var(--jnt-space-3);
  border: 1px solid var(--jnt-border);
  border-radius: var(--jnt-radius-md);
  overflow: hidden;
}
@media (min-width: 1100px) { .jnt-toc-accordion { display: none; } }

.jnt-toc-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--jnt-soft-gray);
  min-height: 44px;
}
.jnt-toc-accordion summary::-webkit-details-marker { display: none; }
.jnt-toc-accordion[open] summary { border-bottom: 1px solid var(--jnt-border); }
.jnt-toc-accordion .chev { transition: transform 200ms ease; color: var(--jnt-green); }
.jnt-toc-accordion[open] .chev { transform: rotate(180deg); }

.jnt-toc-accordion ul { list-style: none; margin: 0; padding: 0.5rem 0.6rem; }
.jnt-toc-accordion li { padding: 0; }
.jnt-toc-accordion a {
  display: block;
  padding: 0.6rem 0.6rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--jnt-text-soft);
  text-decoration: none;
  border-radius: var(--jnt-radius-sm);
}
.jnt-toc-accordion a:hover, .jnt-toc-accordion a:focus-visible { background: var(--jnt-soft-green); color: var(--jnt-green); }
.jnt-toc-accordion a.jnt-toc-h3 { padding-left: 1.5rem; font-size: 13.5px; color: var(--jnt-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .jnt-toc-accordion .chev { transition: none; }
}

/* ---------- Article content typography ---------- */

.jnt-content {
  font-size: 17px;
  line-height: 1.78;
  color: var(--jnt-text);
  max-width: 760px;
}
@media (min-width: 768px) { .jnt-content { font-size: 18px; } }

.jnt-content p { margin: 0 0 1.4rem; }
.jnt-content ul, .jnt-content ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.jnt-content li { margin-bottom: 0.5rem; }
.jnt-content a { color: var(--jnt-green); text-decoration: underline; text-underline-offset: 2px; }
.jnt-content a:hover { color: var(--jnt-darkgreen); }
.jnt-content strong { color: var(--jnt-text); }

.jnt-content h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--jnt-text);
  margin: var(--jnt-space-6) 0 var(--jnt-space-2);
  scroll-margin-top: 96px;
  text-wrap: balance;
}
.jnt-content h2:first-child { margin-top: 0; }

.jnt-content h3 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--jnt-text);
  margin: var(--jnt-space-4) 0 0.85rem;
  scroll-margin-top: 96px;
}

.jnt-content h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--jnt-text);
  margin: var(--jnt-space-3) 0 0.7rem;
}

@media (min-width: 768px) {
  .jnt-content h2 { font-size: 32px; }
  .jnt-content h3 { font-size: 24px; }
}

.jnt-content blockquote {
  margin: var(--jnt-space-3) 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--jnt-green);
  background: var(--jnt-soft-gray);
  border-radius: 0 var(--jnt-radius-md) var(--jnt-radius-md) 0;
  font-style: italic;
  color: var(--jnt-text-soft);
}

.jnt-content figure { margin: var(--jnt-space-3) 0; }
.jnt-content figure img { width: 100%; height: auto; border-radius: var(--jnt-radius-lg); display: block; }
.jnt-content figcaption {
  font-size: 13px;
  color: var(--jnt-text-muted);
  text-align: center;
  margin-top: 0.6rem;
}

.jnt-content img:not(figure img) {
  width: 100%;
  height: auto;
  border-radius: var(--jnt-radius-lg);
  margin: var(--jnt-space-3) 0;
}

/* Tables */

.jnt-content .jnt-table-wrap { overflow-x: auto; margin: var(--jnt-space-3) 0; border-radius: var(--jnt-radius-md); border: 1px solid var(--jnt-border); }
.jnt-content table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.jnt-content table th, .jnt-content table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--jnt-border);
}
.jnt-content table th {
  background: var(--jnt-soft-gray);
  font-weight: 700;
  color: var(--jnt-text);
  white-space: nowrap;
}
.jnt-content table tr:last-child td { border-bottom: none; }

/* Info / warning / tip boxes (Gutenberg-friendly classes: authors can wrap
   content in a group block with these classes, or a shortcode maps to
   them) */

.jnt-box {
  border-radius: var(--jnt-radius-md);
  padding: 20px 24px;
  margin: var(--jnt-space-3) 0;
  font-size: 15.5px;
  line-height: 1.65;
}
.jnt-box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.jnt-box p:last-child { margin-bottom: 0; }

.jnt-box-info { background: var(--jnt-soft-green); border-left: 3px solid var(--jnt-green); color: var(--jnt-text); }
.jnt-box-info .jnt-box-title { color: var(--jnt-green); }

.jnt-box-warning { background: var(--jnt-warning-soft); border-left: 3px solid var(--jnt-warning); color: var(--jnt-text); }
.jnt-box-warning .jnt-box-title { color: var(--jnt-warning); }

.jnt-box-tip { background: var(--jnt-soft-gray); border-left: 3px solid var(--jnt-text-muted); color: var(--jnt-text); }
.jnt-box-tip .jnt-box-title { color: var(--jnt-text-soft); }

/* Step process */

.jnt-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin: var(--jnt-space-3) 0;
}
@media (min-width: 768px) { .jnt-steps { grid-template-columns: repeat(3, 1fr); } }

.jnt-step {
  border: 1px solid var(--jnt-border);
  border-radius: var(--jnt-radius-md);
  padding: 1rem 1.1rem;
}
.jnt-step-num {
  font-weight: 800;
  font-size: 13px;
  color: var(--jnt-green);
  margin-bottom: 0.4rem;
}
.jnt-step-title { font-weight: 700; font-size: 14.5px; margin-bottom: 0.25rem; }
.jnt-step-desc { font-size: 13.5px; color: var(--jnt-text-muted); line-height: 1.5; }

/* ---------- CTA ---------- */

.jnt-cta {
  background: var(--jnt-dark);
  color: #fff;
  border-radius: var(--jnt-radius-xl);
  padding: 1.8rem 1.8rem;
  margin: var(--jnt-space-5) 0;
}
.jnt-cta h3 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: #fff;
}
.jnt-cta p {
  font-size: 14.5px;
  color: #C9D3CE;
  margin: 0 0 1.2rem;
  max-width: 52ch;
}
.jnt-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--jnt-green);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  text-decoration: none;
  min-height: 44px;
  transition: background 150ms ease, transform 150ms ease;
}
.jnt-cta-btn:hover { background: #0a7d43; transform: translateY(-1px); }
/* The contextual CTA (jnt_insert_contextual_cta()) is inserted mid-way
   into the article body, inside .jnt-content — whose ".jnt-content a"
   link-color rule (class+tag) outranks ".jnt-cta-btn" (class only) on
   specificity alone, regardless of source order, so the button text
   silently became the same green as its own background: invisible
   except on selection. Found 2026-08-14 from a screenshot. Scoping
   through the always-present .jnt-cta wrapper beats ".jnt-content a"
   in both places the button appears (mid-article and the one after
   .jnt-content closes). */
.jnt-cta .jnt-cta-btn { color: #fff; text-decoration: none; }
.jnt-cta .jnt-cta-btn:hover { color: #fff; }

/* ---------- FAQ (styles Rank Math's own FAQ block markup) ---------- */

.jnt-content .rank-math-block,
.jnt-content .wp-block-rank-math-faq-block {
  margin: var(--jnt-space-3) 0;
}
.jnt-content .rank-math-list-item,
.jnt-content .rank-math-faq-item {
  border: 1px solid var(--jnt-border);
  border-radius: var(--jnt-radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
}
.jnt-content .rank-math-question { font-weight: 700; color: var(--jnt-text); }

/* ---------- Author / Trust ---------- */

.jnt-author {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-top: 1px solid var(--jnt-border);
  border-bottom: 1px solid var(--jnt-border);
  padding: var(--jnt-space-3) 0;
  margin-top: var(--jnt-space-5);
  max-width: 760px;
}
.jnt-author-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--jnt-soft-green);
  color: var(--jnt-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.jnt-author-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jnt-text-muted);
  margin-bottom: 0.2rem;
}
.jnt-author-name { font-weight: 700; font-size: 15px; color: var(--jnt-text); }
.jnt-author-role { font-size: 13px; color: var(--jnt-text-muted); margin-top: 0.15rem; }
.jnt-author-updated { font-size: 12.5px; color: var(--jnt-text-muted); margin-top: 0.5rem; }

/* ---------- Service internal-links row (section 22/23) ---------- */

.jnt-services-links {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0;
  font-size: 13.5px;
  color: var(--jnt-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
}
.jnt-services-links a {
  color: var(--jnt-green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.jnt-services-links a:hover { border-bottom-color: var(--jnt-green); }

/* ---------- Related Articles ---------- */

.jnt-related { max-width: 1040px; margin: 0 auto; padding: 0 1rem var(--jnt-space-8); }
.jnt-related-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jnt-text-muted);
  margin-bottom: 1.2rem;
}
.jnt-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}
@media (min-width: 640px) { .jnt-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .jnt-related-grid { grid-template-columns: repeat(4, 1fr); } }

.jnt-related-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--jnt-border);
  border-radius: var(--jnt-radius-lg);
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.jnt-related-card:hover { box-shadow: var(--jnt-shadow); transform: translateY(-2px); }
.jnt-related-card:focus-visible { outline: 2px solid var(--jnt-green); outline-offset: 2px; }

.jnt-related-thumb { aspect-ratio: 16/10; background: var(--jnt-soft-gray); overflow: hidden; }
.jnt-related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.jnt-related-card:hover .jnt-related-thumb img { transform: scale(1.03); }

.jnt-related-body { padding: 1rem; }
.jnt-related-cat { font-size: 11px; font-weight: 700; color: var(--jnt-green); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.jnt-related-card-title { font-size: 15px; font-weight: 700; color: var(--jnt-text); line-height: 1.35; margin-bottom: 0.4rem; }
.jnt-related-excerpt { font-size: 13px; color: var(--jnt-text-muted); line-height: 1.5; margin-bottom: 0.5rem; }
.jnt-related-meta { font-size: 12px; color: var(--jnt-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .jnt-related-card, .jnt-related-thumb img, .jnt-cta-btn { transition: none; }
}

/* ---------- Sticky header class-name collision fix ----------
   WordPress core defines its own `.sticky` (for the unrelated "Sticky
   Post" feature) with `position:relative`. The shared site header uses
   Tailwind's `.sticky` (`position:sticky`) for its sticky-on-scroll
   behaviour. The homepage never loads the theme's base stylesheet
   (self-contained template, no wp_head()), so it never meets this
   collision — Single Article does load it via wp_head(), and depending
   on cascade order the WP-core rule can win, silently turning the
   header non-sticky. Compound selector here is more specific than
   either single-class rule, so it wins regardless of source order. */
header.sticky.glass-header {
  position: sticky;
}

/* ---------- Focus states / a11y ---------- */

.jnt-article-wrap a:focus-visible,
.jnt-article-wrap button:focus-visible,
.jnt-article-wrap summary:focus-visible {
  outline: 2px solid var(--jnt-green);
  outline-offset: 2px;
}

/* ---------- No horizontal overflow safety ---------- */

.jnt-article-wrap { overflow-x: hidden; }
.jnt-article-wrap img { max-width: 100%; }
