/* ============================================================
   Nexora Hero Manager v1.1.0 — Public Styles
   Layouts: fullwidth | split-left | split-right | bg-overlay
   Compatible: iOS Safari 14–17, Chrome Android, IQOO, Safari macOS,
   Edge, Firefox. Responsive from 320px to 4K.
   ============================================================ */

/* ---- Variables ---- */
.nx-hero {
  --nx-accent: #0071e3;
  --nx-accent-hover: #0077ed;
  --nx-bg: #ffffff;
  --nx-bg-2: #f5f5f7;
  --nx-text: #1d1d1f;
  --nx-muted: #86868b;
  --nx-border: #e8e8ed;
  --nx-shadow: 0 12px 48px rgba(0,0,0,0.08);
  --nx-shadow-lg: 0 24px 72px rgba(0,0,0,0.12);
  --nx-radius: 24px;
  --nx-radius-sm: 16px;
  --nx-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --nx-transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Common helpers ---- */
.nx-hero img { max-width: 100%; height: auto; display: block; }
.nx-hero * { box-sizing: border-box; }

/* Fixed header offset for all layouts — controlled by inline CSS via wp_add_inline_style */
.nx-hero-fw,
.nx-hero-bg,
.nx-hero-split-wrap {
  margin-top: 0;
}

/* ============================================================
   1. FULLWIDTH CAROUSEL
   ============================================================ */
.nx-hero-fw { position: relative; width: 100%; overflow: hidden; }

.nx-hero-fw-viewport {
  position: relative;
  width: 100%;
  /* aspect-ratio fallback for iOS 14- */
  padding-bottom: 36%;
  aspect-ratio: 25 / 9;
  background: #1d1d1f;
}

.nx-hero-fw-track {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  width: 100%; height: 100%;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-hero-fw-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%; height: 100%;
}

.nx-hero-fw-slide img,
.nx-hero-fw-slide a {
  display: block;
  width: 100%; height: 100%;
}

.nx-hero-fw-slide img {
  object-fit: cover;
  -o-object-fit: cover;
}

/* Overlay text inside fullwidth slide */
.nx-hero-fw-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 80px 64px 80px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 60%, transparent 100%);
  color: #fff;
  z-index: 2;
}

.nx-hero-fw-content .nx-fw-eyebrow {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  opacity: 0.85; margin-bottom: 12px;
}

.nx-hero-fw-content .nx-fw-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.5px; margin: 0 0 12px;
}

.nx-hero-fw-content .nx-fw-desc {
  font-size: 16px; line-height: 1.55;
  opacity: 0.9; max-width: 520px; margin: 0 0 20px;
}

.nx-hero-fw-content .nx-fw-btns {
  display: flex; align-items: center;
  gap: 0; /* fallback margin used below */
}

.nx-hero-fw-content .nx-fw-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; transition: var(--nx-transition-fast);
}

.nx-hero-fw-content .nx-fw-btn + .nx-fw-btn { margin-left: 12px; }

.nx-hero-fw-content .nx-fw-btn-primary {
  background: var(--nx-accent); color: #fff;
  box-shadow: 0 4px 14px rgba(0,113,227,0.3);
}

.nx-hero-fw-content .nx-fw-btn-secondary {
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Controls */
.nx-hero-fw-btn {
  position: absolute; top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 20px; line-height: 1;
  transition: var(--nx-transition-fast); z-index: 10;
  -webkit-appearance: none; appearance: none;
}

.nx-hero-fw-btn:hover { background: rgba(255,255,255,0.25); }

.nx-hero-fw-btn.nx-prev { left: 24px; }
.nx-hero-fw-btn.nx-next { right: 24px; }

.nx-hero-fw-dots {
  position: absolute; bottom: 28px; left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  display: flex; align-items: center;
  z-index: 10;
}

.nx-hero-fw-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.35);
  cursor: pointer; transition: var(--nx-transition-fast);
  -webkit-appearance: none; appearance: none;
}

.nx-hero-fw-dot + .nx-hero-fw-dot { margin-left: 10px; }

.nx-hero-fw-dot.nx-active {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}

.nx-hero-fw-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--nx-accent); width: 0%;
  transition: width 0.1s linear; z-index: 10;
}

/* ============================================================
   2. SPLIT LAYOUT — Scene Card (left-text/right-card & reverse)
   ============================================================ */
.nx-hero-split-wrap {
  background: linear-gradient(180deg, #ffffff 0%, var(--nx-bg-2) 100%);
  padding: 80px 0;
  display: flex;
  align-items: center;
}

.nx-hero-scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.nx-hero-scene.nx-reverse {
  grid-template-columns: 1fr 1fr;
}

.nx-hero-scene.nx-reverse .nx-scene-visual {
  order: -1;
}

/* Text side */
.nx-scene-text .nx-eyebrow {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--nx-accent); margin-bottom: 20px;
}

.nx-scene-text .nx-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -1.5px; margin: 0 0 24px;
  color: var(--nx-text);
}

.nx-scene-text .nx-desc {
  font-size: 18px; color: var(--nx-muted);
  line-height: 1.6; margin-bottom: 36px;
  max-width: 480px;
}

.nx-scene-btns {
  display: flex; align-items: center;
  gap: 0;
}

.nx-scene-btns .nx-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; transition: var(--nx-transition-fast);
  cursor: pointer; border: none;
}

.nx-scene-btns .nx-btn + .nx-btn { margin-left: 16px; }

.nx-scene-btns .nx-btn-primary {
  background: var(--nx-accent); color: #fff;
  box-shadow: 0 4px 14px rgba(0,113,227,0.25);
}

.nx-scene-btns .nx-btn-primary:hover {
  background: var(--nx-accent-hover);
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
}

.nx-scene-btns .nx-btn-secondary {
  background: transparent; color: var(--nx-text);
  border: 1.5px solid var(--nx-border);
}

.nx-scene-btns .nx-btn-secondary:hover {
  background: var(--nx-bg-2); border-color: var(--nx-border);
}

/* Visual side — rounded card */
.nx-scene-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nx-scene-card {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  box-shadow: var(--nx-shadow-lg);
  overflow: hidden;
  position: relative;
  transition: var(--nx-transition);
}

.nx-scene-card:hover {
  -webkit-transform: translateY(-6px);
  transform: translateY(-6px);
}

.nx-scene-card a {
  display: block; width: 100%; height: 100%;
}

.nx-scene-card img {
  width: 100%; height: 100%;
  object-fit: cover; -o-object-fit: cover;
  transition: opacity 0.35s ease;
}

/* Dots + progress below card (scene-carousel style) */
.nx-scene-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.nx-scene-indicators .nx-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: var(--nx-border);
  cursor: pointer; transition: var(--nx-transition-fast);
  -webkit-appearance: none; appearance: none;
}

.nx-scene-indicators .nx-dot.nx-active {
  background: var(--nx-accent);
  box-shadow: 0 0 0 4px rgba(0,113,227,0.12);
}

.nx-scene-progress {
  width: 80px; height: 3px;
  background: var(--nx-border);
  border-radius: 2px;
  margin: 12px auto 0;
  overflow: hidden;
}

.nx-scene-progress .nx-progress-bar {
  height: 100%;
  background: var(--nx-accent);
  width: 0%;
  transition: width 0.1s linear;
}

/* ============================================================
   3. BACKGROUND OVERLAY
   ============================================================ */
.nx-hero-bg {
  position: relative;
  width: 100%;
  padding-bottom: 42%; /* fallback ~2.4:1 */
  aspect-ratio: 12 / 5;
  background: #1d1d1f;
  overflow: hidden;
}

.nx-hero-bg-track {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-hero-bg-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%; height: 100%;
}

.nx-hero-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; -o-object-fit: cover;
}

.nx-hero-bg-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1;
}

.nx-hero-bg-content {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 72px 64px 40px;
  color: #fff;
}

.nx-hero-bg-content.nx-align-center {
  align-items: center; text-align: center;
}

.nx-hero-bg-content.nx-align-left {
  align-items: flex-start; text-align: left;
}

.nx-hero-bg-content .nx-bg-eyebrow {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  opacity: 0.85; margin-bottom: 12px;
}

.nx-hero-bg-content .nx-bg-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.5px; margin: 0 0 12px;
  max-width: 720px;
}

.nx-hero-bg-content .nx-bg-desc {
  font-size: 16px; line-height: 1.6;
  opacity: 0.9; max-width: 520px; margin: 0 0 24px;
}

.nx-hero-bg-content .nx-bg-btns {
  display: flex; align-items: center; gap: 0;
}

.nx-hero-bg-content .nx-bg-btns .nx-btn + .nx-btn { margin-left: 12px; }

.nx-hero-bg-content .nx-bg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; transition: var(--nx-transition-fast);
}

.nx-hero-bg-content .nx-bg-btn-primary {
  background: var(--nx-accent); color: #fff;
  box-shadow: 0 4px 14px rgba(0,113,227,0.3);
}

.nx-hero-bg-content .nx-bg-btn-secondary {
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* bg-overlay controls */
.nx-hero-bg-dots {
  position: absolute; bottom: 28px; left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  display: flex; z-index: 10;
}

.nx-hero-bg-dots .nx-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.35);
  cursor: pointer; transition: var(--nx-transition-fast);
  -webkit-appearance: none; appearance: none;
}

.nx-hero-bg-dots .nx-dot + .nx-dot { margin-left: 10px; }

.nx-hero-bg-dots .nx-dot.nx-active {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}

.nx-hero-bg-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: rgba(255,255,255,0.15); width: 100%;
  z-index: 10;
}
.nx-hero-bg-progress .nx-progress-bar {
  height: 100%; background: var(--nx-accent); width: 0%;
}

/* ============================================================
   RESPONSIVE — Tablets & Small Laptops (1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .nx-hero-scene,
  .nx-hero-scene.nx-reverse {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .nx-scene-text .nx-desc {
    margin-left: auto; margin-right: auto;
  }

  .nx-scene-btns {
    justify-content: center;
  }

  .nx-scene-visual {
    order: -1;
  }

  .nx-hero-fw-content {
    padding: 32px 40px 64px;
  }

  .nx-hero-fw-btn { width: 40px; height: 40px; font-size: 16px; }
  .nx-hero-fw-btn.nx-prev { left: 16px; }
  .nx-hero-fw-btn.nx-next { right: 16px; }

  .nx-hero-bg-content {
    padding: 32px 40px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile Landscape & Large Phones (768px)
   ============================================================ */
@media (max-width: 768px) {
  .nx-hero-split-wrap { padding: 48px 0; min-height: auto !important; }

  .nx-hero-scene {
    padding: 0 20px;
    gap: 28px;
  }

  .nx-scene-text .nx-title {
    font-size: 32px;
    letter-spacing: -0.8px;
  }

  .nx-scene-text .nx-desc {
    font-size: 15px;
  }

  .nx-scene-card {
    max-width: 360px;
  }

  .nx-scene-btns .nx-btn {
    padding: 11px 20px;
    font-size: 13px;
  }

  .nx-hero-fw-viewport {
    padding-bottom: 50%; /* 2:1 */
    aspect-ratio: 2 / 1;
  }

  .nx-hero-fw-content {
    padding: 24px 24px 56px;
  }

  .nx-hero-fw-content .nx-fw-title {
    font-size: 26px;
  }

  .nx-hero-fw-content .nx-fw-desc {
    font-size: 14px;
  }

  .nx-hero-fw-btn { display: none; } /* hide arrows on mobile, use swipe */

  .nx-hero-bg {
    padding-bottom: 65%; /* ~3:2 */
    aspect-ratio: 3 / 2;
  }

  .nx-hero-bg-content {
    padding: 24px 24px 48px;
    justify-content: flex-end;
  }

  .nx-hero-bg-content .nx-bg-title {
    font-size: 26px;
  }

  .nx-hero-bg-content .nx-bg-desc {
    font-size: 14px;
  }
}

/* ============================================================
   RESPONSIVE — iPhone / Android Standard (480px)
   ============================================================ */
@media (max-width: 480px) {
  .nx-scene-text .nx-title { font-size: 28px; }
  .nx-scene-text .nx-desc { font-size: 14px; }

  .nx-scene-btns .nx-btn {
    padding: 11px 20px;
    font-size: 13px;
  }

  .nx-scene-card {
    max-width: 300px;
  }

  .nx-hero-fw-viewport {
    padding-bottom: 62.5%; /* 16:10 */
    aspect-ratio: 16 / 10;
  }

  .nx-hero-fw-content {
    padding: 20px 20px 48px;
  }

  .nx-hero-fw-content .nx-fw-title { font-size: 22px; }
  .nx-hero-fw-content .nx-fw-desc { font-size: 13px; }

  .nx-hero-split-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .nx-hero-split-thumb-label {
    font-size: 10px;
    padding: 4px;
  }

  .nx-hero-bg {
    padding-bottom: 75%; /* 4:3 */
    aspect-ratio: 4 / 3;
  }

  .nx-hero-bg-content .nx-bg-title { font-size: 22px; }
  .nx-hero-bg-content .nx-bg-desc { font-size: 13px; }
}

/* ============================================================
   RESPONSIVE — iPhone SE / Small Android (375px)
   ============================================================ */
@media (max-width: 375px) {
  .nx-scene-text .nx-title { font-size: 24px; }
  .nx-scene-btns { flex-direction: column; gap: 0; }
  .nx-scene-btns .nx-btn + .nx-btn { margin-left: 0; margin-top: 10px; }

  .nx-hero-fw-content .nx-fw-title { font-size: 20px; }
  .nx-hero-fw-content .nx-fw-desc { display: none; } /* too cramped */

  .nx-hero-bg-content .nx-bg-title { font-size: 20px; }
}

/* ============================================================
   RESPONSIVE — Tiny screens (320px)
   ============================================================ */
@media (max-width: 320px) {
  .nx-hero-scene { padding: 0 16px; }
  .nx-hero-fw-content { padding: 16px 16px 40px; }
  .nx-hero-fw-content .nx-fw-title { font-size: 18px; }
  .nx-hero-bg-content { padding: 16px 16px 40px; }
  .nx-hero-bg-content .nx-bg-title { font-size: 18px; }
}

/* ============================================================
   TOUCH / SWIPE INDICATOR (mobile)
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .nx-hero-fw-btn,
  .nx-hero-fw-btn.nx-prev,
  .nx-hero-fw-btn.nx-next { display: none !important; }
}
