﻿/* ============================================================
   AK-Dental Clinic — Custom Layer فوق Tailwind (النسخة النهائية)
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  --color-primary:      #0B1F3A;
  --color-primary-700:  #071528;
  --color-primary-300:  #1E3A5F;
  --color-accent:       #C9A961;
  --color-accent-soft:  #E6D3A3;
  --color-accent-700:   #A8894A;
  --color-bg:           #FFFFFF;
  --color-surface:      #F7F5F0;
  --color-text:         #0B1F3A;
  --color-muted:        #5A6B7D;
  --color-border:       #E5E1D8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 8px 24px rgba(11,31,58,.10);
  --shadow-gold: 0 6px 20px rgba(201,169,97,.25);
  --font-ar: "Tajawal", system-ui, sans-serif;
  --font-en: "Poppins", system-ui, sans-serif;
  --font-en-display: "Playfair Display", serif;
}

/* ---------- 2. Dark Mode ---------- */
html.dark {
  --color-bg:          #071528;
  --color-surface:     #0B1F3A;
  --color-text:        #F7F5F0;
  --color-muted:       #A9B6C6;
  --color-border:      #1E3A5F;
  --shadow-soft:       0 8px 24px rgba(0,0,0,.45);
}

/* ---------- 3. Base ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ar);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="en"] body { font-family: var(--font-en); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { font-family: var(--font-en-display); }
img { max-width: 100%; height: auto; display: block; }

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

/* Skip link */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--color-primary);
  color: #fff;
  padding: .625rem 1rem;
  border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- 4. RTL Icon Flip ---------- */
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ---------- 5. Containers ---------- */
.container-x {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px)  { .container-x { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container-x { padding-inline: 2rem; } }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--color-accent); color: var(--color-primary-700); box-shadow: var(--shadow-gold); }
.btn-gold:hover { background: var(--color-accent-700); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-border); }
html.dark .btn-outline { color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent-700); }
.btn-dark { background: var(--color-primary); color: #fff; }
.btn-dark:hover { background: var(--color-primary-700); }

/* ---------- 7. Cards ---------- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--color-accent); }
html.dark .card { background: var(--color-surface); }

/* ---------- 8. Section Eyebrow ---------- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-accent-700);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

/* ---------- 9. Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

.stagger > * { transition-delay: 0ms; }
.stagger > *.in:nth-child(1) { transition-delay: 0ms; }
.stagger > *.in:nth-child(2) { transition-delay: 80ms; }
.stagger > *.in:nth-child(3) { transition-delay: 160ms; }
.stagger > *.in:nth-child(4) { transition-delay: 240ms; }
.stagger > *.in:nth-child(5) { transition-delay: 320ms; }
.stagger > *.in:nth-child(6) { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 10. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-soft); }

.nav-link {
  position: relative;
  color: var(--color-text);
  font-weight: 500;
  font-size: .95rem;
  padding: .5rem .25rem;
  text-decoration: none;
  transition: color .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width .25s ease;
}
.nav-link:hover { color: var(--color-accent-700); }
.nav-link:hover::after { width: 100%; }

/* ---------- 11. Icon Buttons ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  transition: border-color .2s, color .2s, background-color .2s;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--color-accent); color: var(--color-accent-700); }

/* ---------- 12. Mobile Menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--color-bg);
  transform: translateY(-100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateY(0); }
body.menu-open { overflow: hidden; }

/* ---------- 13. Hero Overlay ---------- */
.hero-overlay {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-primary) 92%, transparent) 0%,
    color-mix(in srgb, var(--color-primary) 75%, transparent) 55%,
    color-mix(in srgb, var(--color-primary) 40%, transparent) 100%);
}

/* ---------- 14. Trust Bar ---------- */
.trust-item { text-align: center; }
.trust-number {
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-primary);
  line-height: 1;
}
html.dark .trust-number { color: var(--color-accent); }

/* ---------- 15. Accordion ---------- */
.acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
}
.acc-panel[data-open="true"] { max-height: 500px; }
.acc-icon { transition: transform .3s ease; flex-shrink: 0; color: var(--color-accent-700); }
.acc-btn[aria-expanded="true"] .acc-icon { transform: rotate(180deg); }

/* ---------- 16. Before/After ---------- */
.ba-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  user-select: none;
  background: var(--color-surface);
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-after { clip-path: inset(0 0 0 50%); }
.ba-handle {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 50%;
  width: 3px;
  background: var(--color-accent);
  pointer-events: none;
}
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B1F3A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 18l4-4-4-4'/%3E%3Cpath d='M16 6l-4 4 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.ba-label {
  position: absolute;
  top: .75rem;
  padding: .25rem .625rem;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 80%, transparent);
  color: #fff;
}

/* ---------- 17. Testimonials ---------- */
.tst-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-block: .5rem;
  scrollbar-width: none;
}
.tst-track::-webkit-scrollbar { display: none; }
.tst-item { flex: 0 0 88%; scroll-snap-align: center; }
@media (min-width: 768px)  { .tst-item { flex-basis: 48%; } }
@media (min-width: 1024px) { .tst-item { flex-basis: 32%; } }

/* ---------- 18. Form ---------- */
.field {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 25%, transparent);
}
.field[aria-invalid="true"] { border-color: #B3261E; }
.field-error { color: #B3261E; font-size: .8rem; margin-top: .25rem; min-height: 1rem; }
html.dark .field-error { color: #FF8A80; }

/* ---------- 19. Floating Buttons ---------- */
.float-wa {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(37,211,102,.35);
  transition: transform .2s ease;
}
.float-wa:hover { transform: scale(1.06); }
.float-call {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 767px) { .float-call { display: grid; } }

/* ---------- 20. Anchors offset ---------- */
section[id] { scroll-margin-top: 88px; }

/* ---------- 21. Gold Divider ---------- */
.gold-divider {
  width: 64px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 999px;
}

/* ---------- 22. Stars ---------- */
.stars { display: inline-flex; gap: 2px; color: var(--color-accent); }

/* ---------- 23. Lucide Placeholder (pre-init) ---------- */
i[data-lucide] { display: inline-block; width: 1em; height: 1em; }

/* ---------- 24. Ratio ---------- */
.ratio-16-9 { aspect-ratio: 16 / 9; }

/* ---------- 25. Correction: about badge ---------- */
.inset-inline-start-6 { inset-inline-start: 1.5rem; }

/* ---------- 26. 404 page logo size ---------- */
.w-18 { width: 4.5rem; }
.h-18 { height: 4.5rem; }