/* ==========================================================================
   Khaled Bin Fawzan Al-Fayez Law Firm - Design System & Styles
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('assets/fonts/cairo-arabic-variable.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('assets/fonts/cairo-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Color Palette */
  --navy-primary: #0a1c33;
  --navy-dark: #081729;
  --navy-light: #122b4d;
  --navy-hover: #15345b;
  
  --gold-primary: #c59d4c;
  --gold-dark: #b38a39;
  --gold-light: #dfba6c;
  --gold-gradient: linear-gradient(135deg, #d8b260 0%, #b38a39 100%);
  --gold-gradient-soft: linear-gradient(135deg, #f0dfb5 0%, #d8b260 100%);

  --bg-white: #ffffff;
  --bg-soft: #faf8f4;
  --bg-card: #fdfcfa;
  --bg-banner: #f7f5f0;
  
  --text-dark: #0a1c33;
  --text-body: #3d4a5c;
  --text-muted: #6c7a8d;
  --text-light: #e2e8f0;
  
  --border-light: #eee9df;
  --border-gold: rgba(197, 157, 76, 0.4);
  
  --shadow-sm: 0 2px 8px rgba(10, 28, 51, 0.04);
  --shadow-md: 0 6px 20px rgba(10, 28, 51, 0.07);
  --shadow-lg: 0 12px 32px rgba(10, 28, 51, 0.1);
  --shadow-gold: 0 8px 24px rgba(197, 157, 76, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 50px;

  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  direction: rtl;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-white);
  color: var(--text-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

section[id] {
  scroll-margin-top: 20px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Section Common Styles */
.section {
  padding: 70px 0;
  position: relative;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy-primary);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.gold-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px auto 16px;
  width: 120px;
}

.gold-ornament::before,
.gold-ornament::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.gold-diamond {
  width: 8px;
  height: 8px;
  background-color: var(--gold-primary);
  transform: rotate(45deg);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-body);
  font-weight: 500;
  max-width: 700px;
  margin: 0 auto;
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn-navy {
  background-color: var(--navy-primary);
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(10, 28, 51, 0.2);
}

.btn-navy:hover {
  background-color: var(--navy-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 28, 51, 0.3);
  color: var(--bg-white);
}

.btn-gold-outline {
  background-color: transparent;
  border-color: var(--gold-primary);
  color: var(--gold-dark);
}

.btn-gold-outline:hover {
  background-color: var(--gold-primary);
  color: var(--bg-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-gold-outline:hover svg {
  fill: #ffffff;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: var(--transition);
}

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.header {
  position: relative;
  width: 100%;
  z-index: 1000;
  background-color: var(--bg-white);
  border: 0;
  box-shadow: none;
  transition: var(--transition);
  padding: 10px 0;
}

.header.scrolled {
  box-shadow: none;
  padding: 10px 0;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 112px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}

.header.scrolled .logo-img {
  height: 112px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-primary);
  position: relative;
  padding: 8px 0;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background-color: var(--gold-primary);
  border-radius: 2px;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background-color: var(--navy-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-only-action {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 58px 0 78px;
  background-color: var(--bg-white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-bg-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hero-pattern {
  position: absolute;
  pointer-events: none;
}

.hero-pattern-left {
  left: 0;
  bottom: 0;
  width: min(36vw, 430px);
  height: 100%;
  fill: none;
  stroke: rgba(197, 157, 76, 0.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero-pattern-right {
  right: 0;
  bottom: 0;
  width: min(17vw, 220px);
  height: 100%;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 16px;
}

.hero-title-dark {
  color: var(--navy-primary);
  display: block;
}

.hero-title-gold {
  color: var(--gold-primary);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-body);
  font-weight: 500;
  line-height: 1.9;
  margin: 24px auto 36px;
  max-width: 780px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ==========================================================================
   Services Section ("خدماتنا")
   ========================================================================== */
.services-section {
  background-color: var(--bg-white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.service-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 36px 20px 32px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(10, 28, 51, 0.08);
  border-color: var(--gold-primary);
  background-color: #ffffff;
}

.service-icon-wrap {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.service-icon-wrap svg {
  width: 52px;
  height: 52px;
  stroke: var(--gold-primary);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-icon-wrap svg.execution-gavel-icon {
  stroke-width: 1.65;
}

.service-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-primary);
  margin-bottom: 14px;
}

.service-desc {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.75;
  font-weight: 500;
}

/* ==========================================================================
   About Us Section ("من نحن")
   ========================================================================== */
.about-section {
  background-color: var(--bg-white);
  padding-top: 50px;
}

.about-text-content {
  max-width: 920px;
  margin: 0 auto 50px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-body);
  line-height: 2.1;
  font-weight: 500;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.feature-card {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.feature-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background-color: var(--border-light);
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon-wrap svg {
  width: 42px;
  height: 42px;
  stroke: var(--gold-primary);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy-primary);
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 0.93rem;
  color: var(--text-body);
  line-height: 1.7;
}

/* ==========================================================================
   Banner CTA Box ("لديك قضية أو استفسار قانوني؟")
   ========================================================================== */
.cta-banner-section {
  padding: 30px 0 60px;
}

.cta-banner-box {
  background-color: var(--bg-banner);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  text-align: center;
}

.cta-banner-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy-primary);
  margin-bottom: 12px;
}

.cta-banner-subtitle {
  font-size: 1.05rem;
  color: var(--text-body);
  margin-bottom: 28px;
  font-weight: 500;
}

.cta-banner-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ==========================================================================
   Partners Section ("الشركاء والجهات المعنية")
   ========================================================================== */
.partners-section {
  padding: 20px 0 60px;
  background-color: var(--bg-white);
}

.partners-carousel-box {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.partners-carousel-track-container {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.partners-carousel-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: scrollMarquee 35s linear infinite;
}

.partners-carousel-track:hover {
  animation-play-state: paused;
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

.partner-card {
  flex: 0 0 300px;
  background-color: transparent;
  padding: 16px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  position: relative;
}

.partner-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background-color: var(--border-light);
}

.partner-logo-img {
  max-height: 60px;
  max-width: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}

.partner-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy-primary);
}

.partner-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.carousel-chevron {
  background: transparent;
  border: none;
  color: var(--navy-primary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: var(--transition);
  flex-shrink: 0;
}

.carousel-chevron:hover {
  color: var(--gold-primary);
}

.carousel-chevron svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* ==========================================================================
   Footer Section (Pixel-Perfect SiteDesign.png RTL Match)
   ========================================================================== */
.footer {
  background-color: var(--navy-dark);
  color: var(--bg-white);
  padding: 60px 0 0;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.2fr;
  gap: 40px;
  padding-bottom: 45px;
}

.footer-col-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--bg-white);
  margin-bottom: 22px;
}

/* Column 1 (Right): Logo & Social */
.footer-brand-col {
  display: flex;
  flex-direction: column;
}

.footer-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.footer-logo-img {
  height: 85px;
  width: auto;
  object-fit: contain;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-primary);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  text-decoration: none;
  transition: var(--transition);
}

.social-btn:hover {
  background-color: var(--gold-primary);
  color: var(--navy-dark);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(197, 157, 76, 0.3);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Column 2 (Center): Quick Links */
.footer-links-col {
  padding-right: 20px;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-link {
  color: #d1dbed;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--gold-primary);
  transform: translateX(-4px);
}

/* Column 3 (Left): Contact Info */
.footer-contact-col {
  display: flex;
  flex-direction: column;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
  color: #d1dbed;
  text-decoration: none;
  transition: var(--transition);
}

.contact-item:hover {
  color: var(--gold-primary);
}

.contact-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--gold-primary);
}

/* Bottom Copyright Bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 0;
  text-align: center;
  font-size: 0.92rem;
  color: #92a4bd;
  font-weight: 600;
}

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  left: 26px;
  bottom: 26px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(197, 157, 76, 0.75);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-light), var(--navy-primary));
  color: var(--gold-light);
  box-shadow: 0 8px 22px rgba(10, 28, 51, 0.24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 900;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 11px 28px rgba(10, 28, 51, 0.3);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(197, 157, 76, 0.35);
  outline-offset: 3px;
}

.back-to-top svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Responsive Mobile & Tablet Optimization
   ========================================================================== */
@media (max-width: 1100px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 850px) {
  .header {
    padding: 8px 0;
  }

  .header.scrolled {
    padding: 8px 0;
  }

  .logo-img,
  .header.scrolled .logo-img {
    height: 90px;
  }
  
  .desktop-only-btn {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: var(--bg-white);
    flex-direction: column;
    padding: 24px;
    gap: 18px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-light);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-only-action {
    display: block;
    width: 100%;
    margin-top: 10px;
  }

  .mobile-only-action .btn {
    width: 100%;
  }

  .hero-section {
    padding: 50px 0 65px;
  }

  .hero-pattern-left {
    width: min(43vw, 350px);
  }

  .hero-pattern-right {
    width: min(19vw, 150px);
  }

  .hero-title {
    font-size: 2.3rem;
  }

  .hero-description {
    font-size: 1.02rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .footer-brand-wrap {
    align-items: center;
  }

  .social-links {
    justify-content: center;
  }

  .contact-item {
    justify-content: center;
  }

  .footer-links-col {
    padding-right: 0;
  }
}

@media (max-width: 580px) {
  .container {
    padding: 0 16px;
  }

  .back-to-top {
    left: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  section[id] {
    scroll-margin-top: 20px;
  }

  .logo-img,
  .header.scrolled .logo-img {
    height: 70px;
  }

  .hero-section {
    padding: 38px 0 50px;
  }

  .hero-pattern-left {
    width: 54vw;
    stroke: rgba(197, 157, 76, 0.12);
  }

  .hero-pattern-right {
    width: 23vw;
    opacity: 0.78;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-description {
    font-size: 0.96rem;
    margin: 18px auto 28px;
  }

  .hero-cta-group,
  .cta-banner-buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .btn {
    width: 100%;
    padding: 14px 20px;
  }

  .services-grid,
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-card,
  .feature-card {
    padding: 24px 18px;
  }

  .cta-banner-box {
    padding: 32px 20px;
  }

  .cta-banner-title {
    font-size: 1.45rem;
  }

  .cta-banner-subtitle {
    font-size: 0.95rem;
  }

  .footer-logo-img {
    height: 70px;
  }
}
