/* ==============================================================
   Blog Single — Desktop Refinements
   Scope: single post view only (enqueued conditionally)
   Goal: improve reading comfort on desktop and better align
         with site-wide visual language without disrupting pages.
   -------------------------------------------------------------- */

/* --------------------------------------------------------------
   Neon Moods: Category-Based Theming
   -------------------------------------------------------------- */

:root {
  /* Default (Performance / Generic) - Neon Cyan */
  --post-accent: var(--neon-cyan);
  --post-accent-hover: var(--neon-magenta);
  --post-accent-glow: rgba(0, 229, 255, 0.4);
  --post-accent-dim: rgba(0, 229, 255, 0.1);
  --post-accent-shadow: rgba(0, 229, 255, 0.15);
}

body.category-privacy {
  /* Privacy - Neon Magenta (Warning/Stealth) */
  --post-accent: var(--neon-magenta);
  --post-accent-hover: var(--neon-cyan);
  --post-accent-glow: rgba(255, 0, 224, 0.4);
  --post-accent-dim: rgba(255, 0, 224, 0.1);
  --post-accent-shadow: rgba(255, 0, 224, 0.15);
}

body.category-strategy {
  /* Strategy - Deep Purple (Wisdom/Depth) */
  --post-accent: var(--deep-purple);
  --post-accent-hover: var(--neon-amber);
  --post-accent-glow: rgba(110, 42, 251, 0.4);
  --post-accent-dim: rgba(110, 42, 251, 0.1);
  --post-accent-shadow: rgba(110, 42, 251, 0.15);
}

body.category-process {
  /* Process - Neon Amber (Industrial/Flow) */
  --post-accent: var(--neon-amber);
  --post-accent-hover: var(--neon-cyan);
  --post-accent-glow: rgba(255, 107, 0, 0.4);
  --post-accent-dim: rgba(255, 107, 0, 0.1);
  --post-accent-shadow: rgba(255, 107, 0, 0.15);
}

body.category-brand {
  /* Brand - Neon Violet (Creative/Bold) */
  --post-accent: #8a6bff;
  --post-accent-hover: var(--neon-cyan);
  --post-accent-glow: rgba(138, 107, 255, 0.4);
  --post-accent-dim: rgba(138, 107, 255, 0.1);
  --post-accent-shadow: rgba(138, 107, 255, 0.15);
}

/* Inline links (Global) */
.single-article__inner .entry-content a {
  color: var(--post-accent);
  text-decoration: underline;
  text-decoration-color: var(--post-accent-glow);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.single-article__inner .entry-content a:hover,
.single-article__inner .entry-content a:focus-visible {
  color: var(--post-accent-hover);
  text-decoration-color: var(--post-accent-hover);
  outline: none;
}

/* Back to Blog link (Global) */
.back-to-blog {
  margin-bottom: clamp(18px, 2vw, 28px);
}

.back-to-blog a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-to-blog a:hover,
.back-to-blog a:focus-visible {
  color: var(--post-accent);
}

/* Headings rhythm */

.single-article__inner .entry-content h1,
.single-article__inner .entry-content h2,
.single-article__inner .entry-content h3,
.single-article__inner .entry-content h4,
.single-article__inner .entry-content h5,
.single-article__inner .entry-content h6 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

/* Paragraph spacing */

.single-article__inner .entry-content p {
  margin: 0 0 1.05em;
}

/* Lists */

.single-article__inner .entry-content ul,
.single-article__inner .entry-content ol {
  padding-left: 1.2em;
  margin: 0 0 1.1em;
}

/* Media blocks */

.single-article__inner .entry-content figure,
.single-article__inner .entry-content img,
.single-article__inner .entry-content video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  margin: 1.2em 0;
}

/* Neon Highlighter Pull Quotes */

.single-article__inner .entry-content blockquote {
  margin: 2em 0;
  padding: 1.5em 2em;
  background: linear-gradient(90deg, var(--post-accent-dim) 0%, rgba(4, 8, 22, 0) 100%);
  border-left: 4px solid var(--post-accent);
  border-radius: 4px 16px 16px 4px;
  position: relative;
  box-shadow: -8px 0 24px -4px var(--post-accent-shadow);
}

.single-article__inner .entry-content blockquote p {
  font-size: 1.25rem;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  text-shadow: 0 0 20px var(--post-accent-shadow);
}

.single-article__inner .entry-content blockquote cite {
  display: block;
  margin-top: 1em;
  font-size: 0.9rem;
  color: var(--post-accent-hover);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Code blocks */

.single-article__inner .entry-content pre {
  overflow: auto;
  padding: 1em 1.2em;
  border-radius: 10px;
  background: #0e1938;
  border: 1px solid var(--post-accent-shadow);
  box-shadow: 0 14px 36px rgba(3, 8, 22, 0.45);
  margin: 1.2em 0;
}

/* Glassmorphism Data Tables */

.single-article__inner .entry-content figure.wp-block-table {
  margin: 2.5em 0;
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--post-accent-glow);
}

.single-article__inner .entry-content table {
  width: 100%;
  border-collapse: separate; /* Required for border-radius on rows/cells */
  border-spacing: 0;
  background: rgba(10, 18, 38, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.single-article__inner .entry-content th {
  background: var(--post-accent-dim);
  color: var(--post-accent);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  padding: 1.2em 1.5em;
  text-align: left;
  border-bottom: 1px solid var(--post-accent-glow);
  white-space: nowrap;
}

.single-article__inner .entry-content td {
  padding: 1.2em 1.5em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

/* Hover effect on rows */
.single-article__inner .entry-content tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

/* Remove bottom border on last row */
.single-article__inner .entry-content tr:last-child td {
  border-bottom: none;
}

/* Caption styling */
.single-article__inner .entry-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 0.8em;
  font-style: italic;
}

/* Typographic surface: center the prose and set ideal measure */
@media (min-width: 1100px) {
  .single-article.container {
    width: min(1260px, 92vw);
    margin-top: clamp(96px, 12vw, 140px);
  }

  .single-article__inner {
    padding: clamp(48px, 5vw, 72px);
  }

  .single-article__inner .entry-content {
    max-width: 70ch;           /* ~65–75 characters for readability */
    margin-inline: auto;
    font-size: clamp(1.06rem, 0.7vw + 1rem, 1.18rem);
    line-height: 1.8;
  }

  /* Remove double-panel feel on desktop by letting the inner card be the surface */

  .single-article__inner .reading-surface {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

/* Hero balance on widescreens: give copy a touch more room */
@media (min-width: 1280px) {
  .single-hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .single-hero__image {
    width: min(520px, 88vw);
  }
}

@media (min-width: 1600px) {
  .single-article.container {
    width: min(1400px, 92vw);
  }
}

/* --------------------------------------------------------------
 * “Fire” extras: ToC rail, share buttons, author card,
 * progress bar, and next/prev nav styled to match neon theme.
 * -------------------------------------------------------------- */

/* Reading progress bar removed (header has global completion) */

/* --------------------------------------------------------------
 * Single Header (compact, post-first)
 * -------------------------------------------------------------- */

.single-header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: clamp(10px, 2.6vw, 20px);
  margin-bottom: clamp(16px, 3vw, 28px);
}

.single-header__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

/* Hide default catch-all category */

.single-header__categories a[href$="/category/blog/"],
.single-header__categories a[href*="/category/blog/"] {
  display: none !important;
}

/* Defensive: hide any stray Blog term inside the header */

.single-header a[href$="/category/blog/"],
.single-header a[href*="/category/blog/"] {
  display: none !important;
}

.single-header__categories a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(79, 240, 255, 0.28);
  background: rgba(6, 14, 36, 0.45);
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.single-header__categories a:hover,
.single-header__categories a:focus-visible {
  color: var(--neon-amber);
  border-color: rgba(255, 0, 224, 0.36);
  outline: none;
}

.single-header__title {
  margin: 0 0 6px;
  color: var(--text-primary);
}

.single-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--text-tertiary);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.single-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Share actions */

.single-share {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}

.single-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(4, 12, 30, 0.6);
  border: 1px solid rgba(79, 240, 255, 0.22);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.single-share__btn:hover,
.single-share__btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(255, 0, 224, 0.36);
  box-shadow: 0 10px 22px rgba(0, 229, 255, 0.24);
  transform: translateY(-1px);
  outline: none;
}

/* Share group aligns right to visually separate from category chips */

.single-header .single-share {
  justify-self: center;
  display: inline-flex;
  gap: 10px;
}

.single-header .single-share__btn {
  background: rgba(8, 14, 34, 0.85);
  border: 1px solid rgba(79, 240, 255, 0.32);
  color: var(--text-secondary);
}

.single-header .single-share__btn:hover,
.single-header .single-share__btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(255, 0, 224, 0.42);
  box-shadow: 0 10px 22px rgba(0, 229, 255, 0.22);
}

/* Slight emphasis for network shares vs copy */

.single-header .single-share__btn[data-mcd-share="x"],
.single-header .single-share__btn[data-mcd-share="linkedin"] {
  background: rgba(8, 14, 34, 0.92);
  border-color: rgba(0, 229, 255, 0.45);
}

.single-header .single-share__btn[data-mcd-share="x"]:hover,
.single-header .single-share__btn[data-mcd-share="linkedin"]:hover,
.single-header .single-share__btn[data-mcd-share="x"]:focus-visible,
.single-header .single-share__btn[data-mcd-share="linkedin"]:focus-visible {
  border-color: rgba(255, 0, 224, 0.46);
}

@media (max-width: 780px) {
  .single-header {
    grid-template-columns: 1fr;
  }

  .single-header .single-share {
    justify-self: start;
  }
}

/* Always-visible collapsed ToC rail (expands on hover/focus) */

.single-toc {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  top: 96px;
  width: 38px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  z-index: 100;
  background: rgba(6, 14, 36, 0.72);
  border: 1px solid rgba(79, 240, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(3, 8, 22, 0.55), inset 0 0 0 1px rgba(255, 116, 228, 0.06);
  transition: width 0.18s ease, box-shadow 0.18s ease;
  scrollbar-color: rgba(79, 240, 255, 0.6) rgba(6, 14, 36, 0.6);
}

.single-toc__handle {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  display: block;
  padding: 8px 6px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.single-toc__title {
  display: none;
}

.single-toc__nav {
  display: none;
  padding: 12px 12px 14px;
}

.single-toc:hover,
.single-toc:focus-within {
  width: clamp(240px, 20vw, 300px);
  background: linear-gradient(160deg, rgba(8,14,34,0.92), rgba(3,8,22,0.9));
  box-shadow: 0 26px 56px rgba(3, 8, 24, 0.58);
}

.single-toc:hover .single-toc__nav,
.single-toc:focus-within .single-toc__nav {
  display: block;
}

.single-toc:hover .single-toc__handle,
.single-toc:focus-within .single-toc__handle {
  writing-mode: horizontal-tb;
  transform: none;
  padding: 10px 12px 6px;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  border-bottom: 1px solid rgba(79, 240, 255, 0.18);
}

/* Arrow affordance on handle */

.single-toc__handle::after {
  content: '›';
  display: inline-block;
  margin-inline-start: 6px;
  transform: rotate(90deg);
  color: var(--text-secondary);
}

.single-toc:hover .single-toc__handle::after,
.single-toc:focus-within .single-toc__handle::after {
  transform: rotate(0deg);
}

/* Ensure collapsed state hides nav at all sizes (overrides earlier rules) */

.single-toc:not(:is(:hover, :focus-within)) .single-toc__nav {
  display: none !important;
}

/* Nav link polish */
/* stylelint-disable-next-line no-descending-specificity -- ToC links live later in cascade for readability without changing specificity */

.single-toc__nav a {
  position: relative;
  border-radius: 8px;
  padding: 8px 12px; /* +2px so text never clashes with bracket */
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  word-break: break-word;
}
/* Bracket bar rendered outside the text box by 2px */

.single-toc__nav a::before {
  content: "";
  position: absolute;
  left: -2px; /* 2px outside the text box as requested */
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: transparent; /* hidden by default */
  transition: background 140ms ease, opacity 140ms ease;
  opacity: 0.9;
}

.single-toc__nav a:hover,
.single-toc__nav a:focus-visible {
  color: var(--text-primary);
  background: rgba(4, 12, 30, 0.5);
  outline: none;
}

.single-toc__nav a:hover::before,
.single-toc__nav a:focus-visible::before {
  background: var(--neon-magenta);
}

.single-toc__nav a.is-active::before {
  background: var(--neon-amber);
}

.single-toc__nav a.is-active {
  color: var(--text-primary);
  background: rgba(0, 229, 255, 0.08);
}

/* Scrollbar polish */

.single-toc::-webkit-scrollbar {
  width: 10px;
}

.single-toc::-webkit-scrollbar-thumb {
  background: rgba(79, 240, 255, 0.6);
  border-radius: 8px;
}

.single-toc::-webkit-scrollbar-track {
  background: rgba(6, 14, 36, 0.2);
}

/* Layout with ToC rail */
@media (min-width: 1100px) {
  .single-layout {
    display: block; /* ToC no longer consumes a column */
  }

  .single-layout .single-toc__title {
    display: none !important;
  }

  .single-toc__nav {
    display: grid;
    gap: 6px;
  }

  .single-toc__nav a {
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    padding: 6px 8px;
    display: block;
  }

  .single-toc__nav a:hover,
  .single-toc__nav a:focus-visible {
    color: var(--neon-amber);
    background: rgba(4, 12, 30, 0.5);
    outline: none;
  }
}

/* Convert ToC to viewport side rail on very wide screens */
@media (min-width: 1600px) {
  .single-layout {
    display: block;
  }

  .single-layout .single-toc {
    position: fixed;
    right: clamp(16px, 2vw, 28px);
    top: 96px; /* keep clear of header */
    width: clamp(240px, 18vw, 300px);
    max-height: calc(100vh - 120px);
    overflow: auto;
    z-index: 100;
  }
}

/* Remove previous hide rule: ToC is always visible as a side rail */

/* Single-column only; wide-mode removed per design */

/* Author card */

.single-author {
  margin-top: clamp(28px, 5vw, 44px);
}


.single-author__inner {
  background: linear-gradient(160deg, rgba(8, 14, 34, 0.92), rgba(3, 8, 22, 0.9));
  border: 1px solid rgba(79, 240, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(3, 8, 22, 0.5), inset 0 0 0 1px rgba(255, 116, 228, 0.06);
  padding: clamp(18px, 3vw, 26px);
  gap: 14px;
}

.single-author__byline {
  color: var(--text-primary);
}

.single-author__bio {
  color: var(--text-secondary);
  margin: 0;
}

/* Next / Prev navigation */

.single-nav {
  margin-top: clamp(28px, 5vw, 44px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 3vw, 22px);
}

.single-nav__link {
  display: block;
  background: rgba(6, 14, 36, 0.55);
  border: 1px solid rgba(79, 240, 255, 0.18);
  border-radius: 14px;
  padding: clamp(14px, 3vw, 20px);
  text-decoration: none;
  color: var(--text-secondary);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.single-nav__link:hover,
.single-nav__link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 0, 224, 0.36);
  color: var(--text-primary);
  outline: none;
}

@media (max-width: 780px) {
  .single-nav { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------
   Neon hash overlay for hero + reading surface
   -------------------------------------------------------------- */

.single-hero,
.single-article__inner {
  position: relative;
}

.single-hero::before,
.single-article__inner::before {
  content: none !important;
}

/* Ensure inner content sits above overlay */

.single-hero__inner,
.single-article__inner > * {
  position: relative;
  z-index: 1;
}

/* Micro breathing room to prevent glow/text-shadow clipping near curved edges */

.single-hero {
  padding-left: calc(clamp(5%, 8vw, 10%) + 1px);
  padding-right: calc(clamp(5%, 8vw, 10%) + 1px);
  background: transparent !important;
}

.single-article__inner {
  padding-left: calc(clamp(40px, 6vw, 60px) + 1px);
  padding-right: calc(clamp(40px, 6vw, 60px) + 1px);
  background: linear-gradient(160deg, rgba(8, 12, 28, 0.96), rgba(4, 10, 24, 0.94)) !important;
}

/* Global background moved to assets/cta.css (body::before/::after) */

/* Single-post kitty overlay moved to .site-backdrop in style.css */
