/* ==========================================================================
   Services & Practice Areas — ebtb20
   Premium Saudi Law Firm
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --ebtb20-primary: #0b5d3b;
  --ebtb20-primary-rgb: 11, 93, 59;
  --ebtb20-dark: #10271f;
  --ebtb20-bg: #f7f4ec;
  --ebtb20-white: #FFFFFF;
  --ebtb20-text: #1d2b24;
  --ebtb20-border: rgba(0, 0, 0, 0.08);
  --ebtb20-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --ebtb20-shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --ebtb20-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
  --ebtb20-shadow-gold: 0 12px 40px rgba(var(--ebtb20-primary-rgb), 0.15);
  --ebtb20-radius: 12px;
  --ebtb20-radius-lg: 16px;
  --ebtb20-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --ebtb20-font-ar: 'Noto Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
  --ebtb20-section-padding: 120px 0;
  --ebtb20-container-max: 1200px;
  --ebtb20-container-padding: 0 24px;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Section Wrapper ---------- */
.ebtb20-section {
  font-family: var(--ebtb20-font-ar);
  background-color: var(--ebtb20-bg);
  padding: var(--ebtb20-section-padding);
  direction: rtl;
  line-height: 1.7;
  color: var(--ebtb20-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ebtb20-container {
  max-width: var(--ebtb20-container-max);
  margin: 0 auto;
  padding: var(--ebtb20-container-padding);
}

/* ---------- Section Title ---------- */
.ebtb20-section-title {
  text-align: center;
  margin-bottom: 60px;
}

.ebtb20-section-title h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--ebtb20-dark);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ebtb20-title-line {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--ebtb20-primary);
  margin: 0 auto 20px;
  border-radius: 2px;
  transition: width var(--ebtb20-transition);
}

.ebtb20-section-title:hover .ebtb20-title-line {
  width: 100px;
}

.ebtb20-section-desc {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: #6b6b6b;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ==========================================================================
   SERVICES GRID
   ========================================================================== */

.ebtb20-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ---------- Service Card ---------- */
.ebtb20-service-card {
  position: relative;
  background: var(--ebtb20-white);
  border: 1px solid var(--ebtb20-border);
  border-radius: var(--ebtb20-radius-lg);
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition:
    transform var(--ebtb20-transition),
    box-shadow var(--ebtb20-transition),
    border-color var(--ebtb20-transition);
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
}

.ebtb20-service-card.ebtb20-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gold top border reveal */
.ebtb20-service-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ebtb20-primary), #d4b97a);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--ebtb20-transition);
}

/* Ripple surface */
.ebtb20-service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
    rgba(var(--ebtb20-primary-rgb), 0.07) 0%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.ebtb20-service-card:hover::after {
  opacity: 1;
}

.ebtb20-service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--ebtb20-shadow-lg);
  border-color: rgba(var(--ebtb20-primary-rgb), 0.2);
}

.ebtb20-service-card:hover::before {
  transform: scaleX(1);
}

/* Icon container */
.ebtb20-service-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--ebtb20-primary-rgb), 0.1), rgba(var(--ebtb20-primary-rgb), 0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: background var(--ebtb20-transition), transform var(--ebtb20-transition);
}

.ebtb20-service-card:hover .ebtb20-service-icon {
  background: linear-gradient(135deg, rgba(var(--ebtb20-primary-rgb), 0.18), rgba(var(--ebtb20-primary-rgb), 0.08));
  transform: scale(1.05);
}

.ebtb20-service-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--ebtb20-primary);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ebtb20-service-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Card text */
.ebtb20-service-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ebtb20-dark);
  margin-bottom: 12px;
  transition: color var(--ebtb20-transition);
}

.ebtb20-service-card:hover .ebtb20-service-title {
  color: var(--ebtb20-primary);
}

.ebtb20-service-desc {
  font-size: 0.92rem;
  color: #777;
  line-height: 1.8;
  flex: 1;
  margin-bottom: 24px;
}

/* Arrow link */
.ebtb20-service-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ebtb20-primary);
  text-decoration: none;
  transition: gap var(--ebtb20-transition);
}

.ebtb20-service-link svg {
  width: 18px;
  height: 18px;
  stroke: var(--ebtb20-primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--ebtb20-transition);
}

.ebtb20-service-card:hover .ebtb20-service-link {
  gap: 14px;
}

.ebtb20-service-card:hover .ebtb20-service-link svg {
  transform: translateX(-4px);
}

/* Stagger animation */
.ebtb20-service-card:nth-child(1) { transition-delay: 0ms; }
.ebtb20-service-card:nth-child(2) { transition-delay: 80ms; }
.ebtb20-service-card:nth-child(3) { transition-delay: 160ms; }
.ebtb20-service-card:nth-child(4) { transition-delay: 240ms; }
.ebtb20-service-card:nth-child(5) { transition-delay: 320ms; }
.ebtb20-service-card:nth-child(6) { transition-delay: 400ms; }

/* ==========================================================================
   SPECIALTIES / PRACTICE AREAS
   ========================================================================== */

.ebtb20-specialties {
  padding-top: 60px;
}

.ebtb20-specialties-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ---------- Specialty Card ---------- */
.ebtb20-specialty-item {
  position: relative;
  background: var(--ebtb20-white);
  border: 1px solid var(--ebtb20-border);
  border-radius: var(--ebtb20-radius);
  padding: 32px 20px 28px;
  text-align: center;
  cursor: pointer;
  transition:
    transform var(--ebtb20-transition),
    box-shadow var(--ebtb20-transition),
    border-color var(--ebtb20-transition);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
}

.ebtb20-specialty-item.ebtb20-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gold top border */
.ebtb20-specialty-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--ebtb20-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--ebtb20-transition);
  border-radius: var(--ebtb20-radius) var(--ebtb20-radius) 0 0;
}

.ebtb20-specialty-item:hover::before {
  transform: scaleX(1);
}

.ebtb20-specialty-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--ebtb20-shadow-md);
  border-color: rgba(var(--ebtb20-primary-rgb), 0.2);
}

/* Specialty icon */
.ebtb20-specialty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--ebtb20-primary-rgb), 0.1), rgba(var(--ebtb20-primary-rgb), 0.03));
  transition: background var(--ebtb20-transition), transform var(--ebtb20-transition);
}

.ebtb20-specialty-item:hover .ebtb20-specialty-icon {
  background: linear-gradient(135deg, rgba(var(--ebtb20-primary-rgb), 0.2), rgba(var(--ebtb20-primary-rgb), 0.08));
  transform: scale(1.1);
}

.ebtb20-specialty-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--ebtb20-primary);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--ebtb20-transition);
}

.ebtb20-specialty-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.ebtb20-specialty-item:hover .ebtb20-specialty-icon svg {
  stroke: var(--ebtb20-primary);
}

/* Specialty title */
.ebtb20-specialty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ebtb20-dark);
  transition: color var(--ebtb20-transition);
  line-height: 1.5;
}

.ebtb20-specialty-item:hover .ebtb20-specialty-title {
  color: var(--ebtb20-primary);
}

/* Stagger — 14 items */
.ebtb20-specialty-item:nth-child(1)  { transition-delay: 0ms; }
.ebtb20-specialty-item:nth-child(2)  { transition-delay: 50ms; }
.ebtb20-specialty-item:nth-child(3)  { transition-delay: 100ms; }
.ebtb20-specialty-item:nth-child(4)  { transition-delay: 150ms; }
.ebtb20-specialty-item:nth-child(5)  { transition-delay: 200ms; }
.ebtb20-specialty-item:nth-child(6)  { transition-delay: 250ms; }
.ebtb20-specialty-item:nth-child(7)  { transition-delay: 300ms; }
.ebtb20-specialty-item:nth-child(8)  { transition-delay: 350ms; }
.ebtb20-specialty-item:nth-child(9)  { transition-delay: 400ms; }
.ebtb20-specialty-item:nth-child(10) { transition-delay: 450ms; }
.ebtb20-specialty-item:nth-child(11) { transition-delay: 500ms; }
.ebtb20-specialty-item:nth-child(12) { transition-delay: 550ms; }
.ebtb20-specialty-item:nth-child(13) { transition-delay: 600ms; }
.ebtb20-specialty-item:nth-child(14) { transition-delay: 650ms; }

/* ==========================================================================
   RESPONSIVE — TABLET (≤ 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .ebtb20-section {
    padding: 80px 0;
  }

  .ebtb20-services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .ebtb20-specialties-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .ebtb20-service-card {
    padding: 32px 24px 28px;
  }

  .ebtb20-specialty-item {
    padding: 28px 16px 24px;
  }
}

/* ==========================================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ========================================================================== */

@media (max-width: 640px) {
  :root {
    --ebtb20-section-padding: 60px 0;
    --ebtb20-container-padding: 0 16px;
  }

  .ebtb20-section-title {
    margin-bottom: 40px;
  }

  .ebtb20-section-title h2 {
    font-size: 1.6rem;
  }

  .ebtb20-services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ebtb20-service-card {
    padding: 28px 20px 24px;
  }

  .ebtb20-specialties-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .ebtb20-specialty-item {
    padding: 24px 12px 20px;
  }

  .ebtb20-specialty-title {
    font-size: 0.85rem;
  }

  .ebtb20-specialties {
    padding-top: 30px;
  }
}

/* ==========================================================================
   ACCESSIBILITY — Focus Visible
   ========================================================================== */

.ebtb20-service-card:focus-visible,
.ebtb20-specialty-item:focus-visible {
  outline: 2px solid var(--ebtb20-primary);
  outline-offset: 3px;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .ebtb20-service-card,
  .ebtb20-specialty-item {
    opacity: 1;
    transform: none;
  }
}
