/* مؤسسة علم الوادي للمقاولات — هوية صناعية فاخرة */
:root {
  --bg: #121417;
  --bg-elevated: #1c2126;
  --bg-soft: #242a31;
  --bg-light: #efe8d8;
  --bg-paper: #f7f1e6;
  --border: #2e353c;
  --border-light: #d9d0c0;
  --accent: #c4a35a;
  --accent-deep: #b08d3e;
  --accent-on-light: #6b5420;
  --text: #f3eee4;
  --text-muted: #c4bdb0;
  --text-dim: #9a9286;
  --text-dark: #1a150c;
  --text-dark-muted: #5a5348;
  --on-accent: #1a150c;
  --whatsapp: #1fa855;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius: 10px;
  --header-h: 74px;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, .btn { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  right: 1rem;
  top: -4rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  z-index: 200;
  border-radius: 4px;
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.section { padding: 4.25rem 0; }
.section-alt { background: var(--bg-elevated); }
.section-light {
  background: var(--bg-light);
  color: var(--text-dark);
}
.section-paper {
  background: var(--bg-paper);
  color: var(--text-dark);
}

.section-kicker {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 0.45rem;
}
.section-light .section-kicker,
.section-paper .section-kicker { color: var(--accent-on-light); }

.section h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.35;
  font-weight: 700;
  max-width: 22ch;
}
.section h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.65rem;
}

.lede {
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 0 1.8rem;
}
.section-light .lede,
.section-paper .lede { color: var(--text-dark-muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  padding-block: 0.4rem;
  display: flex;
  align-items: center;
  background-color: #121417;
  border-bottom: 1px solid var(--border);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #121417;
  z-index: -1;
  pointer-events: none;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(1120px, calc(100% - 1.25rem));
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}
.brand img { width: 40px; height: 40px; flex-shrink: 0; }
.brand img[src*="logo.svg"] {
  background: transparent;
}
.brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand b {
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.brand small {
  color: var(--text-dim);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.nav-toggle {
  margin-inline-start: auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: rgba(196, 163, 90, 0.45);
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid transparent;
  color: var(--on-accent);
  text-decoration: none;
  flex-shrink: 0;
  font-weight: 700;
  cursor: pointer;
}
.header-phone-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.header-phone:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.site-nav { display: none; }
.site-nav.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  flex-direction: column;
  background: #0f1114;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem 1.1rem;
  gap: 0.15rem;
  max-height: calc(100svh - var(--header-h));
  overflow: auto;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
}
.site-nav a.is-active,
.site-nav a:hover { color: var(--accent); }

.nav-label {
  margin: 0.65rem 0 0.15rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}
.nav-sub { display: grid; gap: 0.05rem; padding: 0 0.35rem 0.4rem; }
.nav-sub a { font-size: 0.9rem; min-height: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.15rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  text-align: center;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-icon { gap: 0.45rem; }
.btn-icon svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(196, 163, 90, 0.72);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(196, 163, 90, 0.1);
}
.btn-wa {
  background: transparent;
  color: var(--text);
  border: 1px solid #1f6b3a;
}
.btn-wa:hover,
.btn-wa:focus-visible {
  border-color: var(--whatsapp);
  color: var(--whatsapp);
}
.btn-full { width: 100%; }

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}
.hero img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: grayscale(0.12) saturate(0.82);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(270deg, rgba(12, 14, 16, 0.92) 8%, rgba(12, 14, 16, 0.62) 55%, rgba(12, 14, 16, 0.28) 100%),
    linear-gradient(0deg, #121417 0%, transparent 48%);
}
.hero .content { position: relative; z-index: 1; padding: 3.2rem 0 2.6rem; }
.hero h1 {
  margin: 0.15rem 0 0.9rem;
  font-size: clamp(1.28rem, 5.2vw, 2.55rem);
  line-height: 1.32;
  font-weight: 700;
  max-width: 22ch;
  overflow-wrap: anywhere;
}
.hero p {
  max-width: 38rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.intent-grid,
.cards,
.why-grid,
.areas-grid,
.contact-grid { display: grid; gap: 1rem; align-items: start; }
.areas-grid { align-items: stretch; }
.contact-numbers,
.contact-side { display: grid; gap: 1rem; }
.contact-side p { margin: 0; }

.intent-card,
.card,
.why-item,
.area-card,
.phone-card,
.registry-card,
.cta-panel,
.about-box,
.error-links a {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.intent-card { padding: 1.35rem 1.3rem; }
.intent-card h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.intent-card p { margin: 0 0 1rem; color: var(--text-muted); }
.intent-card p a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.intent-card .btn { text-decoration: none; }
.intent-card .btn-primary { color: var(--on-accent); }
.intent-card .btn-ghost { color: var(--text); }

.section-light .card,
.section-paper .about-box,
.section-paper .area-card {
  background: #fff;
  border-color: var(--border-light);
  color: var(--text-dark);
  box-shadow: 0 8px 24px rgba(26, 21, 12, 0.06);
}

.card { overflow: hidden; display: flex; flex-direction: column; }
.card-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}
.card .media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1d21;
}
.card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.04);
}
.card .body {
  padding: 1.05rem 1.1rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  border-top: 3px solid transparent;
}
.card:hover .body { border-top-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.12rem; line-height: 1.4; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.section-light .card p { color: var(--text-dark-muted); }

.card-cta { padding: 0 1.1rem 1.15rem; }

.service-group { margin-top: 2.15rem; }
.service-group:first-of-type { margin-top: 1.25rem; }
.service-group-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.05rem;
}
.service-group-head::before {
  content: "";
  width: 3px;
  height: 1.15rem;
  background: var(--accent);
  flex-shrink: 0;
}
.service-group-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-on-light);
  white-space: nowrap;
}
.service-group-head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-light);
  min-width: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 6px;
  text-decoration: none;
}
.pill:hover { background: var(--accent-deep); }
.pill-sell { background: var(--text-dark); color: var(--bg-paper); }
.pill-sell:hover { background: #2a2418; color: var(--bg-paper); }
.section-light .pill-sell { background: var(--text-dark); }

.why-item,
.area-card,
.phone-card,
.registry-card,
.cta-panel,
.about-box { padding: 1.25rem; }
.area-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.area-card .body { flex: 1; }
.area-card .media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1d21;
}
.area-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.area-card .body { padding: 1.25rem; }
.why-item h3,
.area-card h3,
.phone-card h3,
.registry-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.registry-card address {
  font-style: normal;
  margin: 0 0 0.65rem;
  line-height: 1.7;
}
.registry-note {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.registry-card .num-row { margin-bottom: 0; }
.why-item p,
.area-card p { margin: 0; color: var(--text-muted); }
.section-paper .area-card p { color: var(--text-dark-muted); }

.num-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.2rem 0 0.8rem;
}
.phone-card .num,
.registry-card .num {
  font-size: 1.32rem;
  font-weight: 700;
  direction: ltr;
  unicode-bidi: isolate;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.btn-copy {
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.85rem;
  font-size: 0.86rem;
  flex-shrink: 0;
}
.btn-copy.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}
.copy-status {
  margin: 0.75rem 0 0;
  min-height: 1.4em;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.phone-actions { display: flex; gap: 0.5rem; }
.phone-actions .btn { flex: 1; }

.cta-panel {
  background: linear-gradient(160deg, rgba(196, 163, 90, 0.16), transparent 52%), var(--bg-elevated);
  border-color: rgba(196, 163, 90, 0.38);
}
.cta-panel p { color: var(--text-muted); }
.cta-panel h2, .cta-panel h3 { margin-top: 0; }

.about-box a,
.why-item a,
.area-card a,
.lede a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}
.about-box a:hover,
.area-card a:hover { color: var(--accent-deep); }
.section-light .lede a,
.section-paper .lede a,
.section-paper .about-box a,
.section-paper .area-card a { color: var(--text-dark); }
.section-light .lede a:hover,
.section-paper .lede a:hover,
.section-paper .about-box a:hover,
.section-paper .area-card a:hover { color: var(--accent-deep); }
.why-item a { color: var(--accent); text-decoration-color: rgba(196, 163, 90, 0.55); }
.why-item a:hover { color: var(--text); }

.error-links { display: grid; gap: 1rem; }
.error-links a { text-decoration: none; display: block; padding: 1.1rem; }
.error-links a:hover { border-color: var(--accent); }
.error-links small {
  color: var(--accent);
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 0.75rem;
}

.site-footer {
  background: #0b0d0f;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 7.25rem;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.site-footer b { color: var(--text); }
.footer-grid { display: grid; gap: 1.35rem; }
.footer-grid > div > a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  min-height: 44px;
}
.footer-grid > div > a:hover { color: var(--accent); }

.fab-wa {
  position: fixed;
  z-index: 50;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1.75rem, calc(env(safe-area-inset-bottom, 0px) + 1.35rem));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(18, 20, 23, 0.28), var(--shadow);
  transition: transform 0.16s ease, filter 0.16s ease;
}
.fab-wa:hover { transform: scale(1.06); }
.fab-wa svg {
  width: 28px;
  height: 28px;
}

.error-page {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: center;
  padding: 4rem 0;
}
.error-page h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.35rem, 6vw, 2.2rem);
  line-height: 1.35;
  max-width: 16ch;
  overflow-wrap: anywhere;
}
.error-page .lede { max-width: 36rem; }

.error-home-cta {
  margin-inline-start: auto;
  min-height: 44px;
  padding-inline: 0.9rem;
  font-size: 0.88rem;
}

@media (max-width: 759px) {
  .hero {
    min-height: 0;
  }
  .hero img.bg { object-position: 48% 72%; }
  .hero .content { padding: 2.15rem 0 1.85rem; }
  .hero h1 { max-width: none; }
  #contact { padding-bottom: 5.75rem; }
}

@media (max-width: 419px) {
  .brand small { display: none; }
  .brand b { font-size: 0.72rem; line-height: 1.25; }
  .brand img { width: 34px; height: 34px; }
  .hero-actions .btn { width: 100%; }
  .hero h1 { font-size: 1.28rem; max-width: 100%; }
  .phone-actions { flex-direction: column; }
  .service-group-label { white-space: normal; }
  .num-row { flex-wrap: wrap; }
  .header-phone { min-height: 36px; padding: 0.25rem 0.7rem; }
  .header-phone-num { font-size: 0.72rem; }
}

@media (max-width: 359px) {
  .wrap { width: min(1120px, calc(100% - 1.25rem)); }
  .site-header .wrap { width: min(1120px, calc(100% - 0.9rem)); gap: 0.4rem; }
  .hero h1 { font-size: 1.18rem; }
  .brand span { display: none; }
  .nav-toggle { font-size: 0.78rem; padding-inline: 0.45rem; }
}

@media (min-width: 760px) {
  .cards,
  .why-grid,
  .areas-grid,
  .error-links,
  .intent-grid,
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1.15fr 0.85fr; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .nav-toggle { display: none; }
  .site-nav,
  .site-nav.is-open {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: none;
    border: 0;
    padding: 0;
    gap: 0.1rem;
    margin-inline-start: auto;
    max-height: none;
    overflow: visible;
  }
  .site-nav a { min-height: auto; padding: 0.35rem 0.45rem; font-size: 0.86rem; }
  .has-sub { position: relative; }
  .has-sub .nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    background: #0f1114;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.7rem 0.7rem;
    z-index: 30;
  }
  .has-sub:hover .nav-sub,
  .has-sub:focus-within .nav-sub { display: grid; }
  .header-phone { min-height: 42px; padding-inline: 0.95rem; }
  .header-phone-num { font-size: 0.88rem; }
  .brand b { font-size: 0.95rem; white-space: normal; }
}

@media (min-width: 1100px) {
  .service-group--contract .cards { grid-template-columns: repeat(3, 1fr); }
  .service-group--buy .cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 46rem;
  }
  .why-grid { grid-template-columns: repeat(4, 1fr); }
  .areas-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.35fr 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .fab-wa { transition: none; }
}
