/* ==========================================================================
   Nordic Style Article — Premium Light Theme + 3D Parallax Scroller
   MAXXMA Knowledge Hub | Phase 3 — Content Hub & Knowledge SEO
   ========================================================================== */

/* === CSS Custom Properties (Light Theme) === */
:root {
  --ns-bg-primary: #FFFFFF;
  --ns-bg-soft: #F8FAFC;
  --ns-bg-warm: #FDF8F0;
  --ns-accent-gold: #947E33;
  --ns-accent-blue: #48819F;
  --ns-accent-blue-light: #D6E8F3;
  --ns-text-primary: #1E293B;
  --ns-text-secondary: #475569;
  --ns-text-muted: #64748B;
  --ns-border: #E2E8F0;
  --ns-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --ns-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --ns-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --ns-radius: 16px;
  --ns-transition: 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* === Base Reset for Article === */
.ns-article {
  font-family: 'Sarabun', 'GraphikThai', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ns-text-primary);
  background: var(--ns-bg-primary);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* === 3D Parallax Container === */
.ns-scene {
  perspective: 1200px;
  transform-style: preserve-3d;
  will-change: transform;
}

.ns-layer {
  transition: transform var(--ns-transition);
}

/* ==========================================================================
   HERO SECTION — Full-bleed parallax hero with depth
   ========================================================================== */
.ns-hero {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ns-bg-soft);
}

.ns-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.ns-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.1) 0%,
    rgba(255,255,255,0.7) 60%,
    rgba(255,255,255,0.95) 100%
  );
  z-index: 1;
}

.ns-hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ns-hero:hover .ns-hero__bg-img {
  transform: scale(1.02);
}

.ns-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
  animation: nsFadeUp 1s ease-out;
}

.ns-hero__breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ns-text-muted);
  margin-bottom: 1rem;
}

.ns-hero__breadcrumb a {
  color: var(--ns-accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

.ns-hero__breadcrumb a:hover {
  color: var(--ns-accent-gold);
}

.ns-hero__category {
  display: inline-block;
  background: var(--ns-accent-blue-light);
  color: var(--ns-accent-blue);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.ns-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--ns-text-primary);
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.ns-hero__title span {
  color: var(--ns-accent-gold);
}

.ns-hero__subtitle {
  font-size: 1.125rem;
  color: var(--ns-text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.ns-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--ns-text-muted);
}

.ns-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   ARTICLE BODY CONTAINER
   ========================================================================== */
.ns-article__container {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ==========================================================================
   SECTION — 3D Layered Sections
   ========================================================================== */
.ns-section {
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ns-section.ns-visible {
  opacity: 1;
  transform: translateY(0);
}

.ns-section__header {
  margin-bottom: 1.5rem;
}

.ns-section__num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ns-accent-gold);
  margin-bottom: 0.5rem;
}

.ns-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ns-text-primary);
  line-height: 1.35;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.ns-section__body {
  font-size: 1.05rem;
  color: var(--ns-text-secondary);
  line-height: 1.9;
}

.ns-section__body p {
  margin-bottom: 1.25rem;
}

.ns-section__body strong {
  color: var(--ns-text-primary);
  font-weight: 600;
}

/* ==========================================================================
   FIGURE / IMAGE WITH 3D FLOAT EFFECT
   ========================================================================== */
.ns-figure {
  margin: 2.5rem 0;
  border-radius: var(--ns-radius);
  overflow: hidden;
  box-shadow: var(--ns-shadow-md);
  background: var(--ns-bg-soft);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.5s ease;
}

.ns-figure:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--ns-shadow-lg);
}

.ns-figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

.ns-figure:hover img {
  transform: scale(1.03);
}

.ns-figure__caption {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--ns-text-muted);
  text-align: center;
  background: var(--ns-bg-primary);
  border-top: 1px solid var(--ns-border);
}

/* ==========================================================================
   TWO-COLUMN LAYOUT (text + image side-by-side on desktop)
   ========================================================================== */
.ns-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2.5rem 0;
}

@media (max-width: 768px) {
  .ns-two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.ns-two-col__text {
  font-size: 1.05rem;
  color: var(--ns-text-secondary);
  line-height: 1.9;
}

.ns-two-col__visual {
  border-radius: var(--ns-radius);
  overflow: hidden;
  box-shadow: var(--ns-shadow-md);
}

.ns-two-col__visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   HIGHLIGHT BOX (Gold accent callout)
   ========================================================================== */
.ns-highlight-box {
  background: linear-gradient(135deg, #FEF9E7 0%, #FDF3D0 100%);
  border-left: 4px solid var(--ns-accent-gold);
  border-radius: 0 var(--ns-radius) var(--ns-radius) 0;
  padding: 1.75rem 2rem;
  margin: 2.5rem 0;
}

.ns-highlight-box__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ns-accent-gold);
  margin-bottom: 0.75rem;
}

.ns-highlight-box p {
  color: var(--ns-text-secondary);
  margin: 0;
  font-size: 1.02rem;
}

/* ==========================================================================
   SPEC TABLE — Technical specs (VLT, TSER)
   ========================================================================== */
.ns-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--ns-bg-primary);
  border-radius: var(--ns-radius);
  overflow: hidden;
  box-shadow: var(--ns-shadow-sm);
}

.ns-spec-table thead {
  background: var(--ns-accent-blue);
  color: #fff;
}

.ns-spec-table th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.ns-spec-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--ns-border);
  font-size: 0.95rem;
  color: var(--ns-text-secondary);
}

.ns-spec-table tr:last-child td {
  border-bottom: none;
}

.ns-spec-table tr:nth-child(even) {
  background: var(--ns-bg-soft);
}

/* ==========================================================================
   FAQ SECTION — Accordion style within article
   ========================================================================== */
.ns-faq {
  background: var(--ns-bg-soft);
  border-radius: var(--ns-radius);
  padding: 2rem;
  margin: 3rem 0;
}

.ns-faq__heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ns-text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.ns-faq__item {
  background: var(--ns-bg-primary);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: var(--ns-shadow-sm);
  transition: box-shadow 0.3s ease;
}

.ns-faq__item:hover {
  box-shadow: var(--ns-shadow-md);
}

.ns-faq__question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ns-text-primary);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

.ns-faq__question:hover {
  color: var(--ns-accent-blue);
}

.ns-faq__icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  color: var(--ns-accent-gold);
}

.ns-faq__item.ns-faq--open .ns-faq__icon {
  transform: rotate(45deg);
}

.ns-faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.ns-faq__item.ns-faq--open .ns-faq__answer {
  max-height: 500px;
}

.ns-faq__answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--ns-text-secondary);
  font-size: 0.98rem;
  line-height: 1.8;
}

/* ==========================================================================
   CTA SECTION — Contact / Service call-to-action
   ========================================================================== */
.ns-cta {
  background: linear-gradient(135deg, var(--ns-accent-blue) 0%, #3B6F8A 100%);
  border-radius: var(--ns-radius);
  padding: 3rem 2rem;
  margin: 4rem 0 2rem;
  text-align: center;
  color: #fff;
  box-shadow: var(--ns-shadow-lg);
}

.ns-cta__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.ns-cta__desc {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.ns-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.ns-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.ns-cta__btn--primary {
  background: #fff;
  color: var(--ns-accent-blue);
}

.ns-cta__btn--primary:hover {
  background: var(--ns-accent-gold);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.ns-cta__btn--secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}

.ns-cta__btn--secondary:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

/* ==========================================================================
   PARALLAX DEPTH LAYERS
   ========================================================================== */
.ns-parallax-layer {
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
}

/* Floating badge */
.ns-floating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ns-bg-primary);
  border: 1px solid var(--ns-border);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ns-text-secondary);
  box-shadow: var(--ns-shadow-sm);
  position: relative;
  z-index: 3;
}

.ns-floating-badge::before {
  content: '✓';
  color: #22C55E;
  font-weight: 700;
}

/* List with decorative icons */
.ns-list--decorated {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.ns-list--decorated li {
  padding: 0.5rem 0 0.5rem 1.75rem;
  position: relative;
  color: var(--ns-text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

.ns-list--decorated li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ns-accent-gold);
  transform: translateY(-50%);
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes nsFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   BACK TO HUB LINK
   ========================================================================== */
.ns-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ns-accent-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  transition: color 0.2s, gap 0.2s;
  margin-bottom: 2rem;
}

.ns-back-link:hover {
  color: var(--ns-accent-gold);
  gap: 0.75rem;
}

.ns-back-link svg {
  transition: transform 0.2s;
}

.ns-back-link:hover svg {
  transform: translateX(-3px);
}

/* ==========================================================================
   TABLE OF CONTENTS (TOC)
   ========================================================================== */
.ns-toc {
  background: var(--ns-bg-soft);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  box-shadow: var(--ns-shadow-sm);
}

.ns-toc__heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ns-text-primary);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ns-toc__heading::before {
  content: '📑';
  font-size: 1.25rem;
}

.ns-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
}

.ns-toc__item {
  counter-increment: toc-counter;
  margin-bottom: 0.25rem;
}

.ns-toc__item:last-child {
  margin-bottom: 0;
}

.ns-toc__link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--ns-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  transition: all 0.25s ease;
  position: relative;
}

.ns-toc__link::before {
  content: counter(toc-counter) '.';
  font-weight: 700;
  color: var(--ns-accent-gold);
  font-size: 0.8rem;
  min-width: 1.25rem;
  flex-shrink: 0;
}

.ns-toc__link:hover {
  background: var(--ns-accent-blue-light);
  color: var(--ns-accent-blue);
}

.ns-toc__link.ns-toc--active {
  background: var(--ns-accent-blue-light);
  color: var(--ns-accent-blue);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ns-accent-blue);
}

/* TOC as sticky sidebar on wide screens (≥1200px) */
@media (min-width: 1200px) {
  .ns-toc {
    position: fixed;
    left: max(calc((100vw - 820px) / 2 - 260px), 1rem);
    top: 8rem;
    width: 230px;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    padding: 1.25rem 1.25rem;
    margin-bottom: 0;
    z-index: 10;
  }

  .ns-toc__heading {
    font-size: 1rem;
  }

  .ns-toc__link {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
  }
}

@media (max-width: 1199px) {
  .ns-toc {
    /* Inline box on tablet/mobile */
    display: block;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .ns-hero {
    min-height: 55vh;
  }

  .ns-hero__title {
    font-size: 1.75rem;
  }

  .ns-hero__subtitle {
    font-size: 1rem;
  }

  .ns-hero__meta {
    font-size: 0.8rem;
    gap: 0.75rem;
  }

  .ns-section__title {
    font-size: 1.35rem;
  }

  .ns-section__body {
    font-size: 1rem;
  }

  .ns-article__container {
    padding: 2rem 1rem 3rem;
  }

  .ns-faq {
    padding: 1.5rem 1rem;
  }

  .ns-spec-table {
    font-size: 0.85rem;
  }

  .ns-spec-table th,
  .ns-spec-table td {
    padding: 0.6rem 0.75rem;
  }

  .ns-cta {
    padding: 2rem 1.25rem;
  }

  .ns-cta__title {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  .ns-hero__bg,
  .ns-cta,
  .ns-faq {
    display: none;
  }

  .ns-article {
    color: #000;
    background: #fff;
  }

  .ns-section {
    opacity: 1 !important;
    transform: none !important;
    break-inside: avoid;
  }
}