/**
 * NDSLinetoWP Post Themes v5.0
 * 4 themes: modern | infographic | interactive | laithai
 * Mobile-first, Astra compatible, GPU-accelerated animations
 */

/* ============================================================
   READING PROGRESS BAR (ทุก theme)
   ============================================================ */
.nds-reading-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  z-index: 9999;
  transition: width 0.1s linear;
}
.nds-theme-modern    .nds-reading-bar,
.nds-theme-interactive .nds-reading-bar { background: linear-gradient(90deg,#667eea,#764ba2); }
.nds-theme-infographic .nds-reading-bar { background: linear-gradient(90deg,#f093fb,#f5576c); }
.nds-theme-laithai   .nds-reading-bar { background: linear-gradient(90deg,#8B0000,#FFD700); }

/* ============================================================
   ESTIMATED READ TIME BADGE
   ============================================================ */
.nds-read-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
  font-family: 'Sarabun', sans-serif;
}
.nds-read-time::before { content: '⏱'; }

/* ============================================================
   SCROLL REVEAL (ทุก theme)
   ============================================================ */
.nds-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(.4,0,.2,1),
              transform 0.65s cubic-bezier(.4,0,.2,1);
  will-change: transform, opacity;
}
.nds-reveal.nds-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .nds-reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   ██████  MODERN THEME
   ============================================================ */
.nds-theme-modern {
  font-family: 'Sarabun', 'Kanit', sans-serif;
}

/* Hero image เต็มความกว้าง */
.nds-theme-modern .nds-hero {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  height: clamp(220px, 45vw, 480px);
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 32px;
}
.nds-theme-modern .nds-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.nds-theme-modern .nds-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,20,.85) 0%, rgba(10,10,20,.1) 60%, transparent 100%);
}
.nds-theme-modern .nds-hero-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px 20px;
  color: #fff;
  font-size: clamp(18px, 4.5vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* Typography */
.nds-theme-modern .entry-content p,
.nds-theme-modern .entry-content .wp-block-paragraph p {
  font-size: clamp(15px, 2.5vw, 17px);
  line-height: 1.9;
  color: #2d2d2d;
}
.nds-theme-modern .entry-content h2,
.nds-theme-modern .entry-content .wp-block-heading h2 {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 800;
  color: #1a1a2e;
  margin: 40px 0 16px;
  padding-left: 14px;
  border-left: 4px solid #667eea;
  line-height: 1.3;
}
.nds-theme-modern .entry-content h3,
.nds-theme-modern .entry-content .wp-block-heading h3 {
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 700;
  color: #333;
  margin: 28px 0 10px;
}

/* Highlight quote */
.nds-theme-modern .entry-content blockquote,
.nds-theme-modern .wp-block-quote {
  border: none;
  background: linear-gradient(135deg, #667eea11, #764ba211);
  border-left: 4px solid #667eea;
  border-radius: 0 12px 12px 0;
  padding: 18px 20px;
  margin: 28px 0;
  font-size: 1.08em;
  font-style: italic;
  color: #444;
}

/* List styles */
.nds-theme-modern .entry-content ul li {
  padding: 4px 0 4px 8px;
  position: relative;
}
.nds-theme-modern .entry-content ul li::before {
  content: '▸';
  color: #667eea;
  margin-right: 8px;
}

/* ============================================================
   ████████ INFOGRAPHIC THEME
   ============================================================ */
.nds-theme-infographic {
  font-family: 'Sarabun', sans-serif;
}

/* Stat cards */
.nds-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.nds-stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(102,126,234,.35);
}
.nds-stat-card.accent-orange { background: linear-gradient(135deg,#f093fb,#f5576c); }
.nds-stat-card.accent-teal   { background: linear-gradient(135deg,#4facfe,#00f2fe); }
.nds-stat-card.accent-green  { background: linear-gradient(135deg,#43e97b,#38f9d7); }
.nds-stat-value {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  line-height: 1;
  display: block;
}
.nds-stat-unit  { font-size: 13px; opacity: .85; display: block; margin-top: 2px; }
.nds-stat-label { font-size: 12px; opacity: .8;  display: block; margin-top: 6px; }

/* Step timeline */
.nds-timeline { margin: 28px 0; }
.nds-timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.nds-step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: linear-gradient(135deg,#667eea,#764ba2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(102,126,234,.4);
}
.nds-step-body h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #1a1a2e; }
.nds-step-body p  { margin: 0; font-size: 14px; color: #666; line-height: 1.6; }

/* Feature icon cards */
.nds-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.nds-feature-card {
  background: #f8f9ff;
  border: 1px solid #e8ecff;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nds-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102,126,234,.18);
}
.nds-feature-icon { font-size: 28px; display: block; margin-bottom: 8px; }

/* Progress bars */
.nds-progress-wrap { margin: 10px 0; }
.nds-progress-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: #555; margin-bottom: 6px;
}
.nds-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 99px;
  overflow: hidden;
}
.nds-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,#667eea,#764ba2);
  border-radius: 99px;
  width: 0%;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* Infographic H2 style */
.nds-theme-infographic .entry-content h2,
.nds-theme-infographic .entry-content .wp-block-heading h2 {
  font-size: clamp(19px, 3.8vw, 26px);
  font-weight: 800;
  background: linear-gradient(135deg,#667eea,#764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 36px 0 14px;
}
.nds-theme-infographic .entry-content h3,
.nds-theme-infographic .entry-content .wp-block-heading h3 {
  font-size: clamp(16px,3vw,20px);
  font-weight: 700;
  color: #764ba2;
  margin: 24px 0 8px;
}

/* ============================================================
   ███ INTERACTIVE 3D THEME
   ============================================================ */
.nds-theme-interactive {
  font-family: 'Sarabun', sans-serif;
}

/* Parallax hero */
.nds-theme-interactive .nds-hero {
  position: relative;
  width: 100vw;
  left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  height: clamp(260px, 50vw, 560px);
  overflow: hidden;
  margin-bottom: 40px;
}
.nds-theme-interactive .nds-hero img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center;
  will-change: transform;
}
.nds-theme-interactive .nds-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,20,60,.7) 0%, rgba(0,100,200,.3) 100%);
}
.nds-theme-interactive .nds-hero-title {
  position: absolute;
  bottom: 28px; left: 20px; right: 20px;
  color: #fff;
  font-size: clamp(20px, 5vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
}

/* 3D hover cards */
.nds-card-3d-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
  perspective: 1200px;
}
.nds-card-3d {
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,40,120,.12);
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: default;
  border: 1px solid rgba(255,255,255,.8);
}
@media (hover: hover) {
  .nds-card-3d:hover {
    transform: perspective(600px) rotateX(-6deg) rotateY(6deg) scale(1.04);
    box-shadow: 0 20px 48px rgba(0,40,120,.22);
  }
}
.nds-card-3d-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.nds-card-3d-title { font-weight: 700; font-size: 14px; color: #1a2e6e; margin-bottom: 6px; }
.nds-card-3d-desc  { font-size: 13px; color: #666; line-height: 1.5; }

/* Floating badge */
.nds-badge-float {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg,#0066ff,#00c6ff);
  color: #fff;
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,102,255,.35);
  margin: 4px;
  animation: nds-float 3s ease-in-out infinite;
}
@keyframes nds-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Interactive H2 */
.nds-theme-interactive .entry-content h2,
.nds-theme-interactive .entry-content .wp-block-heading h2 {
  font-size: clamp(20px,4vw,28px);
  font-weight: 800;
  color: #0a1628;
  margin: 40px 0 16px;
  position: relative;
  padding-bottom: 10px;
}
.nds-theme-interactive .entry-content h2::after,
.nds-theme-interactive .entry-content .wp-block-heading h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 48px; height: 3px;
  background: linear-gradient(90deg,#0066ff,#00c6ff);
  border-radius: 2px;
}

/* Sticky CTA */
.nds-sticky-cta {
  position: fixed;
  bottom: 24px; right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.nds-sticky-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0066ff;
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Sarabun', sans-serif;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(0,102,255,.4);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.nds-sticky-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 32px rgba(0,102,255,.5);
  color: #fff;
  text-decoration: none;
}
.nds-sticky-btn.secondary {
  background: #fff;
  color: #0066ff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  font-size: 13px;
}

/* ============================================================
   🇹🇭 LAITHAI THEME — ไทยสมัยใหม่
   ============================================================ */
.nds-theme-laithai {
  font-family: 'Sarabun', sans-serif;
}

/* Thai ornament header */
.nds-laithai-hero {
  position: relative;
  background: linear-gradient(135deg, #8B0000 0%, #c0392b 40%, #8B6914 100%);
  padding: 40px 20px 32px;
  margin-bottom: 32px;
  overflow: hidden;
  border-radius: 0 0 32px 32px;
  text-align: center;
}
.nds-laithai-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,215,0,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,215,0,.12) 0%, transparent 40%);
}
.nds-laithai-hero img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 3px solid rgba(255,215,0,.5);
  position: relative;
}
.nds-laithai-hero-title {
  position: relative;
  color: #FFD700;
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  line-height: 1.3;
}

/* Thai ornament divider */
.nds-thai-divider {
  text-align: center;
  color: #8B6914;
  font-size: 20px;
  margin: 24px 0;
  letter-spacing: 8px;
  opacity: .6;
}
.nds-thai-divider::before, .nds-thai-divider::after {
  content: '❧';
}

/* Warm content box */
.nds-laithai-box {
  background: linear-gradient(135deg, #fffbf0, #fff8e7);
  border: 1px solid rgba(139,105,20,.2);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #8B0000;
}

/* H2 laithai */
.nds-theme-laithai .entry-content h2,
.nds-theme-laithai .entry-content .wp-block-heading h2 {
  font-size: clamp(20px,4vw,26px);
  font-weight: 800;
  color: #8B0000;
  margin: 36px 0 14px;
  text-align: center;
  position: relative;
  padding-bottom: 14px;
}
.nds-theme-laithai .entry-content h2::after,
.nds-theme-laithai .entry-content .wp-block-heading h2::after {
  content: '◆ ◆ ◆';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #FFD700;
  letter-spacing: 6px;
}
.nds-theme-laithai .entry-content h3,
.nds-theme-laithai .entry-content .wp-block-heading h3 {
  font-size: clamp(17px,3.2vw,21px);
  font-weight: 700;
  color: #6b3a00;
  margin: 24px 0 10px;
}
.nds-theme-laithai .entry-content p,
.nds-theme-laithai .entry-content .wp-block-paragraph p {
  line-height: 2;
  font-size: clamp(15px,2.5vw,17px);
  color: #3a2000;
}
.nds-theme-laithai .entry-content ul li::before {
  content: '◈';
  color: #8B0000;
  margin-right: 8px;
}

/* Thai highlight badge */
.nds-thai-badge {
  display: inline-block;
  background: linear-gradient(135deg,#8B0000,#c0392b);
  color: #FFD700;
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  margin: 3px;
}

/* ============================================================
   HIGHLIGHTS SECTION (all themes)
   ============================================================ */
.nds-highlights {
  background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
}
.nds-highlights h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 12px;
}
.nds-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 14px;
  color: #333;
  line-height: 1.55;
}
.nds-highlight-item:last-child { border-bottom: none; }
.nds-highlight-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: linear-gradient(135deg,#43e97b,#38f9d7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #fff;
  margin-top: 1px;
}

/* ============================================================
   THEME ADMIN SETTINGS BADGE
   ============================================================ */
.nds-theme-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-left: 8px;
}
.nds-badge-modern      { background: #667eea; }
.nds-badge-infographic { background: #f5576c; }
.nds-badge-interactive { background: #0066ff; }
.nds-badge-laithai     { background: #8B0000; }

/* ============================================================
   RESPONSIVE MOBILE OVERRIDES
   ============================================================ */
@media (max-width: 640px) {
  .nds-hero, .nds-laithai-hero { border-radius: 0; }
  .nds-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nds-card-3d-wrap { grid-template-columns: repeat(2, 1fr); }
  .nds-sticky-btn { padding: 10px 16px; font-size: 13px; }
  .nds-feature-grid { grid-template-columns: repeat(2, 1fr); }
  /* Disable parallax on mobile for performance */
  .nds-theme-interactive .nds-hero img { transform: none !important; }
}

/* ============================================================
   FONT IMPORT (Sarabun for Thai)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600;700;800&display=swap');
