/* Ahmed Shafeeq Dental Clinic | main stylesheet
   Colors taken from the clinic logo (calm blue) with a soft teal accent. */

:root {
  --brand: #1f5fa8;
  --brand-strong: #174a85;
  --brand-soft: #e6effa;
  --accent: #0b8f8a;
  --accent-soft: #e3f4f3;
  --wa: #128c4a;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --text: #13233a;
  --muted: #4a5b72;
  --border: #d6e0ec;
  --shadow: 0 1px 2px rgba(19, 35, 58, .06), 0 6px 20px rgba(19, 35, 58, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dir: 1;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

html[lang="ar"] {
  --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, Tahoma, sans-serif;
  --dir: -1;
}

html[data-theme="dark"] {
  --brand: #7fb2ec;
  --brand-strong: #a9cbf3;
  --brand-soft: #16263d;
  --accent: #4fc9c2;
  --accent-soft: #10302f;
  --wa: #3ccf7f;
  --bg: #0d1624;
  --surface: #132033;
  --surface-2: #182a42;
  --text: #e8eef6;
  --muted: #a9b8cb;
  --border: #26384f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

@view-transition { navigation: auto; }

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background-color .3s ease, color .3s ease;
  animation: page-in .45s var(--ease) both;
}
html[lang="ar"] body { line-height: 1.9; }

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.3; color: var(--text); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1.1em; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1.1em; }
li { margin-bottom: .4em; }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { inset-inline-start: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 700; line-height: 1.2; }
.logo svg { width: 42px; height: 42px; flex: none; }
.logo small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.main-nav { margin-inline-start: auto; }
.main-nav ul { list-style: none; display: flex; gap: .2rem; margin: 0; padding: 0; }
.main-nav a { display: block; padding: .5rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .98rem; font-weight: 500; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.header-tools { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: .9rem;
  transition: background-color .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { width: auto; padding-inline: .8rem; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-toggle { display: none; }

@media (max-width: 1320px) {
  .menu-toggle { display: inline-grid; }
  .header-tools .btn-book { display: none; }
  .main-nav {
    position: fixed; inset: 72px 0 auto 0; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .35s var(--ease);
  }
  .main-nav.open { max-height: 80vh; overflow-y: auto; }
  .main-nav ul { flex-direction: column; padding: .8rem 1.25rem 1.2rem; }
  .main-nav a { padding: .8rem .9rem; font-size: 1.05rem; }
  .header-tools { margin-inline-start: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 50px; padding: .7rem 1.35rem; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 1.02rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
html[data-theme="dark"] .btn-primary { color: #0b1626; }
html[data-theme="dark"] .btn-primary:hover { color: #0b1626; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { color: #fff; filter: brightness(1.05); }
html[data-theme="dark"] .btn-wa, html[data-theme="dark"] .btn-wa:hover { color: #08210f; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-book { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.eyebrow { display: inline-block; font-size: .92rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 38em; }
.hero-photo { position: relative; }
.hero-photo img { border-radius: 22px; box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--surface-2); }
.hero-badge { position: absolute; inset-inline-start: -1rem; bottom: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--shadow); font-size: .95rem; max-width: 260px; }
.hero-badge strong { display: block; color: var(--brand); }
.hero-points { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: .45rem; }
.hero-points li { display: flex; gap: .6rem; align-items: flex-start; }
.hero-points svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: .3em; }
.hero .anim { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; }
.hero .anim:nth-child(2) { animation-delay: .08s; }
.hero .anim:nth-child(3) { animation-delay: .16s; }
.hero .anim:nth-child(4) { animation-delay: .24s; }
.hero .anim:nth-child(5) { animation-delay: .32s; }
.hero-photo.anim { animation-delay: .2s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; margin-inline: auto; }
  .hero-badge { inset-inline-start: .5rem; }
}

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 2rem 0 2.2rem; background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.page-head p.lead { color: var(--muted); font-size: 1.1rem; max-width: 46em; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0 0 1rem; font-size: .92rem; color: var(--muted); }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: .3rem; color: var(--border); }
.breadcrumbs a { color: var(--muted); }
.meta-line { font-size: .95rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ---------- Sections ---------- */
section.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page-head + section.block { padding-top: 1.5rem; }
@media (max-width: 480px) { .logo small { display: none; } .logo { font-size: .95rem; } }
section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 46em; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s ease;
}
a.card { text-decoration: none; color: inherit; display: block; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card .card-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 1rem; }
.card .card-icon svg { width: 28px; height: 28px; }
.card p { color: var(--muted); margin-bottom: .8rem; }
.card .more { font-weight: 600; color: var(--brand); display: inline-flex; gap: .35rem; align-items: center; }
.card .more svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.card:hover .more svg { transform: translateX(calc(4px * var(--dir))); }
[dir="rtl"] .card .more svg { transform: scaleX(-1); }
[dir="rtl"] .card:hover .more svg { transform: scaleX(-1) translateX(4px); }

/* doctor card */
.doc-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.doc-card img { border-radius: 12px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-2); }
@media (max-width: 560px) { .doc-card { grid-template-columns: 1fr; } .doc-card img { max-width: 220px; } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat { text-align: center; padding: 1.4rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat .num { font-size: 2.3rem; font-weight: 700; color: var(--brand); line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: .98rem; }
.stat .placeholder-num { font-size: 1rem; color: #b45309; font-weight: 600; }

/* content */
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose { font-size: 1.06rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }
.side-box { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.side-box h2, .side-box h3 { font-size: 1.15rem; }
.side-box .btn { width: 100%; margin-bottom: .6rem; }
.side-box ul { list-style: none; padding: 0; }
.side-box li { padding: .35rem 0; border-bottom: 1px dashed var(--border); }

.callout { background: var(--accent-soft); border-inline-start: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.disclaimer-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: .95rem; color: var(--muted); margin-top: 2rem; }
.author-box { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.author-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.author-box p { margin: 0; font-size: .97rem; color: var(--muted); }
.author-box strong { color: var(--text); }

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 3.2rem; margin-bottom: 1.1rem; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: .1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .75rem; }
.faq summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 1.2rem 1rem; color: var(--muted); }

/* placeholders: easy to spot */
.ph { background: #fff4d6; color: #7a4b00; border: 1px dashed #d99a00; padding: 0 .35em; border-radius: 4px; font-weight: 600; font-size: .92em; }
html[data-theme="dark"] .ph { background: #3a2c08; color: #ffd98a; border-color: #a77a10; }

/* map */
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 10; background: var(--surface-2); }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.info-list { list-style: none; padding: 0; }
.info-list li { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .8rem; }
.info-list svg { width: 22px; height: 22px; color: var(--brand); flex: none; margin-top: .3em; }

/* forms */
.form { display: grid; gap: 1rem; }
.form label { font-weight: 600; display: block; margin-bottom: .35rem; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1.02rem; padding: .8rem .95rem; min-height: 50px;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
}
.form textarea { min-height: 110px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.form .hint { font-size: .9rem; color: var(--muted); margin-top: .3rem; }
.form .error { color: #b42318; font-size: .92rem; margin-top: .3rem; display: none; }
html[data-theme="dark"] .form .error { color: #ff9b8f; }
.form .invalid .error { display: block; }
.form .invalid input, .form .invalid select, .form .invalid textarea { border-color: #b42318; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.consent { font-size: .93rem; color: var(--muted); }
.consent label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.consent input { width: 22px; height: 22px; min-height: 0; flex: none; margin-top: .25em; }

/* reviews */
.empty-state { text-align: center; padding: 2.5rem 1.5rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* blog */
.post-card .date { font-size: .9rem; color: var(--muted); }
.tag { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .6rem; }

/* CTA band */
.cta-band { background: var(--brand); color: #fff; border-radius: 20px; padding: clamp(1.6rem, 4vw, 2.6rem); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin-bottom: .3rem; }
.cta-band p { margin: 0; opacity: .92; }
.cta-band .btn-primary { background: #fff; color: var(--brand-strong); }
html[data-theme="dark"] .cta-band { background: #1b3a63; }
html[data-theme="dark"] .cta-band .btn-primary { background: #e8eef6; color: #0d1624; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 6rem; margin-top: 3rem; font-size: .98rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: 2rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer p { color: var(--muted); }
.social { display: flex; gap: .5rem; margin-top: 1rem; }
.social a { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.social a:hover { border-color: var(--brand); color: var(--brand); }
.social svg { width: 20px; height: 20px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; color: var(--muted); font-size: .93rem; }
.footer-bottom a { color: var(--brand); }
@media (min-width: 861px) { .site-footer { padding-bottom: 2rem; } }

/* ---------- Mobile sticky CTA ---------- */
.mobile-cta { display: none; }
@media (max-width: 860px) {
  .mobile-cta {
    display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border-top: 1px solid var(--border); backdrop-filter: blur(8px);
  }
  .mobile-cta .btn { min-height: 48px; padding: .5rem; font-size: .98rem; }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translate3d(calc(18px * var(--dir) * var(--rx, 0)), 18px, 0); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.from-side { --rx: -1; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

@media print {
  .site-header, .mobile-cta, .site-footer .social, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
