:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f5f2;
  --color-surface: #ffffff;
  --color-text: #1c1c1c;
  --color-text-muted: #5f5f5f;
  --color-border: #e6e2db;
  --color-primary: #b8934a;
  --color-primary-dark: #96742f;
  --color-primary-contrast: #ffffff;
  --color-danger: #b23b3b;
  --shadow-card: 0 2px 10px rgba(0,0,0,0.06);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-arabic: "Segoe UI", Tahoma, "Noto Naskh Arabic", sans-serif;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #14120f;
    --color-bg-alt: #1b1815;
    --color-surface: #201d19;
    --color-text: #f1ede6;
    --color-text-muted: #b7afa2;
    --color-border: #33302a;
    --shadow-card: 0 2px 14px rgba(0,0,0,0.4);
  }
}

:root[data-theme="dark"] {
  --color-bg: #14120f;
  --color-bg-alt: #1b1815;
  --color-surface: #201d19;
  --color-text: #f1ede6;
  --color-text-muted: #b7afa2;
  --color-border: #33302a;
  --shadow-card: 0 2px 14px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: var(--font-arabic); }

img { max-width: 100%; display: block; }
a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: 760px; }
.section { padding: 3.5rem 0; }
.center-cta { text-align: center; margin-top: 2rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { border-color: var(--color-primary); color: var(--color-primary-dark); background: transparent; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }

/* Header */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 40; }
.topbar { background: var(--color-bg-alt); font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; gap: 1rem; }
.topbar-contacts a { margin-inline-end: 1rem; color: var(--color-text-muted); }
.topbar-social { display: flex; align-items: center; }
.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; margin-inline-start: .5rem; border-radius: 50%;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.social-icon:hover { color: var(--color-primary); border-color: var(--color-primary); text-decoration: none; background: var(--color-bg-alt); }
.navbar { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 0; }
.brand img { height: 48px; width: auto; }
.nav-links { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; flex: 1; }
.nav-links a { color: var(--color-text); font-weight: 500; }
.nav-links a.active { color: var(--color-primary-dark); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-switch { font-weight: 600; border: 1px solid var(--color-border); border-radius: 999px; padding: .3rem .9rem; }
.theme-toggle { background: none; border: 1px solid var(--color-border); border-radius: 999px; width: 2.2rem; height: 2.2rem; cursor: pointer; color: var(--color-text); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; background: none; border: 0; cursor: pointer; width: 2.75rem; height: 2.75rem; }
.nav-toggle span { width: 22px; height: 2px; background: var(--color-text); }

/* Hero */
.hero { padding: 4.5rem 0; background: var(--color-bg-alt); text-align: center; }
.hero h1 { font-size: 2.1rem; max-width: 760px; margin: 0 auto .8rem; }
.hero-copy { max-width: 680px; margin: 0 auto 1.5rem; color: var(--color-text-muted); }

/* Hero slider */
.hero-slider { position: relative; height: 78vh; min-height: 480px; max-height: 760px; overflow: hidden; color: #fff; }
.hero-slider-track { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.1s ease; will-change: opacity;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,.6) 100%);
  padding-bottom: 3.5rem;
}
.hero-slider .hero-inner {
  max-width: 780px; background: rgba(15,13,11,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 16px; padding: 2rem 2.5rem; border: 1px solid rgba(255,255,255,.08);
}
.hero-slider h1 { font-size: 2.2rem; color: #fff; margin-bottom: .8rem; }
.hero-slider .hero-copy { color: rgba(255,255,255,.92); }
@media (max-width: 780px) { .hero-slider .hero-inner { padding: 1.5rem 1.25rem; margin: 0 .75rem; } }
.hero-slider-dots { position: absolute; bottom: 1.6rem; left: 0; right: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: 0 1rem; }
.hero-slider-dots .dot {
  position: relative; width: 28px; height: 28px; padding: 0; border: 0; background: none;
  cursor: pointer; flex-shrink: 0;
}
.hero-slider-dots .dot::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.25);
}
.hero-slider-dots .dot.active::before { background: #fff; }
@media (max-width: 780px) { .hero-slider { height: 64vh; min-height: 420px; } .hero-slider h1 { font-size: 1.7rem; } }

/* Stats */
.stats-bar { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.stats-grid { display: flex; justify-content: center; gap: 3rem; padding: 2.2rem 1.25rem; flex-wrap: wrap; text-align: center; }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--color-primary-dark); }
.stat-label { color: var(--color-text-muted); font-size: .9rem; }

/* CTA banner */
.cta-banner { background: var(--color-primary); color: #fff; padding: 3.5rem 0; text-align: center; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255,255,255,.9); max-width: 560px; margin: 0 auto 1.5rem; }
.cta-banner .btn-primary { background: #fff; color: var(--color-primary-dark); }
.cta-banner .btn-primary:hover { background: rgba(255,255,255,.85); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; margin-top: 1.5rem; }
.service-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-card); }
.service-card h3 { color: var(--color-primary-dark); }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 260px)); justify-content: center; gap: 1.4rem; margin-top: 1.5rem; }
.video-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow-card); }
.video-frame { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 6px; background: #000; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-frame video[data-rotation="180"] { transform: rotate(180deg); }
.video-caption { margin: .6rem 0 0; color: var(--color-text-muted); font-size: .9rem; }

/* Gallery */
.gallery-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0 2rem; }
.chip { border: 1px solid var(--color-border); border-radius: 999px; padding: .4rem 1rem; color: var(--color-text); }
.chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.gallery-thumb { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-thumb:hover img { transform: scale(1.05); }
.empty-state { color: var(--color-text-muted); padding: 2rem 0; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; z-index: 100; flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 90vw; max-height: 78vh; object-fit: contain; }
.lightbox-caption { color: #f1ede6; margin-top: 1rem; max-width: 80vw; text-align: center; }
.lightbox-close {
  position: absolute; top: .6rem; inset-inline-end: .8rem; background: none; border: 0; color: #fff;
  font-size: 2rem; line-height: 1; cursor: pointer; width: 2.75rem; height: 2.75rem;
}
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.lightbox-prev { inset-inline-start: 1.5rem; }
.lightbox-next { inset-inline-end: 1.5rem; }

/* Simple pages */
.page-simple h1 { font-size: 1.8rem; }
.prose { color: var(--color-text); }
.contact-list, .social-list { list-style: none; padding: 0; }
.contact-list li, .social-list li { padding: .3rem 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding: 2rem 0; text-align: center; color: var(--color-text-muted); font-size: .9rem; margin-top: 2rem; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; inset-inline: 0; top: 100%; background: var(--color-surface);
    flex-direction: column; padding: .5rem 1.25rem; display: none; border-bottom: 1px solid var(--color-border);
    gap: 0; max-height: 70vh; overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .8rem 0; }
  .topbar-inner { font-size: .75rem; }
  .stats-grid { gap: 1.5rem 2rem; padding: 1.8rem 1.25rem; }
}

@media (max-width: 400px) {
  .hero-slider h1 { font-size: 1.45rem; }
  .stat-num { font-size: 1.5rem; }
}
