/* Loaded after main.css, on index.php only. */

/* Exactly one viewport tall on every real device. 560px is a defensive floor,
   well below any realistic phone/tablet/desktop viewport height, that only
   engages on pathologically short viewports (e.g. landscape phones) so the
   content scrolls into view instead of being invisibly clipped by the
   section's overflow:hidden — it replaces the base .hero rule's 680px floor,
   which would otherwise clamp this taller than 100vh everywhere. The dvh
   line is a progressive enhancement over vh — it accounts for mobile browser
   chrome so the hero never runs taller than what's actually visible. */
.hero--home { min-height: 560px; height: 100vh; height: 100dvh; }
.hero--home .hero__content { max-width: 680px; }

/* Hero background video: image acts as poster + reduced-motion fallback, sitting
   behind the video in DOM order (same absolute inset:0 box, so no layout shift).
   Both stay below .hero__scrim, which relies on that same DOM-order stacking. */
.hero--home .hero__bg--video { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .hero--home .hero__bg--video { display: none; }
}

.hero__search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  width: fit-content; max-width: 100%;
  margin-top: 44px;
  padding: 10px 20px 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(7, 26, 49, 0.28);
}
.hero__search-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold); flex-shrink: 0;
}
.hero__search-divider {
  width: 1px; align-self: stretch; min-height: 22px;
  background: rgba(255, 255, 255, 0.25); flex-shrink: 0;
}
.hero__search-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero__search-chips a {
  display: inline-flex; align-items: center;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white); font-size: 0.875rem; font-weight: 600;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.hero__search-chips a:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Below this width the pill no longer fits everything on one line at full size;
   keep it a single row, pin the icon, and let the chips scroll horizontally
   instead of wrapping — same colors/borders/shape as the base styles above. */
@media (max-width: 480px) {
  /* The nowrap chip row below must not force the implicit grid track (and with
     it, the whole hero content column) wider than the viewport — cap its
     automatic minimum size so the row's own overflow-x handles the excess. */
  .hero--home .hero__inner { grid-template-columns: minmax(0, 1fr); }

  .hero__search {
    flex-wrap: nowrap;
    width: 100%; max-width: 100%;
    overflow: hidden;
  }
  .hero__search-chips {
    flex: 1 1 auto; min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .hero__search-chips::-webkit-scrollbar { display: none; }
  .hero__search-chips a { flex-shrink: 0; white-space: nowrap; }
}

@media (min-width: 992px) {
  .hero--home .hero__inner { grid-template-columns: 1fr; }
}

/* Wider than the shared .section-head cap (640px) so the heading and
   description each fit on a single line at desktop; mobile/tablet keep the
   default width and wrap naturally. Scoped to this section only. */
@media (min-width: 992px) {
  .projects .section-head { max-width: 820px; }
}

/* Desktop-only: these single-column section headings wrap by a narrow margin
   at the shared 640px cap (only ~7-8px over) — a small, section-scoped bump
   is enough to fit them on one line without touching any other section. */
@media (min-width: 992px) {
  .steps .section-head { max-width: 820px; }
  .testimonials .section-head { max-width: 860px; }
}

.categories__grid { display: grid; gap: 20px; grid-template-columns: 1fr; }

.category-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--white); border-radius: var(--r-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  padding: 24px 28px;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.category-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--r-sm);
  background: var(--bg-section-alt); color: var(--navy); flex-shrink: 0;
}

.category-card__text { flex: 1; min-width: 0; }
.category-card h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.category-card p { font-size: 0.875rem; color: var(--text-muted); }

.category-card__arrow {
  color: var(--navy); flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}
.category-card__arrow .icon { width: 18px; height: 18px; }
.category-card:hover .category-card__arrow { transform: translateX(3px); color: var(--gold-dark); }
[dir="rtl"] .category-card:hover .category-card__arrow { transform: translateX(-3px); color: var(--gold-dark); }

@media (min-width: 600px) { .categories__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .categories__grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.communities__grid { display: grid; gap: 24px; grid-template-columns: 1fr; }

.community-card {
  position: relative; display: block;
  border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 4 / 3;
}
.community-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s ease;
}
.community-card:hover img { transform: scale(1.04); }

.community-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 26, 49, 0) 40%, rgba(7, 26, 49, 0.8) 100%);
}

.community-card__content {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding: 24px;
}
.community-card h3 { color: var(--white); font-size: 1.25rem; margin-bottom: 4px; }
.community-card__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
}
.community-card__cta .icon { width: 14px; height: 14px; transition: transform var(--transition-fast); }
.community-card:hover .community-card__cta .icon { transform: translateX(3px); }
[dir="rtl"] .community-card:hover .community-card__cta .icon { transform: scaleX(-1) translateX(-3px); }

@media (min-width: 600px) { .communities__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .communities__grid { grid-template-columns: repeat(3, 1fr); } }

.steps__grid { display: grid; gap: 40px; grid-template-columns: 1fr; list-style: none; }

.step { position: relative; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  font-size: 1rem; font-weight: 800; color: var(--navy);
  margin-bottom: 20px;
}
.step h3 { font-size: 1.125rem; margin-bottom: 10px; }
.step p { font-size: 0.9375rem; color: var(--text-muted); }

@media (min-width: 600px) { .steps__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) {
  .steps__grid { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  /* subtle connector line between step numbers */
  .step:not(:last-child)::before {
    content: ""; position: absolute; top: 26px; left: 68px; right: -16px;
    height: 1px; background: var(--border-light);
  }
  /* RTL: the next step sits to the visual left, so the connector must
     extend that way instead of continuing to point right. */
  [dir="rtl"] .step:not(:last-child)::before { left: -16px; right: 68px; }
}

.testimonials__grid { display: grid; gap: 24px; grid-template-columns: 1fr; }

.testimonial-card {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--white); border-radius: var(--r-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  padding: 32px;
}
.testimonial-card__mark {
  font-size: 2.5rem; font-weight: 800; line-height: 1;
  color: var(--gold); font-family: Georgia, serif;
}
.testimonial-card blockquote p { font-size: 1rem; color: var(--text-main); }
.testimonial-card figcaption { margin-top: auto; }
.testimonial-card__name { font-size: 0.9375rem; font-weight: 700; color: var(--navy); }
.testimonial-card__role { font-size: 0.8125rem; color: var(--text-muted); }

@media (min-width: 992px) { .testimonials__grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.insights__grid { display: grid; gap: 32px; grid-template-columns: 1fr; }

.insight-card { display: flex; flex-direction: column; }
.insight-card__media {
  border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 10;
  margin-bottom: 20px;
}
.insight-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s ease;
}
.insight-card:hover .insight-card__media img { transform: scale(1.03); }

.insight-card__tag {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--navy); margin-bottom: 10px;
}
.insight-card h3 { font-size: 1.1875rem; line-height: 1.35; margin-bottom: 10px; }
.insight-card h3 a:hover { color: var(--gold-dark); }
.insight-card__excerpt { font-size: 0.9375rem; color: var(--text-muted); margin-bottom: 14px; }
.insight-card__date { margin-top: auto; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }

@media (min-width: 768px) { .insights__grid { grid-template-columns: repeat(3, 1fr); } }

.cta-final { position: relative; background: var(--bg-dark); overflow: hidden; }
.cta-final__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.25;
}
.cta-final::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 35, 66, 0.9) 0%, rgba(10, 35, 66, 0.75) 100%);
}
.cta-final__inner {
  position: relative; z-index: 1;
  max-width: 720px; margin-inline: auto; text-align: center;
}
.cta-final h2 { color: var(--white); }
.cta-final__sub {
  color: rgba(255, 255, 255, 0.8); font-size: 1.0625rem;
  max-width: 62ch; margin: 0 auto 36px;
}
.cta-final__buttons {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin-bottom: 28px;
}
.cta-final__contact {
  font-size: 0.9375rem; color: rgba(255, 255, 255, 0.7); max-width: none;
}
.cta-final__contact a { font-weight: 700; color: var(--white); }
.cta-final__contact a:hover { color: var(--gold); }

/* Desktop-only: this centered CTA heading is reused on every page and the
   longest one (Communities) needs ~994px to stay on one line. Widening it
   here fixes all of them at once; .cta-final__sub keeps its own max-width
   so the supporting line stays a normal centered paragraph beneath it. */
@media (min-width: 992px) {
  .cta-final__inner { max-width: 1100px; }
}

.sticky-cta__price { font-size: 1.0625rem; white-space: nowrap; }
.sticky-cta__action { white-space: nowrap; }
