/* ==========================================================================
   Afaq Al Waleed International for Commercial Agencies
   Shared stylesheet for the English (LTR) and Arabic (RTL) pages.
   Uses CSS logical properties so most layout mirrors automatically for RTL.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --gold: #C9972E;
  --gold-light: #E3C270;
  --charcoal: #221F1D;
  --paper: #FAF7F2;
  --ink: #33302C;

  --paper-2: #F3EEE5;          /* subtle alternating band */
  --line: rgba(34, 31, 29, 0.12);
  --gold-ring: rgba(201, 151, 46, 0.16);

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  --wedge: clamp(42px, 7vw, 90px);

  --shadow: 0 12px 32px -18px rgba(34, 31, 29, 0.35);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font: "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--charcoal); }
h1 { font-weight: 800; }
h2 { font-weight: 800; }
h3 { font-weight: 600; }
p { margin: 0 0 1rem; }

a { color: inherit; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Screen-reader-only helper */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -100px;
  background: var(--gold); color: var(--charcoal);
  padding: 0.6rem 1rem; border-radius: 8px; font-weight: 700;
  z-index: 200; transition: inset-block-start 0.2s var(--ease);
}
.skip-link:focus { inset-block-start: 1rem; }

/* ---- Layout helpers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  scroll-margin-top: 84px;
  position: relative;
}
.section--alt { background: var(--paper-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 34px; height: 2px;
  background: var(--gold);
  display: inline-block;
}

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
.section-head p { margin-top: 0.75rem; color: var(--ink); opacity: 0.85; }

/* Gold ring motif behind the section number */
.section-number {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 68px; height: 68px;
  margin-bottom: 1.25rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--gold);
}
.section-number::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--gold-ring);
  border-radius: 50%;
}
.section-number::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px solid var(--gold-ring);
  border-radius: 50%;
  opacity: 0.6;
}

.section-lead { max-width: 46rem; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
    color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: var(--gold); color: var(--charcoal); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); }
.btn-outline { border-color: currentColor; color: var(--charcoal); background: transparent; }
.btn-outline:hover { background: var(--charcoal); color: var(--paper); border-color: var(--charcoal); transform: translateY(-2px); }
.btn-ghost-light { border-color: rgba(250, 247, 242, 0.4); color: var(--paper); background: transparent; }
.btn-ghost-light:hover { background: var(--paper); color: var(--charcoal); transform: translateY(-2px); }
.btn-whatsapp { background: #25D366; color: #04310f; }
.btn-whatsapp:hover { background: #34e07a; transform: translateY(-2px); }

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(34, 31, 29, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201, 151, 46, 0.25);
  color: var(--paper);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding-block: 0.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--paper);
  font-weight: 800;
  font-size: 1.05rem;
  margin-inline-end: auto;
}
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand span { max-width: 15ch; line-height: 1.15; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: rgba(250, 247, 242, 0.85);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.18s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s var(--ease);
}
.nav-links a:hover { color: var(--paper); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--paper);
  border: 1.5px solid rgba(201, 151, 46, 0.55);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.lang-toggle:hover { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }

.nav-cta { padding: 0.55rem 1.1rem; font-size: 0.92rem; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid rgba(250, 247, 242, 0.4);
  border-radius: 10px;
  width: 44px; height: 44px;
  cursor: pointer;
  padding: 0;
  color: var(--paper);
}
.nav-toggle svg { width: 22px; height: 22px; margin-inline: auto; }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 480px at 80% -10%, rgba(201, 151, 46, 0.10), transparent 60%),
    var(--paper);
  padding-block: clamp(3rem, 8vw, 6.5rem) 0;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.hero-copy { max-width: 40rem; }
.hero .company-en {
  font-size: clamp(1.9rem, 5vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero .company-ar {
  font-size: clamp(1.35rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: var(--gold);
  margin-top: 0.3rem;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--ink);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero-figure {
  position: relative;
  display: grid;
  place-items: center;
}
.hero-figure .ring {
  position: absolute;
  width: min(105%, 420px);
  aspect-ratio: 1;
  border: 2px solid var(--gold-ring);
  border-radius: 50%;
}
.hero-figure .ring.ring-2 { width: min(88%, 350px); opacity: 0.7; }
.hero-figure img {
  position: relative;
  width: min(78%, 320px);
  filter: drop-shadow(0 20px 30px rgba(34, 31, 29, 0.18));
}

/* Diagonal charcoal wedge with thin gold edge at the base of the hero */
.wedge {
  position: relative;
  background: var(--gold);              /* the thin gold edge shows through */
  height: var(--wedge);
  margin-top: calc(var(--wedge) * -1);
  pointer-events: none;
}
.wedge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--charcoal);
  clip-path: polygon(0 100%, 100% calc(100% - var(--wedge) + 3px), 100% 100%, 0 100%);
}
.wedge::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 100% calc(100% - var(--wedge)), 100% calc(100% - var(--wedge) + 3px), 0 100%);
  background: var(--gold);
}
[dir="rtl"] .wedge::before {
  clip-path: polygon(0 calc(100% - var(--wedge) + 3px), 100% 100%, 100% 100%, 0 100%);
}
[dir="rtl"] .wedge::after {
  clip-path: polygon(0 calc(100% - var(--wedge)), 100% 100%, 100% 100%, 0 calc(100% - var(--wedge) + 3px));
}

/* ---- About --------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-lead { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 600; color: var(--charcoal); }
.about-facts {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1rem;
}
.about-facts li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.about-facts .mark {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.about-facts .mark svg { width: 16px; height: 16px; }

/* ---- Services ------------------------------------------------------------ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.service-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.section--alt .service-card { background: #fff; }
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(201, 151, 46, 0.4);
}
.service-icon {
  position: relative;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
  color: var(--gold);
}
.service-icon::before {
  content: "";
  position: absolute; inset: 0;
  border: 2px solid var(--gold-ring);
  border-radius: 50%;
}
.service-icon svg { width: 26px; height: 26px; }
.service-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.service-card p { margin: 0; font-size: 0.98rem; opacity: 0.85; }

/* ---- Contact ------------------------------------------------------------- */
.contact {
  position: relative;
  background: var(--charcoal);
  color: var(--paper);
}
.contact .eyebrow { color: var(--gold-light); }
.contact .section-head h2 { color: var(--paper); }
.contact .section-number { color: var(--gold-light); }
.contact .section-number::before,
.contact .section-number::after { border-color: rgba(227, 194, 112, 0.28); }

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1.1rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--paper);
  padding: 0.85rem 1rem;
  border: 1px solid rgba(250, 247, 242, 0.14);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.contact-item:hover { border-color: var(--gold); background: rgba(201, 151, 46, 0.08); }
.contact-item .ci-icon {
  flex: none; width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(201, 151, 46, 0.16);
  color: var(--gold-light);
}
.contact-item .ci-icon svg { width: 20px; height: 20px; }
.contact-item .ci-label { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin-bottom: 0.1rem; }
.contact-item .ci-value { display: block; font-weight: 700; font-size: 1.05rem; }
.contact-item[dir="ltr"] .ci-value { direction: ltr; unicode-bidi: embed; }

.contact-person {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(250, 247, 242, 0.14);
  opacity: 0.9;
}
.contact-person strong { color: var(--gold-light); }

/* Form */
.contact-form {
  background: rgba(250, 247, 242, 0.04);
  border: 1px solid rgba(250, 247, 242, 0.12);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--paper);
}
.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: rgba(250, 247, 242, 0.06);
  border: 1.5px solid rgba(250, 247, 242, 0.2);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(250, 247, 242, 0.4); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(250, 247, 242, 0.1);
}
.field textarea { resize: vertical; min-height: 130px; }
.contact-form .btn { width: 100%; margin-top: 0.25rem; }

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  display: none;
}
.form-status.is-success { display: block; background: rgba(37, 211, 102, 0.14); color: #7ff0a8; border: 1px solid rgba(37, 211, 102, 0.4); }
.form-status.is-error { display: block; background: rgba(224, 84, 84, 0.14); color: #ff9d9d; border: 1px solid rgba(224, 84, 84, 0.4); }

/* Honeypot */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  background: #1a1715;
  color: rgba(250, 247, 242, 0.7);
  padding-block: 2.5rem;
  border-top: 1px solid rgba(201, 151, 46, 0.2);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 0.75rem; color: var(--paper); font-weight: 700; }
.footer-brand img { width: 38px; height: 38px; object-fit: contain; }
.footer-brand .en { font-size: 0.95rem; }
.footer-brand .ar { font-size: 0.9rem; color: var(--gold-light); }
.site-footer a { color: var(--gold-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-meta { font-size: 0.85rem; text-align: end; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { max-width: none; margin-inline: auto; }
  .hero .tagline { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-figure { order: -1; }
  .hero-figure img { width: min(60%, 240px); }
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links,
  .nav .lang-toggle,
  .nav .nav-cta { display: none; }
  .nav-toggle { display: grid; place-items: center; }

  .nav-links.is-open {
    display: flex;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--charcoal);
    border-bottom: 1px solid rgba(201, 151, 46, 0.25);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .nav-links.is-open li { border-bottom: 1px solid rgba(250, 247, 242, 0.08); }
  .nav-links.is-open a { display: block; padding: 0.9rem 0; font-size: 1.05rem; }
  .nav-links.is-open a::after { display: none; }

  .mobile-extra { display: flex; gap: 0.6rem; margin-top: 1rem; }
  .mobile-extra .lang-toggle,
  .mobile-extra .nav-cta { display: inline-flex; }
}

@media (min-width: 721px) {
  .mobile-extra { display: none; }
}

/* ---- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
