/*
 * editorial.css
 * Consolidated styles for single posts, archive/category pages, and insights index.
 * Conditionally enqueued on is_single(), is_archive(), and the insights page template.
 *
 * @package Prysmedge
 */

/* ════════════════════════════════════════════════════════════════════════════
   1. SHARED DESIGN TOKENS
   All three templates use the same base palette; namespaced per context.
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  /* Single post tokens */
  --sp-bg:        #f7f6f3;
  --sp-surface:   #ffffff;
  --sp-border:    #e5e1da;
  --sp-border-lt: #eeebe5;
  --sp-text:      #18160f;
  --sp-mid:       #6b6560;
  --sp-muted:     #a09b94;
  --sp-orange:    #c94b00;

  /* Insights tokens */
  --ins-bg:      #f7f6f3;
  --ins-surface: #ffffff;
  --ins-border:  #e5e1da;
  --ins-text:    #18160f;
  --ins-mid:     #6b6560;
  --ins-muted:   #a09b94;
  --ins-orange:  #c94b00;

  /* Archive tokens */
  --arc-bg:      #f7f6f3;
  --arc-surface: #ffffff;
  --arc-border:  #e5e1da;
  --arc-text:    #18160f;
  --arc-mid:     #6b6560;
  --arc-muted:   #a09b94;
  --arc-orange:  #c94b00;
}


/* ════════════════════════════════════════════════════════════════════════════
   2. SINGLE POST (single.php)
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Hero ── */
.post-hero {
  position: relative;
  min-height: 480px;
  background-color: #1a1008;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0;
}
.post-hero--no-image {
  background: linear-gradient(160deg, #1a1008 0%, #2c1e10 50%, #18120a 100%);
}
.post-hero__placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: rgba(201,75,0,.3);
  pointer-events: none;
}
.post-hero__placeholder span {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.post-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15,8,2,.10) 0%, rgba(15,8,2,.45) 50%, rgba(15,8,2,.88) 100%);
  z-index: 1;
}
.post-hero__content {
  position: relative;
  z-index: 2;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.post-hero__category-badge {
  display: inline-block;
  background: var(--sp-orange);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 3px;
  text-decoration: none;
  margin-bottom: .875rem;
}
.post-hero__category-badge:hover { opacity: .85; }
.post-hero__title {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  max-width: 820px;
  margin: 0;
}

/* ── Meta bar ── */
.post-meta-bar {
  background: var(--sp-surface);
  border-bottom: 1.5px solid var(--sp-border);
  padding: .875rem 0;
}
.post-meta-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.post-meta__author { display: flex; align-items: center; gap: .5rem; }
.post-meta__avatar { border-radius: 50%; width: 36px; height: 36px; }
.post-meta__author-name {
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--sp-text);
  text-decoration: none;
}
.post-meta__author-name:hover { color: var(--sp-orange); }
.post-meta__date,
.post-meta__read-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--sp-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.post-meta__categories { display: flex; flex-wrap: wrap; gap: .375rem; margin-left: auto; }
.post-meta__cat-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  font-weight: 700;
  color: var(--sp-orange);
  text-decoration: none;
  border: 1.5px solid rgba(201,75,0,.3);
  padding: .2rem .65rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.post-meta__cat-link:hover { background: rgba(201,75,0,.06); }

/* ── Layout ── */
.single-post { padding: 3.5rem 0 5rem; background: var(--sp-bg); }
.single-post__container {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 1023px) {
  .single-post__container { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
}

/* ── Article body ── */
.single-post__article {
  order: 1;
  background: var(--sp-surface);
  border: 1.5px solid var(--sp-border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  color: var(--sp-mid);
  font-family: 'Manrope', sans-serif;
  min-width: 0;
}
@media (max-width: 768px) { .single-post__article { padding: 2rem 1.25rem; } }

/* ── Post content typography ── */
.post-content { font-size: 1.0625rem; line-height: 1.85; }
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: 'Barlow', sans-serif;
  color: var(--sp-text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}
.post-content h2 { font-size: 1.625rem; font-weight: 700; }
.post-content h3 { font-size: 1.25rem; font-weight: 700; }
.post-content h4 { font-size: 1.0625rem; font-weight: 600; }
.post-content p  { margin-bottom: 1.5rem; color: var(--sp-mid); }
.post-content a  { color: var(--sp-orange); text-underline-offset: 3px; }
.post-content a:hover { opacity: .8; }
.post-content ul,
.post-content ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.post-content li { margin-bottom: .5rem; color: var(--sp-mid); }

/* ── Inline images ── */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 2rem 0;
  display: block;
}
.post-content figure {
  margin: 2.5rem -1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
}
.post-content figure img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
  display: block;
  transition: transform .5s ease;
}
.post-content figure:hover img { transform: scale(1.025); }
.post-content figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--sp-muted);
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--sp-border-lt);
  letter-spacing: .04em;
}
.single-post__hero-caption figcaption {
  background: rgba(201,75,0,.04);
  border: 1.5px solid var(--sp-border-lt);
  border-radius: 6px;
  padding: .625rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--sp-muted);
  margin-bottom: 2rem;
}

/* ── Two-column image grid ── */
.post-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2.5rem 0;
}
@media (max-width: 600px) { .post-image-grid { grid-template-columns: 1fr; } }
.post-image-grid__item {
  border-radius: 12px;
  overflow: hidden;
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  margin: 0;
}
.post-image-grid__item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
  transition: transform .5s ease;
}
.post-image-grid__item:hover img { transform: scale(1.025); }
.post-image-grid__item figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--sp-muted);
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--sp-border-lt);
  letter-spacing: .04em;
}
.post-image-grid__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 240px;
  background: var(--sp-bg);
  color: var(--sp-muted);
  gap: .5rem;
}
.post-image-grid__placeholder span {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Blockquotes ── */
.post-content blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--sp-orange);
  background: rgba(201,75,0,.04);
  border-radius: 0 8px 8px 0;
}
.post-content blockquote p {
  font-size: 1.175rem;
  font-style: italic;
  font-weight: 500;
  color: var(--sp-text);
  line-height: 1.6;
  margin: 0;
}
.post-content blockquote cite {
  display: block;
  font-size: .8125rem;
  font-style: normal;
  color: var(--sp-orange);
  margin-top: .75rem;
}

/* ── Code blocks ── */
.post-content pre {
  background: #18160f;
  border: 1px solid #2a2520;
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content code {
  font-size: .875em;
  background: rgba(201,75,0,.08);
  color: var(--sp-orange);
  padding: .125rem .35rem;
  border-radius: 3px;
}
.post-content pre code { background: none; color: #e5e5e5; padding: 0; }

/* ── Featured stat block ── */
.featured-stat-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(201,75,0,.05);
  border: 1.5px solid rgba(201,75,0,.2);
  border-radius: 10px;
  padding: 2rem 2.5rem;
  margin-bottom: 2.5rem;
}
.featured-stat-block__value {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1;
}
.text-gradient-orange {
  background: linear-gradient(135deg, #c94b00, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.featured-stat-block__label {
  font-family: 'Manrope', sans-serif;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--sp-mid);
  margin-top: .5rem;
}

/* ── Newsletter CTA inline ── */
.newsletter-cta-inline {
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2.5rem 0;
}
.newsletter-cta-inline__inner { display: flex; gap: 1.25rem; align-items: flex-start; }
.newsletter-cta-inline__icon { color: var(--sp-orange); flex-shrink: 0; padding-top: .15rem; }
.newsletter-cta-inline__heading {
  font-family: 'Barlow', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--sp-text);
  margin: 0 0 .375rem;
}
.newsletter-cta-inline__sub { font-size: .9rem; color: var(--sp-mid); margin: 0 0 1rem; line-height: 1.6; }
.newsletter-cta-inline__row { display: flex; gap: .625rem; flex-wrap: wrap; }
.newsletter-cta-inline__input {
  flex: 1;
  min-width: 200px;
  background: var(--sp-surface);
  border: 1.5px solid var(--sp-border);
  border-radius: 7px;
  color: var(--sp-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  padding: .625rem 1rem;
  outline: none;
  transition: border-color .2s;
}
.newsletter-cta-inline__input:focus { border-color: var(--sp-orange); }
.newsletter-cta-inline__input::placeholder { color: var(--sp-muted); }
.newsletter-cta-inline__btn { white-space: nowrap; }
.newsletter-cta-inline__privacy {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--sp-muted);
  margin: .625rem 0 0;
}
@media (max-width: 600px) { .newsletter-cta-inline__inner { flex-direction: column; } }

/* ── Social share ── */
.social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1.5px solid var(--sp-border);
}
.social-share__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sp-muted);
  margin-right: .25rem;
}
.social-share__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--sp-mid);
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  border-radius: 7px;
  padding: .5rem 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.social-share__btn:hover { border-color: var(--sp-orange); color: var(--sp-orange); }
.social-share__btn--copy { font-family: inherit; }

/* ── Post tags ── */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.post-tags__link {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--sp-muted);
  border: 1.5px solid var(--sp-border);
  border-radius: 4px;
  padding: .25rem .625rem;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.post-tags__link:hover { color: var(--sp-orange); border-color: rgba(201,75,0,.35); }

/* ── ToC sidebar ── */
.toc-sidebar {
  order: 2;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc-sidebar__heading {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sp-muted);
  margin: 0 0 .75rem;
}
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--sp-border); }
.toc-list__item { margin: 0; }
.toc-list__item--h3 { padding-left: .75rem; }
.toc-list__link {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  color: var(--sp-muted);
  text-decoration: none;
  padding: .3rem .75rem;
  border-left: 2px solid transparent;
  margin-left: -2px;
  line-height: 1.4;
  transition: color .2s, border-color .2s;
}
.toc-list__link:hover,
.toc-list__link--active { color: var(--sp-orange); border-left-color: var(--sp-orange); }

/* ── Related posts section ── */
.related-posts {
  padding: 4rem 0 5rem;
  background: var(--sp-bg);   /* warm cream — matches Insights page background */
  border-top: 1.5px solid var(--sp-border);
}
.related-posts__heading {
  font-family: 'Barlow', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sp-text);
  margin: 0 0 2rem;
}
.related-posts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .related-posts__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .related-posts__grid { grid-template-columns: 1fr; } }

/* ── rp-card: Related posts card — mirrors Insights page ins-card style ── */
.rp-card {
  background: var(--sp-surface);   /* white card on warm bg */
  border: 1.5px solid var(--sp-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.rp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  border-color: rgba(201,75,0,.25);
}
.rp-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.rp-card__img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.rp-card__img-wrap--placeholder {
  background: linear-gradient(135deg, #f0ede8, #e8e4de);
}
.rp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.rp-card:hover .rp-card__img { transform: scale(1.04); }
.rp-card__body {
  padding: 1.375rem 1.375rem 1.125rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rp-card__meta-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}
/* Category badges — colour-coded per lane, matching Insights page */
.rp-card__badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.rp-badge--announcements         { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.rp-badge--new-products          { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.rp-badge--building-optimization { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.rp-badge--smart-tech            { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.rp-badge--asset-care            { background: #ccfbf1; color: #134e4a; border: 1px solid #99f6e4; }
.rp-badge--default               { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.rp-card__read-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--sp-muted);
}
.rp-card__title {
  font-family: 'Barlow', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--sp-text);
  line-height: 1.3;
  margin: 0 0 .625rem;
  transition: color .2s;
}
.rp-card:hover .rp-card__title { color: var(--sp-orange); }
.rp-card__excerpt {
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  color: var(--sp-mid);
  line-height: 1.6;
  margin: 0 0 auto;
  padding-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rp-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .875rem;
  border-top: 1px solid var(--sp-border-lt);
  margin-top: auto;
}
.rp-card__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--sp-muted);
}
.rp-card__cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sp-orange);
}


/* ════════════════════════════════════════════════════════════════════════════
   3. INSIGHTS INDEX (template-insights.php)
   ════════════════════════════════════════════════════════════════════════════ */

.ins-card {
  background: var(--ins-surface);
  border: 1.5px solid var(--ins-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ins-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  border-color: rgba(201,75,0,.25);
}
.ins-featured {
  background: var(--ins-surface);
  border: 1.5px solid var(--ins-border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.ins-featured:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,.10);
  border-color: rgba(201,75,0,.3);
}
.ins-filter-tab {
  transition: all .2s ease;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--ins-muted);
}
.ins-filter-tab.active {
  color: var(--ins-orange);
  border-bottom-color: var(--ins-orange);
}
.ins-filter-tab:not(.active):hover {
  color: var(--ins-text);
  border-bottom-color: rgba(24,22,15,.2);
}
.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 7px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
  color: var(--ins-mid); border: 1.5px solid var(--ins-border);
  background: var(--ins-surface); transition: all .2s; text-decoration: none;
}
.page-numbers:hover { border-color: var(--ins-orange); color: var(--ins-orange); }
.page-numbers.current { color: #fff; background: var(--ins-orange); border-color: var(--ins-orange); }
.page-numbers.dots { border: none; background: none; }


/* ════════════════════════════════════════════════════════════════════════════
   4. ARCHIVE / CATEGORY (archive.php)
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Hero ── */
.archive-hero {
  background: linear-gradient(135deg, #23150d 0%, #000 100%);
  padding: 5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.archive-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.archive-hero__inner { max-width: 720px; position: relative; }
.archive-hero__eyebrow { margin-bottom: 1rem; }
.archive-hero__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--arc-orange);
}
.archive-hero__back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: 'Manrope', sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--arc-orange);
  text-decoration: none;
  transition: gap .2s;
}
.archive-hero__back:hover { gap: .55rem; }
.archive-hero__title {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  color: #fafafa;
  line-height: 1.1;
  margin: 0 0 1rem;
}
.archive-hero__sub {
  font-family: 'Manrope', sans-serif;
  font-size: 1.125rem;
  color: rgba(255,255,255,.55);
  line-height: 1.65;
  margin: 0;
  max-width: 560px;
}

/* ── Category filter bar ── */
.category-filter-bar {
  background: rgba(247,246,243,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--arc-border);
  position: sticky;
  top: 5rem;
  z-index: 40;
}
.category-filter-bar__inner {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.category-filter-bar__inner::-webkit-scrollbar { display: none; }
.category-filter-bar__link {
  flex-shrink: 0;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--arc-muted);
  text-decoration: none;
  padding: .875rem 1.25rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.category-filter-bar__link:hover { color: var(--arc-text); border-bottom-color: rgba(24,22,15,.2); }
.category-filter-bar__link--active {
  color: var(--arc-orange);
  border-bottom-color: var(--arc-orange);
}

/* ── Archive page base ── */
.archive-page { padding: 3.5rem 0 5rem; background: var(--arc-bg); }

/* ── Featured post card ── */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--arc-surface);
  border: 1.5px solid var(--arc-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 3rem;
  transition: border-color .25s, box-shadow .25s;
}
.featured-post:hover { border-color: rgba(201,75,0,.3); box-shadow: 0 16px 48px rgba(0,0,0,.08); }
@media (max-width: 768px) { .featured-post { grid-template-columns: 1fr; } }
.featured-post__img-link { display: block; }
.featured-post__img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  background-size: cover;
  background-position: center;
  display: block;
}
.featured-post__img--placeholder {
  background: linear-gradient(135deg, #f0ede8, #e8e4de);
}
@media (max-width: 768px) { .featured-post__img { min-height: 220px; } }
.featured-post__body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--arc-orange);
  border: 1.5px solid rgba(201,75,0,.3);
  padding: .2rem .65rem;
  border-radius: 3px;
  text-decoration: none;
  margin-bottom: 1.25rem;
  align-self: flex-start;
}
.card-badge:hover { background: rgba(201,75,0,.06); }
.featured-post__title {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: var(--arc-text);
  line-height: 1.2;
  margin: 0 0 1rem;
}
.featured-post__title a { color: inherit; text-decoration: none; }
.featured-post__title a:hover { color: var(--arc-orange); }
.featured-post__excerpt {
  font-family: 'Manrope', sans-serif;
  font-size: .9375rem;
  color: var(--arc-mid);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}
.featured-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin-bottom: 1.75rem;
}
.featured-post__author { display: flex; align-items: center; gap: .45rem; }
.featured-post__avatar { border-radius: 50%; width: 32px; height: 32px; }
.featured-post__author-name {
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--arc-text);
}
.featured-post__date,
.featured-post__read-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--arc-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.featured-post__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* ── Posts grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (max-width: 768px) { .posts-grid { grid-template-columns: 1fr; } }

/* ── card-pe (shared by archive + single related posts) ── */
.card-pe {
  background: var(--arc-surface, var(--sp-bg));
  border: 1.5px solid var(--arc-border, var(--sp-border));
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card-pe:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  border-color: rgba(201,75,0,.25);
}
.card-pe__thumbnail { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-pe__body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.card-pe__badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--arc-orange, var(--sp-orange));
  border: 1.5px solid rgba(201,75,0,.3);
  padding: .2rem .55rem;
  border-radius: 3px;
  text-decoration: none;
  margin-bottom: .75rem;
  align-self: flex-start;
}
.card-pe__title {
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--arc-text, var(--sp-text));
  margin: 0 0 .625rem;
  line-height: 1.35;
}
.card-pe__title a { color: inherit; text-decoration: none; }
.card-pe__title a:hover { color: var(--arc-orange, var(--sp-orange)); }
.card-pe__excerpt {
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  color: var(--arc-mid, var(--sp-mid));
  line-height: 1.6;
  margin: 0 0 auto;
  padding-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-pe__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--arc-muted, var(--sp-muted));
  padding-top: .75rem;
  border-top: 1px solid var(--arc-border, var(--sp-border));
}
.card-pe__author-avatar { border-radius: 50%; width: 24px; height: 24px; }
.card-pe__sep { color: var(--arc-border, var(--sp-border)); font-size: .75rem; }
.card-pe__read-more {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--arc-orange, var(--sp-orange));
  text-decoration: none;
  margin-top: .5rem;
  transition: gap .2s;
}
.card-pe__read-more:hover { gap: .625rem; }

/* ── Load More ── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}
.load-more-btn {
  position: relative;
  min-width: 160px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--arc-orange);
  background: var(--arc-surface);
  border: 1.5px solid rgba(201,75,0,.3);
  border-radius: 8px;
  padding: .75rem 2rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.load-more-btn:hover { background: rgba(201,75,0,.06); border-color: var(--arc-orange); }
.load-more-btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(201,75,0,.3);
  border-top-color: var(--arc-orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: .5rem;
}
.load-more-btn--loading .load-more-btn__label { opacity: .5; }
.load-more-btn--loading .load-more-btn__spinner { display: inline-block; }

/* ── No posts ── */
.archive-no-posts {
  text-align: center;
  padding: 4rem 0;
  font-family: 'Manrope', sans-serif;
  color: var(--arc-muted);
}
.archive-no-posts p { margin-bottom: 1.5rem; font-size: 1.0625rem; }


/* ════════════════════════════════════════════════════════════════════════════
   5. SHARED ANIMATIONS
   ════════════════════════════════════════════════════════════════════════════ */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUpIn .55s ease forwards;
}
.fade-up.stagger-child {
  animation-delay: var(--stagger-delay, 0ms);
}
@keyframes fadeUpIn {
  to { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════════
   NEWSLETTER SIGN-UP SECTION (single.php — above related posts)
   ════════════════════════════════════════════════════════════════════════════ */

.post-newsletter {
  background: #0f0b08;
  padding: 5rem 0;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.post-newsletter__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .post-newsletter__inner {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }
}

.post-newsletter__badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #f97316;
  margin-bottom: 1.25rem;
}

.post-newsletter__pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
  animation: nl-pulse 2s ease-in-out infinite;
}
@keyframes nl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.85); }
}

.post-newsletter__heading {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.post-newsletter__sub {
  font-family: 'Manrope', sans-serif;
  font-size: .9375rem;
  color: rgba(255,255,255,.5);
  line-height: 1.7;
  margin: 0;
  max-width: 480px;
}

/* Form layout */
.post-newsletter__fields {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
@media (min-width: 640px) {
  .post-newsletter__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
  }
}

.post-newsletter__field { display: flex; }
.post-newsletter__field--email { }

.post-newsletter__input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: .5rem;
  padding: .8125rem 1rem;
  font-family: 'Manrope', sans-serif;
  font-size: .9375rem;
  color: #ffffff;
  outline: none;
  transition: border-color .2s ease;
}
.post-newsletter__input::placeholder { color: rgba(255,255,255,.3); }
.post-newsletter__input:focus { border-color: #f97316; }

.post-newsletter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #f97316;
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  border: none;
  border-radius: .5rem;
  padding: .8125rem 1.75rem;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .post-newsletter__btn {
    grid-column: 1 / -1;
  }
}
.post-newsletter__btn:hover {
  background: #ea580c;
  transform: translateY(-1px);
}
.post-newsletter__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.post-newsletter__message {
  margin-top: .875rem;
  font-family: 'Manrope', sans-serif;
  font-size: .875rem;
  min-height: 1.4em;
}
.post-newsletter__message--success { color: #34d399; }
.post-newsletter__message--error   { color: #f87171; }


/* ════════════════════════════════════════════════════════════════════════════
   6. MAGAZINE ENHANCEMENTS
   Lead paragraph · Pull quote · Inline figures · Currency spans
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Lead paragraph (first <p> in post body) ── */
.post-content .lead-para {
  font-size: 1.1875rem;
  line-height: 1.9;
  color: var(--sp-text);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* ── Pull quote ── */
.pull-quote {
  margin: 3rem -1.5rem;
  padding: 2.25rem 2.5rem;
  background: linear-gradient(160deg, #23150d 0%, #1a0e08 100%);
  border-left: none;
  border-radius: 0;
  position: relative;
}
.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: .75rem;
  left: 1.75rem;
  font-family: 'Barlow', sans-serif;
  font-size: 5rem;
  line-height: 1;
  color: rgba(201,75,0,.35);
  pointer-events: none;
}
.pull-quote__text {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
  font-style: italic;
  margin: 0 0 .875rem;
  padding-left: .5rem;
}
.pull-quote__source {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sp-orange);
  padding-left: .5rem;
}

/* ── Currency value spans ── */
.currency-val {
  font-weight: 700;
  color: var(--sp-text);
  font-variant-numeric: tabular-nums;
}

/* ── Inline figures (inserted by content filter / seed script) ── */
.post-inline-figure {
  margin: 2.75rem -2rem;
  overflow: hidden;
  background: var(--sp-bg);
  border-top: 1.5px solid var(--sp-border);
  border-bottom: 1.5px solid var(--sp-border);
}
.post-inline-figure img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
  transition: transform .6s ease;
}
.post-inline-figure:hover img { transform: scale(1.02); }
.post-inline-figure figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--sp-muted);
  padding: .625rem 1.25rem;
  letter-spacing: .04em;
  border-top: 1px solid var(--sp-border-lt);
}


/* ════════════════════════════════════════════════════════════════════════════
   7. RIGHT EDITORIAL SIDEBAR  (post-sidebar)
   Replaces the old .toc-sidebar single-purpose aside.
   ════════════════════════════════════════════════════════════════════════════ */

.post-sidebar {
  order: 2;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sp-border) transparent;
}
.post-sidebar::-webkit-scrollbar { width: 3px; }
.post-sidebar::-webkit-scrollbar-track { background: transparent; }
.post-sidebar::-webkit-scrollbar-thumb { background: var(--sp-border); border-radius: 2px; }
@media (max-width: 1023px) { .post-sidebar { display: none; } }

/* ToC section inside sidebar */
.post-sidebar__toc {
  background: var(--sp-surface);
  border: 1.5px solid var(--sp-border);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1rem;
}
.post-sidebar__toc .toc-sidebar__heading { padding: 0; margin-bottom: .75rem; }

/* Shared section card base */
.post-sidebar__section {
  border-radius: 12px;
  overflow: hidden;
}
.post-sidebar__section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sp-muted);
  margin: 0 0 .875rem;
  display: flex;
  align-items: center;
  gap: .375rem;
}

/* Currency switcher */
.post-sidebar__currency {
  background: var(--sp-surface);
  border: 1.5px solid var(--sp-border);
  padding: 1.125rem;
}
.currency-toggle {
  display: flex;
  gap: .375rem;
  margin-bottom: .625rem;
}
.currency-btn {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--sp-muted);
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  border-radius: 7px;
  padding: .5rem .25rem;
  cursor: pointer;
  transition: all .18s;
  line-height: 1;
}
.currency-btn:hover { border-color: var(--sp-orange); color: var(--sp-orange); }
.currency-btn--active {
  background: var(--sp-orange);
  border-color: var(--sp-orange);
  color: #fff;
}
.currency-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: .63rem;
  color: var(--sp-muted);
  margin: 0;
  line-height: 1.55;
}

/* CTA card */
.post-sidebar__cta {
  background: linear-gradient(160deg, #111009 0%, #080604 100%);
  border: 1.5px solid rgba(201,75,0,.28);
  padding: 1.375rem 1.25rem 1.25rem;
}
.post-sidebar__cta-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sp-orange);
  display: flex;
  align-items: center;
  gap: .375rem;
  margin: 0 0 .75rem;
}
.post-sidebar__cta-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sp-orange);
  animation: nl-pulse 2s ease-in-out infinite;
}
.post-sidebar__cta-heading {
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 .625rem;
}
.post-sidebar__cta-body {
  font-family: 'Manrope', sans-serif;
  font-size: .8125rem;
  color: rgba(255,255,255,.5);
  line-height: 1.65;
  margin: 0 0 1.125rem;
}
.post-sidebar__cta-btn {
  display: block;
  background: var(--sp-orange);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  padding: .75rem 1rem;
  border-radius: 8px;
  transition: background .2s, transform .18s;
}
.post-sidebar__cta-btn:hover { background: #b04000; transform: translateY(-1px); color: #fff; }

/* Related posts mini-list */
.post-sidebar__resources {
  background: var(--sp-surface);
  border: 1.5px solid var(--sp-border);
  padding: 1.125rem;
}
.sidebar-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}
.sidebar-posts-list__item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--sp-border-lt);
}
.sidebar-posts-list__item:last-child { padding-bottom: 0; border-bottom: none; }
.sidebar-posts-list__thumb {
  flex-shrink: 0;
  width: 68px;
  height: 52px;
  border-radius: 7px;
  overflow: hidden;
  display: block;
  background: var(--sp-bg);
}
.sidebar-posts-list__img {
  width: 68px !important;
  height: 52px !important;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0 !important;
}
.sidebar-posts-list__body {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
  min-width: 0;
}
.sidebar-posts-list__title {
  font-family: 'Manrope', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  color: var(--sp-text);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.sidebar-posts-list__title:hover { color: var(--sp-orange); }
.sidebar-posts-list__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: .63rem;
  color: var(--sp-muted);
}
