/* ================================================================
   NUSAIL — Homepage enhancements (load after nusail-clean-style.css)
   ================================================================ */

.page-home {
  background: #ffffff;
}

.page-home .site-topbar {
  font-size: 0.8rem;
  padding: 0.55rem 0;
}

/* ── 26 Years floating promo popup (homepage only) ─────────────── */
.page-home .nusail-floating-promo {
  position: fixed;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  /* ~1/4 of previous max width (920px → 230px) */
  width: min(230px, calc(100vw - 32px));
  z-index: 9999;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.page-home .nusail-floating-promo-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.page-home .nusail-floating-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(5, 18, 55, 0.9);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.page-home .nusail-floating-close:hover {
  background: #e51b3e;
}

@media (max-width: 768px) {
  .page-home .nusail-floating-promo {
    top: 120px;
    width: min(230px, calc(100vw - 24px));
    border-radius: 10px;
  }

  .page-home .nusail-floating-close {
    width: 26px;
    height: 26px;
    font-size: 16px;
    top: 6px;
    right: 6px;
  }
}

.page-home .hero--media {
  min-height: clamp(520px, 78vh, 780px);
}

.page-home .hero-bg-image {
  opacity: 0.45;
}

.page-home .hero-grid {
  padding-block: 3.5rem 4rem;
}

.page-home .hero-copy h1 {
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
}

.page-home .hero-slide-media img {
  height: 280px;
}
.page-home .hero-panel--services {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
}

.page-home .section--core-services {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
}

/* ── Homepage About / Our Story alignment fix ─────────────────── */
.page-home #about .page-hero-inner {
  grid-template-columns: 0.9fr 1.1fr; /* ~45% / 55% */
  gap: 48px;
  align-items: center;
}

.page-home #about .page-hero-image {
  border-radius: 14px;
  overflow: hidden;
  max-height: 520px;
}

.page-home #about .page-hero-image img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
}

.page-home #about .page-hero-copy {
  padding: 2.25rem 0 2.25rem 0; /* remove the big right padding pushing text tight */
  max-width: 720px;
}

.page-home #about .our-story p {
  line-height: 1.8;
  margin-bottom: 18px;
}

.page-home #about .our-story p:last-child {
  margin-bottom: 0;
}

@media (max-width: 992px) {
  .page-home #about .page-hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .page-home #about .page-hero-image {
    max-height: none;
    border-radius: 12px;
  }

  .page-home #about .page-hero-image img {
    height: auto;
    max-height: none;
  }

  .page-home #about .page-hero-copy {
    padding: 0 0 1.5rem 0;
    max-width: none;
  }
}

.page-home .section--specialist {
  background: linear-gradient(180deg, #eef2fa 0%, #f8f9fd 100%);
}

.page-home .glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 86, 219, 0.12);
  box-shadow: 0 8px 32px rgba(1, 27, 88, 0.08);
}

.page-home .service-card-media {
  height: 210px;
}

.page-home .section-head h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 0.65rem auto 0;
  background: linear-gradient(90deg, #c8001e, #1a56db);
  border-radius: 2px;
}

.page-home #clients {
  background: #fff;
}

.page-home .clients-carousel {
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.page-home .site-footer {
  background: linear-gradient(180deg, #010e33 0%, #011b58 100%);
}

/* ── Homepage contact section (match two-column layout) ─────────── */
.page-home #contact {
  background: #ffffff;
}

.page-home #contact .homepage-contact-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: start;
}

.page-home #contact .homepage-contact-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.page-home #contact .homepage-contact-info > h2 {
  margin-bottom: 0.75rem;
}

.page-home #contact .homepage-contact-info > p:first-of-type {
  margin-bottom: 1.25rem;
  max-width: 42rem;
}

.page-home #contact .contact-mini-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 1rem;
  width: 100%;
}

.page-home #contact .contact-mini-cards .uk-saudi-card {
  grid-column: 1 / 2;
}

.page-home #contact .contact-mini-cards .contact-detail.glass-card {
  padding: 1rem 1.1rem;
  height: 100%;
  min-width: 0;
}

.page-home #contact .office-card {
  width: 100%;
}

.page-home #contact .homepage-contact-offices {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.page-home #contact .office.glass-card {
  border-left: none;
  background: rgba(255, 255, 255, 0.92);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.page-home #contact .office.glass-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.page-home #contact .office.glass-card p {
  font-size: 0.85rem;
  color: #3d4a5c;
  line-height: 1.6;
  margin: 0;
}

.page-home #contact .homepage-contact-info > p:not(:first-of-type) {
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.page-home #contact .homepage-contact-info .social-links {
  margin-top: 0.75rem;
}

.page-home #contact .homepage-form-card {
  width: 100%;
  padding: 1.75rem 1.85rem 2rem;
  align-self: start;
}

.page-home #contact .homepage-form-card .contact-form {
  width: 100%;
}

.page-home #contact .homepage-form-card .contact-form .btn {
  margin-top: 0.5rem;
}

@media (max-width: 1024px) {
  .page-home #contact .homepage-contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .page-home #contact .homepage-form-card {
    max-width: 100%;
  }
}

@media (max-width: 992px) {
  .page-home #contact .contact-mini-cards {
    grid-template-columns: 1fr;
  }

  .page-home #contact .contact-mini-cards .uk-saudi-card {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .page-home .site-nav.is-open {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 10px;
    margin-top: 0.5rem;
    padding: 1rem;
    box-shadow: 0 12px 40px rgba(1, 27, 88, 0.12);
  }
  .page-home .btn-nav-cta {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }
  .page-home .hero-slide-link img {
    height: 200px;
  }
}

/* ── HARD OVERRIDES: homepage contact must match reference layout ── */
.page-home #contact .home-contact-grid {
  display: grid !important;
  grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr) !important;
  gap: 48px !important;
  align-items: start !important;
}

.page-home #contact .home-contact-left {
  grid-column: 1 !important;
  min-width: 0 !important;
}

.page-home #contact .home-contact-form {
  grid-column: 2 !important;
  min-width: 0 !important;
  width: 100% !important;
  /* Match the wider, cleaner form column (no narrow card) */
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  align-self: start !important;
}

.page-home #contact .home-contact-mini-cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

.page-home #contact .home-contact-mini-cards .uk-saudi-card {
  grid-column: 1 / 2 !important;
}

.page-home #contact .home-contact-form form,
.page-home #contact .home-contact-form .contact-form {
  width: 100% !important;
  max-width: 100% !important;
}

/* Form card spacing (right column only) */
.page-home #contact .home-contact-form.homepage-form-card {
  padding: 2.25rem 2.25rem 2.5rem !important;
}

@media (max-width: 992px) {
  .page-home #contact .home-contact-grid {
    grid-template-columns: 1fr !important;
  }

  .page-home #contact .home-contact-left,
  .page-home #contact .home-contact-form {
    grid-column: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .page-home #contact .home-contact-mini-cards {
    grid-template-columns: 1fr !important;
  }

  .page-home #contact .home-contact-mini-cards .uk-saudi-card {
    grid-column: auto !important;
  }
}

/* ================================================================
   FINAL FIX — Homepage index contact form width + card placement
   Replace/override previous contact rules. Keep this at VERY BOTTOM.
   ================================================================ */

/* Make sure homepage contact wrapper is a real 2-column grid */
.page-home #contact .homepage-contact-grid,
.page-home #contact .home-contact-grid,
.page-home #contact .contact-grid,
.page-home #contact .contact-enquiry-grid {
  display: grid !important;
  grid-template-columns: minmax(420px, 0.95fr) minmax(600px, 1.05fr) !important;
  gap: 48px !important;
  align-items: start !important;
  max-width: 1320px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Left contact column */
.page-home #contact .homepage-contact-info,
.page-home #contact .home-contact-left,
.page-home #contact .contact-info,
.page-home #contact .contact-enquiry-aside {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Right form card — make the outer card wide and aligned like the first screenshot */
.page-home #contact .homepage-form-card,
.page-home #contact .home-contact-form,
.page-home #contact .enquiry-form-card,
.page-home #contact .contact-form-card,
.page-home #contact .glass-card:has(#enquiry-form) {
  grid-column: 2 !important;
  width: 100% !important;
  max-width: 930px !important;
  min-width: 0 !important;
  justify-self: end !important;
  align-self: start !important;
  margin: 0 !important;
  padding: 2.2rem 2.7rem 2.45rem !important;
  box-sizing: border-box !important;
}

/* Remove any old max-width on the inner form */
.page-home #contact #enquiry-form,
.page-home #contact form#enquiry-form,
.page-home #contact .homepage-form-card .contact-form,
.page-home #contact .home-contact-form .contact-form,
.page-home #contact .enquiry-form-card .contact-form,
.page-home #contact .glass-card:has(#enquiry-form) .contact-form,
.page-home #contact .php-email-form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Make all fields fill the card width */
.page-home #contact #enquiry-form input,
.page-home #contact #enquiry-form textarea,
.page-home #contact #enquiry-form select,
.page-home #contact #enquiry-form .form-control {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Keep message box similar to the first screenshot */
.page-home #contact #enquiry-form textarea {
  min-height: 175px !important;
}

/* Top mini contact cards: first row PHONE + EMAIL only */
.page-home #contact .contact-mini-cards,
.page-home #contact .home-contact-mini-cards,
.page-home #contact .contact-detail-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
}

/* UK & Saudi card goes under PHONE, not as a third card */
.page-home #contact .contact-mini-cards > :nth-child(3),
.page-home #contact .home-contact-mini-cards > :nth-child(3),
.page-home #contact .contact-detail-grid > :nth-child(3),
.page-home #contact .uk-saudi-card {
  grid-column: 1 / 2 !important;
}

/* Full-width office cards */
.page-home #contact .homepage-contact-offices,
.page-home #contact .office-list {
  width: 100% !important;
}

.page-home #contact .office.glass-card,
.page-home #contact .office-card {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Tablet/mobile: stack cleanly */
@media (max-width: 1024px) {
  .page-home #contact .homepage-contact-grid,
  .page-home #contact .home-contact-grid,
  .page-home #contact .contact-grid,
  .page-home #contact .contact-enquiry-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .page-home #contact .homepage-contact-info,
  .page-home #contact .home-contact-left,
  .page-home #contact .contact-info,
  .page-home #contact .contact-enquiry-aside,
  .page-home #contact .homepage-form-card,
  .page-home #contact .home-contact-form,
  .page-home #contact .enquiry-form-card,
  .page-home #contact .contact-form-card,
  .page-home #contact .glass-card:has(#enquiry-form) {
    grid-column: auto !important;
    max-width: 100% !important;
    justify-self: stretch !important;
    margin: 0 !important;
  }
}

@media (max-width: 768px) {
  .page-home #contact .contact-mini-cards,
  .page-home #contact .home-contact-mini-cards,
  .page-home #contact .contact-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .page-home #contact .contact-mini-cards > :nth-child(3),
  .page-home #contact .home-contact-mini-cards > :nth-child(3),
  .page-home #contact .contact-detail-grid > :nth-child(3),
  .page-home #contact .uk-saudi-card {
    grid-column: auto !important;
  }

  .page-home #contact .homepage-form-card,
  .page-home #contact .home-contact-form,
  .page-home #contact .enquiry-form-card,
  .page-home #contact .contact-form-card,
  .page-home #contact .glass-card:has(#enquiry-form) {
    padding: 1.5rem !important;
  }
}
