/**
 * Skyonix Blog Article — dark theme, sticky TOC + lead form.
 */

.blog-article-page {
  --blog-page-bg: #000000;
  --blog-card-bg: #111111;
  --blog-card-bg-alt: #121212;
  --blog-card-border: rgba(255, 255, 255, 0.1);
  --blog-accent: #a63cff;
  --blog-accent-hover: #c084fc;
  --blog-text-primary: #ffffff;
  --blog-text-muted: #a1a1aa;
  --blog-text-body: #d4d4d8;
  --blog-table-border: #9a2fff;
  --blog-sticky-top: 90px;
  background-color: var(--blog-page-bg) !important;
  color: var(--blog-text-body);
}

/* overflow-x: hidden on body breaks position: sticky in many browsers */
body.blog-article-page {
  overflow-x: clip;
}

.blog-article-page main {
  background-color: var(--blog-page-bg);
  overflow: visible;
}

.blog-article-section-wrap,
.blog-article-section-wrap .container {
  overflow: visible;
}

.blog-article-page img {
  max-width: 100%;
  height: auto;
}

/* Hero banner — blog.png as full-width background (Nixace-style) */
.blog-hero-banner {
  margin: 0;
  padding: 0;
  background-color: var(--blog-page-bg);
  width: 100%;
}

.blog-hero-banner__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(260px, 38vh, 420px);
  background-color: #000;
  background-image: url('../image/blog.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  overflow: hidden;
}

.blog-hero-banner__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0.65) 100%),
    linear-gradient(135deg, rgba(107, 0, 255, 0.18) 0%, rgba(0, 0, 0, 0.1) 55%, rgba(154, 47, 255, 0.15) 100%);
  pointer-events: none;
}

.blog-hero-banner__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(260px, 38vh, 420px);
  padding: 2rem 15px;
}

.blog-hero-banner__title {
  width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  text-align: center;
  font-size: clamp(1.65rem, 4.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
  max-width: 960px;
}

.blog-breadcrumb {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.blog-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blog-text-muted);
}

.blog-breadcrumb li + li::before {
  content: "/";
  color: rgba(255, 255, 255, 0.35);
  margin-right: 0.15rem;
}

.blog-breadcrumb a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-breadcrumb a:hover {
  color: var(--blog-accent);
}

.blog-breadcrumb li[aria-current="page"] {
  color: var(--blog-text-primary);
}

/* Article wrap */
.blog-article-section-wrap {
  padding: clamp(36px, 5vw, 56px) 0 clamp(48px, 6vw, 72px);
  background: var(--blog-page-bg);
}

.blog-article-section-wrap .container {
  max-width: 1320px;
  overflow: visible;
}

/* Meta hero row (Nixace-style: badge + title + meta | featured image) */
.blog-article-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.blog-article-title {
  font-size: clamp(1.65rem, 3.2vw, 2rem);
  line-height: 1.25;
  margin: 0 0 0.8rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  letter-spacing: -0.02em;
}

.blog-article-meta {
  color: var(--blog-text-muted);
  font-size: 0.95rem;
}

.blog-article-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 30px;
  background: linear-gradient(135deg, #6b00ff 0%, #9a2fff 50%, #e14bff 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.blog-article-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  color: var(--blog-text-muted);
  font-size: 0.95rem;
}

.blog-article-meta-row strong {
  color: var(--blog-text-primary);
}

.blog-article-meta-row .meta-divider {
  opacity: 0.35;
}

.blog-article-meta-row .blog-reading-time {
  color: var(--blog-accent);
  font-weight: 600;
}

.blog-article-hero-right {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--blog-card-border);
  background: var(--blog-card-bg);
}

.blog-article-hero-right img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

/* Author */
.blog-author-box {
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.blog-author-box .author-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blog-accent);
  margin-bottom: 0.35rem;
}

.blog-author-box h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--blog-text-primary);
}

.blog-author-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--blog-text-body);
  line-height: 1.7;
}

/* Three-column layout (Nixace: sticky sidebars + page-scrolling center) */
.blog-article-layout,
.blog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 1.5rem;
  overflow: visible;
}

.blog-article-sidebar-left,
.blog-article-sidebar-right {
  overflow: visible;
  min-width: 0;
}

.blog-article-box {
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.blog-article-box h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--blog-card-border);
  color: var(--blog-text-primary);
}

.blog-article-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-article-box ul li + li {
  margin-top: 0.45rem;
}

.blog-article-box a {
  color: var(--blog-text-body);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.45;
  display: inline-block;
  padding: 2px 0 2px 12px;
  position: relative;
  transition: color 0.2s ease;
}

.blog-article-box a:hover {
  color: var(--blog-accent);
}

.blog-article-sidebar-left ul li a.active {
  color: var(--blog-accent);
  font-weight: 600;
}

.blog-article-sidebar-left ul li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--blog-accent);
  border-radius: 4px;
}

/* Sticky sidebars (Nixace: sticky-left / sticky-right on .blog-article-box) */
.sticky-left,
.sticky-right {
  position: -webkit-sticky;
  position: sticky;
  top: var(--blog-sticky-top);
  align-self: start;
  width: 100%;
  z-index: 2;
}

.blog-article-sidebar-left .blog-article-box {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--blog-accent) transparent;
}

.blog-article-sidebar-left .blog-article-box::-webkit-scrollbar {
  width: 6px;
}

.blog-article-sidebar-left .blog-article-box::-webkit-scrollbar-track {
  background: transparent;
}

.blog-article-sidebar-left .blog-article-box::-webkit-scrollbar-thumb {
  background: var(--blog-accent);
  border-radius: 10px;
}

.blog-article-sidebar-left .blog-article-box::-webkit-scrollbar-thumb:hover {
  background: var(--blog-accent-hover);
}

.blog-toc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  border-radius: 12px;
  color: var(--blog-text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.blog-toc-toggle:hover {
  border-color: rgba(166, 60, 255, 0.45);
}

.blog-toc-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.blog-toc-toggle i {
  transition: transform 0.25s ease;
  color: var(--blog-accent);
}

@media (max-width: 991.98px) {
  .blog-toc-panel:not(.is-open) {
    display: none;
  }
}

/* Article content */
.blog-article-content {
  min-width: 0;
  overflow-x: auto;
}

.blog-article-content section + section {
  margin-top: 1.5rem;
}

.blog-article-content h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--blog-text-primary);
}

.blog-article-content h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  color: var(--blog-text-primary);
}

.blog-article-content > section > h2:first-child {
  margin-top: 0;
}

.blog-article-content > h3:first-child {
  margin-top: 0;
}

.blog-article-content p {
  color: var(--blog-text-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.15rem;
}

.blog-article-content ul,
.blog-article-content ol {
  color: var(--blog-text-body);
  margin-bottom: 1.15rem;
  padding-left: 1.35rem;
  line-height: 1.75;
}

.blog-article-content li {
  margin-bottom: 0.45rem;
}

.blog-article-content a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-article-content a:hover {
  color: var(--blog-accent-hover);
}

.blog-article-content strong {
  color: var(--blog-text-primary);
  font-weight: 600;
}

.blog-tldr-box {
  background: var(--blog-card-bg-alt);
  border: 1px solid rgba(154, 47, 255, 0.3);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.blog-tldr-box h2 {
  font-size: 1.25rem !important;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  color: var(--blog-accent) !important;
}

.blog-tldr-box ul {
  margin-bottom: 0;
}

.blog-article-content .table-responsive {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow-x: auto;
}

.blog-article-content table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--blog-card-bg) !important;
  color: var(--blog-text-primary) !important;
  margin: 0;
  font-size: 0.95rem;
}

.blog-article-content table th,
.blog-article-content table td {
  background-color: var(--blog-card-bg) !important;
  color: var(--blog-text-primary) !important;
  border: 1px solid var(--blog-table-border);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.blog-article-content table th {
  font-weight: 600;
  background: rgba(107, 0, 255, 0.15) !important;
}

.blog-inline-figure {
  margin: 1.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--blog-card-border);
  background: var(--blog-card-bg);
}

.blog-inline-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-inline-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  background: var(--blog-card-bg-alt);
}

.blog-callout {
  border-left: 4px solid var(--blog-accent);
  background: rgba(107, 0, 255, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}

.blog-callout p:last-child {
  margin-bottom: 0;
}

.blog-faq-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--blog-card-border);
}

.blog-faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.blog-faq-item h3 {
  font-size: 1.1rem;
  margin-top: 0;
}

.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.blog-related-card {
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.blog-related-card:hover {
  transform: translateY(-3px);
  border-color: rgba(166, 60, 255, 0.4);
}

.blog-related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.blog-related-card-body {
  padding: 1rem 1.15rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-related-card-body time {
  font-size: 0.8rem;
  color: var(--blog-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-related-card-body h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.blog-related-card-body h3 a {
  color: var(--blog-text-primary);
  text-decoration: none;
}

.blog-related-card-body h3 a:hover {
  color: var(--blog-accent);
}

.blog-related-card-body p {
  font-size: 0.875rem;
  margin-bottom: 0;
  flex-grow: 1;
  color: var(--blog-text-muted);
}

.blog-article-sidebar-right .form-control {
  background: var(--blog-card-bg-alt);
  border-color: var(--blog-card-border);
  color: var(--blog-text-primary);
  border-radius: 8px;
  min-height: 46px;
}

.blog-article-sidebar-right .form-control::placeholder {
  color: var(--blog-text-muted);
}

.blog-article-sidebar-right .form-control:focus {
  background: var(--blog-card-bg-alt);
  border-color: var(--blog-accent);
  color: var(--blog-text-primary);
  box-shadow: 0 0 0 2px rgba(154, 47, 255, 0.2);
}

.blog-form-submit {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #6b00ff 0%, #9a2fff 50%, #e14bff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.blog-form-submit:hover {
  opacity: 0.9;
  color: #fff;
}

.blog-inline-cta {
  background: var(--blog-card-bg-alt);
  border: 1px solid rgba(154, 47, 255, 0.35);
  border-radius: 12px;
  padding: 1.75rem;
  margin: 2rem 0;
  text-align: center;
}

.blog-inline-cta h2 {
  margin-top: 0 !important;
}

.blog-sources-list {
  font-size: 0.9rem;
}

.blog-sources-list li {
  margin-bottom: 0.65rem;
}

.blog-back-btn {
  margin-top: 2rem;
}

.blog-page-cta.cta-section {
  position: relative;
  background-color: #05030d;
  background-image: url('../image/CTA.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 60px 0 60px !important;
  border-top: 1px solid rgba(148, 163, 253, 0.25);
  isolation: isolate;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

.blog-page-cta.cta-section .cta-title {
  margin-top: 0;
}

.blog-page-cta.cta-section .button-grp {
  margin-bottom: 0;
}

.blog-contact-strip {
  padding: 60px 0;
  background: var(--blog-page-bg);
  border-top: 1px solid var(--blog-card-border);
}

.blog-contact-strip .section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--blog-text-primary);
}

.blog-contact-strip .section-description {
  color: var(--blog-text-muted);
  margin-bottom: 1.5rem;
}

.blog-toast {
  position: fixed;
  right: 24px;
  top: 90px;
  z-index: 9999;
  padding: 12px 16px;
  background: var(--blog-card-bg);
  color: #fff;
  border-left: 4px solid var(--blog-accent);
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-10px);
  transition: 0.3s;
  max-width: 320px;
}

.blog-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Tablet / laptop ≤1199 — 2 columns, form drops below article */
@media (max-width: 1199.98px) {
  .blog-article-layout,
  .blog-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .blog-article-sidebar-right {
    grid-column: 1 / -1;
  }

  .sticky-right {
    position: static;
  }
}

/* Desktop TOC always expanded + full-height sidebar track for sticky */
@media (min-width: 992px) {
  .blog-article-sidebar-left,
  .blog-article-sidebar-right {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }

  .blog-toc-panel,
  #blogTocPanel {
    display: block !important;
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    visibility: visible !important;
    overflow: visible !important;
  }

  .blog-toc-toggle {
    display: none !important;
  }
}

/* Mobile + small tablet ≤991 */
@media (max-width: 991.98px) {
  .blog-article-hero {
    grid-template-columns: 1fr;
  }

  .blog-article-layout,
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-article-sidebar-left,
  .blog-article-sidebar-right {
    display: block;
    align-self: auto;
  }

  .sticky-left,
  .sticky-right {
    position: static;
    top: auto;
  }

  .blog-article-sidebar-left .blog-article-box {
    max-height: none;
    overflow: visible;
  }
}

/* Mobile ≤767 */
@media (max-width: 767.98px) {
  .blog-hero-banner__media,
  .blog-hero-banner__inner {
    min-height: clamp(200px, 42vw, 300px);
  }

  .blog-hero-banner__title {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
  }

  .blog-article-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .blog-article-section-wrap {
    padding: 28px 0 40px;
  }

  .blog-article-content p {
    font-size: 1rem;
  }

  .blog-article-content table {
    font-size: 0.85rem;
  }

  .blog-article-content table th,
  .blog-article-content table td {
    padding: 8px 10px;
  }

  .blog-related-grid {
    grid-template-columns: 1fr;
  }

  .blog-toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-related-card,
  .blog-form-submit,
  .blog-toast,
  .blog-toc-toggle i {
    transition: none;
  }
}
