/**
 * Article v2 - Styles
 * @description Full editorial article layout — hero, prose, sidebar, TOC,
 *              lightbox, related cards, mobile adaptations.
 * @version 1.0.0
 * @date 2026-02-17
 */

/* Article v2 — CSS Custom Properties */
:root {
  --article-progress-height: 3px;
}

/* ==========================================================================
   Base overrides for article page
   ========================================================================== */

.article-page {
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.article-page ::selection {
  background: var(--color-brand-accent);
  color: var(--color-bg);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--article-progress-height) + 24px);
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: var(--article-progress-height);
  background: linear-gradient(90deg, #c9a93c, var(--color-brand-accent), #f0d878);
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(232, 197, 71, 0.15);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

/* Visible breadcrumbs over the hero — scoped to article only (INK-DESIGN-ART27 P2-c).
   Does NOT touch the global breadcrumbs component (Q2: article-only). */
.article-hero-wrap {
  position: relative;
}

.article-hero-wrap .breadcrumbs--article {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  letter-spacing: normal;
  text-transform: none;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
  padding: var(--space-4) var(--gutter);
}

.article-hero-wrap .breadcrumbs--article .breadcrumbs__crumb,
.article-hero-wrap .breadcrumbs--article .breadcrumbs__current {
  color: rgba(255, 255, 255, 0.85);
}

.article-hero-wrap .breadcrumbs--article a.breadcrumbs__crumb:hover,
.article-hero-wrap .breadcrumbs--article a.breadcrumbs__crumb:focus-visible {
  color: var(--color-brand-accent);
}

.article-hero-wrap .breadcrumbs--article .breadcrumbs__sep {
  color: rgba(255, 255, 255, 0.55);
}

.article-hero {
  position: relative;
  width: 100%;
  height: var(--article-hero-height);
  min-height: var(--article-hero-min);
  max-height: var(--article-hero-max);
  overflow: hidden;
}

.article-hero .img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, -1%); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center 60%,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.15) 70%,
    transparent 100%
  );
}

/* Hero favorite (heart) button — top-right, mirrors master/studio pattern */
.article-heart-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 5;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}

.article-heart-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.7);
}

.article-heart-btn:focus-visible {
  outline: 2px solid var(--color-brand-accent);
  outline-offset: 2px;
}

.article-heart-btn svg {
  display: block;
  transition: transform var(--transition-fast);
}

.article-heart-btn.favorited {
  background: var(--color-brand-accent, #e8c547);
  border-color: var(--color-brand-accent, #e8c547);
  color: #1a1a1a;
}

.article-heart-btn.favorited svg {
  fill: currentColor;
}

@media (max-width: 768px) {
  .article-heart-btn {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
}

.hero-category {
  display: inline-block;
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-brand-accent);
  margin-bottom: 28px;
  padding: 6px 14px;
  border: 1px solid rgba(232, 197, 71, 0.3);
  border-radius: 2px;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.hero-category:hover {
  background: rgba(232, 197, 71, 0.1);
  color: var(--color-brand-accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 64px);
  letter-spacing: normal;
  font-weight: 400; /* DM Serif Display ships 400 only — no faux-bold (Q3, INK-DESIGN-ART27 P3-h) */
  line-height: 1.15;
  color: #fff;
  margin-bottom: 20px;
  max-width: 900px;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  /* Mono data strip (DESIGN.md §5, INK-DESIGN-ART27 P3-m) */
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  font-size: var(--text-2xs);
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.hero-meta .separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.hero-meta .reading-time {
  color: var(--color-brand-accent);
  font-weight: 500;
}

.hero-meta a {
  color: var(--color-text-secondary);
  text-decoration: none;
}
.hero-meta a:hover { color: var(--color-brand-accent); }

/* -- Scroll Indicator -- */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scroll-indicator span {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.scroll-indicator .chevron {
  width: 24px;
  height: 24px;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: 2px solid rgba(255, 255, 255, 0.4);
  transform: rotate(-45deg);
  animation: scrollFade 2s ease-in-out infinite;
}

/* Soft opacity fade — no transform overshoot (DESIGN.md §F.17, INK-DESIGN-ART27 P2-b) */
@keyframes scrollFade {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

/* ==========================================================================
   Article Layout (content + sidebar)
   ========================================================================== */

.article-layout {
  max-width: var(--article-layout-max);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr var(--article-sidebar-width);
  gap: var(--article-gap);
}

/* ==========================================================================
   Article Body — Prose Typography
   ========================================================================== */

.article-body {
  max-width: var(--article-body-width);
  min-width: 0;
}

.article-body p {
  margin-bottom: 1.5em;
  font-optical-sizing: auto;
}

.article-body .lead {
  font-size: 22px;
  line-height: 1.65;
  color: var(--color-text);
  /* Open extra room + gold rule under the lead so the standing
     paragraph reads as a deliberate masthead, not paragraph one. */
  margin-bottom: 2.4em;
  position: relative;
}

.article-body .lead::after {
  content: '';
  display: block;
  width: 64px;
  height: 2px;
  background: var(--color-brand-accent);
  border-radius: 1px;
  margin: 1.4em 0 0;
  opacity: 0.7;
}

/* Drop cap — applies regardless of a leading link (INK-DESIGN-ART27 P3-n) */
.article-body .lead::first-letter {
  float: left;
  font-family: var(--article-font-display);
  font-size: 4.2em;
  line-height: 0.8;
  font-weight: 400; /* DM Serif Display ships 400 only (Q3) */
  color: var(--color-brand-accent);
  margin: 6px 14px 0 -4px;
  text-shadow: 2px 2px 0 rgba(232, 197, 71, 0.15);
}

/* Headings */
.article-body h2 {
  font-family: var(--article-font-display);
  font-size: 32px;
  font-weight: 400; /* DM Serif Display ships 400 only (Q3, INK-DESIGN-ART27 P3-h) */
  line-height: 1.3;
  color: var(--color-text);
  margin: 2.5em 0 0.8em;
  padding-top: 1.2em;
  position: relative;
  border-top: none;
  scroll-margin-top: calc(var(--header-h) + var(--article-progress-height) + 24px);
}

.dark-theme .article-body h2 { color: #fff; }

.article-body h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--color-brand-accent);
  border-radius: 2px;
}

.article-body h2:first-of-type {
  padding-top: 0;
  margin-top: 1.5em;
}

.article-body h2:first-of-type::before {
  display: none;
}

.article-body h3 {
  font-family: var(--article-font-display);
  font-size: 24px;
  font-weight: 400; /* DM Serif Display ships 400 only (Q3, INK-DESIGN-ART27 P3-h) */
  line-height: 1.35;
  color: var(--color-text);
  margin: 2em 0 0.6em;
}

/* Blockquotes */
.article-body blockquote {
  position: relative;
  margin: 2.5em -32px;
  padding: 32px 40px;
  /* Editorial mark: 3px gold left rule, no top/bottom borders, no tint (DESIGN.md §5, INK-DESIGN-ART27 P3-l) */
  border-left: 3px solid var(--color-brand-accent);
  border-top: none;
  border-bottom: none;
  background: none;
  font-style: italic;
  font-size: 21px;
  line-height: 1.6;
  color: var(--color-text);
}

.article-body blockquote::before {
  content: '\201C';
  position: absolute;
  top: -4px;
  left: 24px;
  font-family: var(--article-font-display);
  font-size: 72px;
  color: var(--color-brand-accent);
  opacity: 0.25;
  line-height: 1;
}

.article-body blockquote p {
  margin-bottom: 0;
  position: relative;
}

.article-body blockquote cite {
  display: block;
  margin-top: 16px;
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: var(--color-brand-accent);
  letter-spacing: 0.5px;
}

/* Links in article */
.article-body a {
  color: var(--color-brand-accent);
  text-decoration: underline;
  text-decoration-color: rgba(232, 197, 71, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast);
}
.article-body a:hover {
  text-decoration-color: var(--color-brand-accent);
  color: var(--color-brand-accent);
}

/* Article images / figures */
.article-figure {
  margin: 2.5em -40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.article-figure img {
  width: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-figure:hover img {
  transform: scale(1.02);
}

.article-figure figcaption {
  font-family: var(--article-font-ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  padding: 12px 16px;
  background: var(--color-bg-card);
  border-left: 3px solid var(--color-brand-accent);
}

/* Legacy MODX image captions (TinyMCE editor) */
.article-body .imageHomecaption {
  font-family: var(--article-font-ui);
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: left;
  padding: 8px 0 8px 16px;
  margin-top: -0.5em;
  margin-bottom: 2em;
  border-left: 3px solid var(--color-brand-accent);
}

.article-figure .zoom-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.article-figure:hover .zoom-icon { opacity: 1; }

/* Image gallery — 4-up 2x2, square cells, total block ≤ 80vh.
   Editorial rule (2026-05-03): tattoo articles are visual-first; the
   gallery mirrors the 2x2 portfolio preview from the masters listing. */
.article-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  /* 2 square cells + gap stack to ≤ 80vh */
  max-width: calc(80vh - 8px);
  max-height: 80vh;
  margin: 2.5em auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-gallery .gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.article-gallery .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-gallery .gallery-item:hover img {
  transform: scale(1.05);
}

.article-gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-family: var(--article-font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Article body images (TinyMCE with hardcoded width/height attributes) */
.article-body img {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5em 0;
}

.article-body img.lazy {
  width: 100%;
  height: auto;
}

/* Horizontal rule */
.article-body hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.5em 0;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.article-sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: calc(var(--header-h) + var(--article-progress-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: calc(100vh - var(--header-h) - var(--article-progress-height) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-sticky::-webkit-scrollbar {
  display: none;
}

/* Prevent sidebar flex from collapsing children — they keep natural height, sidebar scrolls */
.sidebar-sticky > * {
  flex-shrink: 0;
}

/* TOC Card */
.toc-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.toc-title {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toc-title .toggle-icon {
  transition: transform var(--transition-fast);
  font-size: 10px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.toc-list.collapsed { display: none; }

.toc-list a {
  display: block;
  font-family: var(--article-font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.toc-list a.active {
  color: var(--color-brand-accent);
  border-left-color: var(--color-brand-accent);
  background: rgba(232, 197, 71, 0.08);
}

/* Master card (sidebar) */
.master-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.master-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-brand-accent), transparent);
}

.master-card-label {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  width: 100%;
  text-align: left;
}

.master-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-brand-accent);
  box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.15);
}

.master-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.master-card-name {
  font-family: var(--article-font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.master-card-handle {
  font-family: var(--article-font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
}

.master-card-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--article-font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.master-card-location svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.master-card-styles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* Mono data strip, not GitHub topic chips (INK-DESIGN-ART27 B5 sidebar de-github):
   no borders/backgrounds, JetBrains Mono caps, '·' separators, muted-secondary. */
.master-card-tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--color-text-secondary);
  border: none;
  white-space: nowrap;
}

.master-card-tag:not(:last-child)::after {
  content: '·';
  margin-left: 6px;
  color: var(--color-text-muted);
}

.master-card-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  /* Unified Primary button pattern (DESIGN.md, INK-DESIGN-ART27 P3-k) — matches .sidebar-cta-btn */
  background: var(--color-brand-accent);
  color: var(--color-gray-900, #1a1a1a);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.master-card-btn:hover {
  box-shadow: 0 4px 16px rgba(232, 197, 71, 0.4);
  transform: translateY(-1px);
}

/* Share card — compact icon row */
.share-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-card-label {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.share-row {
  display: flex;
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-family: var(--article-font-ui);
  font-size: 0;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

.share-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
  background: var(--color-surface);
}

/* ==========================================================================
   Sidebar CTA Card
   ========================================================================== */

.sidebar-cta {
  background: var(--color-bg-card);
  /* Full hairline border, no gold side-stripe — gold lives only in the button
     (INK-DESIGN-ART27 B5 sidebar de-github). */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
}

.sidebar-cta-eyebrow {
  font-family: var(--article-font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  /* Muted eyebrow scaffolding, not gold (INK-DESIGN-ART27 B5) — like .section-mast caption */
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.sidebar-cta-title {
  font-family: var(--article-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 8px;
}

.sidebar-cta-desc {
  font-family: var(--article-font-ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.sidebar-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--article-font-ui);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-brand-accent);
  color: var(--color-gray-900, #1a1a1a);
  text-decoration: none;
  transition: all var(--transition-normal, 0.2s ease);
  cursor: pointer;
  line-height: 1;
}

.sidebar-cta-btn:hover {
  box-shadow: 0 4px 16px rgba(232, 197, 71, 0.4);
  transform: translateY(-1px);
}

.sidebar-cta-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Sidebar Popular Articles
   ========================================================================== */

.popular-card-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-section-title {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.popular-card-section .popular-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Mobile TOC (collapsible, visible < 1024px)
   ========================================================================== */

.mobile-toc {
  display: none;
  max-width: var(--article-body-width);
  margin: 0 auto 24px;
  padding: 0 24px;
}

.mobile-toc-inner {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mobile-toc-toggle {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-toc-toggle .chevron {
  transition: transform var(--transition-fast);
  font-size: 12px;
  color: var(--color-text-muted);
}

.mobile-toc-toggle.open .chevron { transform: rotate(180deg); }

.mobile-toc-body {
  display: none;
  padding: 0 16px 16px;
}

.mobile-toc-body.open { display: block; }

.mobile-toc-body .toc-list a {
  padding: 8px 12px;
  font-size: 14px;
}

/* ==========================================================================
   Inline Newsletter CTA
   ========================================================================== */

.inline-cta {
  margin: 3em 0;
  padding: 32px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.inline-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232, 197, 71, 0.15), transparent 70%);
  pointer-events: none;
}

.inline-cta-label {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-brand-accent);
  margin-bottom: 8px;
  position: relative;
}

.inline-cta h3 {
  font-family: var(--article-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  position: relative;
}
.dark-theme .inline-cta h3 { color: #fff; }

.inline-cta p {
  font-family: var(--article-font-ui);
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  position: relative;
}

.cta-form {
  display: flex;
  gap: 8px;
  position: relative;
}

.cta-form input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.cta-form input:focus {
  border-color: var(--color-brand-accent);
}

.cta-form input::placeholder {
  color: var(--color-text-muted);
}

.cta-form button {
  padding: 12px 24px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  font-weight: 600;
  background: var(--color-brand-accent);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cta-form button:hover {
  background: #f0d878;
  transform: translateY(-1px);
}

/* ==========================================================================
   Inline CTA — renderer-injected mid-article prompt (Bug 6 fix)
   ========================================================================== */

.article-inline-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2.5em 0;
  padding: 20px 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-brand-accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.inline-cta-icon {
  flex-shrink: 0;
  color: var(--color-brand-accent);
  opacity: 0.8;
}

.inline-cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.inline-cta-text strong {
  font-family: var(--article-font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
.dark-theme .inline-cta-text strong { color: #fff; }

.inline-cta-text span {
  font-family: var(--article-font-ui);
  font-size: 13px;
  color: var(--color-text-muted);
}

.inline-cta-btn {
  flex-shrink: 0;
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  background: var(--color-brand-accent);
  color: var(--color-bg) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.inline-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .article-inline-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .inline-cta-btn { width: 100%; text-align: center; }
}

/* ==========================================================================
   Author Card (after article body)
   ========================================================================== */

.author-card-section {
  max-width: var(--article-layout-max);
  margin: 0 auto;
  padding: 0 24px;
}

.author-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info h4 {
  font-family: var(--article-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.dark-theme .author-info h4 { color: #fff; }

.author-info .author-role {
  font-family: var(--article-font-ui);
  font-size: 13px;
  color: var(--color-brand-accent);
  margin-bottom: 8px;
}

.author-info .author-bio {
  font-family: var(--article-font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.author-social {
  display: flex;
  gap: 12px;
}

.author-social a {
  font-family: var(--article-font-ui);
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
}
.author-social a:hover { color: var(--color-brand-accent); }

/* ==========================================================================
   Article Tags
   ========================================================================== */

.article-tags {
  max-width: var(--article-layout-max);
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-tags-title {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  width: 100%;
  margin-bottom: 4px;
}

.article-tag {
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.article-tag:hover {
  color: var(--color-brand-accent);
  border-color: rgba(232, 197, 71, 0.3);
  background: rgba(232, 197, 71, 0.08);
}

/* ==========================================================================
   Related Articles
   ========================================================================== */

.related-section {
  max-width: var(--container-max);
  margin: 0 auto 64px;
  padding: 0 24px;
}

.related-section h2 {
  font-family: var(--article-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 32px;
}
.dark-theme .related-section h2 { color: #fff; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  transform: scale(0.95);
  transition: transform 0.5s var(--ease-standard);
}

.lightbox.open img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--article-font-ui);
  font-size: 14px;
  color: #a3a3a3;
  text-align: center;
  max-width: 600px;
}

/* ==========================================================================
   Mobile Share Bar
   ========================================================================== */

.mobile-share-bar {
  display: none;
  position: fixed;
  /* Stack ABOVE the global tab-bar (.bottom-nav = 56px) — both visible (Q4, INK-DESIGN-ART27 P3-g) */
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  z-index: 89; /* below the tab-bar (z-index 90) so it never occludes it */
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  padding: 10px 24px;
}

.mobile-share-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 400px;
  margin: 0 auto;
}

.mobile-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  font-family: var(--article-font-ui);
  font-size: 10px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-share-btn svg { width: 20px; height: 20px; }
.mobile-share-btn:hover { color: var(--color-brand-accent); }

/* ==========================================================================
   Animations
   ========================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive — Tablet (< 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    max-width: var(--article-body-width);
  }

  .article-sidebar { display: none; }
  .mobile-toc { display: block; }
  .mobile-share-bar { display: block; }

  /* Clear BOTH stacked bars: share (~64px) + tab-bar (56px) (Q4, INK-DESIGN-ART27 P3-g/o) */
  .article-page { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   Responsive — Mobile (< 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .article-hero {
    height: 70vh;
    min-height: 380px;
  }

  .hero-content {
    padding: 16px;
  }

  .hero-category {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: clamp(24px, 7vw, 36px);
    margin-bottom: 14px;
  }

  .hero-meta {
    gap: 10px;
    font-size: 12px;
  }

  .scroll-indicator { bottom: 16px; }

  .scroll-indicator span { font-size: 10px; }

  .scroll-indicator .chevron {
    width: 18px;
    height: 18px;
  }

  .article-body blockquote {
    margin: 2em 0;
    padding: 24px;
  }

  .article-figure {
    margin: 2em -24px;
    border-radius: 0;
  }

  .article-gallery {
    margin: 2em auto;
 /* Stay centered + 2x2 even on mobile rule (2026-05-03) */
    max-width: min(calc(80vh - 8px), 100%);
    border-radius: var(--radius-md);
  }

  .article-layout {
    padding: 32px 16px;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

 /* §3.11 mobile body legibility ( consistency rebase 2026-05-12)
     SPEC: body prose ≥16px on mobile, constrained measure ≤65ch.
     Fixes Pattern E long-form reading fail at 375px. */
  .article-page {
    font-size: 16px;
    line-height: 1.7;
  }

  .article-body {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
  }

  .article-body p {
    font-size: 16px;
    line-height: 1.7;
  }

  .article-body .lead {
    font-size: 18px;
    line-height: 1.6;
  }

  .article-body h2 {
    font-size: 24px;
    line-height: 1.3;
  }

  .article-body h3 {
    font-size: 20px;
    line-height: 1.35;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Responsive — Small Mobile (< 520px)
   ========================================================================== */

@media (max-width: 520px) {
  .cta-form { flex-direction: column; }

  .author-card-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-social { justify-content: center; }

  .hero-title {
    font-size: clamp(20px, 6vw, 30px);
  }

  .article-hero {
    height: 60vh;
    min-height: 320px;
  }
}

/* ==========================================================================
   Layer 2: Stats Callout (3 key numbers)
   ========================================================================== */

.article-stats,
.stats-callout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 2em 0;
  padding: 28px 24px;
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

.article-stats .stat-item,
.stats-callout__item {
  text-align: center;
}

.article-stats .stat-number,
.stats-callout__number {
  display: block;
  font-family: var(--article-font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  color: var(--color-brand-accent);
  line-height: 1.1;
  margin-bottom: 6px;
}

.article-stats .stat-label,
.stats-callout__label {
  font-family: var(--article-font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

@media (max-width: 480px) {
  .article-stats,
  .stats-callout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px;
  }

  .article-stats .stat-item,
  .stats-callout__item {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
  }

  .article-stats .stat-number,
  .stats-callout__number {
    font-size: 32px;
    flex-shrink: 0;
    min-width: 80px;
  }
}

/* ==========================================================================
   Layer 2: Fading Timeline Infographic
   ========================================================================== */

.article-timeline,
.infographic {
  margin: 2em 0;
  padding: 28px 24px;
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

.infographic__title {
  font-family: var(--article-font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.infographic__title span {
  color: var(--color-brand-accent);
}

.article-timeline .timeline-item,
.timeline-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  position: relative;
}

.article-timeline .timeline-item + .timeline-item,
.timeline-stage + .timeline-stage {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.timeline-stage__years {
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  min-width: 80px;
  flex-shrink: 0;
}

.timeline-stage__bar-wrap {
  flex: 1;
  min-width: 0;
}

.timeline-stage__label {
  font-family: var(--article-font-ui);
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.article-timeline .timeline-bar,
.timeline-stage__bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.timeline-stage__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Status ramp from design-system tokens, no Tailwind hex (INK-DESIGN-ART27 P3-f) */
.timeline-stage__fill--100 { width: 100%; background: var(--color-success); }
.timeline-stage__fill--85 { width: 85%; background: var(--color-warning); }
.timeline-stage__fill--65 { width: 65%; background: var(--color-warning); }
.timeline-stage__fill--40 { width: 40%; background: var(--color-error); }
.timeline-stage__fill--20 { width: 20%; background: var(--color-error); }

.timeline-stage__pct {
  font-family: var(--article-font-ui);
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.timeline-stage__pct--100 { color: var(--color-success); }
.timeline-stage__pct--85 { color: var(--color-warning); }
.timeline-stage__pct--65 { color: var(--color-warning); }
.timeline-stage__pct--40 { color: var(--color-error); }
.timeline-stage__pct--20 { color: var(--color-error); }

@media (max-width: 480px) {
  .timeline-stage {
    flex-wrap: wrap;
    gap: 8px;
  }

  .timeline-stage__years {
    min-width: 100%;
    font-size: 14px;
  }

  .timeline-stage__pct {
    min-width: 36px;
  }
}

/* ==========================================================================
   Layer 2: Before / After Comparison
   ========================================================================== */

.article-compare,
.comparison {
  margin: 2em 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-compare .compare-panel,
.comparison__panel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-compare .compare-panel img,
.comparison__panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.comparison__label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--article-font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 4px;
}

.comparison__label--fresh {
  border-left: 3px solid var(--color-success);
}

.comparison__label--faded {
  border-left: 3px solid var(--color-brand-accent);
}

@media (max-width: 480px) {
  .article-compare,
  .comparison {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==========================================================================
   Layer 2: Accordion (Pro Tips)
   ========================================================================== */

.article-accordion,
.accordion {
  margin: 2em 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-accordion details,
.accordion__item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  transition: border-color var(--transition-fast);
}

.accordion__item--open {
  border-color: rgba(232, 197, 71, 0.3);
}

.article-accordion summary,
.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font-family: var(--article-font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
  gap: 12px;
}

.article-accordion summary { list-style: none; }
.article-accordion summary::-webkit-details-marker { display: none; }

.accordion__item--open .accordion__trigger {
  color: var(--color-brand-accent);
}

.article-accordion details[open] summary {
  color: var(--color-brand-accent);
}

.accordion__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: transform var(--transition-normal);
}

.accordion__item--open .accordion__icon {
  transform: rotate(180deg);
  color: var(--color-brand-accent);
}

.accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion__content {
  padding: 0 20px 16px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   Layer 2: Image Slider (horizontal swipe)
   ========================================================================== */

.article-slider-wrapper {
  margin: 2em 0;
}

.article-slider {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  display: flex;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 16px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.article-slider::-webkit-scrollbar { display: none; }

.article-slider.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Slide aspect: vertical 9:16 to maximise tattoo body shots; capped at 80vh
   so a single image cannot dominate the viewport on tall mobiles. */
.article-slide {
  flex: 0 0 85%;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 80vh;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.article-slide__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 16px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  color: #fff;
  font-family: var(--article-font-ui);
  font-size: 13px;
  line-height: 1.3;
  pointer-events: none;
}

.article-slider__dots,
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
}

/* Dots match the masters-listing card slider so editorial carousels feel
   like the same component family (gold pill on active). */
.article-slider__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.article-slider__dot.active {
  background: var(--color-brand-accent);
  width: 16px;
  border-radius: 3px;
}

/* ==========================================================================
   Layer 2: Info Box
   ========================================================================== */

.article-infobox {
  margin: 2em 0;
  padding: 24px 28px;
  background: rgba(232, 197, 71, 0.06);
  border: 1px solid rgba(232, 197, 71, 0.2);
  border-radius: var(--radius-lg);
  font-family: var(--article-font-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
}

.article-infobox strong {
  color: var(--color-brand-accent);
}

/* ==========================================================================
   Layer 2: Fading Risk Calculator
   ========================================================================== */

.calculator {
  margin: 2em 0;
  padding: 28px 24px;
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

.calculator__title {
  font-family: var(--article-font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.calculator__subtitle {
  font-family: var(--article-font-ui);
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.calculator__group {
  margin-bottom: 20px;
}

.calculator__label {
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  display: block;
}

.calculator__options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calculator__btn {
  flex: 1;
  min-width: 100px;
  min-height: 44px;
  padding: 10px 16px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.calculator__btn:active {
  transform: scale(0.97);
}

.calculator__btn--selected {
  color: var(--color-bg);
  background: var(--color-brand-accent);
  border-color: var(--color-brand-accent);
  font-weight: 600;
}

.calculator__result {
  margin-top: 24px;
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: none;
}

.calculator__result.visible {
  display: block;
}

.calculator__result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calculator__result-label {
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
}

.calculator__result-score {
  font-family: var(--article-font-display);
  font-size: 20px;
  font-weight: 700;
}

.calculator__result-score--low { color: var(--color-success); }
.calculator__result-score--medium { color: var(--color-warning); }
.calculator__result-score--high { color: var(--color-error); }

.calculator__result-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
  overflow: hidden;
}

.calculator__result-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.5s ease;
}

.calculator__result-text {
  font-family: var(--article-font-ui);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   Inline Related Articles (Editorial Cards — Variant B)
   ========================================================================== */

.article-body .inline-related {
  margin: 2.5em 0;
}

.article-body .inline-related__header {
  margin-bottom: 16px;
}

.article-body .inline-related__label {
  font-family: var(--article-font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-brand-accent);
  display: block;
  margin-bottom: 8px;
}

.article-body .inline-related__rule {
  width: 32px;
  height: 2px;
  background: var(--color-brand-accent);
  border-radius: 1px;
}

.article-body .inline-related__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.article-body .inline-related__card {
  display: block;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-body .inline-related__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: var(--color-border-hover);
}

.article-body .inline-related__card:hover .inline-related__title {
  color: var(--color-brand-accent);
}

.article-body .inline-related__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.article-body .inline-related__body {
  padding: 14px 16px 16px;
}

.article-body .inline-related__cat {
  font-family: var(--article-font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-brand-accent);
  margin-bottom: 8px;
  display: block;
}

.article-body .inline-related__title {
  font-family: var(--article-font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

@media (max-width: 520px) {
  .article-body .inline-related__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

/* ==========================================================================
   Article Image Favorite Button (mirrors .mp-gallery__fav-btn)
   ========================================================================== */

.article-fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.article-fav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  transform: scale(1.08);
}

.article-fav-btn.saved {
  background: rgba(224, 92, 122, 0.9);
  color: #fff;
}

.article-fav-btn.saved svg {
  fill: currentColor;
}

/* Sliders / galleries: cursor + relative positioning so the button anchors. */
.article-figure,
.article-gallery .gallery-item,
.article-slide {
  position: relative;
}

/* ==========================================================================
   Lightbox extras (counter, prev/next, fav, toast)
   ========================================================================== */

.lightbox-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--article-font-ui);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
  pointer-events: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-fav {
  position: absolute;
  top: 24px;
  right: 88px; /* leave room for the close button */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.lightbox-fav:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox-fav.saved {
  background: rgba(224, 92, 122, 0.9);
  color: #fff;
}

.lightbox-fav.saved svg { fill: currentColor; }

@media (max-width: 520px) {
  .lightbox-prev { left: 8px; width: 40px; height: 40px; }
  .lightbox-next { right: 8px; width: 40px; height: 40px; }
  .lightbox-fav { top: 16px; right: 64px; width: 40px; height: 40px; }
  .lightbox-counter { top: 16px; }
}

.article-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  font-family: var(--article-font-ui);
  font-size: 14px;
  color: #fff;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 30000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.article-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
  .article-toast { bottom: 20px; padding: 8px 14px; font-size: 13px; }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
  /* INK-DESIGN-ART27 P2-a: stop infinite animations (kenBurns hero, scroll chevron) */
  .article-hero img { transition: none; animation: none; }
  .scroll-indicator .chevron { animation: none; }
  .article-figure img { transition: none; }
  .article-gallery .gallery-item img { transition: none; }
  .lightbox,
  .lightbox img { transition: none; }
  .fade-in { transition: none; opacity: 1; transform: none; }
  .popular-card-image img { transition: none; }
  .timeline-stage__fill { transition: none; }
  .calculator__result-fill { transition: none; }
  .accordion__body { transition: none; }
  .accordion__icon { transition: none; }
  .article-slider__dot { transition: none; }
}
