/* =============================================================================
   article_v2.css  —  OpenAccessPub Article Page Visual Modernization
   2026 Frontiers / MDPI scholarly standard
   -----------------------------------------------------------------------------
   STAGING ONLY. Loaded ONLY on the redesigned preview page whose <body>/main
   wrapper carries class "article-v2".

   SCOPING RULE: EVERY selector is namespaced under `.article-v2` so nothing
   can leak onto legacy article pages or any other route. Do not remove the
   `.article-v2` prefix from any rule.

   STACK: Bootstrap 5 is already loaded. This sheet COMPLEMENTS Bootstrap —
   it does not redefine the grid, utilities, or component internals. Where it
   touches Bootstrap components (.card, .table, .nav-pills, .breadcrumb) it
   only adds visual polish under the .article-v2 scope.

   PALETTE: CSS custom properties below. OAP blue accent = #007BFF.
   FONTS: system font stack only — NO @import of remote fonts.

   TABLE OF CONTENTS
     0.  Design tokens (CSS variables) + base resets
     3.4 Typography (base 17–18px, line-height ~1.6, H1/H2/H3)
     3.5 Reading-progress bar (thin, top)
     3.3 Breadcrumb + back-to-top
     3.1 Two-pane sticky layout (TOC | main | tools rail)
     3.2 Scrollspy active-TOC highlight
     2.1 Trust-badge chips strip
     2.2 Article-info card
     2.3 Publication-timeline card (Received → Accepted → Published)
     2.5 Statement cards (Funding / COI / Data / Ethics / Acknowledgements)
     1.7 Table polish (zebra, sticky header, responsive scroll)
     4.6 Figure lightbox affordances
     4.4 Metrics stat card
     4.5 Quiet journal CTA card
     5.1 Mobile-first (single column, TOC drawer, sticky bottom action bar)
     5.2 WCAG AA (focus rings, contrast, reduced-motion, print)
   ========================================================================== */


/* =============================================================================
   0.  DESIGN TOKENS  (scoped to .article-v2 so they cannot affect :root global)
   ========================================================================== */
.article-v2 {
  /* --- Brand / accent --- */
  --av-accent:            #007BFF;   /* OAP blue */
  --av-accent-rgb:        0, 123, 255;
  --av-accent-hover:      #0062cc;   /* darker — passes 4.5:1 on white */
  --av-accent-soft:       #e7f1ff;   /* tints, chip/timeline backgrounds */
  --av-accent-soft-2:     #cfe2ff;

  /* --- Neutrals / ink --- */
  --av-ink:               #16202c;   /* body text  ~ 15:1 on white */
  --av-ink-soft:          #41505f;   /* secondary text ~ 8:1 */
  --av-ink-muted:         #5d6b78;   /* captions/meta — still >= 4.5:1 */
  --av-bg:                #ffffff;
  --av-bg-subtle:         #f6f8fa;   /* card/section wash */
  --av-bg-sunken:         #eef1f4;   /* zebra / sunken wells */
  --av-border:            #dde3ea;
  --av-border-strong:     #c4ccd6;

  /* --- Semantic statement-card accents (all AA on their soft bg) --- */
  --av-fund:              #2e7d32;   /* funding — green */
  --av-fund-soft:         #e8f5e9;
  --av-coi:               #b26a00;   /* competing interests — amber */
  --av-coi-soft:          #fff4e2;
  --av-data:              #006d8f;   /* data availability — teal */
  --av-data-soft:         #e2f3f8;
  --av-ethics:            #6a3fb5;   /* ethics — violet */
  --av-ethics-soft:       #efe9fb;
  --av-ack:               #5d6b78;   /* acknowledgements — slate */
  --av-ack-soft:          #eef1f4;

  /* --- Timeline states --- */
  --av-tl-received:       #6c757d;
  --av-tl-accepted:       #007BFF;
  --av-tl-published:      #2e7d32;

  /* --- Typography scale --- */
  --av-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
                  Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
                  "Segoe UI Emoji";
  --av-font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --av-fs-base:    1.0625rem;        /* 17px */
  --av-lh-base:    1.62;
  --av-measure:    720px;            /* readable main-column max-width (3.1) */

  /* --- Spacing / radius / shadow --- */
  --av-radius:      12px;
  --av-radius-sm:   8px;
  --av-radius-pill: 999px;
  --av-shadow-sm:   0 1px 2px rgba(16, 32, 44, .06),
                    0 1px 3px rgba(16, 32, 44, .08);
  --av-shadow-md:   0 4px 14px rgba(16, 32, 44, .10);
  --av-shadow-lg:   0 12px 40px rgba(16, 32, 44, .22);

  /* --- Sticky offsets (keep anchored jumps clear of the sticky header) --- */
  --av-header-h:        64px;        /* assumed site header height */
  --av-progress-h:      3px;         /* reading-progress bar (3.5) */
  --av-scroll-offset:   100px;       /* matches legacy inline scroll-margin-top */

  color: var(--av-ink);
  background-color: var(--av-bg);
  font-family: var(--av-font-sans);
  font-size: var(--av-fs-base);
  line-height: var(--av-lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Inherit the base size without forcing it onto Bootstrap component internals */
.article-v2 *,
.article-v2 *::before,
.article-v2 *::after {
  box-sizing: border-box;
}

/* CRITICAL: preserve the legacy anchor-offset behaviour (scroll-margin-top:100px
   was inline on every panel). Apply it to all preserved fragment targets so
   deep-links to #idm…, #ridm…, #v-pills-*, #references, #cited-by, #citation_,
   #article, #tables-and-figures don't hide beneath the sticky header. */
.article-v2 [id] {
  scroll-margin-top: var(--av-scroll-offset);
}
.article-v2 .tab-pane,
.article-v2 [id^="idm"],
.article-v2 [id^="ridm"],
.article-v2 [id^="v-pills-"],
.article-v2 #references,
.article-v2 #cited-by,
.article-v2 #citation_,
.article-v2 #article,
.article-v2 #tables-and-figures {
  scroll-margin-top: var(--av-scroll-offset);
}


/* =============================================================================
   3.4  TYPOGRAPHY  —  base 17–18px, line-height ~1.6, distinct H1/H2/H3
   ========================================================================== */
.article-v2 .av-main,
.article-v2 .article,
.article-v2 .tab-content {
  font-size: var(--av-fs-base);
  line-height: var(--av-lh-base);
  color: var(--av-ink);
}

.article-v2 .av-main p,
.article-v2 .article p {
  margin: 0 0 1.15em;
  /* readable measure — paragraphs never exceed the column, hyphenate gracefully */
  overflow-wrap: break-word;
}

/* Headings: clear, distinct hierarchy. Serif H1 lends scholarly authority. */
.article-v2 h1,
.article-v2 .av-title {
  font-family: var(--av-font-serif);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.4rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--av-ink);
  margin: 0 0 .5em;
}

.article-v2 h2,
.article-v2 .av-main h2 {
  font-size: 1.55rem;
  line-height: 1.28;
  font-weight: 700;
  color: var(--av-ink);
  margin: 2.2rem 0 .75rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--av-border);
}

.article-v2 h3,
.article-v2 .av-main h3 {
  font-size: 1.22rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--av-ink-soft);
  margin: 1.75rem 0 .5rem;
}

.article-v2 h4,
.article-v2 .av-main h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--av-ink-soft);
  margin: 1.4rem 0 .4rem;
  text-transform: none;
}

/* Links inside readable content */
.article-v2 .av-main a,
.article-v2 .article a {
  color: var(--av-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.article-v2 .av-main a:hover,
.article-v2 .article a:hover {
  color: var(--av-accent);
  text-decoration-thickness: 2px;
}

/* Inline citation cross-links [1]…[12] — keep them obvious but unobtrusive */
.article-v2 a[href^="#ridm"] {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Lists, blockquotes, figures, small print */
.article-v2 .av-main ul,
.article-v2 .av-main ol {
  margin: 0 0 1.15em;
  padding-left: 1.4em;
}
.article-v2 .av-main li { margin-bottom: .35em; }

.article-v2 blockquote {
  margin: 1.4em 0;
  padding: .25em 0 .25em 1.1em;
  border-left: 3px solid var(--av-accent-soft-2);
  color: var(--av-ink-soft);
  font-style: italic;
}

.article-v2 figcaption,
.article-v2 .figure-caption,
.article-v2 small,
.article-v2 .article_text_small {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--av-ink-muted);
}


/* =============================================================================
   3.5  READING-PROGRESS BAR  —  thin, fixed at very top
   -----------------------------------------------------------------------------
   Markup (suggested):
     <div class="av-progress" role="progressbar" aria-hidden="true">
       <div class="av-progress__fill" style="width:0%"></div>
     </div>
   JS sets the inline width of __fill from scroll position.
   ========================================================================== */
.article-v2 .av-progress {
  position: fixed;
  inset: 0 0 auto 0;             /* top:0; left/right:0 */
  height: var(--av-progress-h);
  background: transparent;
  z-index: 1080;                 /* above sticky header, below modals */
  pointer-events: none;
}
.article-v2 .av-progress__fill {
  height: 100%;
  width: 100%;                   /* full-width; JS scales it via transform */
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--av-accent), #4aa3ff);
  /* animate transform (GPU-composited) not width, to avoid layout thrash.
     JS sets `transform: scaleX(<0..1>)` from scroll progress. */
  transition: transform .08s linear;
  will-change: transform;
}


/* =============================================================================
   3.3  BREADCRUMB  +  BACK-TO-TOP
   ========================================================================== */

/* --- Breadcrumb (complements Bootstrap .breadcrumb) --- */
.article-v2 .breadcrumb,
.article-v2 .av-breadcrumb {
  font-size: .8125rem;
  background: transparent;
  padding: .25rem 0;
  margin-bottom: 1rem;
  color: var(--av-ink-muted);
}
.article-v2 .breadcrumb a,
.article-v2 .av-breadcrumb a {
  color: var(--av-ink-soft);
  text-decoration: none;
}
.article-v2 .breadcrumb a:hover,
.article-v2 .av-breadcrumb a:hover {
  color: var(--av-accent-hover);
  text-decoration: underline;
}
.article-v2 .breadcrumb-item + .breadcrumb-item::before {
  color: var(--av-border-strong);
}

/* --- Back-to-top floating button --- */
.article-v2 .av-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;                   /* >= 44px touch target (5.2) */
  height: 44px;
  border: 1px solid var(--av-border);
  border-radius: 50%;
  background: var(--av-bg);
  color: var(--av-accent-hover);
  box-shadow: var(--av-shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.article-v2 .av-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.article-v2 .av-back-to-top:hover {
  background: var(--av-accent);
  color: #fff;
  border-color: var(--av-accent);
}
.article-v2 .av-back-to-top svg { width: 20px; height: 20px; }


/* =============================================================================
   3.1  TWO-PANE STICKY LAYOUT  —  sticky TOC | readable main | sticky tools
   -----------------------------------------------------------------------------
   Suggested wrapper:
     <div class="av-layout">
       <aside class="av-toc">…primary v-pills nav / sidebar TOC…</aside>
       <main  class="av-main">…readable article column (max ~720px)…</main>
       <aside class="av-tools">…export / pdf / xml / share rail…</aside>
     </div>
   Uses CSS grid so it composes with the Bootstrap container without fighting
   the .row/.col system. Mobile collapse handled in 5.1.
   ========================================================================== */
.article-v2 .av-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 260px);
  gap: clamp(1.5rem, 2vw, 2.5rem);
  align-items: start;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 2vw, 1.5rem);
}

/* Readable main column — capped measure, centered within its grid cell */
.article-v2 .av-main {
  min-width: 0;                  /* allow wide tables to scroll, not blow out grid */
  max-width: var(--av-measure);
  margin-inline: auto;
  width: 100%;
}

/* --- Sticky left TOC --- */
.article-v2 .av-toc {
  position: sticky;
  top: calc(var(--av-header-h) + var(--av-progress-h) + 12px);
  max-height: calc(100vh - var(--av-header-h) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .5rem;
  font-size: .875rem;
  scrollbar-width: thin;
}
.article-v2 .av-toc__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--av-ink-muted);
  margin: 0 0 .5rem;
}

/* TOC list — works with the existing #v-pills-tab nav or a plain <ul> */
.article-v2 .av-toc .nav,
.article-v2 .av-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--av-border);
}
.article-v2 .av-toc .nav-link,
.article-v2 .av-toc a {
  display: block;
  padding: .35rem .75rem;
  margin-left: -2px;             /* sit the active border over the rail */
  border-left: 2px solid transparent;
  color: var(--av-ink-soft);
  text-decoration: none;
  border-radius: 0 var(--av-radius-sm) var(--av-radius-sm) 0;
  line-height: 1.35;
  transition: color .15s ease, background-color .15s ease,
              border-color .15s ease;
}
.article-v2 .av-toc .nav-link:hover,
.article-v2 .av-toc a:hover {
  color: var(--av-accent-hover);
  background: var(--av-accent-soft);
}
/* nested sub-items (collapsible groups reuse #idm… fragments) */
.article-v2 .av-toc ul ul a,
.article-v2 .av-toc .nav .nav a {
  padding-left: 1.5rem;
  font-size: .825rem;
  color: var(--av-ink-muted);
}

/* --- Sticky right tools rail --- */
.article-v2 .av-tools {
  position: sticky;
  top: calc(var(--av-header-h) + var(--av-progress-h) + 12px);
  max-height: calc(100vh - var(--av-header-h) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.article-v2 .av-tools__group {
  background: var(--av-bg-subtle);
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  padding: .85rem;
}
.article-v2 .av-tools__group h4 {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--av-ink-muted);
  margin: 0 0 .6rem;
}
.article-v2 .av-tools a.av-tool {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .6rem;
  border-radius: var(--av-radius-sm);
  color: var(--av-ink);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
}
.article-v2 .av-tools a.av-tool:hover {
  background: var(--av-accent-soft);
  color: var(--av-accent-hover);
}
.article-v2 .av-tools a.av-tool svg {
  width: 18px; height: 18px; flex: none; color: var(--av-accent);
}


/* =============================================================================
   3.2  SCROLLSPY ACTIVE-TOC HIGHLIGHT
   -----------------------------------------------------------------------------
   Bootstrap scrollspy toggles `.active` on the matching .nav-link.
   We style both Bootstrap's class and a generic `.is-active` so either JS works.
   ========================================================================== */
.article-v2 .av-toc .nav-link.active,
.article-v2 .av-toc .nav-link.is-active,
.article-v2 .av-toc a.active,
.article-v2 .av-toc a.is-active {
  color: var(--av-accent-hover);
  font-weight: 600;
  background: var(--av-accent-soft);
  border-left-color: var(--av-accent);
}
.article-v2 .av-toc .nav-link.active:hover,
.article-v2 .av-toc a.active:hover {
  color: var(--av-accent);
}


/* =============================================================================
   2.1  TRUST-BADGE CHIPS STRIP
   -----------------------------------------------------------------------------
   Suggested markup:
     <ul class="av-trust-strip">
       <li class="av-chip"><svg…/> Open Access</li>
       <li class="av-chip av-chip--peer">Peer Reviewed</li>
       <li class="av-chip av-chip--cc">CC BY 4.0</li>
       <li class="av-chip">Crossref</li> …
     </ul>
   ========================================================================== */
.article-v2 .av-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.article-v2 .av-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--av-ink-soft);
  background: var(--av-bg-subtle);
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-pill);
  white-space: nowrap;
}
.article-v2 .av-chip svg {
  width: 14px; height: 14px; flex: none;
}
/* Emphasis variants */
.article-v2 .av-chip--oa,
.article-v2 .av-chip--peer {
  color: var(--av-accent-hover);
  background: var(--av-accent-soft);
  border-color: var(--av-accent-soft-2);
}
.article-v2 .av-chip--cc {
  color: var(--av-fund);
  background: var(--av-fund-soft);
  border-color: #c4e3c6;
}
.article-v2 .av-chip svg { color: currentColor; }


/* =============================================================================
   2.2  ARTICLE-INFO CARD
   -----------------------------------------------------------------------------
   Holds DOI, journal/issue/volume, article type, license, citation line.
   NOTE (defect 1.3): the legacy "Author Contributions" <h5> at article_v2.xsl
   line 242 actually wraps Received/Accepted/Published + editor + license. That
   is a content/label fix in the XSL, not CSS — these styles render whatever
   heading the corrected markup supplies. Use .av-info-card for the metadata
   block and the timeline card (2.3) for the dates.
   ========================================================================== */
.article-v2 .av-info-card,
.article-v2 .av-main .card {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-bg);
  box-shadow: var(--av-shadow-sm);
}
.article-v2 .av-info-card {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.article-v2 .av-info-card__grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .45rem 1rem;
  font-size: .9rem;
}
.article-v2 .av-info-card__label {
  color: var(--av-ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .04em;
  padding-top: .15em;
}
.article-v2 .av-info-card__value {
  color: var(--av-ink);
  word-break: break-word;
}
.article-v2 .av-info-card__value a {           /* DOI link */
  color: var(--av-accent-hover);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.article-v2 .av-info-card__value a:hover { text-decoration: underline; }

/* Tidy the Bootstrap card title inside the readable column */
.article-v2 .av-main .card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--av-ink);
  margin-bottom: .75rem;
}


/* =============================================================================
   2.3  PUBLICATION-TIMELINE CARD  —  Received → Accepted → Published
   -----------------------------------------------------------------------------
   Suggested markup:
     <ol class="av-timeline">
       <li class="av-timeline__step av-timeline__step--received">
         <span class="av-timeline__dot"></span>
         <span class="av-timeline__label">Received</span>
         <time class="av-timeline__date">12 Jan 2016</time>
       </li>
       …Accepted…  …Published…
     </ol>
   ========================================================================== */
.article-v2 .av-timeline-card {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-bg-subtle);
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
}
.article-v2 .av-timeline {
  list-style: none;
  margin: .25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}
/* connector line behind the dots */
.article-v2 .av-timeline::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--av-border-strong);
  z-index: 0;
}
.article-v2 .av-timeline__step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 .25rem;
}
.article-v2 .av-timeline__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--av-bg);
  border: 3px solid var(--av-tl-received);
  margin-bottom: .55rem;
}
.article-v2 .av-timeline__label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--av-ink-muted);
}
.article-v2 .av-timeline__date {
  font-size: .85rem;
  font-weight: 600;
  color: var(--av-ink);
  margin-top: .15rem;
}
/* per-step accent colours */
.article-v2 .av-timeline__step--received .av-timeline__dot { border-color: var(--av-tl-received); }
.article-v2 .av-timeline__step--accepted  .av-timeline__dot { border-color: var(--av-tl-accepted); }
.article-v2 .av-timeline__step--published .av-timeline__dot {
  border-color: var(--av-tl-published);
  background: var(--av-tl-published);
}
.article-v2 .av-timeline__step--published .av-timeline__label { color: var(--av-tl-published); }


/* =============================================================================
   2.5  STATEMENT CARDS
        Funding / Competing Interests / Data Availability / Ethics /
        Acknowledgements
   -----------------------------------------------------------------------------
   Suggested markup:
     <section class="av-statement av-statement--funding">
       <h3 class="av-statement__title"><svg…/> Funding</h3>
       <div class="av-statement__body">…</div>
     </section>
   A type modifier sets the left-accent + icon tint. Defaults are neutral.
   ========================================================================== */
.article-v2 .av-statement {
  position: relative;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  background: var(--av-bg-subtle);
  padding: .9rem 1.1rem;
  margin: 1rem 0;
  /* Type is conveyed by the title icon tint (below) and a quiet soft wash,
     not a heavy colored slab on one edge. --av-stmt defaults to neutral and
     each modifier overrides it. */
  --av-stmt: var(--av-ack);
}
.article-v2 .av-statement__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--av-ink);
  margin: 0 0 .55rem;
  /* subtle type cue: a short accent underline beneath the title only —
     not a full-height colored card edge. Driven by --av-stmt. */
  border: 0;
  padding: 0 0 .4rem;
  box-shadow: inset 0 -2px 0 -1px var(--av-stmt);
}
.article-v2 .av-statement__title svg { width: 18px; height: 18px; flex: none; }
.article-v2 .av-statement__body {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--av-ink-soft);
}
.article-v2 .av-statement__body p:last-child { margin-bottom: 0; }

/* Type modifiers — soft wash + icon tint only (no colored side slab) */
.article-v2 .av-statement--funding   { --av-stmt: var(--av-fund);   background: var(--av-fund-soft); }
.article-v2 .av-statement--funding   .av-statement__title svg { color: var(--av-fund); }
.article-v2 .av-statement--coi       { --av-stmt: var(--av-coi);    background: var(--av-coi-soft); }
.article-v2 .av-statement--coi       .av-statement__title svg { color: var(--av-coi); }
.article-v2 .av-statement--data      { --av-stmt: var(--av-data);   background: var(--av-data-soft); }
.article-v2 .av-statement--data      .av-statement__title svg { color: var(--av-data); }
.article-v2 .av-statement--ethics    { --av-stmt: var(--av-ethics); background: var(--av-ethics-soft); }
.article-v2 .av-statement--ethics    .av-statement__title svg { color: var(--av-ethics); }
.article-v2 .av-statement--ack       { --av-stmt: var(--av-ack);    background: var(--av-ack-soft); }
.article-v2 .av-statement--ack       .av-statement__title svg { color: var(--av-ack); }


/* =============================================================================
   1.7  TABLE POLISH  —  zebra rows, sticky header, responsive horizontal scroll
   -----------------------------------------------------------------------------
   Wrap each table:  <div class="av-table-wrap"><table class="table">…</table></div>
   The wrap provides the responsive scroll; the table styles add zebra + sticky
   header. Scoped so it does not override Bootstrap's .table elsewhere.
   ========================================================================== */
.article-v2 .av-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  margin: 1.25rem 0;
  /* subtle shadow hint that content scrolls horizontally */
  background:
    linear-gradient(90deg, var(--av-bg) 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat,
    linear-gradient(270deg, var(--av-bg) 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat,
    radial-gradient(farthest-side at 0 50%, rgba(16,32,44,.12), transparent) left / 12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(16,32,44,.12), transparent) right / 12px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.article-v2 .av-table-wrap table,
.article-v2 .av-main table.table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
  color: var(--av-ink);
}
.article-v2 .av-table-wrap th,
.article-v2 .av-main table.table th,
.article-v2 .av-table-wrap td,
.article-v2 .av-main table.table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--av-border);
  vertical-align: top;
  text-align: left;
}
/* Sticky header — stays put while the table body scrolls within the wrap */
.article-v2 .av-table-wrap thead th,
.article-v2 .av-main table.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--av-accent-soft);
  color: var(--av-ink);
  font-weight: 700;
  border-bottom: 2px solid var(--av-accent-soft-2);
  white-space: nowrap;
}
/* Zebra rows */
.article-v2 .av-table-wrap tbody tr:nth-child(odd) td,
.article-v2 .av-main table.table tbody tr:nth-child(odd) td {
  background: var(--av-bg-sunken);
}
.article-v2 .av-table-wrap tbody tr:hover td,
.article-v2 .av-main table.table tbody tr:hover td {
  background: var(--av-accent-soft);
}


/* =============================================================================
   4.6  FIGURE LIGHTBOX AFFORDANCES
   -----------------------------------------------------------------------------
   Suggested markup:
     <figure class="av-figure">
       <a class="av-figure__zoom" href="full.jpg" data-lightbox>
         <img src="thumb.jpg" alt="…">
         <span class="av-figure__cue" aria-hidden="true"><svg…/></span>
       </a>
       <figcaption class="figure-caption">Figure 1. …</figcaption>
     </figure>
   ========================================================================== */
.article-v2 .av-figure {
  margin: 1.5rem 0;
  text-align: center;
}
.article-v2 .av-figure__zoom {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--av-bg);
}
.article-v2 .av-figure__zoom img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform .3s ease;
}
.article-v2 .av-figure__zoom:hover img { transform: scale(1.02); }
/* magnifier cue badge */
.article-v2 .av-figure__cue {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 32, 44, .72);
  color: #fff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
.article-v2 .av-figure__zoom:hover .av-figure__cue,
.article-v2 .av-figure__zoom:focus-visible .av-figure__cue {
  opacity: 1;
  transform: translateY(0);
}
.article-v2 .av-figure__cue svg { width: 16px; height: 16px; }
.article-v2 .av-figure figcaption,
.article-v2 .av-figure .figure-caption {
  margin-top: .6rem;
  text-align: left;
}


/* =============================================================================
   4.4  METRICS STAT CARD  —  Views / Downloads / Citations
   ========================================================================== */
.article-v2 .av-metrics {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-bg);
  box-shadow: var(--av-shadow-sm);
  padding: 1rem 1.1rem;
}
.article-v2 .av-metrics__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--av-ink-muted);
  margin: 0 0 .75rem;
}
.article-v2 .av-metrics__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: .5rem;
}
.article-v2 .av-metric {
  text-align: center;
  padding: .5rem .25rem;
  border-radius: var(--av-radius-sm);
  background: var(--av-bg-subtle);
}
.article-v2 .av-metric__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--av-accent-hover);
  font-variant-numeric: tabular-nums;
}
.article-v2 .av-metric__label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--av-ink-muted);
  margin-top: .2rem;
}


/* =============================================================================
   4.5  QUIET JOURNAL CTA CARD  —  "Submit to this journal" (low-key)
   ========================================================================== */
.article-v2 .av-cta {
  border: 1px solid var(--av-accent-soft-2);
  border-radius: var(--av-radius);
  background: linear-gradient(180deg, var(--av-accent-soft), var(--av-bg));
  padding: 1.1rem 1.2rem;
  text-align: center;
}
.article-v2 .av-cta__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--av-ink);
  margin: 0 0 .35rem;
}
.article-v2 .av-cta__text {
  font-size: .85rem;
  color: var(--av-ink-soft);
  margin: 0 0 .85rem;
}
.article-v2 .av-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: var(--av-accent);
  border: 1px solid var(--av-accent);
  border-radius: var(--av-radius-pill);
  text-decoration: none;
  transition: background-color .15s ease;
}
.article-v2 .av-cta__btn:hover {
  background: var(--av-accent-hover);
  border-color: var(--av-accent-hover);
  color: #fff;
}


/* =============================================================================
   5.1  MOBILE-FIRST
        single column · collapsible TOC drawer · slim sticky bottom action bar
   -----------------------------------------------------------------------------
   The desktop layout above is the wide state. Below the lg breakpoint the
   three-pane grid collapses to one column, the TOC becomes an off-canvas
   drawer, and a slim sticky action bar appears at the bottom.
   ========================================================================== */

/* Drawer trigger + bottom bar are desktop-hidden by default */
.article-v2 .av-toc-toggle,
.article-v2 .av-bottombar,
.article-v2 .av-toc__backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  /* Collapse to a single readable column */
  .article-v2 .av-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 760px;
  }
  .article-v2 .av-main { max-width: 100%; }

  /* Tools rail moves inline, below content, not sticky */
  .article-v2 .av-tools {
    position: static;
    max-height: none;
    order: 3;
    flex-direction: column;
  }

  /* ---- TOC becomes an off-canvas drawer ---- */
  .article-v2 .av-toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--av-accent-hover);
    background: var(--av-accent-soft);
    border: 1px solid var(--av-accent-soft-2);
    border-radius: var(--av-radius-pill);
    cursor: pointer;
    margin-bottom: 1rem;
  }
  .article-v2 .av-toc {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    max-height: 100vh;
    z-index: 1055;
    background: var(--av-bg);
    border-right: 1px solid var(--av-border);
    box-shadow: var(--av-shadow-lg);
    padding: 1.25rem 1rem;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  /* open state — JS adds .is-open to .article-v2 (or to .av-toc) */
  .article-v2.av-toc-open .av-toc,
  .article-v2 .av-toc.is-open {
    transform: translateX(0);
  }
  .article-v2.av-toc-open .av-toc__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(16, 32, 44, .45);
  }

  /* ---- Slim sticky bottom action bar ---- */
  .article-v2 .av-bottombar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    background: var(--av-bg);
    border-top: 1px solid var(--av-border);
    box-shadow: 0 -2px 10px rgba(16, 32, 44, .08);
    padding: .4rem max(.5rem, env(safe-area-inset-left))
             calc(.4rem + env(safe-area-inset-bottom))
             max(.5rem, env(safe-area-inset-right));
  }
  .article-v2 .av-bottombar__btn {
    flex: 1 1 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;              /* comfortable touch target */
    padding: .25rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--av-ink-soft);
    background: transparent;
    border: 0;
    text-decoration: none;
    border-radius: var(--av-radius-sm);
  }
  .article-v2 .av-bottombar__btn svg { width: 20px; height: 20px; color: var(--av-accent); }
  .article-v2 .av-bottombar__btn:active { background: var(--av-accent-soft); }

  /* keep the floating back-to-top clear of the bottom bar */
  .article-v2 .av-back-to-top { bottom: calc(56px + 1rem); }

  /* slightly smaller headings on narrow screens */
  .article-v2 h2 { font-size: 1.35rem; }
  .article-v2 h3 { font-size: 1.12rem; }

  /* timeline stacks vertically when very narrow (see below) */
}

@media (max-width: 575.98px) {
  .article-v2 { --av-fs-base: 1.05rem; }   /* keep ~17px floor on phones */

  /* Vertical timeline on the smallest screens */
  .article-v2 .av-timeline {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .article-v2 .av-timeline::before {
    top: 8px;
    bottom: 8px;
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .article-v2 .av-timeline__step {
    flex-direction: row;
    align-items: center;
    gap: .65rem;
    text-align: left;
    padding-left: 0;
  }
  .article-v2 .av-timeline__dot { margin-bottom: 0; }

  .article-v2 .av-trust-strip { gap: .4rem; }
  .article-v2 .av-info-card__grid { grid-template-columns: 1fr; gap: .15rem .5rem; }
  .article-v2 .av-info-card__label { padding-top: .5em; }
}


/* =============================================================================
   5.2  WCAG AA  —  visible focus rings · contrast · reduced motion · print
   -----------------------------------------------------------------------------
   Body/secondary text tokens above are all chosen >= 4.5:1 on their bg.
   Here we guarantee keyboard visibility and motion/print safety.
   ========================================================================== */

/* Visible focus ring on every interactive element (keyboard users) */
.article-v2 a:focus-visible,
.article-v2 button:focus-visible,
.article-v2 [tabindex]:focus-visible,
.article-v2 .nav-link:focus-visible,
.article-v2 .av-tool:focus-visible,
.article-v2 .av-chip:focus-visible,
.article-v2 .av-figure__zoom:focus-visible,
.article-v2 .av-cta__btn:focus-visible,
.article-v2 .av-bottombar__btn:focus-visible,
.article-v2 .av-toc-toggle:focus-visible,
.article-v2 .av-back-to-top:focus-visible {
  outline: 3px solid var(--av-accent);
  outline-offset: 2px;
  border-radius: var(--av-radius-sm);
}
/* Fallback for browsers without :focus-visible */
.article-v2 a:focus,
.article-v2 button:focus { outline-color: var(--av-accent); }

/* Skip-link (suggested first child of .article-v2) */
.article-v2 .av-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1100;
  padding: .6rem 1rem;
  background: var(--av-bg);
  color: var(--av-accent-hover);
  border: 2px solid var(--av-accent);
  border-radius: var(--av-radius-sm);
  font-weight: 600;
}
.article-v2 .av-skip-link:focus {
  left: 1rem;
  top: calc(var(--av-progress-h) + .5rem);
}

/* Screen-reader-only utility (scoped) */
.article-v2 .av-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Honour reduced-motion: kill transforms/animations/smooth-scroll */
@media (prefers-reduced-motion: reduce) {
  .article-v2 * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .article-v2 .av-figure__zoom:hover img { transform: none; }
}

/* High-contrast / forced-colors: keep accents from disappearing */
@media (forced-colors: active) {
  .article-v2 .av-chip,
  .article-v2 .av-statement,
  .article-v2 .av-info-card,
  .article-v2 .av-table-wrap { border: 1px solid CanvasText; }
  .article-v2 .av-toc .nav-link.active,
  .article-v2 .av-toc a.active { border-left-color: Highlight; }
}

/* Print: drop chrome, expand content, show DOI/link URLs */
@media print {
  .article-v2 .av-progress,
  .article-v2 .av-back-to-top,
  .article-v2 .av-bottombar,
  .article-v2 .av-toc,
  .article-v2 .av-toc-toggle,
  .article-v2 .av-tools,
  .article-v2 .av-cta { display: none !important; }
  .article-v2 .av-layout { display: block; max-width: none; padding: 0; }
  .article-v2 .av-main { max-width: none; }
  .article-v2 .av-table-wrap { overflow: visible; box-shadow: none; }
  .article-v2 a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .8em;
    color: #444;
    word-break: break-all;
  }
}

/* ============================ end article_v2.css ========================== */
