/*
 * Homepage-specific styles — Phase 5. Reusable pieces (buttons, cards,
 * badges, accordion) come from components.css; this file is only the
 * layout patterns unique to the homepage (hero, search widget,
 * process steps, portal preview).
 */

.hero {
  background-color: var(--visa-blue-dark);
  /* "contain", not "cover" — the source photos are narrow crops
     (~500-807px wide); "cover" stretches them to fill the full section
     width, which both blurs them badly and crops out most of the
     traveller figure (only a thin vertical sliver of the tall photo
     fits a section this wide). "contain" shows the whole photo,
     uncropped, scaled down to fit the section's height instead. */
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  color: var(--white);
  padding-top: var(--space-8);
  padding-bottom: var(--space-10);
  min-height: clamp(440px, 60vh, 580px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Readability scrim: solid brand color behind the text, fading out
   toward the right so the photo (set as .hero's own background-image,
   inline per slide — see pages/home.php) shows through clearly. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    var(--visa-blue-dark) 0%,
    var(--visa-blue-dark) 40%,
    rgba(8, 42, 103, 0.82) 55%,
    rgba(8, 42, 103, 0.35) 75%,
    transparent 92%
  );
}

.hero-slide--light::before {
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff 40%,
    rgba(255, 255, 255, 0.85) 55%,
    rgba(255, 255, 255, 0.4) 75%,
    transparent 92%
  );
}

@media (max-width: 767px) {
  /* Below the 768px breakpoint the text column runs nearly full
     width (no separate narrow text vs. photo split like desktop), so
     the left-to-right gradient above — tuned for a ~640px text column
     inside a ~1440px section — lets the photo show through right
     behind the stat icons and buttons. A near-solid scrim keeps text
     legible everywhere on narrow screens; the photo still shows as a
     subtle backdrop rather than disappearing. */
  .hero::before {
    background: rgba(8, 42, 103, 0.88);
  }
  .hero-slide--light::before {
    background: rgba(255, 255, 255, 0.88);
  }
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
}

.hero__content {
  max-width: 640px;
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--visa-gold);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.hero__label-line {
  width: 22px;
  height: 1px;
  background: var(--visa-gold);
  opacity: 0.7;
}

.hero__accent {
  color: var(--visa-gold);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.hero__stat {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  line-height: 1.35;
}

.hero__stat strong {
  color: var(--white);
  font-size: var(--font-size-base);
}

.hero__stat-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) and (max-width: 767px) {
  /* Hero is still single-column here (2-col kicks in at 768px below),
     so the stat row has the full container width to itself. */
  .hero__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  /* Past 768px the hero itself goes 2-column and the left half
     narrows — wait for extra room before flattening the stats back
     out to one row. */
  .hero__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.hero h1 {
  color: var(--white);
  margin-bottom: var(--space-3);
}

.hero__subtitle {
  color: var(--visa-blue-light);
  font-size: var(--font-size-lg);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.hero__actions .btn-outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.hero__actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

/* ---------- Hero slider (4 slides — see pages/home.php's $heroSlides) ---------- */

.hero-slider {
  position: relative;
  overflow: hidden;
}

.hero-slider__track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slider__track {
    transition: none;
  }
}

.hero-slide {
  flex: 0 0 100%;
  min-width: 100%;
}

/* Light-theme slide (slide 2) — everything else stays the dark navy
   .hero look already defined above. */
.hero-slide--light {
  background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 65%);
  background-image: linear-gradient(135deg, #eaf2ff 0%, #ffffff 65%);
  color: var(--text-dark);
}

.hero-slide--light h1 {
  color: var(--visa-blue-dark);
}

.hero-slide--light .hero__accent {
  color: var(--visa-blue-secondary);
}

.hero-slide--light .hero__subtitle {
  color: var(--text-muted);
}

.hero-slide--light .hero__label {
  color: var(--visa-gold-dark);
}

.hero-slide--light .hero__label-line {
  background: var(--visa-gold-dark);
}

.hero-slide--light .hero__stat {
  color: var(--text-muted);
}

.hero-slide--light .hero__stat strong {
  color: var(--visa-blue-dark);
}

.hero-slide--light .hero__stat-icon {
  background: var(--visa-blue-light);
  color: var(--visa-blue);
}

.hero-slide--light .hero__actions .btn-outline {
  border-color: var(--visa-blue);
  color: var(--visa-blue);
}

.hero-slide--light .hero__actions .btn-outline:hover {
  background: var(--visa-blue-light);
  color: var(--visa-blue-dark);
}

/* Arrows + dots sit on the slider chrome, not inside any one slide,
   so their default (dark-slide) look is overridden as a unit via
   .hero-slider.is-light-slide when JS reports slide 2 is active —
   keeps them readable against that slide's light background too. */
.hero-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.hero-slider__arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-slider__arrow--prev {
  left: var(--space-3);
}

.hero-slider__arrow--next {
  right: var(--space-3);
}

.hero-slider.is-light-slide .hero-slider__arrow {
  background: rgba(11, 59, 145, 0.08);
  color: var(--visa-blue);
}

.hero-slider.is-light-slide .hero-slider__arrow:hover {
  background: rgba(11, 59, 145, 0.16);
}

.hero-slider__dots {
  position: absolute;
  left: 50%;
  bottom: calc(var(--space-10) + var(--space-2));
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: var(--space-2);
}

.hero-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background-color 0.15s, width 0.15s;
}

.hero-slider__dot.is-active {
  width: 20px;
  border-radius: 4px;
  background: var(--visa-gold);
}

.hero-slider.is-light-slide .hero-slider__dot {
  background: rgba(11, 59, 145, 0.25);
}

.hero-slider.is-light-slide .hero-slider__dot.is-active {
  background: var(--visa-gold-dark);
}

@media (max-width: 767px) {
  .hero-slider__arrow {
    width: 34px;
    height: 34px;
  }
  .hero-slider__dots {
    bottom: calc(var(--space-8) + var(--space-2));
  }
}

/* ---------- Search widget (floats over the hero on desktop) ---------- */

.search-widget {
  position: relative;
  z-index: 5;
  margin-top: calc(-1 * var(--space-10));
  margin-bottom: var(--space-10);
}

.search-widget__card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
}

.search-widget__title {
  margin-bottom: var(--space-1);
}

.search-widget__hint {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
}

.search-widget__grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  align-items: end;
}

.search-widget__grid .form-group {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .search-widget__grid { grid-template-columns: repeat(4, 1fr) auto; }
}

/* ---------- Section scaffolding ---------- */

.section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-8);
}

.section-heading p {
  margin: 0;
}

.section-eyebrow {
  display: block;
  color: var(--visa-blue-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

/* ---------- Destination + service cards ---------- */

.destination-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.destination-card__flag {
  font-size: 2rem;
  line-height: 1;
}

.destination-card__name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-dark);
  margin-bottom: var(--space-1);
}

.destination-card__link {
  font-size: var(--font-size-sm);
}

.service-card {
  text-align: left;
}

.service-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--visa-blue-light);
  color: var(--visa-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-xl);
}

/* ---------- Process steps ---------- */

.process-steps {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  counter-reset: step;
}

.process-step {
  display: flex;
  gap: var(--space-4);
}

.process-step__number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--visa-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
}

.process-step__title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.process-step__desc {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

@media (min-width: 640px) {
  .process-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .process-steps { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Why Visagiri ---------- */

.feature-card {
  text-align: left;
}

.feature-card__icon {
  color: var(--visa-gold-dark);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-3);
}

/* ---------- Tracking band ---------- */

.tracking-band {
  background: var(--visa-blue-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.tracking-band form {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.tracking-band .form-input {
  min-width: 220px;
  background: var(--white);
}

/* ---------- Customer portal preview ---------- */

.portal-preview {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  align-items: center;
}

.portal-preview__mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.portal-preview__mock-header {
  background: var(--visa-blue);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.portal-preview__mock-body {
  display: grid;
  grid-template-columns: 140px 1fr;
}

.portal-preview__mock-body .sidebar-nav {
  padding: var(--space-4);
  border-right: 1px solid var(--border);
}

.portal-preview__mock-body .sidebar-nav a {
  font-size: var(--font-size-xs);
  padding: var(--space-2) var(--space-3);
}

.portal-preview__mock-content {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, 1fr);
}

.portal-preview__stat {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.portal-preview__stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.portal-preview__stat-value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-dark);
}

@media (min-width: 768px) {
  .portal-preview { grid-template-columns: 1fr 1fr; }
}

/* ---------- Updates grid ---------- */

.updates-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .updates-grid { grid-template-columns: repeat(3, 1fr); }
}

.update-card__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-8);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ---------- Final CTA ---------- */

.final-cta {
  background: var(--visa-blue);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
}

.final-cta h2 {
  color: var(--white);
}

/* Homepage-only additions: a modifier class plus brand-new
   sub-element classes layered on the shared .final-cta component
   above (also used as-is by pages/documentation.php,
   pages/process.php, pages/corporate-services.php and
   visa/index.php) — nothing here touches the base .final-cta/.section
   rules, so those other pages' CTAs are unaffected. Reduces the
   compounding whitespace from .section's own padding-block stacking
   with .final-cta's internal padding, per the client's explicit
   request to tighten this section without touching any other
   homepage section. */
.final-cta-section {
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}
.final-cta--compact {
  padding: var(--space-8) var(--space-6);
}
.final-cta__lede {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--font-size-lg);
  max-width: 42rem;
  margin: 0 auto var(--space-3);
}
.final-cta__services {
  color: rgba(255, 255, 255, 0.68);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 var(--space-6);
}
@media (max-width: 640px) {
  .final-cta--compact {
    padding: var(--space-6) var(--space-4);
  }
  .final-cta__services {
    letter-spacing: 0.02em;
  }
}
