/**
 * VNPT TP.HCM — homepage visual layer
 *
 * This file is intentionally loaded from index.php only. Every selector is
 * scoped to .vnpt-home-page so shared templates keep their existing styles.
 */

.vnpt-home-page {
  --home-ink: var(--vnpt-navy);
  --home-muted: var(--vnpt-text-secondary);
  --home-surface: rgba(255, 255, 255, 0.86);
  --home-line: rgba(0, 104, 255, 0.13);
  --home-blue-glow: rgba(0, 104, 255, 0.14);
  color: var(--vnpt-text);
}

/* Hero: keep the source image and dynamic banner untouched, but give the
 * composition a quieter, more premium canvas and enough space for the cards. */
.vnpt-home-page .home-hero {
  padding-block: clamp(2.75rem, 5vw, 4.25rem) clamp(2.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(circle at 76% 8%, rgba(34, 184, 255, 0.15), transparent 28%),
    radial-gradient(circle at 7% 68%, rgba(0, 104, 255, 0.08), transparent 30%),
    var(--vnpt-gradient-hero);
}

.vnpt-home-page .home-hero > .container > .row {
  --bs-gutter-x: clamp(1.5rem, 4vw, 4.5rem);
  min-height: clamp(390px, 31vw, 470px);
}

.vnpt-home-page .home-hero__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.vnpt-home-page .home-hero__badge {
  margin-bottom: var(--space-5);
  padding: 0.5rem 0.9rem;
  border-color: rgba(0, 104, 255, 0.2);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(0, 68, 160, 0.07);
}

.vnpt-home-page .home-hero__title {
  max-width: none;
  margin-bottom: var(--space-5);
  color: var(--home-ink);
  font-size: clamp(2.55rem, 3.35vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.vnpt-home-page .home-hero__title .text-gradient-blue {
  background: linear-gradient(135deg, var(--vnpt-primary-dark), var(--vnpt-electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
}

.vnpt-home-page .home-hero__desc {
  max-width: 56ch;
  margin-bottom: var(--space-6);
  color: var(--home-muted);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.68;
}

.vnpt-home-page .home-hero__actions {
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.vnpt-home-page .home-hero__actions .vnpt-btn {
  min-height: 50px;
  padding-inline: 1.25rem;
  border-radius: 12px;
}

.vnpt-home-page .home-hero__actions .vnpt-btn--primary {
  box-shadow: 0 14px 28px rgba(0, 104, 255, 0.25);
}

.vnpt-home-page .home-hero__trust {
  gap: clamp(0.75rem, 2vw, 1.35rem);
}

.vnpt-home-page .home-hero__trust-item {
  font-size: 0.84rem;
  color: var(--vnpt-text-secondary);
}

.vnpt-home-page .home-hero__stage {
  min-height: clamp(390px, 31vw, 470px);
  isolation: isolate;
}

.vnpt-home-page .home-hero__stage::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: min(84%, 480px);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 104, 255, 0.1);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.78), rgba(234, 244, 255, 0.35) 54%, transparent 70%);
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.34), 0 24px 70px rgba(0, 79, 180, 0.1);
}

.vnpt-home-page .home-hero__visual-wrap {
  max-width: min(100%, 545px);
  filter: drop-shadow(0 24px 34px rgba(0, 75, 180, 0.15));
}

.vnpt-home-page .home-hero__specialist-img {
  max-height: 455px;
  border-radius: 28px;
}

.vnpt-home-page .home-hero__glass-grid {
  right: clamp(-1.75rem, -2vw, -0.25rem);
  grid-template-columns: repeat(2, minmax(170px, 190px));
  gap: 14px;
}

.vnpt-home-page .home-glass-card {
  min-height: 74px;
  padding: 0.75rem 0.8rem;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(7, 31, 70, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.vnpt-home-page .home-glass-card__icon {
  width: 40px;
  height: 40px;
}

.vnpt-home-page .home-glass-card__info strong,
.vnpt-home-page .home-glass-card__info small {
  overflow: visible;
  text-overflow: clip;
}

.vnpt-home-page .home-glass-card__info strong {
  font-size: 0.86rem;
}

.vnpt-home-page .home-glass-card__info small {
  font-size: 0.72rem;
}

/* The carousel remains the same dynamic component and retains its links,
 * controls and database content; only its frame is aligned with the hero. */
.vnpt-home-page .home-hero-slider-wrap {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  margin-bottom: 0;
}

.vnpt-home-page .home-hero-slider-container {
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(0, 68, 160, 0.11);
}

/* Quick access: one calm service rail on wide screens, two-column touch grid
 * on phones. */
.vnpt-home-page .home-quick-access {
  padding-block: clamp(3rem, 5vw, 4.75rem);
}

.vnpt-home-page .home-quick-access__header {
  margin-bottom: var(--space-8);
}

.vnpt-home-page .home-quick-access__title,
.vnpt-home-page .home-ecosystem__title {
  margin-bottom: var(--space-2);
  color: var(--home-ink);
  font-size: clamp(1.75rem, 2.5vw, 2.45rem);
  letter-spacing: -0.045em;
}

.vnpt-home-page .home-quick-access__subtitle,
.vnpt-home-page .home-ecosystem__subtitle {
  font-size: 1rem;
}

.vnpt-home-page .home-quick-card {
  min-height: 150px;
  justify-content: center;
  padding: 1.25rem 0.7rem;
  border-color: var(--home-line);
  background: linear-gradient(180deg, #fff, #f7faff);
  box-shadow: var(--shadow-card);
}

.vnpt-home-page .home-quick-card__icon {
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-3);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(0, 104, 255, 0.18);
}

.vnpt-home-page .home-quick-card__text strong {
  font-size: 0.9rem;
}

.vnpt-home-page .home-quick-card__text span {
  font-size: 0.78rem;
}

/* Ecosystem and tabs: make the active state feel like a product filter while
 * keeping Bootstrap's tab behavior and the current database-backed cards. */
.vnpt-home-page .home-ecosystem {
  padding-block: clamp(3.5rem, 6vw, 5.5rem);
  background:
    radial-gradient(circle at 92% 8%, rgba(34, 184, 255, 0.08), transparent 24%),
    var(--vnpt-bg-soft);
}

.vnpt-home-page .home-ecosystem__header-row {
  align-items: center;
  margin-bottom: var(--space-8);
}

.vnpt-home-page .home-ecosystem__tabs-wrap {
  max-width: 100%;
  gap: 4px;
  padding: 5px;
}

.vnpt-home-page .home-eco-tab {
  min-height: 44px;
  padding: 0.65rem 1rem;
}

.vnpt-home-page .home-eco-grid {
  gap: var(--space-4);
}

.vnpt-home-page .home-eco-card {
  min-height: 244px;
  padding: 1.35rem 1.25rem;
  border-color: var(--home-line);
  box-shadow: 0 10px 28px rgba(0, 68, 160, 0.06);
}

.vnpt-home-page .home-eco-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  border-radius: 15px;
}

/* Shared homepage sections below the first viewport get a consistent edge,
 * so the page reads as one system even where their existing components differ. */
.vnpt-home-page .vnpt-section:not(.vnpt-section--dark-tech),
.vnpt-home-page .vnp-onboarding,
.vnpt-home-page .vnp-home-locator,
.vnpt-home-page .vnpt-home-news-section,
.vnpt-home-page .vnp-home-faq {
  border-color: var(--vnpt-border-subtle);
}

/* `.vnpt-section` uses `isolation: isolate`, which otherwise traps the
 * package-catalog offcanvas below the hero's positioned content on phones.
 * Raising only this homepage section keeps the Bootstrap offcanvas above the
 * hero without changing the shared section or sidebar behavior on other URLs. */
.vnpt-home-page .vnpt-home-news-section {
  position: relative;
  z-index: 3;
  padding-block: clamp(40px, 5vw, 64px);
  background-color: var(--vnpt-bg-soft, #f8faff);
  border-top: 1px solid var(--vnpt-border, #dce8f7);
  border-bottom: 1px solid var(--vnpt-border, #dce8f7);
}

/* Fluid Container: 0px overflow guarantee with clamp gutter (min 16px) */
:root {
  --home-news-gutter: clamp(16px, 2.5vw, 32px);
}

.vnpt-home-page .vnpt-home-news-section .container {
  width: min(calc(100% - 2 * var(--home-news-gutter)), 1440px) !important;
  max-width: 1440px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Eliminate Bootstrap negative row margins that trigger scrollWidth overflow */
.vnpt-home-page .vnpt-home-news-section .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* News Section Header */
.vnpt-home-page .vnpt-news-section-header {
  border-bottom: 1px solid #dce8f7;
}

.vnpt-home-page .vnpt-news-header-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #0068ff;
  background: #e0efff;
  font-size: 1.15rem;
}

.vnpt-home-page .vnpt-news-header-title {
  color: var(--vnpt-text, #0f172a);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.vnpt-home-page .vnpt-news-header-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0068ff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: gap 0.18s ease, color 0.18s ease;
}

.vnpt-home-page .vnpt-news-header-more:hover {
  color: #0047b9;
  gap: 9px;
}

/* ==========================================================================
   BREAKPOINT ARCHITECTURE (STRICT 1101px / 1100px RULE)
   ========================================================================== */

/* State A: Viewport >= 1101px -> Fixed Sidebar (270px at >= 1440px, 250px at 1101px-1439px) */
@media (min-width: 1101px) {
  .vnpt-home-page .vnpt-home-news-section .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 28px !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-package-sidebar {
    flex: 0 0 250px !important;
    width: 250px !important;
    max-width: 250px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-news-main-article {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
  }

  /* Hide mobile trigger, header, summary, and floating button on desktop */
  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-mobile-entry,
  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-floating,
  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-offcanvas-header,
  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-summary {
    display: none !important;
  }

  /* Show desktop title */
  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-desktop-title {
    display: flex !important;
  }

  /* Inline display of offcanvas content in layout flow */
  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-offcanvas {
    position: static !important;
    visibility: visible !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    z-index: auto !important;
  }
}

/* >= 1440px: 270px sidebar + 3 article columns */
@media (min-width: 1440px) {
  .vnpt-home-page .vnpt-home-news-section .row {
    gap: 32px !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-package-sidebar {
    flex: 0 0 270px !important;
    width: 270px !important;
    max-width: 270px !important;
  }

  .vnpt-home-page #news-section .vnp-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
  }
}

/* 1101px - 1439px: 250px sidebar + 2 article columns */
@media (min-width: 1101px) and (max-width: 1439.98px) {
  .vnpt-home-page #news-section .vnp-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

/* State B: Viewport <= 1100px -> Category Trigger + Offcanvas Drawer */
@media (max-width: 1100px) {
  .vnpt-home-page .vnpt-home-news-section .row {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-package-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-news-main-article {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* Show mobile Category Trigger */
  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-mobile-entry {
    display: flex !important;
  }

  /* Hide desktop title */
  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-desktop-title {
    display: none !important;
  }

  /* Show offcanvas header & summary inside drawer */
  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-summary {
    display: flex !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-catalog-offcanvas-header {
    display: flex !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-sticky {
    position: static !important;
    top: auto !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-surface {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .vnpt-home-page .vnpt-home-news-section .vnp-sidebar-content {
    padding: 0 !important;
  }
}

/* 641px - 1100px (including 1024px tablet landscape & 768px tablet portrait): Full width 2 article columns */
@media (min-width: 641px) and (max-width: 1100px) {
  .vnpt-home-page #news-section .vnp-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }
}

/* <= 640px (Mobile devices: 430px, 390px, etc.): 1 article column */
@media (max-width: 640px) {
  .vnpt-home-page #news-section .vnp-news-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

.vnpt-home-page .vnpt-enterprise-card,
.vnpt-home-page .vnpt-utility-card,
.vnpt-home-page .vnpt-pillar-card {
  border-radius: var(--radius-xl);
}

@media (max-width: 1399.98px) and (min-width: 992px) {
  .vnpt-home-page .home-hero__glass-grid {
    right: -0.5rem;
    grid-template-columns: repeat(2, minmax(145px, 168px));
    gap: 10px;
  }

  .vnpt-home-page .home-glass-card {
    min-height: 68px;
    padding: 0.65rem;
  }

  .vnpt-home-page .home-glass-card__icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}

@media (max-width: 991.98px) {
  .vnpt-home-page .home-hero > .container > .row {
    min-height: 0;
  }

  .vnpt-home-page .home-hero__title {
    max-width: 15ch;
  }

  .vnpt-home-page .home-hero__stage {
    min-height: 0;
    padding-top: var(--space-4);
  }

  .vnpt-home-page .home-hero__glass-grid {
    width: min(100%, 520px);
    margin-top: var(--space-4);
  }

  .vnpt-home-page .home-ecosystem__header-row {
    align-items: stretch;
  }

  .vnpt-home-page .home-ecosystem__tabs-wrap {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }
}

@media (max-width: 575.98px) {
  .vnpt-home-page .home-hero {
    padding-top: 2rem;
  }

  .vnpt-home-page .home-hero__title {
    max-width: none;
    font-size: clamp(2.35rem, 11vw, 3rem);
  }

  .vnpt-home-page .home-hero__desc {
    font-size: 1rem;
  }

  .vnpt-home-page .home-hero__stage::before {
    width: 92%;
  }

  .vnpt-home-page .home-hero__glass-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .vnpt-home-page .home-glass-card {
    min-height: 66px;
    gap: 8px;
    padding: 0.6rem;
    border-radius: 14px;
  }

  .vnpt-home-page .home-glass-card__icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .vnpt-home-page .home-glass-card__info strong {
    font-size: 0.76rem;
  }

  .vnpt-home-page .home-glass-card__info small {
    font-size: 0.64rem;
  }

  .vnpt-home-page .home-quick-access__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .vnpt-home-page .home-quick-access__all-link {
    min-height: 44px;
  }

  .vnpt-home-page .home-quick-card {
    min-height: 132px;
  }

  .vnpt-home-page .home-eco-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vnpt-home-page *,
  .vnpt-home-page *::before,
  .vnpt-home-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
