/* =====================================================
   Al Hamriyah Engineering Consultancy – Custom Styles
   ===================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Root Variables ---------- */
:root {
  --brand-red:  #CC1F1F;
  --brand-blue: #1A3A8F;
  --brand-gray: #6B7280;
  --brand-light: #F5F7FA;
  --transition: 200ms ease;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* Arabic mode: switch to Cairo */
[lang="ar"] body,
body.lang-ar {
  font-family: 'Cairo', sans-serif;
}

/* ---------- Direction helpers ---------- */
.ltr-text { direction: ltr; unicode-bidi: isolate; }

[dir="rtl"] .ltr\:right-6  { right: auto; }
[dir="rtl"] .rtl\:-left-6  { left: -1.5rem; }
[dir="ltr"] .ltr\:-right-6 { right: -1.5rem; }
[dir="rtl"] .ltr\:right-6  { right: auto; left: 1.5rem; }

/* RTL arrow flip */
[dir="rtl"] .btn-arrow {
  transform: scaleX(-1);
}

/* ---------- Hero overlay ---------- */
.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(26, 58, 143, 0.80) 0%,
    rgba(10, 10, 20, 0.65) 60%,
    rgba(204, 31, 31, 0.25) 100%
  );
}

/* ---------- Navbar ---------- */
#navbar {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  color: #374151;
  text-decoration: none;
  padding: 0.25rem 0;
  position: relative;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-red);
  transition: width var(--transition);
}

[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

.nav-link:hover { color: var(--brand-red); }
.nav-link:hover::after { width: 100%; }

.mobile-nav-link {
  display: block;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.mobile-nav-link:hover {
  background: #FEF2F2;
  color: var(--brand-red);
}

/* ---------- Section tags ---------- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FEF2F2;
  color: var(--brand-red);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
}

.section-tag-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

/* ---------- Service Cards ---------- */
.service-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.09);
  border-color: var(--brand-red);
}

.service-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

/* ---------- Project Cards ---------- */
.project-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.project-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-img-wide {
  height: 260px;
}

.project-card:hover .project-img {
  transform: scale(1.04);
}

.project-info {
  padding: 1.25rem;
}

.project-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-red);
  background: #FEF2F2;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

/* ---------- Video Cards ---------- */
.video-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Contact ---------- */
.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-info-card:hover {
  border-color: var(--brand-red);
  box-shadow: 0 4px 16px rgba(204,31,31,0.08);
}

.contact-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* ---------- Form ---------- */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  color: #111827;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(204, 31, 31, 0.1);
}

/* ---------- Footer ---------- */
.footer-link {
  color: #9CA3AF;
  text-decoration: none;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-link:hover {
  color: #fff;
}

.footer-link::before {
  content: '→';
  font-size: 0.8em;
  color: var(--brand-red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

[dir="rtl"] .footer-link::before {
  content: '←';
  transform: translateX(4px);
}

.footer-link:hover::before {
  opacity: 1;
  transform: translateX(0);
}


/* ---------- Stat items ---------- */
.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

[dir="rtl"] .stat-item:not(:last-child)::after {
  right: auto;
  left: 0;
}

@media (max-width: 767px) {
  .stat-item::after { display: none; }
}

/* ---------- Scroll animations ---------- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Back to top ---------- */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- RTL-specific overrides ---------- */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .text-center {
  text-align: center;
}

[dir="rtl"] #back-to-top {
  right: auto;
  left: 1.5rem;
}

/* Map container */
.map-container iframe {
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .section-title {
    font-size: 1.6rem;
  }
  .project-img { height: 200px; }
  .project-img-wide { height: 200px; }
}

.text-brand {
  text-shadow: 1px 0 gray, -1px 0 gray, 0 1px gray, 0 -1px gray, 1px 1px gray, -1px -1px gray, 1px -1px gray, -1px 1px gray;
}