/* =============================================================================
   EizTools — Premium Article Renderer
   A drop-in publication-quality reading experience for TinyMCE HTML.
   Framework: Tabler / Bootstrap 5  •  Icons: Font Awesome 5.15
   Theme aware (body.theme-light / body.theme-dark)  •  LTR + RTL (logical props)
   No dependencies. CLS-safe (layout is pure CSS; JS only enhances).
   ----------------------------------------------------------------------------
   Authored for: eiztools.com
   Scope: everything lives under .premium-article-shell / .premium-article
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS
   We inherit the site's Tabler palette where possible, with safe fallbacks,
   then expose a small, calm token set used across every module.
---------------------------------------------------------------------------- */
.premium-article-shell {
  /* Brand accent — pulls the site primary, falls back to Tabler blue */
  --pa-accent:        var(--tblr-primary, #206bc4);
  --pa-accent-strong: color-mix(in srgb, var(--pa-accent) 82%, #000);
  --pa-accent-soft:   color-mix(in srgb, var(--pa-accent) 10%, transparent);
  --pa-accent-tint:   color-mix(in srgb, var(--pa-accent) 6%,  #ffffff);

  /* Ink + surfaces */
  --pa-ink:        #16202c;   /* primary text  */
  --pa-ink-2:      #41505f;   /* secondary text */
  --pa-ink-3:      #6b7888;   /* muted / meta   */
  --pa-surface:    #ffffff;
  --pa-surface-2:  #f7f9fc;   /* subtle panels  */
  --pa-surface-3:  #eef2f7;
  --pa-border:     #e4e9f0;
  --pa-border-2:   #d7deea;

  /* Semantic hues for callouts / pros-cons */
  --pa-info:    #2f7bd6;  --pa-info-bg:    #eef5ff;
  --pa-success: #1f9d63;  --pa-success-bg: #ecfaf1;
  --pa-warning: #c9881a;  --pa-warning-bg: #fef6e7;
  --pa-danger:  #d6453c;  --pa-danger-bg:  #fdeeed;

  /* Shape + depth */
  --pa-radius:   16px;
  --pa-radius-sm:10px;
  --pa-radius-xs: 8px;
  --pa-shadow:    0 1px 2px rgba(16,32,44,.04), 0 8px 24px -12px rgba(16,32,44,.18);
  --pa-shadow-sm: 0 1px 2px rgba(16,32,44,.05), 0 4px 12px -8px rgba(16,32,44,.14);
  --pa-ring:      0 0 0 4px color-mix(in srgb, var(--pa-accent) 22%, transparent);

  /* Typography rhythm */
  --pa-font:      inherit;                 /* respect the site's chosen font */
  --pa-measure:   72ch;                    /* ideal reading measure          */
  --pa-lh:        1.8;
  --pa-gap:       clamp(1.05rem, 0.8rem + 1vw, 1.5rem);

  /* Layout */
  --pa-shell-max: 1080px;
  --pa-toc-w:     264px;
  --pa-sticky-top: 84px;                   /* clears most sticky navbars     */

  container-type: inline-size;             /* enables responsive TOC layout  */
  font-family: var(--pa-font);
}

/* Dark theme — the site toggles body.theme-dark */
body.theme-dark .premium-article-shell,
.premium-article-shell[data-pa-theme="dark"] {
  --pa-accent-tint: color-mix(in srgb, var(--pa-accent) 18%, #0e1620);
  --pa-ink:       #e7edf5;
  --pa-ink-2:     #aeb9c7;
  --pa-ink-3:     #8090a1;
  --pa-surface:   #131c27;
  --pa-surface-2: #16212e;
  --pa-surface-3: #1c2836;
  --pa-border:    #243140;
  --pa-border-2:  #2d3c4d;
  --pa-info-bg:    color-mix(in srgb, var(--pa-info)    16%, #0e1620);
  --pa-success-bg: color-mix(in srgb, var(--pa-success) 16%, #0e1620);
  --pa-warning-bg: color-mix(in srgb, var(--pa-warning) 16%, #0e1620);
  --pa-danger-bg:  color-mix(in srgb, var(--pa-danger)  16%, #0e1620);
  --pa-shadow:    0 1px 2px rgba(0,0,0,.4), 0 14px 30px -14px rgba(0,0,0,.6);
  --pa-shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 8px 18px -10px rgba(0,0,0,.5);
}

/* ----------------------------------------------------------------------------
   2. SHELL LAYOUT  (article column + optional sticky TOC aside)
   Uses container queries so it adapts whether or not the site sidebar is shown.
---------------------------------------------------------------------------- */
.premium-article-shell {
  max-inline-size: var(--pa-shell-max);
  margin-inline: auto;
  color: var(--pa-ink);
  -webkit-font-smoothing: antialiased;
}
.premium-article-shell *,
.premium-article-shell *::before,
.premium-article-shell *::after { box-sizing: border-box; }

.pa-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: start;
}

/* Article body measure */
.premium-article {
  min-inline-size: 0;
  max-inline-size: 100%;
  margin-inline: auto;
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.135rem);
  line-height: var(--pa-lh);
  color: var(--pa-ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.pa-layout:not([data-pa-has-toc]) .premium-article { max-inline-size: 860px; }

/* When a TOC exists and the container is wide enough → two columns.
   Explicit placement lets the TOC be FIRST in source order (so it sits ABOVE
   the article on mobile, where it collapses) while still rendering as the
   right-hand sticky rail on desktop. */
@container (min-width: 1000px) {
  .pa-layout[data-pa-has-toc] {
    grid-template-columns: minmax(0, 1fr) var(--pa-toc-w);
  }
  .pa-layout[data-pa-has-toc] .premium-article {
    max-inline-size: var(--pa-measure);
    grid-column: 1; grid-row: 1;
  }
  .pa-layout[data-pa-has-toc] .pa-toc {
    grid-column: 2; grid-row: 1;
    position: sticky; top: var(--pa-sticky-top);
    margin-block-end: 0;
  }
}

/* ----------------------------------------------------------------------------
   3. READING PROGRESS BAR  (fixed, top)
---------------------------------------------------------------------------- */
.pa-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  z-index: 1080;
  background: transparent;
  pointer-events: none;
}
.pa-progress__bar {
  block-size: 100%;
  inline-size: 0;
  background: linear-gradient(90deg, var(--pa-accent), color-mix(in srgb, var(--pa-accent) 55%, #6ad0ff));
  box-shadow: 0 0 10px color-mix(in srgb, var(--pa-accent) 60%, transparent);
  transition: inline-size .08s linear;
}

/* ----------------------------------------------------------------------------
   4. STICKY SHARE RAIL  (desktop, floating left – top-aligned to article)
---------------------------------------------------------------------------- */
.pa-share-rail {
  position: fixed;
  inset-block-start: 160px;
  inset-inline-start: max(12px, calc((100vw - 1320px) / 2));
  z-index: 1010;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: 999px;
  box-shadow: var(--pa-shadow);
}
.pa-share-rail__label {
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pa-ink-3);
  text-align: center;
  margin-block-end: 2px;
}
.pa-share-rail a,
.pa-share-rail button {
  --b: var(--pa-ink-2);
  inline-size: 40px; block-size: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--pa-border);
  background: var(--pa-surface-2);
  color: var(--b);
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  text-decoration: none;
}
.pa-share-rail a:hover,
.pa-share-rail button:hover {
  transform: translateY(-2px) scale(1.05) !important;
  color: #ffffff !important;
  background: var(--pa-ink-2) !important;
  border-color: var(--pa-ink-2) !important;
}
.pa-share-rail .pa-s-facebook:hover { background:#1877f2 !important; border-color:#1877f2 !important; }
.pa-share-rail .pa-s-twitter:hover  { background:#000     !important; border-color:#000     !important; }
.pa-share-rail .pa-s-linkedin:hover { background:#0a66c2  !important; border-color:#0a66c2  !important; }
.pa-share-rail .pa-s-whatsapp:hover { background:#25d366  !important; border-color:#25d366  !important; }
.pa-share-rail .pa-s-copy:hover     { background:var(--pa-accent) !important; border-color:var(--pa-accent) !important; }

@media (min-width: 1180px) { .pa-share-rail { display: flex; } }

/* ----------------------------------------------------------------------------
   5. HERO META STRIP   (category • author • read time • updated • inline share)
   The H1 itself stays in the site card-header (we upgrade it below) so there is
   only ever ONE <h1> on the page — good for SEO.
---------------------------------------------------------------------------- */
.pa-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding-block-end: 1.1rem;
  margin-block-end: 1.6rem;
  border-block-end: 1px solid var(--pa-border);
}
.pa-hero__cat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--pa-accent);
  background: var(--pa-accent-soft);
  border: 1px solid color-mix(in srgb, var(--pa-accent) 22%, transparent);
  border-radius: 999px;
}
.pa-hero__author { display: inline-flex; align-items: center; gap: 10px; min-inline-size: 0; }
.pa-hero__avatar {
  inline-size: 38px; block-size: 38px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--pa-surface);
  box-shadow: 0 0 0 1px var(--pa-border);
}
.pa-hero__byline { display: flex; flex-direction: column; line-height: 1.25; }
.pa-hero__byname { font-weight: 700; color: var(--pa-ink); font-size: .92rem; }
.pa-hero__byrole { font-size: .76rem; color: var(--pa-ink-3); }
.pa-hero__meta { display: inline-flex; align-items: center; gap: 16px; color: var(--pa-ink-3); font-size: .84rem; }
.pa-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.pa-hero__meta i { color: var(--pa-accent); opacity: .85; }
.pa-hero__share { margin-inline-start: auto; display: inline-flex; gap: 7px; }
.pa-hero__share a, .pa-hero__share button {
  inline-size: 34px; block-size: 34px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--pa-border);
  background: var(--pa-surface-2); color: var(--pa-ink-2); font-size: .85rem;
  cursor: pointer; transition: all .15s ease;
}
.pa-hero__share a:hover, .pa-hero__share button:hover { background: var(--pa-accent); border-color: var(--pa-accent); color:#fff; }

/* ----------------------------------------------------------------------------
   6. TABLE OF CONTENTS
---------------------------------------------------------------------------- */
.pa-toc {
  align-self: start;
  --tc: #3680ED; --tc-d: #2060C0; --tc-l: #60A4F5;
  --tc-tint: color-mix(in srgb, var(--tc) 9%, var(--pa-surface));
  --tc-tint-2: color-mix(in srgb, var(--tc) 5%, var(--pa-surface));
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(16,32,44,.04), 0 24px 48px -30px rgba(16,32,44,.30);
  max-block-size: calc(100vh - var(--pa-sticky-top) - 24px);
  overflow: hidden auto;
  scrollbar-width: thin;
}
body.theme-dark .pa-toc {
  --tc-tint: color-mix(in srgb, var(--tc) 20%, var(--pa-surface));
  --tc-tint-2: color-mix(in srgb, var(--tc) 12%, var(--pa-surface));
  box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 24px 50px -30px rgba(0,0,0,.7);
}

/* header */
.pa-toc__head {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 18px 16px;
  border-block-end: 1px solid var(--pa-border);
}
.pa-toc__ic {
  inline-size: 44px; block-size: 44px; flex-shrink: 0;
  border-radius: 13px; display: grid; place-items: center;
  color: var(--tc); background: var(--tc-tint); font-size: 1.05rem;
}
.pa-toc__ht { flex: 1; min-inline-size: 0; }
.pa-toc__title {
  margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--pa-ink); line-height: 1.15; text-transform: none;
}
.pa-toc__sub { margin: 3px 0 0; font-size: .82rem; color: var(--pa-ink-3); font-weight: 500; }
.pa-toc__toggle {
  inline-size: 40px; block-size: 40px; flex-shrink: 0;
  border: 1px solid var(--pa-border); background: var(--pa-surface);
  color: var(--pa-ink-2); border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; transition: all .18s ease;
}
.pa-toc__toggle:hover { color: var(--tc); border-color: color-mix(in srgb, var(--tc) 40%, var(--pa-border)); background: var(--tc-tint); }
.pa-toc__toggle i { transition: transform .25s ease; }
.pa-toc.is-collapsed .pa-toc__toggle i { transform: rotate(180deg); }

/* body + group */
.pa-toc__body { padding: 14px; }
.pa-toc__ghead { display: flex; align-items: center; gap: 12px; padding: 2px 2px 12px; }
.pa-toc__gic {
  inline-size: 40px; block-size: 40px; flex-shrink: 0;
  border-radius: 11px; display: grid; place-items: center;
  color: var(--tc); background: var(--pa-surface);
  border: 1.5px solid color-mix(in srgb, var(--tc) 28%, var(--pa-border));
  font-size: .95rem;
}
.pa-toc__gtitle {
  flex: 1; min-inline-size: 0; font-size: 1rem; font-weight: 800; letter-spacing: -.01em;
  color: var(--pa-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pa-toc__count {
  flex-shrink: 0; min-inline-size: 24px; text-align: center;
  font-size: .8rem; font-weight: 800; color: var(--tc);
  background: var(--tc-tint); border-radius: 8px; padding: 3px 8px;
}
.pa-toc__gtoggle {
  inline-size: 30px; block-size: 30px; flex-shrink: 0; border: 0; background: transparent;
  color: var(--tc); border-radius: 8px; display: grid; place-items: center; cursor: pointer;
  transition: background .18s ease;
}
.pa-toc__gtoggle:hover { background: var(--tc-tint); }
.pa-toc__gtoggle i { transition: transform .25s ease; }
.pa-toc.is-gcollapsed .pa-toc__gtoggle i { transform: rotate(180deg); }

/* list + timeline */
.pa-toc__list { list-style: none; margin: 0; padding: 2px 0 0; position: relative; }
.pa-toc__list::before {
  content: ""; position: absolute; inset-block: 20px 18px; inset-inline-start: 19px;
  inline-size: 2px; border-radius: 2px;
  background: linear-gradient(var(--pa-border-2), color-mix(in srgb, var(--pa-border-2) 20%, transparent));
}
.pa-toc__list ul { list-style: none; margin: 0; padding: 0; }
.pa-toc__item { position: relative; }
.pa-toc__item > a {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 13px;
  padding: 10px 12px; margin-block: 1px;
  border-radius: 12px; text-decoration: none;
  color: var(--pa-ink-2); line-height: 1.35;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.pa-toc__node {
  inline-size: 16px; block-size: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--pa-border-2); background: var(--pa-surface);
  display: grid; place-items: center; transition: all .2s ease;
}
.pa-toc__node svg { inline-size: 10px; block-size: 10px; color: #fff; opacity: 0; transform: scale(.4); transition: all .2s ease; }
.pa-toc__label { flex: 1; min-inline-size: 0; font-size: .95rem; font-weight: 600; }
.pa-toc__item--h3 .pa-toc__label { padding-inline-start: 12px; font-size: .9rem; font-weight: 500; color: var(--pa-ink-3); }
.pa-toc__item--h4 .pa-toc__label { padding-inline-start: 24px; font-size: .87rem; font-weight: 500; color: var(--pa-ink-3); }
.pa-toc__num {
  flex-shrink: 0; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--pa-ink-3); background: var(--pa-surface-3); border-radius: 8px;
  padding: 4px 9px; min-inline-size: 30px; text-align: center; transition: all .16s ease;
}
.pa-toc__item > a:hover { background: var(--tc-tint); color: var(--tc); box-shadow: inset 3px 0 0 var(--tc); }
[dir="rtl"] .pa-toc__item > a:hover { transform: translateX(-2px); }
.pa-toc__item > a:hover .pa-toc__label { color: var(--tc); font-weight: 800; }
.pa-toc__item > a:hover .pa-toc__node { background: var(--tc); border-color: var(--tc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 18%, transparent); }
.pa-toc__item > a:hover .pa-toc__node svg { opacity: 1; transform: scale(1); }
.pa-toc__item > a:hover .pa-toc__num { background: var(--tc-d); color: #fff; }

/* active */
.pa-toc__item > a.is-active {
  background: var(--tc-tint); color: var(--tc);
  box-shadow: inset 3px 0 0 var(--tc);
}
.pa-toc__item > a.is-active .pa-toc__label { color: var(--tc); font-weight: 800; }
.pa-toc__item > a.is-active .pa-toc__node { background: var(--tc); border-color: var(--tc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 18%, transparent); }
.pa-toc__item > a.is-active .pa-toc__node svg { opacity: 1; transform: scale(1); }
.pa-toc__item > a.is-active .pa-toc__num { background: var(--tc-d); color: #fff; }

/* Hover-follows-cursor: while pointing anywhere in the list, the hovered row is the
   only highlight — the scroll-active row recedes so it never looks "stuck". */
.pa-toc__list:hover .pa-toc__item > a.is-active:not(:hover) { background: transparent; box-shadow: none; color: var(--pa-ink-2); }
.pa-toc__list:hover .pa-toc__item > a.is-active:not(:hover) .pa-toc__label { color: var(--pa-ink-2); font-weight: 600; }
.pa-toc__list:hover .pa-toc__item > a.is-active:not(:hover) .pa-toc__node { background: var(--pa-surface); border-color: var(--pa-border-2); box-shadow: none; }
.pa-toc__list:hover .pa-toc__item > a.is-active:not(:hover) .pa-toc__node svg { opacity: 0; transform: scale(.4); }
.pa-toc__list:hover .pa-toc__item > a.is-active:not(:hover) .pa-toc__num { background: var(--pa-surface-3); color: var(--pa-ink-3); }

/* quick nav */
.pa-toc__quicknav {
  display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
  margin-block-start: 14px; padding: 15px 18px; border-radius: 16px;
  background: linear-gradient(135deg, var(--tc-tint), var(--tc-tint-2));
  border: 1px solid color-mix(in srgb, var(--tc) 15%, var(--pa-border));
}
.pa-toc__qnic {
  inline-size: 42px; block-size: 42px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; color: var(--tc); background: var(--pa-surface);
  box-shadow: var(--pa-shadow-sm); font-size: 1rem;
}
.pa-toc__qntext { flex: 1; min-inline-size: 0; }
.pa-toc__qntext b { display: block; font-size: .95rem; font-weight: 800; color: var(--pa-ink); letter-spacing: -.01em; }
.pa-toc__qntext span { display: block; font-size: .8rem; color: var(--pa-ink-2); line-height: 1.45; margin-block-start: 2px; }
.pa-toc__qnart { flex-shrink: 0; inline-size: 84px; line-height: 0; }
.pa-toc__qnart svg { inline-size: 100%; block-size: auto; display: block; }
@media (max-width: 420px) { .pa-toc__qnart { display: none; } }

/* collapse states */
.pa-toc.is-collapsed .pa-toc__body { display: none; }
.pa-toc.is-gcollapsed .pa-toc__list { display: none; }

/* Mobile / narrow: TOC stacks above the article (it is first in source order). */
@container (max-width: 999.98px) {
  .pa-toc { margin-block-end: 1.75rem; }
}

/* ----------------------------------------------------------------------------
   7. TYPOGRAPHY  — the heart of "premium"
---------------------------------------------------------------------------- */
.premium-article > :first-child { margin-block-start: 0; }
.premium-article > :last-child  { margin-block-end: 0; }

.premium-article h1,
.premium-article h2,
.premium-article h3,
.premium-article h4,
.premium-article h5,
.premium-article h6 {
  color: var(--pa-ink);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.012em;
  scroll-margin-top: calc(var(--pa-sticky-top) + 12px);
}

.premium-article h1 {
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.7rem;
}
.premium-article h2 {
  font-size: clamp(1.15rem, 1.05rem + 1vw, 1.45rem);
  margin: 2.6em 0 0.85em;
  padding-block-end: .5rem;
  position: relative;
}
/* Signature accent rule under every H2 */
.premium-article h2::after {
  content: "";
  position: absolute;
  inset-block-end: 0; inset-inline-start: 0;
  inline-size: 56px; block-size: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--pa-accent), color-mix(in srgb, var(--pa-accent) 40%, transparent));
}
.premium-article h3 {
  font-size: clamp(1rem, 1rem + 0.5vw, 1.15rem);
  margin: 2em 0 0.6em;
}
.premium-article h3::before {
  content: "";
  display: inline-block;
  inline-size: 8px; block-size: 8px; border-radius: 2px;
  background: var(--pa-accent);
  margin-inline-end: 10px;
  vertical-align: middle;
  transform: rotate(45deg);
}
.premium-article h4 {
  font-size: 1rem;
  font-weight: 350;
  color: var(--pa-ink-2);
  margin: 1.7em 0 0.5em;
  text-transform: none;
}

/* Anchor link affordance on hover */
.premium-article :is(h2, h3, h4)[id] { position: relative; }
.premium-article .pa-anchor {
  position: absolute;
  inset-inline-start: -1.4em;
  inset-block-start: 0.08em;
  opacity: 0;
  color: var(--pa-ink-3);
  font-size: .7em;
  text-decoration: none;
  transition: opacity .15s ease, color .15s ease;
}
.premium-article :is(h2, h3, h4):hover .pa-anchor { opacity: 1; }
.premium-article .pa-anchor:hover { color: var(--pa-accent); }
@media (max-width: 991.98px) { .premium-article .pa-anchor { display: none; } }

/* Paragraphs */
.premium-article p {
  margin: 0 0 var(--pa-gap);
  line-height: var(--pa-lh);
  color: var(--pa-ink);
}
/* Lead paragraph — the first paragraph reads larger, like a deck */
.premium-article > p:first-of-type {
  font-size: 1em;
  line-height: 1.7;
  color: var(--pa-ink-2);
}

.premium-article strong, .premium-article b { font-weight: 750; color: var(--pa-ink); }
.premium-article em { font-style: italic; }
.premium-article small { color: var(--pa-ink-3); }
.premium-article mark {
  background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--pa-accent) 28%, transparent) 0);
  color: inherit; padding: 0 .12em; border-radius: 2px;
}

/* Links */
.premium-article a {
  color: var(--pa-accent-strong);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .25s ease, color .2s ease;
  font-weight: 400;
  word-break: break-word;
}
.premium-article a:hover { background-size: 100% 1.5px; color: var(--pa-accent); }

/* Horizontal rule */
.premium-article hr {
  border: 0;
  block-size: 1px;
  margin: 2.4rem 0;
  background: linear-gradient(90deg, transparent, var(--pa-border-2), transparent);
}

/* ----------------------------------------------------------------------------
   8. LISTS
---------------------------------------------------------------------------- */
.premium-article ul,
.premium-article ol {
  margin: 0 0 var(--pa-gap);
  padding-inline-start: 0;
  list-style: none;
}
.premium-article li { margin-block: .5em; line-height: 1.7; padding-inline-start: 1.9em; position: relative; }
.premium-article li > ul, .premium-article li > ol { margin-block: .55em 0; }

/* Custom bullet */
.premium-article ul > li::before {
  content: "";
  position: absolute;
  inset-inline-start: .15em;
  inset-block-start: .62em;
  inline-size: .55em; block-size: .55em;
  border-radius: 3px;
  background: var(--pa-accent);
  box-shadow: 0 0 0 4px var(--pa-accent-soft);
  transform: rotate(45deg);
}
.premium-article ul ul > li::before { background: var(--pa-ink-3); box-shadow: none; opacity:.7; }

/* Numbered list with accent counters */
.premium-article ol { counter-reset: pa-ol; }
.premium-article ol > li { counter-increment: pa-ol; padding-inline-start: 2.4em; }
.premium-article ol > li::before {
  content: counter(pa-ol);
  position: absolute;
  inset-inline-start: 0; inset-block-start: .05em;
  inline-size: 1.7em; block-size: 1.7em;
  display: grid; place-items: center;
  font-size: .82em; font-weight: 400;
  color: var(--pa-accent);
  background: var(--pa-accent-soft);
  border: 1px solid color-mix(in srgb, var(--pa-accent) 25%, transparent);
  border-radius: 8px;
}

/* Checklist support: <ul class="pa-checklist"> or items beginning with ✅ handled in JS */
.premium-article .pa-checklist > li::before {
  content: "\f00c"; /* fa-check */
  font-family: "Font Awesome 5 Free"; font-weight: 400;
  background: var(--pa-success-bg); color: var(--pa-success);
  box-shadow: none; transform: none; border-radius: 6px;
  inline-size: 1.4em; block-size: 1.4em; display: grid; place-items: center;
  inset-block-start: .35em; font-size: .7em;
}

/* Definition lists */
.premium-article dl { margin: 0 0 var(--pa-gap); }
.premium-article dt { font-weight: 750; color: var(--pa-ink); margin-block-start: .8em; }
.premium-article dd { margin: .2em 0 0; padding-inline-start: 1em; color: var(--pa-ink-2); border-inline-start: 2px solid var(--pa-border); }

/* ----------------------------------------------------------------------------
   9. BLOCKQUOTES  → premium quote card
---------------------------------------------------------------------------- */
.premium-article blockquote{ position:relative; overflow:hidden; margin-block:2rem; margin-inline:0; padding-block:1.5rem; padding-inline:3.4rem 1.6rem; background:linear-gradient(180deg, var(--pa-accent-tint), var(--pa-surface-2) 120px); border:1px solid var(--pa-border); border-inline-start:4px solid var(--pa-accent); border-radius:var(--pa-radius-sm); box-shadow:var(--pa-shadow-sm); color:var(--pa-ink); }

/* prominent accent gradient quote-mark chip (fits the ~2.9rem mobile inline-start override) */
.premium-article blockquote::before{ content:""; position:absolute; inset-inline-start:.85rem; inset-block-start:1.35rem; inline-size:1.9rem; block-size:1.9rem; border-radius:9px; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M6 17c-1.7 0-3-1.4-3-3.2 0-2.7 2-5.1 5-6.8l1 1.6c-1.8 1-2.8 2.1-3 3.2.2 0 .4-.1.6-.1 1.5 0 2.7 1.2 2.7 2.7C9.3 15.9 7.8 17 6 17zm9 0c-1.7 0-3-1.4-3-3.2 0-2.7 2-5.1 5-6.8l1 1.6c-1.8 1-2.8 2.1-3 3.2.2 0 .4-.1.6-.1 1.5 0 2.7 1.2 2.7 2.7C18.3 15.9 16.8 17 15 17z'/%3E%3C/svg%3E") center / 60% no-repeat, linear-gradient(135deg, var(--pa-accent), var(--pa-accent-strong)); box-shadow:0 5px 12px -4px color-mix(in srgb, var(--pa-accent) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.4); }

/* larger serif-italic pull-quote body */
.premium-article blockquote p{ margin-block:0 .8rem; margin-inline:0; font-family:Georgia, "Times New Roman", serif; font-style:italic; font-size:1.15em; line-height:1.6; color:var(--pa-ink); }
.premium-article blockquote > :last-child{ margin-block-end:0; }

/* clean "— Name" attribution in brand accent */
.premium-article blockquote :is(cite, footer){ display:block; margin-block-start:1rem; font-family:inherit; font-style:normal; font-weight:700; font-size:.92em; color:var(--pa-ink); }
.premium-article blockquote :is(cite, footer)::before{ content:"\2014\00a0"; color:var(--pa-accent); font-weight:700; }

/* ----------------------------------------------------------------------------
   10. CALLOUT BOXES  (.callout-info / -success / -warning / -danger)
   Also auto-applied to blockquotes starting with Tip:/Note:/Warning: via JS.
---------------------------------------------------------------------------- */
.premium-article [class*="callout-"]{ position:relative; margin-block:1.9rem; margin-inline:0; padding-block:1.15rem; padding-inline:3.6rem 1.3rem; border:1px solid var(--pa-border); border-inline-start-width:4px; border-radius:var(--pa-radius-sm); background:var(--pa-surface-2); color:var(--pa-ink); line-height:1.65; box-shadow:var(--pa-shadow-sm); }
.premium-article [class*="callout-"] > :last-child{ margin-block-end:0; }
.premium-article [class*="callout-"] > :first-child{ margin-block-start:0; }

/* semantic gradient icon chip — same chip language as pros/cons + quote */
.premium-article [class*="callout-"]::before{ content:""; position:absolute; inset-inline-start:1.05rem; inset-block-start:1.1rem; inline-size:1.7rem; block-size:1.7rem; border-radius:9px; background-repeat:no-repeat, no-repeat; background-position:center, center; background-size:58%, cover; box-shadow:0 4px 10px -3px color-mix(in srgb, var(--pa-ink) 25%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }

/* inline bold semantic label that flows into the body ("Label: text") */
.premium-article [class*="callout-"] .pa-callout-title{ font-weight:800; margin-inline-end:.4rem; }
.premium-article [class*="callout-"] .pa-callout-title::after{ content:":"; }

.premium-article .callout-info{ background:var(--pa-info-bg); border-inline-start-color:var(--pa-info); }
.premium-article .callout-info .pa-callout-title{ color:var(--pa-info); }
.premium-article .callout-info::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 7.5h.01'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-info), color-mix(in srgb, var(--pa-info) 60%, #000)); }

.premium-article .callout-success{ background:var(--pa-success-bg); border-inline-start-color:var(--pa-success); }
.premium-article .callout-success .pa-callout-title{ color:var(--pa-success); }
.premium-article .callout-success::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-success), color-mix(in srgb, var(--pa-success) 60%, #000)); }

.premium-article .callout-warning{ background:var(--pa-warning-bg); border-inline-start-color:var(--pa-warning); }
.premium-article .callout-warning .pa-callout-title{ color:var(--pa-warning); }
.premium-article .callout-warning::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 4 2 18.3A2 2 0 0 0 3.7 21h16.6a2 2 0 0 0 1.7-2.7L13.7 4a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9.5v4'/%3E%3Cpath d='M12 17.2h.01'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-warning), color-mix(in srgb, var(--pa-warning) 60%, #000)); }

.premium-article .callout-danger{ background:var(--pa-danger-bg); border-inline-start-color:var(--pa-danger); }
.premium-article .callout-danger .pa-callout-title{ color:var(--pa-danger); }
.premium-article .callout-danger::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16.2h.01'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-danger), color-mix(in srgb, var(--pa-danger) 60%, #000)); }

/* dark-mode: lift semantic label text to meet WCAG AA on dark tinted backgrounds (hues do not auto-remap) */
body.theme-dark .premium-article .callout-info .pa-callout-title{ color:color-mix(in srgb, var(--pa-info) 62%, #fff); }
body.theme-dark .premium-article .callout-success .pa-callout-title{ color:color-mix(in srgb, var(--pa-success) 62%, #fff); }
body.theme-dark .premium-article .callout-warning .pa-callout-title{ color:color-mix(in srgb, var(--pa-warning) 62%, #fff); }
body.theme-dark .premium-article .callout-danger .pa-callout-title{ color:color-mix(in srgb, var(--pa-danger) 62%, #fff); }

/* ----------------------------------------------------------------------------
   11. FEATURED ANSWER / SNIPPET BOX  (.featured-answer)
   Answer-first block styled for Google featured snippets.
---------------------------------------------------------------------------- */
.premium-article .featured-answer {
  position: relative;
  margin: 2rem 0;
  padding: 1.5rem 1.6rem;
  background: linear-gradient(180deg, var(--pa-accent-tint), var(--pa-surface));
  border: 1px solid color-mix(in srgb, var(--pa-accent) 28%, var(--pa-border));
  border-radius: var(--pa-radius);
  box-shadow: var(--pa-shadow-sm);
}
.premium-article .featured-answer::before {
  content: "Quick Answer";
  position: absolute;
  inset-block-start: -0.7rem; inset-inline-start: 1.3rem;
  padding: 3px 11px;
  font-size: .68rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--pa-accent);
  border-radius: 999px;
}
.premium-article .featured-answer > :last-child { margin-block-end: 0; }
.premium-article .featured-answer p { font-size: 1.06em; color: var(--pa-ink); }

/* ----------------------------------------------------------------------------
   12. PROS & CONS  (.pros-cons  with .pros / .cons children)
---------------------------------------------------------------------------- */
.premium-article .pros-cons{ display:grid; grid-template-columns:1fr 1fr; gap:1.15rem; margin-block:2rem; margin-inline:0; }
@media (max-width:600px){ .premium-article .pros-cons{ grid-template-columns:1fr; } }

/* premium cards — shared chip/radius/shadow language with callouts + quote */
.premium-article .pros-cons :is(.pros,.cons){ position:relative; overflow:hidden; padding-block:1.2rem 1.3rem; padding-inline:1.3rem; border:1px solid var(--pa-border); border-radius:var(--pa-radius); background:var(--pa-surface); box-shadow:var(--pa-shadow-sm); }
.premium-article .pros-cons .pros{ border-block-start:3px solid var(--pa-success); }
.premium-article .pros-cons .cons{ border-block-start:3px solid var(--pa-danger); }

/* heading with semantic gradient icon chip */
.premium-article .pros-cons :is(.pros,.cons) > :first-child{ display:flex; align-items:center; gap:.6rem; margin:0 0 .85rem; padding-block-end:.7rem; border-block-end:1px solid var(--pa-border); font-size:1.05rem; font-weight:800; line-height:1.3; color:var(--pa-ink); }
.premium-article .pros-cons :is(.pros,.cons) > :first-child::before{ content:""; transform:none; margin-inline:0; flex-shrink:0; inline-size:1.75rem; block-size:1.75rem; border-radius:9px; background-repeat:no-repeat,no-repeat; background-position:center,center; background-size:60%,cover; box-shadow:0 4px 10px -3px color-mix(in srgb, var(--pa-ink) 25%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.premium-article .pros-cons .pros > :first-child::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-success), color-mix(in srgb, var(--pa-success) 60%, #000)); }
.premium-article .pros-cons .cons > :first-child::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6 18 18M18 6 6 18'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-danger), color-mix(in srgb, var(--pa-danger) 60%, #000)); }

/* list — reset inherited ul spacing, clean rows with hairline dividers */
.premium-article .pros-cons :is(.pros,.cons) ul{ margin:0; padding:0; list-style:none; }
.premium-article .pros-cons :is(.pros,.cons) li{ position:relative; margin:0; padding-block:.6rem; padding-inline:2em 0; line-height:1.6; color:var(--pa-ink-2); border-radius:var(--pa-radius-xs); transition:background-color .18s ease; }
.premium-article .pros-cons :is(.pros,.cons) li + li{ border-block-start:1px solid var(--pa-border); }

/* per-item semantic gradient check / ✗ chip — overrides the base list marker (no diamond leak, no double bullet) */
.premium-article .pros-cons :is(.pros,.cons) li::before{ content:""; position:absolute; inset-inline-start:0; inset-block-start:.6em; inline-size:1.3em; block-size:1.3em; border-radius:6px; transform:none; opacity:1; background-repeat:no-repeat,no-repeat; background-position:center,center; background-size:64%,cover; box-shadow:0 2px 6px -2px color-mix(in srgb, var(--pa-ink) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.premium-article .pros-cons .pros li::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-success), color-mix(in srgb, var(--pa-success) 60%, #000)); }
.premium-article .pros-cons .cons li::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6 18 18M18 6 6 18'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--pa-danger), color-mix(in srgb, var(--pa-danger) 60%, #000)); }

@media (hover:hover){ .premium-article .pros-cons .pros li:hover{ background:var(--pa-success-bg); } .premium-article .pros-cons .cons li:hover{ background:var(--pa-danger-bg); } }
@media (prefers-reduced-motion:reduce){ .premium-article .pros-cons :is(.pros,.cons) li{ transition:none; } }

/* ----------------------------------------------------------------------------
   13. FEATURE GRID  (.feature-grid  with .feature-card children)
---------------------------------------------------------------------------- */
.premium-article .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 2rem 0;
}
.premium-article .feature-grid .feature-card {
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--pa-surface);
  box-shadow: var(--pa-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.premium-article .feature-grid .feature-card:hover { transform: translateY(-3px); box-shadow: var(--pa-shadow); border-color: var(--pa-border-2); }
.premium-article .feature-grid .feature-card i,
.premium-article .feature-grid .feature-card .feature-icon {
  display: inline-grid; place-items: center;
  inline-size: 46px; block-size: 46px; margin-block-end: .85rem;
  font-size: 1.25rem; color: var(--pa-accent);
  background: var(--pa-accent-soft); border-radius: 12px;
}
.premium-article .feature-grid .feature-card h3,
.premium-article .feature-grid .feature-card h4,
.premium-article .feature-grid .feature-card strong { margin: 0 0 .4rem; font-size: 1.08rem; }
.premium-article .feature-grid .feature-card h3::before { content: none; }
.premium-article .feature-grid .feature-card p { font-size: .94rem; color: var(--pa-ink-2); margin: 0; }

/* ----------------------------------------------------------------------------
   14. TABLES  → responsive premium SaaS tables
---------------------------------------------------------------------------- */
.premium-article .pa-table-wrap {
  --pa-t-shadow: color-mix(in srgb, var(--pa-ink) 12%, transparent);
  margin: 2rem 0;
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  box-shadow: var(--pa-shadow-sm);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--pa-border-2) transparent;
  /* Token-only horizontal scroll affordance (Lea Verou technique):
     opaque "cover" gradients pinned to each inline edge (background-attachment: local)
     sit over soft edge shadows pinned to the scroll viewport (attachment: scroll),
     so a shadow appears only while more table remains scrollable in that direction.
     The pair is symmetric across both inline edges, so it renders identically in RTL. */
  background:
    linear-gradient(to right, var(--pa-surface) 32%, transparent) 0 0 / 44px 100% no-repeat local,
    linear-gradient(to left,  var(--pa-surface) 32%, transparent) 100% 0 / 44px 100% no-repeat local,
    radial-gradient(farthest-side at 0    50%, var(--pa-t-shadow), transparent) 0 0 / 22px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--pa-t-shadow), transparent) 100% 0 / 22px 100% no-repeat scroll,
    var(--pa-surface);
}
.premium-article .pa-table-wrap:focus-within {
  border-color: color-mix(in srgb, var(--pa-accent) 45%, var(--pa-border-2));
  box-shadow: var(--pa-shadow-sm), var(--pa-ring);
}
.premium-article .pa-table-wrap table { margin: 0; border: 0; box-shadow: none; min-inline-size: 100%; }
.premium-article table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .95rem;
  line-height: 1.5;
  background: transparent; /* let the wrap's scroll-fade show through */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- Header: accent-tinted gradient band + confident uppercase micro-labels ---- */
.premium-article thead th {
  position: sticky; inset-block-start: 0; z-index: 3;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--pa-accent) 10%, var(--pa-surface)),
      color-mix(in srgb, var(--pa-accent) 5%,  var(--pa-surface)));
  color: var(--pa-ink);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .045em;
  text-transform: uppercase;
  text-align: start;
  white-space: nowrap;
  padding: .9rem 1.2rem;
  border-block-end: 1px solid color-mix(in srgb, var(--pa-accent) 22%, var(--pa-border-2));
}
.premium-article thead th:first-child { border-start-start-radius: calc(var(--pa-radius) - 1px); }
.premium-article thead th:last-child  { border-start-end-radius: calc(var(--pa-radius) - 1px); }

/* ---- Body cells: hairline dividers, roomy rhythm, aligned numerals ---- */
.premium-article tbody td,
.premium-article tbody th {
  position: relative;
  padding: .85rem 1.2rem;
  border-block-end: 1px solid var(--pa-border);
  color: var(--pa-ink-2);
  vertical-align: top;
  line-height: 1.55;
  text-align: start;
  transition: color .18s ease;
}
/* First column reads as the label: semibold, primary ink → row scans label → value */
.premium-article tbody tr > :first-child {
  color: var(--pa-ink);
  font-weight: 600;
}
/* Subtle zebra (semi-transparent so the scroll-fade shows through on overflow) */
.premium-article tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--pa-surface-2) 60%, transparent);
}
.premium-article tbody tr:last-child :is(td, th) { border-block-end: 0; }

/* Rounded outer corners: round the corner cells so backgrounds clip cleanly,
   including headerless tables (first body row) and the final row. */
.premium-article table:not(:has(thead)) tbody tr:first-child > :first-child { border-start-start-radius: calc(var(--pa-radius) - 1px); }
.premium-article table:not(:has(thead)) tbody tr:first-child > :last-child  { border-start-end-radius: calc(var(--pa-radius) - 1px); }
.premium-article tbody tr:last-child > :first-child { border-end-start-radius: calc(var(--pa-radius) - 1px); }
.premium-article tbody tr:last-child > :last-child  { border-end-end-radius: calc(var(--pa-radius) - 1px); }

/* ---- Interactive accent rail: rounded gradient bar slides in on the inline-start edge ---- */
.premium-article tbody tr > :first-child::before {
  content: "";
  position: absolute;
  inset-block: 3px;
  inset-inline-start: 0;
  inline-size: 3px;
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
  background: linear-gradient(180deg, var(--pa-accent), var(--pa-accent-strong));
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity .2s ease, transform .2s ease;
}

/* ---- Restrained, delightful hover / keyboard-focus state ---- */
/* Direction-neutral flat accent tint (RTL-safe; matches the inline-start rail on both edges) */
.premium-article tbody tr { transition: background-color .2s ease; }
.premium-article tbody tr:hover,
.premium-article tbody tr:focus-within {
  background: color-mix(in srgb, var(--pa-accent) 7%, var(--pa-surface));
}
.premium-article tbody tr:hover > :first-child::before,
.premium-article tbody tr:focus-within > :first-child::before {
  opacity: 1;
  transform: scaleY(1);
}
.premium-article tbody tr:focus-within { outline: none; box-shadow: var(--pa-ring); }

.premium-article table caption {
  caption-side: bottom;
  padding-block-start: .8rem;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--pa-ink-3);
  text-align: start;
}

@media (prefers-reduced-motion: reduce) {
  .premium-article tbody tr,
  .premium-article tbody td,
  .premium-article tbody th,
  .premium-article tbody tr > :first-child::before { transition: none; }
  .premium-article tbody tr > :first-child::before { transform: scaleY(1); }
}

/* ----------------------------------------------------------------------------
   15. CODE  → styled blocks with copy button + inline code
---------------------------------------------------------------------------- */
.premium-article :not(pre) > code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .88em;
  padding: .16em .45em;
  border-radius: 6px;
  background: var(--pa-surface-3);
  color: color-mix(in srgb, var(--pa-accent-strong) 88%, var(--pa-ink));
  border: 1px solid var(--pa-border);
  word-break: break-word;
}
.premium-article .pa-code {
  position: relative;
  margin: 2rem 0;
  border-radius: var(--pa-radius-sm);
  background: #0f1620;
  border: 1px solid #1d2937;
  box-shadow: var(--pa-shadow-sm);
  overflow: hidden;
}
.premium-article .pa-code__bar {
  display: flex; align-items: center; gap: 8px;
  padding: .55rem .9rem;
  background: #0b1018;
  border-block-end: 1px solid #1d2937;
}
.premium-article .pa-code__dot { inline-size: 11px; block-size: 11px; border-radius: 50%; }
.premium-article .pa-code__dot:nth-child(1){ background:#ff5f56;} 
.premium-article .pa-code__dot:nth-child(2){ background:#ffbd2e;} 
.premium-article .pa-code__dot:nth-child(3){ background:#27c93f;} 
.premium-article .pa-code__lang { margin-inline-start: 6px; font-size: .72rem; letter-spacing:.06em; text-transform: uppercase; color:#7b8aa0; font-weight:700; }
.premium-article .pa-code__copy {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: .74rem; font-weight: 700;
  color: #c7d2e0; background: #18202c; border: 1px solid #2a3645; border-radius: 7px;
  cursor: pointer; transition: all .15s ease;
}
.premium-article .pa-code__copy:hover { background: #222c3a; color: #fff; }
.premium-article .pa-code__copy.is-done { color: #27c93f; border-color:#27c93f; }
.premium-article .pa-code pre {
  margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto;
  background: transparent; border: 0;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .875rem; line-height: 1.7; color: #e6edf3;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.premium-article .pa-code pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }
/* Bare <pre> not wrapped by JS still looks good */
.premium-article pre:not(.pa-code pre) {
  margin: 2rem 0; padding: 1.1rem 1.2rem; overflow-x: auto;
  background: #0f1620; color:#e6edf3; border-radius: var(--pa-radius-sm);
  font-size:.875rem; line-height:1.7;
}

/* ----------------------------------------------------------------------------
   16. IMAGES / FIGURES / LIGHTBOX
---------------------------------------------------------------------------- */
.premium-article img {
  max-inline-size: 100%;
  block-size: auto;
  border-radius: var(--pa-radius-sm);
  box-shadow: var(--pa-shadow-sm);
  display: block;
}
.premium-article figure { margin: 2rem 0; }
.premium-article figure.pa-figure img { margin-inline: auto; }
.premium-article figure img[data-pa-zoomable] { cursor: zoom-in; transition: transform .25s ease, box-shadow .25s ease; }
.premium-article figure img[data-pa-zoomable]:hover { box-shadow: var(--pa-shadow); }
.premium-article figcaption {
  margin-block-start: .7rem; text-align: center;
  font-size: .85rem; color: var(--pa-ink-3); line-height: 1.5;
}

/* Lightbox overlay (single instance, injected by JS) */
.pa-lightbox {
  position: fixed; inset: 0; z-index: 1090;
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin;
  background: rgba(8,12,18,.86);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.pa-lightbox.is-open { opacity: 1; visibility: visible; }
.pa-lightbox img {
  max-inline-size: 100%; max-block-size: 92vh;
  border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  transform: scale(.96); transition: transform .25s ease;
}
.pa-lightbox.is-open img { transform: scale(1); }
.pa-lightbox__close {
  position: absolute; inset-block-start: 18px; inset-inline-end: 22px;
  inline-size: 44px; block-size: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); color:#fff; border: 1px solid rgba(255,255,255,.25);
  font-size: 1.2rem; cursor: pointer; display: grid; place-items: center;
  transition: background .15s ease;
}
.pa-lightbox__close:hover { background: rgba(255,255,255,.25); }

/* ----------------------------------------------------------------------------
   17. INTERNAL LINK / RELATED CARDS  (.related-card, auto-built related grid)
---------------------------------------------------------------------------- */
.premium-article .related-card,
.pa-related-grid a {
  display: flex; align-items: center; gap: 14px;
  padding: 1rem 1.15rem; margin: 1.4rem 0;
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--pa-surface);
  text-decoration: none; color: var(--pa-ink) !important;
  box-shadow: var(--pa-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  background-image: none !important;
}
.premium-article .related-card:hover,
.pa-related-grid a:hover { transform: translateY(-2px); box-shadow: var(--pa-shadow); border-color: var(--pa-border-2); }
.premium-article .related-card::before {
  content: "\f0c1"; font-family:"Font Awesome 5 Free"; font-weight:900;
  inline-size: 42px; block-size: 42px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 11px;
  color: var(--pa-accent); background: var(--pa-accent-soft); font-size: 1rem;
}

/* ============================================================================
   18. BELOW-ARTICLE MODULES  (rendered by the Blade component, theme-aware)
   author box • history • CTA • community • newsletter • coffee • push • related
   These intentionally live OUTSIDE .premium-article so content CSS won't touch.
   ========================================================================== */
.pa-modules { display: grid; gap: 1.25rem; margin-block-start: 2.5rem; }
.pa-card {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--pa-surface);
  box-shadow: var(--pa-shadow-sm);
  color: var(--pa-ink);
}
.pa-card__pad { padding: clamp(1.25rem, 1rem + 1.5vw, 1.9rem); }

/* Author box */
.pa-author { display: flex; gap: 1.2rem; align-items: flex-start; }
/* Anchor wrapper around the avatar (when authorUrl is set). Sizes the link to
   the same 84x84 block so the flex layout does not collapse it to inline. */
.pa-author__avatar-link {
  display: block; inline-size: 84px; block-size: 84px; flex-shrink: 0;
  border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--pa-border), var(--pa-shadow-sm);
  transition: transform .15s ease;
}
.pa-author__avatar-link:hover { transform: scale(1.03); }
.pa-author__avatar-link .pa-author__avatar { box-shadow: none; border-radius: 0; }
.pa-author__avatar {
  inline-size: 84px; block-size: 84px; border-radius: 18px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--pa-border), var(--pa-shadow-sm);
  display: block;
}
.pa-author__eyebrow { font-size:.7rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color: var(--pa-accent); }
.pa-author__name { font-size: 1.25rem; font-weight: 800; margin: .15rem 0 .1rem; }
.pa-author__role { font-size: .85rem; color: var(--pa-ink-3); margin-block-end:.6rem; }
.pa-author__bio  { color: var(--pa-ink-2); line-height: 1.65; margin: 0 0 .8rem; font-size:.95rem; }
.pa-author__socials { display: flex; gap: 8px; flex-wrap: wrap; }
.pa-author__socials a {
  inline-size: 36px; block-size: 36px; display: grid; place-items: center; border-radius: 9px;
  background: var(--pa-surface-2); border:1px solid var(--pa-border); color: var(--pa-ink-2);
  text-decoration: none; transition: all .15s ease;
}
.pa-author__socials a:hover { background: var(--pa-accent); color:#fff; border-color: var(--pa-accent); }
@media (max-width: 520px){ .pa-author { flex-direction: column; } }

/* ═════════════════ Premium Author Box (E-E-A-T) — reference layout ═════════════════ */
/* Structure: [ avatar + stats stacked ]  |  [ eyebrow / name / role / bio / expertise panel / CTA ]
   Socials pinned to the top-right corner of the right column.                                     */
.pa-authorbox{
  --pab-red:#3680ED;
  --pab-red-dark:#2060C0;
  --pab-tint:#EAF2FD;
  --pab-tint-2:#F4F8FE;
  --pab-ink:#0D0F14;
  --pab-txt:#3A3F49;
  --pab-mut:#7A8090;
  --pab-line:#F1EEF0;
  position:relative;
  display:grid;
  grid-template-columns:220px 1fr;
  gap:38px;
  align-items:flex-start;
  padding:36px 40px;
  border-radius:26px;
  border:1px solid #F0EEF0;
  background:#FFFFFF;
  box-shadow:0 1px 3px rgba(15,23,42,.04),0 24px 60px rgba(15,23,42,.06);
  overflow:hidden;
}

/* ── LEFT column: avatar + stats stacked ── */
.pa-ab-left{display:flex;flex-direction:column;align-items:center;gap:26px}

/* Avatar with soft red halo ring */
.pa-ab-avatar-ring{
  position:relative;
  width:180px;height:180px;border-radius:50%;
  padding:12px;
  background:radial-gradient(circle at 50% 50%,#F4F8FE 0%,#E4EEFC 55%,#CFE0FA 100%);
  box-shadow:0 0 0 1px rgba(54,128,237,.08),0 16px 40px rgba(54,128,237,.14);
}
.pa-ab-avatar-ring > a{display:block;width:100%;height:100%;border-radius:50%;overflow:hidden}
.pa-ab-avatar-ring img{
  width:100%;height:100%;border-radius:50%;object-fit:cover;
  background:#EFF4FE;display:block;
  transition:transform .35s cubic-bezier(.22,1,.36,1);
}
.pa-ab-avatar-ring:hover img{transform:scale(1.02)}
.pa-ab-fallback{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;border-radius:50%;
  background:linear-gradient(135deg,#60A4F5,#3680ED);color:#fff;font-size:64px;font-weight:800;
}

/* Verified badge — proper scalloped starburst */
.pa-ab-verify{
  position:absolute;right:8px;bottom:14px;
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  filter:drop-shadow(0 6px 14px rgba(54,128,237,.35));
  animation:pa-ab-verify-in .55s cubic-bezier(.22,1,.36,1) both;
}
.pa-ab-verify svg{width:100%;height:100%;display:block}
@keyframes pa-ab-verify-in{
  from{opacity:0;transform:scale(.4) rotate(-10deg)}
  to  {opacity:1;transform:scale(1) rotate(0)}
}

/* Stat cards under the avatar (Articles / Readers) */
.pa-ab-stats{
  display:flex;flex-direction:column;gap:0;width:100%;
  background:transparent;
}
.pa-ab-stat{
  display:flex;align-items:center;gap:14px;
  padding:10px 0;
}
.pa-ab-stat + .pa-ab-stat{border-top:1px solid var(--pab-line)}
.pa-ab-stat-ic{
  width:44px;height:44px;border-radius:12px;flex-shrink:0;
  background:var(--pab-tint);color:var(--pab-red);
  display:flex;align-items:center;justify-content:center;font-size:16px;
  transition:background .2s ease,transform .2s ease;
}
.pa-ab-stat:hover .pa-ab-stat-ic{background:var(--aits-blue-tint,#EAF2FD);transform:scale(1.05)}
.pa-ab-stat-body b{
  display:block;font-size:22px;font-weight:800;color:var(--pab-ink);
  line-height:1.05;letter-spacing:-.01em;
}
.pa-ab-stat-body small{
  display:block;font-size:13px;color:var(--pab-mut);margin-top:3px;font-weight:600;
}

/* ── RIGHT column: content ── */
.pa-ab-right{position:relative;min-width:0}

/* Header row — eyebrow left, socials right */
.pa-ab-header{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin-bottom:14px;
}

/* Socials */
.pa-ab-socials{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.pa-ab-socials > a,
.pa-ab-socials > .pa-ab-copy{
  width:42px;height:42px;border-radius:50%;
  background:#fff;border:1px solid #E9E7EA;
  display:flex;align-items:center;justify-content:center;
  color:var(--pab-ink);font-size:15px;
  text-decoration:none;cursor:pointer;padding:0;
  transition:color .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease,transform .2s ease;
}
.pa-ab-socials > a:hover,
.pa-ab-socials > .pa-ab-copy:hover{
  color:var(--pab-red);
  border-color:var(--pab-red);
  background:var(--pab-tint-2);
  box-shadow:0 6px 16px rgba(54,128,237,.14);
  transform:translateY(-2px);
}
.pa-ab-socials > a:active,
.pa-ab-socials > .pa-ab-copy:active{transform:translateY(0);box-shadow:0 3px 8px rgba(54,128,237,.16)}
.pa-ab-socials > .pa-ab-copy.is-copied{color:#0ca678;border-color:#0ca678;background:#EAFBF3}

/* Eyebrow / Name / Role / Bio */
.pa-ab-eyebrow{
  font-size:12px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;
  color:var(--pab-red);margin:0;
}
.pa-ab-name{
  font-size:44px;font-weight:800;line-height:1.02;
  letter-spacing:-.025em;color:var(--pab-ink);margin:0 0 12px;
}
.pa-ab-name a{color:inherit;text-decoration:none;background-image:linear-gradient(currentColor,currentColor);background-size:0 2px;background-position:0 100%;background-repeat:no-repeat;transition:background-size .3s ease,color .2s ease}
.pa-ab-name a:hover{color:var(--pab-red-dark);background-size:100% 2px}
.pa-ab-role{font-size:16px;font-weight:600;color:var(--pab-mut);margin-bottom:18px}
.pa-ab-bio{
  font-size:15px;line-height:1.72;color:var(--pab-txt);
  margin:0 0 22px;max-width:64ch;font-weight:400;
}

/* Expertise panel (brand blue) */
.pa-ab-expertise-panel{
  background:linear-gradient(135deg,#F4F8FE,#EAF2FD);
  border-radius:16px;
  padding:20px 22px;
  margin-bottom:24px;
  border:1px solid #DCE9FC;
}
.pa-ab-expertise-label{
  font-size:12px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;
  color:var(--pab-red);margin-bottom:14px;
}
.pa-ab-chips{display:flex;flex-wrap:wrap;gap:8px}
.pa-ab-chip{
  display:inline-flex;align-items:center;gap:7px;
  background:#fff;border:1px solid transparent;
  color:var(--pab-ink);font-size:12.5px;font-weight:600;
  padding:5px 13px 5px 6px;border-radius:999px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
  cursor:default;
  line-height:1.4;
}
.pa-ab-chip:hover{
  transform:translateY(-2px);
  border-color:#CFE0FA;
  box-shadow:0 8px 18px rgba(54,128,237,.14);
}
.pa-ab-chip-ic{
  width:20px;height:20px;border-radius:50%;
  background:#EAF2FD;color:var(--pab-red);
  display:flex;align-items:center;justify-content:center;font-size:9.5px;flex-shrink:0;
  transition:background .2s ease,color .2s ease;
}
.pa-ab-chip:hover .pa-ab-chip-ic{background:var(--pab-red);color:#fff}

/* CTA button — high-specificity so the sitewide `a:hover{color:…}` from
   Tabler (and any theme layer) doesn't repaint the label mid-hover. */
.pa-authorbox a.pa-ab-cta,
.pa-authorbox a.pa-ab-cta:link,
.pa-authorbox a.pa-ab-cta:visited{
  display:inline-flex;align-items:center;gap:14px;
  background:var(--pab-red);color:#fff;
  font-size:15px;font-weight:700;letter-spacing:-.005em;
  padding:14px 24px;border-radius:12px;text-decoration:none;
  box-shadow:0 10px 24px rgba(54,128,237,.28);
  transition:background .2s ease,box-shadow .2s ease,transform .2s ease;
}
.pa-authorbox a.pa-ab-cta:hover,
.pa-authorbox a.pa-ab-cta:focus,
.pa-authorbox a.pa-ab-cta:active{
  background:var(--pab-red-dark);
  color:#fff;
  text-decoration:none;
  box-shadow:0 14px 30px rgba(54,128,237,.36);
  transform:translateY(-2px);
}
.pa-authorbox a.pa-ab-cta:active{transform:translateY(0);box-shadow:0 6px 14px rgba(54,128,237,.28)}
.pa-authorbox a.pa-ab-cta > span{color:inherit}
.pa-authorbox a.pa-ab-cta i{color:inherit}
.pa-ab-cta-arrow{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;font-size:13px;
  transition:transform .28s cubic-bezier(.22,1,.36,1);
}
.pa-authorbox a.pa-ab-cta:hover .pa-ab-cta-arrow{transform:translateX(4px)}

/* ── Responsive breakpoints ── */
@media (max-width:900px){
  .pa-authorbox{grid-template-columns:180px 1fr;gap:28px;padding:28px 26px}
  .pa-ab-avatar-ring{width:150px;height:150px;padding:10px}
  .pa-ab-verify{width:34px;height:34px;right:6px;bottom:10px}
  .pa-ab-name{font-size:36px}
}
@media (max-width:640px){
  .pa-authorbox{grid-template-columns:1fr;gap:24px;padding:26px 20px}
  .pa-ab-left{align-items:flex-start}
  .pa-ab-avatar-ring{width:140px;height:140px}
  .pa-ab-fallback{font-size:48px}
  .pa-ab-stats{max-width:280px}
  .pa-ab-name{font-size:32px}
  .pa-ab-bio{font-size:14.5px}
  .pa-ab-header{flex-direction:column;align-items:flex-start;gap:12px}
  .pa-ab-socials{justify-content:flex-start}
  .pa-ab-cta{width:100%;justify-content:center}
}

/* ── Dark mode ── */
body.theme-dark .pa-authorbox{
  --pab-ink:#F3F4F7;--pab-txt:#C7CBD3;--pab-mut:#8A8F9A;--pab-line:#242833;
  background:#1A1D24;border-color:#2F3543;
  box-shadow:0 1px 3px rgba(0,0,0,.4),0 24px 60px rgba(15,23,42,.35);
}
body.theme-dark .pa-ab-avatar-ring{background:radial-gradient(circle at 50% 50%,rgba(54,128,237,.22) 0%,rgba(54,128,237,.10) 60%,rgba(54,128,237,.04) 100%);box-shadow:0 0 0 1px rgba(54,128,237,.14),0 20px 45px rgba(54,128,237,.16)}
body.theme-dark .pa-ab-stat-ic{background:rgba(54,128,237,.18)}
body.theme-dark .pa-ab-socials > a,
body.theme-dark .pa-ab-socials > .pa-ab-copy{background:#141416;border-color:#2F3543;color:#F3F4F7}
body.theme-dark .pa-ab-socials > a:hover,
body.theme-dark .pa-ab-socials > .pa-ab-copy:hover{background:rgba(54,128,237,.14);border-color:rgba(54,128,237,.42);color:#fff}
body.theme-dark .pa-ab-expertise-panel{background:rgba(54,128,237,.10);border-color:rgba(54,128,237,.22)}
body.theme-dark .pa-ab-chip{background:#141416;color:#F3F4F7}
body.theme-dark .pa-ab-chip-ic{background:rgba(54,128,237,.18)}
body.theme-dark .pa-ab-chip:hover{border-color:rgba(54,128,237,.42)}

/* Article history */
.pa-history { display: flex; flex-wrap: wrap; gap: 1.5rem 2.4rem; }
.pa-history__item { display: flex; flex-direction: column; gap: 2px; }
.pa-history__k { font-size: .68rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--pa-ink-3); }
.pa-history__v { font-size: .95rem; font-weight: 400; color: var(--pa-ink); display:inline-flex; align-items:center; gap:7px; }
.pa-history__v i { color: var(--pa-accent); }

/* CTA */
.pa-cta {
  text-align: center; color: #fff;
  background:
    radial-gradient(1200px 200px at 50% -40%, rgba(255,255,255,.18), transparent),
    linear-gradient(135deg, var(--pa-accent), var(--pa-accent-strong));
  border: 0;
}
.pa-cta h3 { color:#fff; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); font-weight: 850; margin: 0 0 .5rem; }
.pa-cta p  { color: rgba(255,255,255,.85); margin: 0 auto 1.3rem; max-inline-size: 52ch; }
.pa-cta__row { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.pa-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .72rem 1.4rem; border-radius: 11px;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.pa-btn:hover { transform: translateY(-2px); }
.pa-btn--light { background:#fff; color: var(--pa-accent-strong); box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.pa-btn--ghost { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.4); }
.pa-btn--accent{ background: var(--pa-accent); color:#fff; }
.pa-btn--outline{ background: var(--pa-surface); color: var(--pa-ink); border-color: var(--pa-border-2); }

/* Community */
.pa-section-title { display:flex; align-items:center; gap:.6rem; font-size:1.15rem; font-weight:800; margin:0 0 1.1rem; color: var(--pa-ink); }
.pa-section-title i { color: var(--pa-accent); }
.pa-community__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
.pa-social-card {
  display:flex; align-items:center; gap: .7rem;
  padding: .85rem 1rem; border-radius: 12px;
  border:1px solid var(--pa-border); background: var(--pa-surface-2);
  text-decoration: none; color: var(--pa-ink); font-weight: 700; font-size:.9rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pa-social-card:hover { transform: translateY(-2px); box-shadow: var(--pa-shadow-sm); }
.pa-social-card i { inline-size: 36px; block-size: 36px; display:grid; place-items:center; border-radius:10px; color:#fff; font-size:1rem; flex-shrink:0; }
.pa-social-card .pa-i-facebook{background:#1877f2}.pa-social-card .pa-i-twitter{background:#000}
.pa-social-card .pa-i-linkedin{background:#0a66c2}.pa-social-card .pa-i-youtube{background:#ff0000}
.pa-social-card .pa-i-telegram{background:#229ed9}.pa-social-card .pa-i-instagram{background:#e1306c}
.pa-social-card .pa-i-github{background:#24292e}.pa-social-card .pa-i-default{background:var(--pa-accent)}

/* Newsletter */
.pa-news__form { display: flex; gap: .6rem; flex-wrap: wrap; margin-block-start: 1rem; }
.pa-news__input {
  flex: 1 1 240px; min-inline-size: 0;
  padding: .8rem 1rem; border-radius: 11px;
  border: 1px solid var(--pa-border-2); background: var(--pa-surface);
  color: var(--pa-ink); font-size: .95rem;
}
.pa-news__input:focus { outline: none; border-color: var(--pa-accent); box-shadow: var(--pa-ring); }
.pa-news__note { font-size:.78rem; color: var(--pa-ink-3); margin-block-start:.6rem; }
.pa-news__msg { font-size:.92rem; font-weight:600; margin-block-start:.7rem; }
.pa-news__msg.is-ok { color:#0CA678; }
.pa-news__msg.is-error { color:#E03131; }
.pa-news__form .pa-btn--accent.is-loading { opacity:.7; pointer-events:none; }
/* Success message */
.pa-news__success {
  display: none;
  align-items: center; gap: .7rem;
  padding: .9rem 1.1rem; margin-block-start: 1rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--pa-success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pa-success) 30%, transparent);
  color: var(--pa-ink);
}
.pa-news__success i { color: var(--pa-success); font-size: 1.2rem; flex-shrink: 0; }
.pa-news__success strong { display: block; margin-block-end: .15rem; }
.pa-news__success span { font-size: .87rem; color: var(--pa-ink-2); }
.pa-news--done .pa-news__form,
.pa-news--done .pa-news__note { display: none; }
.pa-news--done .pa-news__success { display: flex; }

/* Buy me a coffee */
.pa-coffee { display:flex; align-items:center; gap:1.1rem; flex-wrap: wrap; }
.pa-coffee__icon { inline-size:54px; block-size:54px; display:grid; place-items:center; border-radius:14px; font-size:1.5rem; color:#5b3a17; background:#ffdd00; flex-shrink:0; }
.pa-coffee__txt { flex:1 1 220px; }
.pa-coffee__txt strong { display:block; font-size:1.05rem; }
.pa-coffee__txt span { font-size:.88rem; color: var(--pa-ink-2); }
.pa-btn--coffee { background:#ffdd00; color:#3b2f0b; }

/* Push notifications */
.pa-push { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.pa-push__icon { inline-size:50px; block-size:50px; display:grid; place-items:center; border-radius:14px; font-size:1.3rem; color: var(--pa-accent); background: var(--pa-accent-soft); flex-shrink:0; }
.pa-push__txt { flex:1 1 200px; }
.pa-push__txt strong { display:block; font-size:1.02rem; }
.pa-push__txt span { font-size:.86rem; color: var(--pa-ink-2); }

/* Related grid */
.pa-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.pa-related-grid a { margin: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
.pa-related-grid .pa-rel-eyebrow { font-size:.66rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color: var(--pa-accent); }
.pa-related-grid .pa-rel-title { font-weight:700; font-size:.98rem; line-height:1.35; }

/* ----------------------------------------------------------------------------
   19. FAQ ACCORDION  (built from .faq-accordion markup or auto-detected FAQ)
---------------------------------------------------------------------------- */
.pa-faq { margin: 2rem 0; display: grid; gap: .75rem; }
.pa-faq__item {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius-sm);
  background: var(--pa-surface);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.pa-faq__item.is-open { border-color: color-mix(in srgb, var(--pa-accent) 40%, var(--pa-border)); box-shadow: var(--pa-shadow-sm); }
.pa-faq__q {
  inline-size: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem;
  background: none; border: 0; cursor: pointer; text-align: start;
  font-size: 1.04rem; font-weight: 750; color: var(--pa-ink);
  font-family: inherit;
}
.pa-faq__q:hover { color: var(--pa-accent); }
.pa-faq__icon {
  flex-shrink: 0; inline-size: 28px; block-size: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--pa-accent-soft); color: var(--pa-accent);
  transition: transform .25s ease, background .2s ease;
}
.pa-faq__item.is-open .pa-faq__icon { transform: rotate(45deg); background: var(--pa-accent); color:#fff; }
.pa-faq__a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.pa-faq__item.is-open .pa-faq__a { grid-template-rows: 1fr; }
.pa-faq__a-inner { overflow: hidden; }
.pa-faq__a-inner > div { padding: 0 1.25rem 1.2rem; color: var(--pa-ink-2); line-height: 1.7; }
.pa-faq__a-inner :last-child { margin-block-end: 0; }

/* ----------------------------------------------------------------------------
   20. TOASTS  (copy-link confirmation)
---------------------------------------------------------------------------- */
.pa-toast {
  position: fixed; inset-block-end: 24px; inset-inline-start: 50%;
  transform: translate(-50%, 16px);
  background: var(--pa-ink); color: #fff;
  padding: .7rem 1.2rem; border-radius: 999px;
  font-size: .88rem; font-weight: 600;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; z-index: 1100;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  display: inline-flex; align-items: center; gap: .5rem;
}
.pa-toast i { color: #0CA678; }
.pa-toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ----------------------------------------------------------------------------
   21. ACCESSIBILITY + MOTION + RESPONSIVE
---------------------------------------------------------------------------- */
.pa-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.premium-article-shell :focus-visible,
.pa-share-rail :focus-visible,
.pa-modules :focus-visible {
  outline: none;
  box-shadow: var(--pa-ring);
  border-radius: 8px;
}
.pa-faq__q:focus-visible { box-shadow: inset var(--pa-ring); }

@media (prefers-reduced-motion: reduce) {
  .premium-article-shell *,
  .pa-share-rail *,
  .pa-lightbox *,
  .pa-modules * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Upgrade the site's existing card-header H1 into a hero title (single H1) */
#content-box > .card > .card-header .card-title,
#tool-box .card > .card-header .card-title {
  font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.65rem) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
  line-height: 1.18 !important;
}

/* Tablet & mobile content padding rhythm */
@media (max-width: 575.98px) {
  .premium-article { font-size: 1.02rem; }
  .pa-hero { gap: 12px 14px; }
  .pa-hero__share { margin-inline-start: 0; }
  .premium-article blockquote { padding-inline: 2.9rem 1.1rem; }
}

/* Print */
@media print {
  .pa-progress, .pa-share-rail, .pa-toc, .pa-modules, .pa-lightbox, .pa-toast { display: none !important; }
  .premium-article a { background: none; color: #000; }
  .pa-layout[data-pa-has-toc] { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------------
   DARK MODE — component-level overrides (theme-toggle correctness sweep)
   Uses design.md §2.2 canonical dark tokens.
---------------------------------------------------------------------------- */
/* Author avatar image fallback bg — replaces #FFF3F3 pink behind transparent PNGs */
body.theme-dark .premium-article-shell .pa-ab-avatar-ring img{background:#141416}
/* Stat card icon hover — replaces #FFDCDC pink hover chip */
body.theme-dark .premium-article-shell .pa-ab-stat:hover .pa-ab-stat-ic{background:rgba(54,128,237,.28)}
/* Copy button "link copied" success state — replaces #EAFBF3/#0ca678 light-green chip */
body.theme-dark .premium-article-shell .pa-ab-socials > .pa-ab-copy.is-copied{background:rgba(12,166,120,.18);border-color:rgba(12,166,120,.45);color:#22c88a}
/* Expertise chip hover — dark-mode shadow (light shadow rgba(54,128,237,.14) invisible on dark) */
body.theme-dark .premium-article-shell .pa-ab-chip:hover{border-color:rgba(96,164,245,.42);box-shadow:0 8px 18px rgba(0,0,0,.45)}
/* Newsletter error message — brighter tone for dark surface */
body.theme-dark .premium-article-shell .pa-news__msg.is-error{color:#f26b6b}
/* Sticky share rail generic hover — accent background so white icon has a coloured chip */
body.theme-dark .premium-article-shell .pa-share-rail a:hover,
body.theme-dark .premium-article-shell .pa-share-rail button:hover{background:var(--pa-accent) !important;border-color:var(--pa-accent) !important}

/* -----------------------------------------------------------------------------
   Additional dark-mode fixes — theme-toggle correctness pass
   All selectors namespaced under .premium-article-shell / .premium-article.
   Design.md §2.2 canonical dark tokens: #17171A card, #0F0F11 bg, #1C1C1F surface-3,
   #F5F5F6 ink, rgba(255,255,255,.09) line, brand #60A4F5 hero-hover.
----------------------------------------------------------------------------- */

/* Copy-link / share confirmation toast — base sets bg:var(--pa-ink) which remaps
   to near-white #e7edf5 in dark, plus color:#fff → invisible white-on-white toast.
   Force a proper dark surface with light ink so users see the confirmation. */
body.theme-dark .premium-article-shell .pa-toast{
  background:#1C1C1F; color:#F5F5F6;
  box-shadow:0 12px 30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.09);
}
body.theme-dark .premium-article-shell .pa-toast i{color:#22c88a}

/* Sticky share rail container — align to the outer canonical dark card surface
   so it doesn't float as a mismatched slate pill over the page background. */
body.theme-dark .premium-article-shell .pa-share-rail{
  background:#17171A;
  border-color:rgba(255,255,255,.09);
  box-shadow:0 8px 24px rgba(0,0,0,.5);
}

/* Light pill button on the accent-gradient CTA banner — swap pure-white pill
   for near-white ink and soften the accent text to a mid-blue that reads
   correctly on the gradient without harsh contrast. */
body.theme-dark .premium-article-shell .pa-btn--light{
  background:#F5F5F6; color:#2060C0;
}

/* Newsletter success message — bump #0CA678 base to brighter tone on dark bg. */
body.theme-dark .premium-article-shell .pa-news__msg.is-ok{color:#22c88a}

/* ::selection — design.md §2.2 mandate for dark surfaces */
body.theme-dark .premium-article-shell ::selection{
  background:rgba(54,128,237,.35); color:#F5F5F6;
}

/* Styled scrollbars inside the article shell — replace browser gray with
   design.md §2.2 tokens (thumb rgba(255,255,255,.14) / track rgba(255,255,255,.04)) */
body.theme-dark .premium-article-shell *::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.14);
}
body.theme-dark .premium-article-shell *::-webkit-scrollbar-track{
  background:rgba(255,255,255,.04);
}
body.theme-dark .premium-article-shell *{
  scrollbar-color: rgba(255,255,255,.14) rgba(255,255,255,.04);
}

/* Reading-progress top bar track — give the unfilled portion a visible tint
   so users can gauge remaining vs. filled on long dark pages. */
body.theme-dark .premium-article-shell .pa-progress,
body.theme-dark .pa-progress{
  background:rgba(255,255,255,.06);
}

/* H2 signature accent rule — the transparent fade blends into --pa-surface on
   dark. Repaint with brighter dark-mode hero blue and a firmer alpha tail. */
body.theme-dark .premium-article h2::after{
  background:linear-gradient(90deg, #60A4F5, rgba(96,164,245,.4));
}