/* ============================================
   DAMO Group — Base Styles
   ============================================ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-turquoise);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: var(--leading-hero);
  letter-spacing: var(--tracking-tight);
}
h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-snug);
}
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); }

/* H2 variants — use on specific sections to establish hierarchy */
.h2--hero    { font-size: var(--fs-h2-hero); font-weight: var(--fw-bold); }
.h2--compact { font-size: var(--fs-h2-compact); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }

p {
  margin-bottom: var(--space-sm);
}

strong {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

/* Small label variant (used in contact cards, feature rows) */
.strong-label {
  display: block;
  font-size: var(--fs-small);
  margin-bottom: 4px;
}

.strong-label--tight {
  display: block;
  font-size: var(--fs-small);
  margin-bottom: 2px;
}

.overline {
  font-family: var(--font-body);
  font-size: var(--fs-overline);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent-gold);
}

/* ── Grain/noise overlay (premium texture) ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

[data-theme="light"] body::after {
  opacity: 0.04;
  mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
  body::after { opacity: 0.03; }
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--wide {
  max-width: var(--container-wide);
}

section {
  padding: var(--section-padding) 0;
  position: relative;
}

/* Alternating section background (2-level rhythm) */
.section--alt {
  background: var(--bg-secondary);
}

/* Bordered alt section (used for call-out blocks between sections) */
.section--alt-bordered {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

/* ── Section Header ── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header .overline {
  margin-bottom: var(--space-sm);
  display: block;
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}

.section-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-gold);
  margin: var(--space-md) auto 0;
  border-radius: 2px;
}

/* ── Gold divider line ── */
.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 2px;
  margin: var(--space-md) auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  border: none;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-glow);
  color: var(--bg-primary);
}

.btn--outline {
  background: transparent;
  color: var(--accent-gold);
  border: 1.5px solid var(--accent-gold);
}

.btn--outline:hover {
  background: rgba(212, 168, 83, 0.1);
  transform: translateY(-2px);
  color: var(--accent-gold-light);
}

.btn--small {
  padding: 10px 24px;
  font-size: var(--fs-small);
}

.btn .arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .arrow {
  transform: translateX(4px);
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

/* Glass-card padding + alignment modifiers */
.glass-card--centered   { text-align: center; }
.glass-card--pad-lg     { padding: var(--space-lg); }
.glass-card--pad-xl     { padding: var(--space-xl); }
.glass-card--pad-2xl    { padding: var(--space-2xl); }
.glass-card--inline     { display: flex; align-items: center; gap: var(--space-md); }

/* ── Feature row (icon + text pair, used in Who We Are / service lists) ── */
.feature-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.feature-row--md {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.feature-row--inline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--fs-small);
}

/* ── Stack (vertical flex container with gap) ── */
.stack-md {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ── Spacing utilities (margin-bottom) ── */
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-0   { margin-bottom: 0; }
.mb-2px { margin-bottom: 2px; }

/* ── Overline variants ── */
.overline--block {
  display: block;
  margin-bottom: var(--space-sm);
}

/* ── Paragraph tone variants ── */
.p-lead    { font-size: 1.0625rem; line-height: 1.9; }
.p-relaxed { line-height: 1.9; }
.p-caption {
  color: var(--text-muted);
  font-size: var(--fs-small);
  margin: 0;
}
.p-body-sm {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: var(--fs-small);
}
.caption-xs {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.caption-muted {
  color: var(--text-muted);
  font-size: var(--fs-small);
}
.caption-gold {
  color: var(--accent-gold);
  font-size: var(--fs-small);
}

/* ── Flex gap + alignment utilities ── */
.g-md  { gap: var(--space-md); }
.g-lg  { gap: var(--space-lg); }
.g-3xl { gap: var(--space-3xl); }
.align-center { align-items: center; }

/* ── Stat number size variant ── */
.num-md { font-size: 2rem; }

/* ── Utility: background none (for transparent icon wrappers) ── */
.bg-none {
  background: transparent;
  border: none;
}

/* ── Auto centering helpers ── */
.mx-auto { margin-left: auto; margin-right: auto; }
.text-secondary-sm {
  color: var(--text-secondary);
  font-size: var(--fs-small);
}
.text-muted-sm-mb-md {
  color: var(--text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-md);
}
.caption-mt-4 {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
}
.heading-gold-mb-xs {
  margin-bottom: var(--space-xs);
  color: var(--accent-gold);
}
.gap-md-mt-2xl {
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.link-accent-gold {
  font-size: var(--fs-small);
  color: var(--accent-gold);
  font-weight: var(--fw-medium);
}
.link-accent-turquoise {
  font-size: var(--fs-small);
  color: var(--accent-turquoise);
  font-weight: var(--fw-medium);
}
.row-icon-md-lg {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.glass-card--pad-2xl-centered {
  padding: var(--space-2xl);
  text-align: center;
}
.link-inline-gold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--accent-gold);
  font-weight: var(--fw-medium);
  font-size: var(--fs-small);
}
.link-block-secondary {
  font-size: var(--fs-small);
  display: block;
  color: var(--text-secondary);
}
.g-2xl  { gap: var(--space-2xl); }
.g-xl   { gap: var(--space-xl); }
.mb-0-imp { margin-bottom: 0; }

/* Logo presentation (with drop-shadow) */
.logo-feature--gold {
  max-width: 220px;
  margin: 0 auto var(--space-lg);
  display: block;
  border-radius: var(--radius-md);
}

/* CTA-card sizing helpers */
.cta-card--narrow {
  max-width: 760px;
  margin: 0 auto;
}
.cta-card__lead {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-secondary);
}
.row-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero/feature logos with brand drop-shadow */
.brand-logo--xl {
  max-width: 480px;
  margin: var(--space-md) auto;
  display: block;
  filter: drop-shadow(0 4px 24px rgba(212, 168, 83, 0.18));
}
.brand-logo--lg {
  max-width: 340px;
  width: 100%;
  filter: drop-shadow(0 4px 24px rgba(212, 168, 83, 0.15));
  border-radius: var(--radius-lg);
}
.brand-logo--sm {
  max-width: 180px;
  margin: 0 auto var(--space-lg);
  display: block;
  border-radius: var(--radius-md);
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.stack-sm-left { display: flex; flex-direction: column; gap: var(--space-sm); text-align: left; }
.text-accent-gold-inline { color: var(--accent-gold); }
.link-muted { color: var(--text-muted); }
.glass-card--centered-grid2 { grid-column: 2; }
.order-0 { order: 0; }
.order-1 { order: 1; }

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* ── Grid utilities ── */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Keep 3-col layout until mobile to avoid orphaning the 3rd card in 2-col grids */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  /* .grid--3 stays at 3 cols — collapses straight to 1 col on mobile */
}

@media (max-width: 768px) {
  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: 1fr; }
}

/* ── Flex utilities ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Text utilities ── */
.text-center { text-align: center; }
.text-gold { color: var(--accent-gold); }
.text-turquoise { color: var(--accent-turquoise); }
.text-muted { color: var(--text-muted); }

/* ── Scroll reveal base (unified: opacity + translate + blur) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  transition: opacity var(--duration-reveal) var(--ease-out-premium),
              transform var(--duration-reveal) var(--ease-out-premium),
              filter var(--duration-reveal) var(--ease-out-premium);
  will-change: opacity, transform, filter;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-delay-1 { transition-delay: 60ms; }
.reveal-delay-2 { transition-delay: 120ms; }
.reveal-delay-3 { transition-delay: 180ms; }
.reveal-delay-4 { transition-delay: 240ms; }

/* ============================================
   RTL Support — Arabic layout (lang="ar")
   ============================================ */
[dir="rtl"] {
  font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: 'Noto Sans Arabic', 'Outfit', sans-serif;
  letter-spacing: 0;          /* Arabic doesn't use latin letter-spacing */
}

/* Flip directional icons (arrows pointing right become left) */
[dir="rtl"] .arrow,
[dir="rtl"] [data-flip-rtl] {
  display: inline-block;
  transform: scaleX(-1);
}

/* Restore icon-inline margin (icon-inline uses margin-right, switch to margin-inline-end) */
.icon-inline {
  margin-inline-end: 0.4em;
  margin-right: 0;            /* override the legacy margin-right */
}

/* Hero text alignment — keep centered, but ensure RTL flow */
[dir="rtl"] .page-hero__content,
[dir="rtl"] .hero__content {
  direction: rtl;
}

/* Stack-sm-left → keep alignment in source language direction */
[dir="rtl"] .stack-sm-left {
  text-align: right;
}

/* Editorial grid stays the same in RTL — visual on the LEFT now (natural flip) */
[dir="rtl"] .editorial-grid__visual {
  /* CSS Grid auto-flips with dir=rtl */
}

/* Footer grid alignment in RTL */
[dir="rtl"] .footer__contact-item {
  flex-direction: row-reverse;
}

/* Language toggle button — keep label LTR */
[dir="rtl"] #langToggle {
  direction: ltr;
}

/* Cookie notice in RTL */
[dir="rtl"] .cookie-notice {
  flex-direction: row-reverse;
}

/* Skip link in RTL appears top-right */
[dir="rtl"] .skip-to-content {
  left: auto;
  right: 0;
  border-radius: 0 0 0 var(--radius-sm);
}

/* ── Skip-to-content link (WCAG keyboard navigation) ── */
.skip-to-content {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  transform: translateY(-110%);
  transition: transform 200ms var(--ease-out-premium);
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--bg-primary);
  outline-offset: -4px;
}

/* ── Inline icons (used in subtitles, source labels) ── */
.icon-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 0.4em;
  stroke-width: 2;
  color: var(--accent-gold);
  flex-shrink: 0;
}

/* ── Icon system (sizes + color modifiers) ── */
.icon-16 { width: 16px; height: 16px; flex-shrink: 0; }
.icon-18 { width: 18px; height: 18px; flex-shrink: 0; }
.icon-20 { width: 20px; height: 20px; flex-shrink: 0; }
.icon-24 { width: 24px; height: 24px; flex-shrink: 0; }
.icon-28 { width: 28px; height: 28px; flex-shrink: 0; }
.icon-32 { width: 32px; height: 32px; flex-shrink: 0; }
.icon-40 { width: 40px; height: 40px; flex-shrink: 0; }

.icon--gold      { color: var(--accent-gold); }
.icon--turquoise { color: var(--accent-turquoise); }
.icon--success   { color: var(--success); }
.icon--muted     { color: var(--text-muted); }

.icon--mb-xs { margin-bottom: var(--space-xs); }
.icon--mb-sm { margin-bottom: var(--space-sm); }
.icon--mb-md { margin-bottom: var(--space-md); }
.icon--mt-2  { margin-top: 2px; }

/* Stat icon — centered above number */
.stat__icon {
  width: 28px;
  height: 28px;
  margin: 0 auto var(--space-xs);
  display: block;
  color: var(--accent-turquoise);
  flex-shrink: 0;
}

/* ── Icon badge (rounded wrapper containing a small icon) ── */
.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.icon-badge--48 { width: 48px; height: 48px; }
.icon-badge--52 { width: 52px; height: 52px; border: 1px solid; }
.icon-badge--56 { width: 56px; height: 56px; border: 1px solid; }

.icon-badge--gold {
  background: rgba(212, 168, 83, 0.10);
  border-color: rgba(212, 168, 83, 0.20);
  color: var(--accent-gold);
}
.icon-badge--turquoise {
  background: rgba(0, 180, 216, 0.10);
  border-color: rgba(0, 180, 216, 0.20);
  color: var(--accent-turquoise);
}
.icon-badge--success {
  background: rgba(46, 204, 113, 0.10);
  border-color: rgba(46, 204, 113, 0.20);
  color: var(--success);
}

/* ── Card logos (square image with rounded corners) ── */
.card-logo--52 {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.card-logo--70 {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

/* ── Accessibility: visually hidden (screen-reader only) ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Accessibility: keyboard focus states ── */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background: rgba(212, 168, 83, 0.3);
  color: var(--text-primary);
}

[data-theme="light"] ::selection {
  background: rgba(30, 136, 229, 0.2);
  color: var(--text-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-gold-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* ── Light mode typography weight ── */
[data-theme="light"] h2 {
  font-weight: 700;
}

/* ── Light mode link hover ── */
[data-theme="light"] a:hover {
  color: var(--accent-gold);
}
