/* ============================================================
   AQUILA360 — BLOG POST ("Insights" article)
   Extends the Operations Deck system (redesign.css). Pairs with
   blog-redesign.css (reuses .blog-card / .loading-spinner for the
   related grid). Class + id names match those js/blog.js reads/writes.
   ============================================================ */

/* ---- Reading progress bar ---------------------------------------- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--grad-spire);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---- Post hero (ink) --------------------------------------------- */
.post-hero {
  background: var(--ink);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
  padding-top: 132px;
  padding-bottom: clamp(40px, 5vw, 60px);
}
.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line-dark-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 30% 0%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 80% at 30% 0%, #000, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.post-hero .container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.post-breadcrumb {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--on-dark-mute);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.post-breadcrumb a:hover {
  color: var(--teal);
}
.post-breadcrumb .current {
  color: var(--on-dark-soft);
}
.post-hero-category {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid rgba(25, 211, 181, 0.3);
  background: rgba(25, 211, 181, 0.08);
  border-radius: 40px;
  padding: 5px 13px;
  margin-bottom: 22px;
}
.post-hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.08;
  max-width: 22ch;
}
.post-meta-row {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
}
.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--on-dark-soft);
}
.post-meta-item svg {
  color: var(--teal);
  flex: none;
}

/* ---- Layout ------------------------------------------------------ */
.post-layout {
  background: #fff;
  padding-block: clamp(44px, 6vw, 72px);
}
.post-layout .container {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.post-layout .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(36px, 5vw, 68px);
}
.post-content-col {
  min-width: 0;
  max-width: 760px;
}

/* ---- Featured banner --------------------------------------------- */
.post-featured-banner {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: clamp(32px, 4vw, 48px);
  background: linear-gradient(135deg, var(--ink-2), var(--ink-3));
}
.post-featured-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Loading / error --------------------------------------------- */
#post-loading {
  text-align: center;
  padding: 64px 20px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
#post-error {
  color: var(--muted);
}
#post-error p {
  font-size: 17px;
}

/* ============================ MARKDOWN PROSE ============================ */
.blog-content {
  font-size: 17.5px;
  line-height: 1.78;
  color: var(--text-soft);
}
.blog-content > *:first-child {
  margin-top: 0;
}
.blog-content p {
  margin: 0 0 24px;
}
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  color: var(--text);
  scroll-margin-top: 100px;
}
.blog-content h2 {
  font-size: clamp(24px, 3vw, 31px);
  margin: 52px 0 18px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
/* avoid a doubled rule when markdown "---" sits right before a heading */
.blog-content hr + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 24px;
}
.blog-content h3 {
  font-size: 21px;
  margin: 38px 0 14px;
}
.blog-content h4 {
  font-size: 17.5px;
  margin: 30px 0 12px;
}
.blog-content a {
  color: var(--azure);
  font-weight: 500;
  border-bottom: 1px solid rgba(30, 127, 212, 0.3);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.blog-content a:hover {
  color: var(--teal-deep);
  border-bottom-color: var(--teal-deep);
}
.blog-content strong {
  color: var(--text);
  font-weight: 600;
}
.blog-content ul,
.blog-content ol {
  margin: 0 0 24px;
  padding-left: 4px;
  display: grid;
  gap: 12px;
}
.blog-content ul li,
.blog-content ol li {
  position: relative;
  padding-left: 30px;
  line-height: 1.7;
}
.blog-content ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--teal);
  transform: rotate(45deg);
}
.blog-content ol {
  counter-reset: li;
}
.blog-content ol li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--azure);
}
.blog-content li > ul,
.blog-content li > ol {
  margin: 12px 0 0;
}
.blog-content blockquote {
  margin: 32px 0;
  padding: 6px 0 6px 26px;
  border-left: 3px solid var(--teal);
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
}
.blog-content blockquote p {
  margin: 0;
}
.blog-content code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text);
}
.blog-content pre {
  margin: 28px 0;
  background: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: var(--r);
  padding: 22px 24px;
  overflow-x: auto;
}
.blog-content pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--on-dark);
  font-size: 13.5px;
  line-height: 1.7;
}
.blog-content img {
  border-radius: var(--r);
  border: 1px solid var(--line);
  margin: 28px 0;
}
.blog-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
}
.blog-content th,
.blog-content td {
  border: 1px solid var(--line);
  padding: 12px 16px;
  text-align: left;
}
.blog-content th {
  background: var(--paper);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ---- Share bar --------------------------------------------------- */
.share-bar {
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.share-bar > span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 15px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.share-btn svg {
  flex: none;
}
.share-btn:hover {
  border-color: var(--teal);
  color: var(--text);
  background: var(--paper);
}

/* ---- Sidebar ----------------------------------------------------- */
.post-sidebar {
  display: grid;
  gap: 20px;
}
.post-sidebar-sticky {
  position: sticky;
  top: 100px;
}
.sidebar-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 22px;
}
.sidebar-card h4 {
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* TOC */
.toc-list {
  display: grid;
  gap: 2px;
}
.toc-list li {
  line-height: 1.4;
}
.toc-list a {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.toc-list a:hover {
  color: var(--text);
  border-left-color: var(--teal);
  background: var(--paper);
}

/* Author */
.author-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.author-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-spire);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 20px;
  flex: none;
}
.author-info .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text);
}
.author-info .role {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* Tags */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 6px 12px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tag-pill:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
}

/* Sidebar CTA */
.cta-sidebar-card {
  background: var(--ink);
  color: var(--on-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--r);
  padding: 26px 24px;
}
.cta-sidebar-card h4 {
  color: #fff;
  font-size: 19px;
  line-height: 1.25;
  margin-bottom: 10px;
}
.cta-sidebar-card p {
  font-size: 14px;
  color: var(--on-dark-soft);
  margin-bottom: 20px;
}
.cta-sidebar-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--teal);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: var(--r-sm);
  box-shadow: 0 10px 24px -10px rgba(25, 211, 181, 0.6);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.cta-sidebar-card .btn:hover {
  background: var(--teal-deep);
  transform: translateY(-2px);
}

/* ---- Related posts ----------------------------------------------- */
.related-posts-section {
  background: var(--paper);
  padding-block: clamp(56px, 7vw, 96px);
}
.related-posts-section .container {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.related-posts-section .caption {
  margin-bottom: 40px;
}
.section-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-deep);
  display: block;
  margin-bottom: 14px;
}
.related-posts-section .caption h2 {
  font-size: clamp(28px, 3.6vw, 40px);
}
.related-posts-section .caption h2 span {
  background: var(--grad-spire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---- Bottom CTA (ink) -------------------------------------------- */
.post-bottom-cta {
  background: var(--ink);
  color: var(--on-dark);
  text-align: center;
  padding-block: clamp(64px, 8vw, 104px);
  padding-inline: var(--gutter);
}
.post-bottom-cta h2 {
  color: #fff;
  font-size: clamp(30px, 4.4vw, 50px);
  max-width: 18ch;
  margin: 0 auto;
}
.post-bottom-cta h2 span {
  background: var(--grad-spire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.post-bottom-cta > p {
  margin: 18px auto 36px;
  color: var(--on-dark-soft);
  font-size: 18px;
  max-width: 56ch;
}
.post-bottom-cta .btn-primary,
.post-bottom-cta .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  padding: 15px 28px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  margin: 6px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.post-bottom-cta .btn-primary {
  background: var(--teal);
  color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(25, 211, 181, 0.6);
}
.post-bottom-cta .btn-primary:hover {
  background: var(--teal-deep);
  transform: translateY(-2px);
}
.post-bottom-cta .btn-outline {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--line-dark);
}
.post-bottom-cta .btn-outline:hover {
  border-color: var(--teal);
  color: #fff;
  transform: translateY(-2px);
}

/* ---- Responsive -------------------------------------------------- */
@media (max-width: 940px) {
  .post-layout .row {
    grid-template-columns: 1fr;
  }
  .post-content-col {
    max-width: 760px;
  }
  .post-sidebar-sticky {
    position: static;
  }
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}
