/* ==========================================================
   HELAL LAW — MODERN OVERRIDES & RESPONSIVE REDESIGN
   Custom CSS: Separators, Layout Fixes, Mobile-First
   ========================================================== */

/* ----------------------------------------------------------
   1. GLOBAL SECTION RESETS
   ---------------------------------------------------------- */
section,
.section {
  overflow: visible !important;
}

/* Ensure sections that need overflow clipping keep it */
.hero,
.hero-legacy-section,
#leadership {
  overflow: hidden !important;
}

/* ----------------------------------------------------------
   2. HERO SECTION — MODERNIZE
   ---------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: 0;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(6, 8, 12, 0.5));
  z-index: 1;
  pointer-events: none;
}

/* ----------------------------------------------------------
   3. SECTION WAVE SEPARATORS
   ---------------------------------------------------------- */
.wave-separator {
  position: relative;
  line-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  z-index: 10;
  display: block;
}

.wave-separator svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ----------------------------------------------------------
   4. LEGACY SECTION — MAJOR LAYOUT FIX
   ---------------------------------------------------------- */
.hero-legacy-section {
  position: relative;
  min-height: 80vh;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}

/* Remove top white gap by ensuring section fills properly */
#legacy {
  padding: 0 !important;
  margin: 0 !important;
  scroll-margin-top: 80px;
}

#leadership {
  padding: 0 !important;
  margin: 0 !important;
  scroll-margin-top: 80px;
}

.legacy-content-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0;
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 75vh;
  align-items: end;
  padding-top: 2rem;
  padding-bottom: 0;
}

/* Text block — left side */
.text-block {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2rem 4rem 4rem;
  transform: none !important;
  /* Remove the translateX that was pushing it off */
  z-index: 100 !important;
  position: relative;
}

.text-block h1,
.text-block h2 {
  font-size: 2.8rem !important;
  line-height: 1.2 !important;
  margin-bottom: 1.5rem !important;
}

.text-block p {
  font-size: 1.25rem !important;
  line-height: 1.6 !important;
}

/* Person showcase — right side */
.person-showcase {
  grid-column: 2;
  position: relative;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  overflow: hidden;
  min-height: 60vh;
}

.hero-person-img {
  height: auto !important;
  max-height: 75vh;
  width: 100% !important;
  max-width: 600px;
  object-fit: contain !important;
  object-position: bottom center !important;
  display: block;
  margin-left: auto;
}

/* Fix leadership specific layout */
#leadership .cta-wrapper.legacy-content-grid {
  align-items: end;
  min-height: 75vh;
}

#leadership .person-showcase .image-container {
  position: relative !important;
  left: auto !important;
  bottom: auto !important;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
}

#leadership .person-showcase .image-container img {
  max-height: 75vh;
  height: auto !important;
  width: 100%;
  max-width: 550px;
  object-fit: contain;
  object-position: bottom left;
}

#leadership .content-block {
  padding: 4rem 4rem 4rem 2rem !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 0 !important;
  width: 100% !important;
}

#leadership .content-block h2 {
  font-size: 2.8rem !important;
  line-height: 1.2 !important;
  margin-bottom: 1.5rem !important;
}

#leadership .content-block p {
  font-size: 1.25rem !important;
  line-height: 1.6 !important;
}

/* ----------------------------------------------------------
   5. EXPERTISE SECTION — MODERNIZE
   ---------------------------------------------------------- */
#expertise {
  background: #f8f7f5;
  padding: 80px 0 100px !important;
}

.section-title h2 {
  color: #171717 !important;
}

.section-title p {
  color: #555 !important;
  font-size: 1.1rem;
}

/* Better card hover on touch devices - REMOVED so it shows title and taps to show description */

/* ----------------------------------------------------------
   6. HEADER — MOBILE FIX
   ---------------------------------------------------------- */
@media (max-width: 576px) {
  .header-badge {
    display: none !important;
    /* Hide badge from header on very small screens; it's shown in hero */
  }
}

/* ----------------------------------------------------------
   7. MOBILE-FIRST RESPONSIVE FIXES
   ---------------------------------------------------------- */

/* Large tablets and below - Keep side-by-side layout */
@media (max-width: 991.98px) {
  .legacy-content-grid {
    grid-template-columns: 0.9fr 1.1fr !important;
    min-height: auto !important;
    gap: 0.75rem;
    padding-top: 40px;
    padding-bottom: 0 !important;
    align-items: end !important;
  }

  .text-block {
    padding: 1.5rem 0.75rem 1.5rem 1.5rem !important;
    transform: none !important;
    max-width: 100% !important;
    text-align: left;
    align-self: end !important;
  }

  .text-block h1,
  .text-block h2 {
    font-size: 2rem !important;
    line-height: 1.25 !important;
    margin-bottom: 1rem !important;
  }

  .text-block p {
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
  }

  .person-showcase {
    width: 100%;
    height: 100%;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    align-self: end !important;
    min-height: auto;
    max-height: none !important;
  }

  .hero-person-img {
    max-height: none !important;
    height: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    object-fit: contain !important;
    object-position: bottom right !important;
    align-self: flex-end !important;
  }

  .hero-legacy-section {
    min-height: auto !important;
  }

  #leadership .cta-wrapper.legacy-content-grid {
    min-height: auto !important;
    grid-template-columns: 1.1fr 0.9fr !important;
    align-items: end !important;
  }

  #leadership .person-showcase {
    max-height: none !important;
    display: flex !important;
    align-items: flex-end !important;
    align-self: end !important;
  }

  #leadership .person-showcase .image-container {
    position: relative !important;
    width: 100%;
    height: 100%;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-end !important;
  }

  #leadership .person-showcase .image-container img {
    max-height: none !important;
    height: auto !important;
    max-width: 100%;
    margin: 0;
    margin-bottom: 0 !important;
    object-fit: contain !important;
    object-position: bottom left !important;
    align-self: flex-end !important;
  }

  #leadership .content-block {
    padding: 1.5rem 1.5rem 1.5rem 0.75rem !important;
    text-align: left;
    align-self: end !important;
  }

  #leadership .content-block h2 {
    font-size: 2rem !important;
    line-height: 1.25 !important;
    margin-bottom: 1rem !important;
  }

  #leadership .content-block p {
    font-size: 1.5rem !important;
    line-height: 1.5 !important;
  }

  #leadership .content-block .text-content {
    padding-left: 0 !important;
  }
}

/* Mobile phones - Keep side-by-side but more compact */
@media (max-width: 767.98px) {
  .legacy-content-grid {
    grid-template-columns: 0.85fr 1.15fr !important;
    padding-top: 30px;
    padding-bottom: 0 !important;
    gap: 0.5rem;
    min-height: auto !important;
    align-items: end !important;
  }

  .text-block {
    padding: 1rem 0.5rem 1rem 1rem !important;
    align-self: end !important;
  }

  .text-block h1,
  .text-block h2 {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.75rem !important;
  }

  .text-block p {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }

  #leadership .cta-wrapper.legacy-content-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
  }

  #leadership .content-block {
    padding: 1rem 1rem 1rem 0.5rem !important;
    align-self: end !important;
  }

  #leadership .content-block h2 {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.75rem !important;
  }

  #leadership .content-block p {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }

  .person-showcase {
    max-height: none !important;
    display: flex !important;
    align-items: flex-end !important;
    align-self: end !important;
  }

  .hero-person-img {
    max-height: none !important;
    height: auto !important;
    margin-bottom: 0 !important;
    align-self: flex-end !important;
  }

  #leadership .person-showcase {
    max-height: none !important;
    display: flex !important;
    align-items: flex-end !important;
    align-self: end !important;
  }

  #leadership .person-showcase .image-container {
    display: flex !important;
    align-items: flex-end !important;
  }

  #leadership .person-showcase .image-container img {
    max-height: none !important;
    height: auto !important;
    margin-bottom: 0 !important;
    align-self: flex-end !important;
  }

  .service-card-hl {
    height: 320px;
  }
}

/* Small phones - Very compact side-by-side */
@media (max-width: 480px) {
  .legacy-content-grid {
    grid-template-columns: 0.8fr 1.2fr !important;
    gap: 0.25rem;
    min-height: auto !important;
    padding-top: 25px;
    padding-bottom: 0 !important;
    align-items: end !important;
  }

  .text-block {
    padding: 0.75rem 0.35rem 0.75rem 0.75rem !important;
    align-self: end !important;
  }

  .text-block h1,
  .text-block h2 {
    font-size: 1.35rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
  }

  .text-block p {
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
  }

  #leadership .cta-wrapper.legacy-content-grid {
    grid-template-columns: 1.2fr 0.8fr !important;
  }

  #leadership .content-block {
    padding: 0.75rem 0.75rem 0.75rem 0.35rem !important;
    align-self: end !important;
  }

  #leadership .content-block h2 {
    font-size: 1.35rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
  }

  #leadership .content-block p {
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
  }

  .person-showcase {
    max-height: none !important;
    display: flex !important;
    align-items: flex-end !important;
    align-self: end !important;
  }

  .hero-person-img {
    max-height: none !important;
    height: auto !important;
    margin-bottom: 0 !important;
    align-self: flex-end !important;
  }

  #leadership .person-showcase {
    max-height: none !important;
    display: flex !important;
    align-items: flex-end !important;
    align-self: end !important;
  }

  #leadership .person-showcase .image-container {
    display: flex !important;
    align-items: flex-end !important;
  }

  #leadership .person-showcase .image-container img {
    max-height: none !important;
    height: auto !important;
    margin-bottom: 0 !important;
    align-self: flex-end !important;
  }

  .service-card-hl {
    height: 280px;
  }
}

/* ----------------------------------------------------------
   8. ANIMATED NUMBER COUNTERS STRIP (between Legacy & Leadership)
   ---------------------------------------------------------- */
.stats-strip {
  background: #ffffff;
  color: #A10131;
  padding: 2rem 0;
  position: relative;
  z-index: 10;
}

.stats-strip .stat-item {
  text-align: center;
  padding: 0 1rem;
}

.stats-strip .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: "Lato", sans-serif;
  line-height: 1;
  display: block;
}

.stats-strip .stat-label {
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 0.5rem;
  display: block;
}

@media (max-width: 576px) {
  .stats-strip .stat-number {
    font-size: 2rem;
  }
}

/* ----------------------------------------------------------
   9. FOOTER REDESIGN — background image, fully responsive
   ---------------------------------------------------------- */

/* 
 * KEY FIX: Apply background-image directly on #footer (not a child).
 * This prevents .dark-background's --background-color variable from
 * overriding it, and avoids iOS Safari's background-attachment: fixed bug.
 */
#footer.footer {
  padding: 0 !important;
  border-top: none !important;
  /* Image on the footer itself — cannot be overridden by var() */
  background-color: #1a000a !important;
  /* fallback if image fails */
  background-image: url('../img/footer-bg.png') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  /* iOS Safari requires scroll */
  overflow: hidden;
}

/* footer-main: transparent so the footer's bg shows through */
#footer .footer-main {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: stretch;
  background: transparent !important;
}

/* Dark overlay for text legibility */
#footer .footer-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.60) 0%,
      rgba(0, 0, 0, 0.30) 55%,
      rgba(0, 0, 0, 0.05) 100%);
  z-index: 1;
  pointer-events: none;
}

#footer .footer-main .container {
  position: relative;
  z-index: 2;
  padding-top: 60px;
  padding-bottom: 50px;
}

/* Left column — full width */
#footer .footer-left-col {
  flex: 0 0 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 0;
}

/* Logo */
#footer .footer-left-col .logo img {
  height: 110px;
  width: auto;
  object-fit: contain;
}

/* Offices heading */
#footer .footer-offices-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
  font-family: var(--heading-font, 'Inter', sans-serif);
}

/* Offices list */
#footer .footer-offices-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

#footer .footer-offices-list li {
  color: rgb(255, 255, 255) !important;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.75;
  margin-bottom: 12px;
}

#footer .footer-offices-list li strong {
  color: #ffffff;
  font-weight: 600;
}

/* CTA button */
#footer .footer-cta-btn {
  display: inline-block;
  background: #A10131;
  color: #ffffff;
  border: none;
  padding: 13px 32px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
  width: fit-content;
}

#footer .footer-cta-btn:hover {
  background: #c4013c;
  transform: translateY(-2px);
  color: #ffffff;
}

/* Right column hidden — image is the full CSS background */
#footer .footer-right-col {
  display: none !important;
}

#footer .footer-deco-img {
  display: none;
}

/* Copyright bar */
#footer .footer-bottom {
  background: rgba(0, 0, 0, 0.75);
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
  margin-top: 0 !important;
}

#footer .footer-bottom .footer-bottom-content {
  display: flex;
  align-items: center;
}

#footer .footer-bottom p {
  color: rgba(255, 255, 255, 0.50);
  font-size: 15px;
  font-weight: 300;
}

#footer .footer-bottom .sitename {
  color: rgba(255, 255, 255, 0.80);
  font-weight: 500;
}

/* ----------------------------------------------------------
   MOBILE RESPONSIVE — ensure image stays visible on all sizes
   ---------------------------------------------------------- */

/* Tablet and below */
@media (max-width: 991.98px) {
  #footer.footer {
    background-size: cover !important;
    background-position: center center !important;
  }

  #footer .footer-main {
    min-height: 340px;
  }

  #footer .footer-main .container {
    padding-top: 50px;
    padding-bottom: 45px;
  }
}

/* Mobile phones (iPhone 13 = 390px, SE = 375px) */
@media (max-width: 767.98px) {
  #footer.footer {
    /* Shift focal point so the 3D logo stays partially visible on right */
    background-position: 70% center !important;
    background-size: cover !important;
    background-color: #1a000a !important;
    /* solid fallback */
    background-attachment: scroll !important;
  }

  #footer .footer-main {
    min-height: 300px;
  }

  #footer .footer-main::before {
    /* Stronger overlay on mobile so text is readable over the image */
    background: rgba(0, 0, 0, 0.55) !important;
  }

  #footer .footer-main .container {
    padding-top: 40px;
    padding-bottom: 35px;
  }

  #footer .footer-left-col {
    padding-right: 0;
    align-items: flex-start;
  }
}

/* Small phones (iPhone SE, Galaxy S8) */
@media (max-width: 480px) {
  #footer.footer {
    background-position: 65% center !important;
    background-size: cover !important;
  }

  #footer .footer-main {
    min-height: 280px;
  }

  #footer .footer-left-col .logo img {
    height: 75px;
  }

  #footer .footer-offices-list li {
    font-size: 15px;
  }

  #footer .footer-cta-btn {
    padding: 12px 26px;
    font-size: 15px;
  }
}

/* ----------------------------------------------------------
   10. SEPARATOR DECORATIVE ELEMENTS
   ---------------------------------------------------------- */

/* Diagonal separator from dark to light */
.separator-dark-to-light {
  position: relative;
  overflow: hidden;
  height: 80px;
  background: #06080c;
  z-index: 9;
}

.separator-dark-to-light::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: #f8f7f5;
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
}

/* Diagonal separator from light to dark (footer) */
.separator-light-to-dark {
  position: relative;
  overflow: hidden;
  height: 80px;
  background: #f8f7f5;
  z-index: 9;
}

.separator-light-to-dark::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: #06080c;
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
}

/* ----------------------------------------------------------
   11. SCROLL ANIMATION ENHANCEMENTS
   ---------------------------------------------------------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: #A10131;
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* ----------------------------------------------------------
   12. EXPERTISE SECTION GRID IMPROVEMENTS
   ---------------------------------------------------------- */
#expertise .container {
  max-width: 1400px;
}

@media (max-width: 575.98px) {
  #expertise .col-lg-3.col-md-6 {
    padding-left: 8px;
    padding-right: 8px;
  }

  .service-card-hl {
    border-radius: 14px;
  }
}

/* ==========================================================
   13. HEADER & MOBILE MENU FIXES (Hostinger Deployment)
   ========================================================== */

/* Fix 1: Ensure navbar background is reliably visible */
.header {
  background-color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
}

.scrolled .header {
  background-color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Fix 2: Mobile Menu Display Fix
   Backdrop-filter creates a CSS containing block which breaks position:fixed.
   This traps the mobile menu inside the header, making it invisible.
   We remove backdrop-filter when the menu is open. */
body.mobile-nav-active .header,
body.mobile-nav-active .header .header-inner {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  filter: none !important;
}

.mobile-nav-active .navmenu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85) !important;
  z-index: 9999 !important;
}

.mobile-nav-active .navmenu ul {
  background-color: #ffffff !important;
  z-index: 10000 !important;
}

.mobile-nav-active .mobile-nav-toggle {
  z-index: 10001 !important;
  color: #ffffff !important;
}

/* Fix 3: Full-width header alignment - edge to edge */
.header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Align logo with section content while header spans full width */
@media (min-width: 1400px) {
  .header .header-inner {
    padding-left: 80px;
    padding-right: 80px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .header .header-inner {
    padding-left: 60px;
    padding-right: 60px;
  }
}