/* NepalTechHub Phase 19B-1 — Homepage hierarchy + discovery polish. */
body.nth-phase19a-ui.nth-phase19b-home {
  --nth-home-section-gap: clamp(34px, 5vw, 68px);
  --nth-home-card-radius: 18px;
}

/* Hero: preserve current content, tighten rhythm, avoid oversized mobile voids. */
body.nth-phase19b-home .nth-home-hero-premium {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe5f2;
  border-radius: 24px;
  box-shadow: 0 20px 55px -40px rgba(15, 23, 42, .42);
}

body.nth-phase19b-home .nth-home-hero-premium h1 {
  max-width: 880px;
}

body.nth-phase19b-home .nth-home-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

body.nth-phase19b-home .nth-home-quicklinks a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--nth-ui-text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.15;
  text-decoration: none;
  box-shadow: 0 8px 22px -20px rgba(15,23,42,.45);
}

body.nth-phase19b-home .nth-home-quicklinks a:hover,
body.nth-phase19b-home .nth-home-quicklinks a:focus-visible {
  border-color: #93c5fd;
  background: var(--nth-ui-primary-soft);
  color: var(--nth-ui-primary-strong);
}

/* Shared section rhythm. JS only adds these classes to recognized homepage sections. */
body.nth-phase19b-home .nth-home-section {
  width: min(100%, var(--nth-ui-content));
  margin-inline: auto;
  margin-block: var(--nth-home-section-gap) 0;
  min-width: 0;
}

body.nth-phase19b-home .nth-home-section > :first-child {
  margin-top: 0;
}

body.nth-phase19b-home .nth-home-section h2 {
  margin-bottom: 8px;
  font-size: clamp(25px, 3.1vw, 38px);
  line-height: 1.08;
}

body.nth-phase19b-home .nth-home-section h2 + p {
  max-width: 720px;
  margin-top: 0;
  color: var(--nth-ui-muted);
  font-size: clamp(15px, 1.7vw, 18px);
}

/* Category discovery: make the 12 destinations feel like intentional cards. */
body.nth-phase19b-home .nth-home-categories .nth-home-category-link {
  border-radius: 14px;
  text-decoration: none;
}

body.nth-phase19b-home .nth-home-categories a {
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

body.nth-phase19b-home .nth-home-categories a:hover,
body.nth-phase19b-home .nth-home-categories a:focus-visible {
  border-color: #bfdbfe !important;
  background: #f8fbff !important;
  box-shadow: 0 12px 26px -24px rgba(37,99,235,.55);
}

/* Tools: each buying action should read as a peer, not a wall of links. */
body.nth-phase19b-home .nth-home-tools .nth-home-tool-link {
  text-decoration: none;
}

body.nth-phase19b-home .nth-home-tools a {
  border-radius: 15px;
}

/* Compare becomes the primary conversion CTA after Trending. */
body.nth-phase19b-home .nth-home-compare {
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #f8fafc 100%);
  box-shadow: 0 24px 52px -40px rgba(37, 99, 235, .48);
}

body.nth-phase19b-home .nth-home-compare h2 {
  color: #172554;
}

body.nth-phase19b-home .nth-home-compare a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 17px;
  border-radius: 12px;
  background: var(--nth-ui-primary);
  color: #fff;
  font-weight: 840;
  text-decoration: none;
  box-shadow: 0 12px 26px -18px rgba(37,99,235,.8);
}

body.nth-phase19b-home .nth-home-compare a:hover,
body.nth-phase19b-home .nth-home-compare a:focus-visible {
  background: var(--nth-ui-primary-strong);
  color: #fff;
}

/* Editorial and trust blocks get a calmer surface so commerce cards dominate. */
body.nth-phase19b-home .nth-home-editorial,
body.nth-phase19b-home .nth-home-trust {
  padding: clamp(20px, 3.5vw, 34px);
  border: 1px solid var(--nth-ui-line);
  border-radius: 22px;
  background: rgba(255,255,255,.72);
}

body.nth-phase19b-home .nth-home-trust {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

/* Secondary discovery should not visually overpower phones/trending/compare. */
body.nth-phase19b-home .nth-home-latest-tech,
body.nth-phase19b-home .nth-home-launch,
body.nth-phase19b-home .nth-home-browse {
  padding-top: clamp(20px, 3vw, 30px);
  border-top: 1px solid var(--nth-ui-line);
}

body.nth-phase19b-home .nth-home-section :where(img, video, iframe, svg) {
  max-width: 100%;
}

@media (max-width: 900px) {
  body.nth-phase19a-ui.nth-phase19b-home {
    --nth-home-section-gap: 34px;
  }

  body.nth-phase19b-home .nth-home-section {
    padding-inline: 12px;
  }

  body.nth-phase19b-home .nth-home-hero-premium {
    margin-inline: 10px;
    border-radius: 20px;
  }

  body.nth-phase19b-home .nth-home-quicklinks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.nth-phase19b-home .nth-home-quicklinks a {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    text-align: center;
    font-size: 12.5px;
  }

  body.nth-phase19b-home .nth-home-section h2 {
    font-size: clamp(25px, 7.5vw, 32px);
  }

  body.nth-phase19b-home .nth-home-compare,
  body.nth-phase19b-home .nth-home-editorial,
  body.nth-phase19b-home .nth-home-trust {
    margin-inline: 10px;
    padding: 20px;
    border-radius: 18px;
  }

  /* When category links are direct children of a flex/grid list, keep them compact. */
  body.nth-phase19b-home .nth-home-categories :where(ul, .grid, [class*="grid"]) {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  body.nth-phase19b-home .nth-home-section {
    padding-inline: 10px;
  }

  body.nth-phase19b-home .nth-home-hero-premium {
    border-radius: 18px;
  }

  body.nth-phase19b-home .nth-home-compare,
  body.nth-phase19b-home .nth-home-editorial,
  body.nth-phase19b-home .nth-home-trust {
    padding: 18px;
  }
}

/* ==========================================================
 * Phase 19B-2 — product density + deliberate mobile rails
 * Keeps every server-rendered product in the DOM. Only the
 * <=900px presentation becomes horizontally swipeable.
 * ======================================================== */
body.nth-phase19b-home .nth-home-product-card {
  border-color: #dbe4ef;
  border-radius: 16px;
  box-shadow: 0 12px 30px -28px rgba(15, 23, 42, .52);
}

body.nth-phase19b-home .nth-home-product-card .nth-neo-title {
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
}

body.nth-phase19b-home .nth-home-product-card .nth-neo-specs {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.nth-phase19b-home .nth-home-product-card .nth-neo-best {
  font-size: 16px;
  letter-spacing: -.01em;
}

body.nth-phase19b-home .nth-home-swipe-hint {
  display: none;
  margin: 7px 0 0;
  color: var(--nth-ui-muted);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 900px) {
  /* Trending and Latest Across Tech: same content, far less vertical height. */
  body.nth-phase19b-home .nth-home-snap-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(215px, 74vw) !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    width: auto !important;
    max-width: none !important;
    margin: 14px -10px 0 !important;
    padding: 2px 10px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scroll-padding-inline: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.nth-phase19b-home .nth-home-snap-rail::-webkit-scrollbar {
    display: none;
  }

  body.nth-phase19b-home .nth-home-snap-rail > .nth-neo-card,
  body.nth-phase19b-home .nth-home-snap-rail > .nth-home-product-card {
    width: 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  /* Product image/body density: readable, but no giant cards. */
  body.nth-phase19b-home .nth-home-snap-rail .nth-neo-media {
    aspect-ratio: 4 / 3;
    padding: 12px;
  }

  body.nth-phase19b-home .nth-home-snap-rail .nth-neo-body {
    gap: 5px;
    padding: 10px 11px 11px;
  }

  body.nth-phase19b-home .nth-home-snap-rail .nth-neo-specs {
    min-height: 2.75em;
    font-size: 12px;
  }

  body.nth-phase19b-home .nth-home-swipe-hint {
    display: block;
  }

  /* Launch tracker becomes swipeable only after JS confirms sibling panels. */
  body.nth-phase19b-home .nth-home-launch-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(260px, 82vw) !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    margin-inline: -10px !important;
    padding: 2px 10px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
  }

  body.nth-phase19b-home .nth-home-launch-rail::-webkit-scrollbar {
    display: none;
  }

  body.nth-phase19b-home .nth-home-launch-card {
    min-width: 0;
    scroll-snap-align: start;
  }

  /* Primary Latest Phones remains a normal 2-column browse grid. */
  body.nth-phase19b-home .nth-home-latest-phones .nth-neo-grid:not(.nth-home-snap-rail) {
    gap: 10px;
  }

  body.nth-phase19b-home .nth-home-latest-phones .nth-home-product-card .nth-neo-body {
    padding: 9px 10px 10px;
  }

  body.nth-phase19b-home .nth-home-latest-phones .nth-home-product-card .nth-neo-title {
    font-size: 13.5px;
  }
}

@media (max-width: 480px) {
  body.nth-phase19b-home .nth-home-snap-rail {
    grid-auto-columns: minmax(205px, 78vw) !important;
  }

  body.nth-phase19b-home .nth-home-launch-rail {
    grid-auto-columns: minmax(245px, 86vw) !important;
  }
}

/* ==========================================================
 * Phase 19B-3 — final homepage length + secondary discovery
 * No server content is removed. Mobile-only folds/rails keep
 * the homepage shorter while preserving every rendered link.
 * ======================================================== */
body.nth-phase19b-home .nth-home-phone-fold-toggle {
  display: none;
  width: 100%;
  min-height: 44px;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--nth-ui-text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

body.nth-phase19b-home .nth-home-phone-fold-toggle:hover,
body.nth-phase19b-home .nth-home-phone-fold-toggle:focus-visible {
  border-color: #93c5fd;
  background: var(--nth-ui-primary-soft);
  color: var(--nth-ui-primary-strong);
}

body.nth-phase19b-home .nth-home-budget-chip,
body.nth-phase19b-home .nth-home-brand-chip {
  text-decoration: none;
}

body.nth-phase19b-home .nth-home-trust-compact {
  box-shadow: 0 18px 44px -38px rgba(15, 23, 42, .42);
}

@media (max-width: 900px) {
  /* Latest Phones: first six cards = three two-column rows. */
  body.nth-phase19b-home .nth-home-latest-foldable:not(.nth-home-phone-expanded) .nth-home-phone-extra {
    display: none !important;
  }

  body.nth-phase19b-home .nth-home-latest-foldable .nth-home-phone-fold-toggle {
    display: block;
  }

  /* Reviews: safe-detected article siblings become one deliberate shelf. */
  body.nth-phase19b-home .nth-home-editorial-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(270px, 84vw) !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    margin: 12px -10px 0 !important;
    padding: 2px 10px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: inline mandatory;
    scroll-padding-inline: 10px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.nth-phase19b-home .nth-home-editorial-rail::-webkit-scrollbar {
    display: none;
  }

  body.nth-phase19b-home .nth-home-editorial-card {
    min-width: 0;
    padding: 15px !important;
    border: 1px solid var(--nth-ui-line);
    border-radius: 16px;
    background: #fff;
    scroll-snap-align: start;
    box-shadow: 0 12px 28px -26px rgba(15, 23, 42, .5);
  }

  body.nth-phase19b-home .nth-home-editorial-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 17px;
    line-height: 1.28;
  }

  body.nth-phase19b-home .nth-home-editorial-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
  }

  /* Price bands: one horizontal chip strip instead of wrapping tall. */
  body.nth-phase19b-home .nth-home-budget-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 9px -10px 0 !important;
    padding: 2px 10px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.nth-phase19b-home .nth-home-budget-chips::-webkit-scrollbar {
    display: none;
  }

  body.nth-phase19b-home .nth-home-budget-chip {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px !important;
    border: 1px solid #dbe5f2 !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--nth-ui-text) !important;
    font-size: 13px !important;
    font-weight: 780 !important;
    white-space: nowrap;
  }

  /* Brand groups may be rendered in two server rows. Each stays one compact rail. */
  body.nth-phase19b-home .nth-home-brand-rail {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 7px -10px 0 !important;
    padding: 2px 10px 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.nth-phase19b-home .nth-home-brand-rail::-webkit-scrollbar {
    display: none;
  }

  body.nth-phase19b-home .nth-home-brand-chip {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    min-height: 36px;
    padding: 7px 11px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    color: var(--nth-ui-text) !important;
    font-size: 12.5px !important;
    font-weight: 760 !important;
    white-space: nowrap;
  }

  /* The lower homepage should breathe, but not become a second giant page. */
  body.nth-phase19b-home .nth-home-launch,
  body.nth-phase19b-home .nth-home-browse,
  body.nth-phase19b-home .nth-home-trust {
    margin-top: 30px;
  }

  body.nth-phase19b-home .nth-home-browse h3,
  body.nth-phase19b-home .nth-home-launch h3 {
    font-size: 18px;
    line-height: 1.25;
  }
}

@media (max-width: 480px) {
  body.nth-phase19b-home .nth-home-editorial-rail {
    grid-auto-columns: minmax(255px, 88vw) !important;
  }
}

@media (min-width: 901px) {
  body.nth-phase19b-home .nth-home-phone-extra {
    display: block !important;
  }
}
