/* ===== Landing Smile Makers — صفحة مستقلة ===== */
:root {
  --teal: #0f766e;
  --teal-dark: #0d5e56;
  --teal-light: #14b8a6;
  --teal-muted: #2d7d7d;
  --gold: #c9a227;
  --white: #ffffff;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --shadow: 0 12px 40px rgba(15, 118, 110, 0.12);
  --radius: 18px;
  --fab-offset: 1.25rem;
  --intro-duration: 1.15s;
  --logo-split-w: min(78vw, 300px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: clip;
}

body.intro-active {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.page-root {
  min-height: 100vh;
}

/* ===== انترو: شعار + نبض ثم انقسام نصفين ===== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(2.5rem, 6vw);
  box-sizing: border-box;
  pointer-events: auto;
  transition: background 0.35s ease;
  overflow: visible;
}

.intro-logo-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* الشعار كقطعتين متجاورتين (اتجاه ltr لصحة نصفي الصورة مع صفحة rtl) */
.intro-logo-split {
  display: flex;
  flex-direction: row;
  width: var(--logo-split-w);
  max-width: 100%;
  direction: ltr;
  animation: introLogoPulse 1.25s ease-in-out infinite;
  filter: drop-shadow(0 10px 28px rgba(15, 118, 110, 0.22));
}

.intro-logo-half {
  flex: 0 0 50%;
  width: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: transform var(--intro-duration) cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

/* النصف الأيمن: محاذاة الصورة لنهاية الحاوية لإظهار نصف الصورة الأيمن دون قصّ */
.intro-logo-half--east {
  justify-content: flex-end;
}

.intro-logo-half img {
  width: 200%;
  height: auto;
  max-width: none;
  display: block;
  flex-shrink: 0;
}

body.intro-opening .intro-logo-split {
  animation: none;
}

body.intro-opening .intro-overlay {
  background: transparent;
  pointer-events: none;
}

body.intro-opening .intro-logo-half--west {
  transform: translateX(-110vw);
}

body.intro-opening .intro-logo-half--east {
  transform: translateX(110vw);
}

body.intro-done .intro-overlay {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

@keyframes introLogoPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 10px 28px rgba(15, 118, 110, 0.22));
  }
  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 16px 40px rgba(15, 118, 110, 0.35));
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-logo-split {
    animation: none;
  }
  .intro-logo-half {
    transition-duration: 0.01ms;
  }
}

/* ===== أزرار عائمة ===== */
.fab {
  position: fixed;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.fab--whatsapp {
  bottom: var(--fab-offset);
  right: var(--fab-offset);
  width: 58px;
  height: 58px;
  background: #25d366;
  color: #fff;
  font-size: 1.75rem;
}

.fab--contact {
  bottom: var(--fab-offset);
  left: var(--fab-offset);
  padding: 0.65rem 1.15rem;
  background: #111827;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.fab--contact i {
  font-size: 1rem;
}

@media (max-width: 480px) {
  .fab--contact span {
    display: none;
  }
  .fab--contact {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 7rem) 0 clamp(5rem, 14vw, 8rem);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      105deg,
      rgba(248, 250, 252, 0.97) 0%,
      rgba(248, 250, 252, 0.88) 42%,
      rgba(248, 250, 252, 0.4) 52%,
      rgba(15, 118, 110, 0.12) 100%
    ),
    url("https://smilemakersksa.com/images/clinic-photo.jpg") center / cover
      no-repeat;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero__eyebrow {
  color: var(--teal);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.hero__title {
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero__brand {
  display: block;
  color: var(--teal);
  margin-top: 0.35rem;
}

.hero__lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 2rem;
  max-width: 36ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  background: var(--white);
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.35);
}

.btn--ghost:hover {
  border-color: var(--teal);
}

/* ===== Sections ===== */
.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.section:nth-of-type(even) {
  background: var(--white);
}

.section__title {
  text-align: center;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--teal);
  font-weight: 800;
  margin: 0 0 0.75rem;
}

.section__subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto 2.5rem;
  max-width: 42ch;
}

.section__cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ===== Grids ===== */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--features {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid--services {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--doctors {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ===== Cards ===== */
.card {
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}

.card--feature {
  background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: var(--white);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card--feature h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.card--feature p {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.95;
  line-height: 1.55;
}

.card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.card--service {
  position: relative;
  background: linear-gradient(165deg, var(--teal-muted), var(--teal-dark));
  color: var(--white);
  overflow: hidden;
  min-height: 200px;
}

.card--service .card__num {
  position: absolute;
  inset-inline-end: 0.5rem;
  inset-block-start: 0.25rem;
  font-size: clamp(4rem, 14vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.card--service h3 {
  position: relative;
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  font-weight: 800;
}

.card--service p {
  position: relative;
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
  line-height: 1.6;
}

.card--doctor {
  background: var(--white);
  border: 2px solid rgba(15, 118, 110, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

.card--doctor .doctor-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--teal-light);
  margin-bottom: 1rem;
  background: var(--bg);
}

.card--doctor h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 800;
}

.card--doctor .role {
  margin: 0 0 0.75rem;
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.card--doctor .bio {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== معرض التعليقات: صور مستطيلة + تمرير أفقي ===== */
.section--gallery .container {
  overflow: visible;
}

.gallery-scroll-outer {
  position: relative;
  width: 100%;
  padding-block: 0.35rem;
}

.gallery.gallery--scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1.1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-left));
  padding: 0.65rem max(1rem, 4vw) 1.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) rgba(15, 118, 110, 0.12);
}

.gallery.gallery--scroll::-webkit-scrollbar {
  height: 9px;
}

.gallery.gallery--scroll::-webkit-scrollbar-track {
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  margin-inline: max(1rem, 4vw);
}

.gallery.gallery--scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  border-radius: 999px;
}

.gallery.gallery--scroll::-webkit-scrollbar-thumb:hover {
  background: var(--teal-dark);
}

.gallery--scroll .gallery__item {
  flex: 0 0 auto;
  width: auto;
  min-width: min(240px, 85vw);
  max-width: min(420px, 88vw);
  height: min(280px, 48vw);
  max-height: 320px;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #f1f5f9;
  border: 1px solid rgba(15, 118, 110, 0.12);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.gallery--scroll .gallery__item:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.gallery--scroll .gallery__item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.gallery--scroll .gallery__item:hover img {
  transform: scale(1.02);
}

button.gallery__item {
  margin: 0;
  font: inherit;
  color: inherit;
  border: none;
  background: #f1f5f9;
  -webkit-tap-highlight-color: transparent;
}

/* معاينة الصورة (Lightbox) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.lightbox__inner {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 100%;
  max-height: min(92vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  inset-inline-end: max(0.75rem, env(safe-area-inset-left, 0px));
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--teal-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.lightbox__close:hover {
  transform: scale(1.06);
  background: #fff;
}

.gallery__loading,
.gallery__empty {
  flex: 1 0 100%;
  width: 100%;
  min-height: 200px;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  scroll-snap-align: none;
}

.gallery__empty i {
  font-size: 2rem;
  color: var(--teal-light);
}

/* ===== Contact ===== */
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid #e2e8f0;
  font-weight: 700;
  color: var(--teal-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact__card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow);
}

.contact__card i {
  font-size: 1.5rem;
  color: var(--teal);
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 0;
  background: var(--teal-dark);
  color: rgba(255, 255, 255, 0.9);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
