/* =====================================================================
   STYLES  —  DAFCA · Dr. Ahmed Nasser Al-Fadala Chartered Accountants
   Brand palette built around the logo green (#537f6b). Mobile-first & RTL-ready.
   ===================================================================== */

:root {
  --green: #537f6b;        /* logo green */
  --green-dark: #3e6353;
  --green-deep: #243d33;
  --green-light: #6f9a86;
  --silver: #d7ddd9;
  --silver-light: #eef2f0;
  --ink: #1d2823;
  --muted: #5c6a63;
  --white: #ffffff;
  --bg: #f7f8f6;
  --shadow-sm: 0 1px 2px rgba(36,61,51,0.06), 0 3px 8px rgba(36,61,51,0.05);
  --shadow: 0 12px 32px -14px rgba(36,61,51,0.20);
  --shadow-lg: 0 28px 60px -22px rgba(36,61,51,0.30);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-ar: "IBM Plex Sans Arabic", "Tajawal", "Cairo", "Segoe UI", system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Offset in-page anchors so the sticky header never covers a section heading */
section[id] { scroll-margin-top: 90px; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle film grain to break digital flatness */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Arabic typography */
html[dir="rtl"] body { font-family: var(--font-ar); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

section { padding-block: 96px; }

h1, h2, h3 {
  color: var(--ink); font-family: var(--font-display); font-weight: 600;
  line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h3 { letter-spacing: -0.01em; }
p { text-wrap: pretty; }

/* Arabic headings use the Arabic family with comfortable metrics */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-family: var(--font-ar); letter-spacing: 0; line-height: 1.32; font-weight: 700;
}

.section-title { text-align: center; margin-bottom: 16px; }
.section-intro {
  text-align: center; color: var(--muted); font-size: 1.08rem;
  max-width: 60ch; margin-inline: auto; margin-bottom: 52px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .18s cubic-bezier(.22,.61,.36,1), background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-primary { background: var(--green); color: var(--white); box-shadow: 0 8px 20px -10px rgba(36,61,51,0.5); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(36,61,51,0.55); }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--white); transform: translateY(-2px); }
.btn-light { background: var(--white); color: var(--green-dark); }
.btn-light:hover { background: var(--silver-light); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }

/* Accessible focus rings for keyboard users */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.lang-btn:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 4px solid var(--green);
  border-bottom: 1px solid var(--silver);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 12px;
}

/* Logo */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo-mark { height: 46px; width: auto; display: block; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; letter-spacing: 0.01em; color: var(--green-dark); }
.brand .brand-tag { font-size: .74rem; color: var(--green); letter-spacing: .2px; }
html[dir="rtl"] .brand .brand-name { font-family: var(--font-ar); font-weight: 700; }

/* Menu */
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-weight: 500; color: var(--ink); padding-block: 4px; position: relative; transition: color .2s ease; }
.nav-links a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -3px; height: 2px;
  background: var(--green); border-radius: 2px;
  transform: scaleX(0); transform-origin: center; transition: transform .25s cubic-bezier(.22,.61,.36,1);
}
.nav-links a:hover { color: var(--green); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--green); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-btn {
  background: var(--silver-light); border: 1px solid var(--silver);
  color: var(--green-dark); font-weight: 700; font-size: .85rem;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.lang-btn:hover { background: var(--silver); }

.nav-cta { display: inline-block; }

/* Hamburger */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 3px; background: var(--green);
  border-radius: 2px; transition: .25s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 120% at 88% 8%, rgba(111,154,134,0.30), transparent 55%),
    linear-gradient(135deg, rgba(62,99,83,0.78), rgba(36,61,51,0.86)),
    url("../assets/hero-doha.jpg") center / cover no-repeat;
  color: #fff;
  padding-block: clamp(88px, 13vw, 158px);
  position: relative; overflow: hidden;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 14ch; font-size: clamp(2.8rem, 7vw, 4.6rem); }
html[dir="rtl"] .hero h1 { max-width: 20ch; }
.hero p {
  color: rgba(255,255,255,0.90); font-size: 1.2rem; line-height: 1.7;
  max-width: 56ch; margin-block: 26px 38px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.95); font-size: .8rem; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 18px; border-radius: 999px; margin-bottom: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,0.7); }
.hero .btn-outline:hover { background: #fff; color: var(--green-dark); }

/* ---------- Cards grid ---------- */
.grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
/* Why Choose Us: keep an even 3-per-row grid on desktop (6 cards = 3 + 3) */
@media (min-width: 900px) {
  #highlights-grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--white); border: 1px solid var(--silver-light);
  border-radius: var(--radius); padding: 34px 30px;
  box-shadow: var(--shadow-sm);
  transition: transform .28s cubic-bezier(.22,.61,.36,1), box-shadow .28s ease, border-color .28s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--silver); }
.card h3 { color: var(--green-dark); margin-bottom: 9px; font-size: 1.16rem; }
.card p { color: var(--muted); font-size: .96rem; line-height: 1.65; }
.card-icon {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 20px;
  display: grid; place-items: center;
  color: var(--green-dark);
  background: linear-gradient(150deg, rgba(83,127,107,0.16), rgba(83,127,107,0.06));
  box-shadow: inset 0 0 0 1px rgba(83,127,107,0.12);
  transition: transform .28s cubic-bezier(.22,.61,.36,1), background .28s ease;
}
.card:hover .card-icon { transform: scale(1.06) rotate(-2deg); background: linear-gradient(150deg, rgba(83,127,107,0.24), rgba(83,127,107,0.10)); }
.card-icon svg { width: 28px; height: 28px; }

.section-alt { background: var(--silver-light); }

/* ---------- CTA band ---------- */
.cta-band {
  background:
    linear-gradient(135deg, rgba(62,99,83,0.93), rgba(36,61,51,0.96)),
    url("../assets/hero-doha.jpg") center / cover no-repeat;
  color: #fff; text-align: center; border-radius: var(--radius);
  padding: 56px 28px; box-shadow: var(--shadow);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); margin-block: 12px 26px; }

/* ---------- Page head (About / Contact) ---------- */
.page-head {
  background:
    linear-gradient(135deg, rgba(62,99,83,0.90), rgba(36,61,51,0.94)),
    url("../assets/hero-doha.jpg") center / cover no-repeat;
  color: #fff; padding-block: 78px; text-align: center;
}
.page-head h1 { color: #fff; }
.page-head p { color: rgba(255,255,255,0.9); max-width: 640px; margin: 14px auto 0; }

.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { margin-block: 36px 12px; color: var(--green-dark); }
.prose p { color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr 1fr; align-items: start;
}
.contact-info .info-item { margin-bottom: 22px; }
.contact-info .info-label {
  font-weight: 700; color: var(--green-dark); font-size: .9rem;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px;
}
.contact-info .info-value { color: var(--ink); }

.contact-form { background: var(--silver-light); padding: 28px; border-radius: var(--radius); }
.contact-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid var(--silver); border-radius: 10px;
  font: inherit; background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--green-light); border-color: transparent; }
.contact-form textarea { min-height: 130px; resize: vertical; }
.form-status {
  display: none; background: #e7f3ec; color: #2c6e4a;
  border: 1px solid #bfe0cb; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px;
}
.form-note { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.hidden-field { display: none; }

/* Placeholder text at full AA contrast (browser defaults are too light) */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* ---------- Testimonials ---------- */
.testimonial { display: flex; flex-direction: column; }
.testimonial .quote {
  font-style: italic; color: var(--ink); font-size: 1rem;
  margin-bottom: 18px; flex: 1;
}
.testimonial .who { display: flex; flex-direction: column; }
.testimonial .who-name { font-weight: 700; color: var(--green-dark); }
.testimonial .who-role { font-size: .85rem; color: var(--muted); }

/* Review form */
.review-form-wrap {
  max-width: 640px; margin: 48px auto 0;
  background: var(--white); border: 1px solid var(--silver);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
}
.review-form-wrap h3 { color: var(--green-dark); }
.review-intro { color: var(--muted); margin-block: 6px 18px; }
.review-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.review-form input,
.review-form textarea {
  width: 100%; padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--silver); border-radius: 10px; font: inherit; background: #fff;
}
.review-form input:focus,
.review-form textarea:focus { outline: 2px solid var(--green-light); border-color: transparent; }
.review-form textarea { min-height: 110px; resize: vertical; }

/* ---------- Articles ---------- */
.article-teaser-wrap { max-width: 760px; margin-inline: auto; }
.article-card {
  background: var(--white); border: 1px solid var(--silver);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.article-meta { font-size: .85rem; color: var(--green); font-weight: 600; margin-bottom: 8px; }
.article-card h3 { color: var(--green-dark); margin-bottom: 12px; font-size: 1.3rem; }
.article-card p { color: var(--muted); margin-bottom: 20px; }

.article-full { max-width: 760px; margin: 0 auto 48px; padding-bottom: 32px; border-bottom: 1px solid var(--silver); }
.article-full:last-child { border-bottom: 0; margin-bottom: 0; }
.article-full h2 { color: var(--green-dark); margin-bottom: 14px; }
.article-full p { color: var(--muted); margin-bottom: 14px; }

.map-embed { margin-top: 44px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map-embed iframe { width: 100%; height: 320px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-deep); color: #d3ddd7; padding-block: 50px 24px; }
.footer-grid {
  display: grid; gap: 32px;
  grid-template-columns: 2fr 1fr 1fr; margin-bottom: 30px;
}
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
.site-footer a { color: #d3ddd7; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.footer-brand .logo-mark {
  height: 84px; width: auto; margin-bottom: 14px;
  background: #fff; padding: 12px 16px; border-radius: 12px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: 18px; text-align: center; font-size: .85rem; color: #9fb1a8;
}

/* ---------- About media image ---------- */
.about-media { padding-block: 56px 0; }
.about-figure {
  display: block; width: 100%; max-width: 1000px; height: auto;
  margin-inline: auto; border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Feature image bands ---------- */
.image-band { padding-block: 64px; }
.band-img {
  display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover;
  object-position: center; border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Article images ---------- */
.article-img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 20px;
}
.article-full .article-img { aspect-ratio: 16 / 8; margin-bottom: 26px; }

/* ---------- Scroll-reveal motion ---------- */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
/* gentle stagger for items sitting in a grid */
.grid .reveal:nth-child(2) { transition-delay: .07s; }
.grid .reveal:nth-child(3) { transition-delay: .14s; }
.grid .reveal:nth-child(4) { transition-delay: .21s; }
.grid .reveal:nth-child(5) { transition-delay: .10s; }
.grid .reveal:nth-child(6) { transition-delay: .17s; }
.grid .reveal:nth-child(7) { transition-delay: .24s; }
.grid .reveal:nth-child(8) { transition-delay: .31s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive (phones) ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .nav-links {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--silver);
    padding: 10px 20px; box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease;
  }
  .nav-links.open { max-height: 320px; padding-block: 14px; }
  .nav-links a { width: 100%; padding-block: 12px; border-bottom: 1px solid var(--silver-light); }
  .nav { position: relative; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  section { padding-block: 64px; }
}

@media (max-width: 420px) {
  .brand .brand-tag { display: none; }
  .brand .logo-mark { height: 40px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
}
