/* Maharat Wathiqa — brand component layer.
   Loaded AFTER Bootstrap 5 RTL so brand tokens win. Imports the design tokens,
   then defines the reusable marketing + dashboard components. */

@import url('./tokens/fonts.css');
@import url('./tokens/colors.css');
@import url('./tokens/typography.css');
@import url('./tokens/spacing.css');
@import url('./tokens/effects.css');
@import url('./tokens/base.css');

/* ---------- Global overrides on top of Bootstrap ---------- */
body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--text-strong); }
a { color: var(--text-link); }
.container { max-width: var(--container-max); }

/* Mono technical eyebrow with a gold rule */
.mw-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--gold-600);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.mw-eyebrow::before { content: ""; width: 36px; height: 2px; background: currentColor; display: inline-block; }
.mw-eyebrow--light { color: var(--gold-400); }

.section { padding-block: var(--space-24); }
.section--sunken { background: var(--surface-sunken); }
.section--dark { background: var(--grad-navy); color: var(--text-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.section-title { font-size: var(--fs-h2); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); margin-bottom: var(--space-4); }
.section-subtitle { color: var(--text-muted); max-width: 640px; }
.section--dark .section-subtitle { color: var(--navy-300); }

/* ---------- Buttons ---------- */
.btn-gold {
  background: var(--gold-500); color: #1b1200; border: 1px solid var(--gold-500);
  font-weight: var(--fw-semibold); border-radius: var(--radius-md);
  padding: 0 var(--space-6); height: var(--control-h-md); display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #1b1200; }
.btn-gold:active { transform: translateY(1px); }

.btn-navy {
  background: var(--navy-800); color: #fff; border: 1px solid var(--navy-800);
  font-weight: var(--fw-semibold); border-radius: var(--radius-md);
  padding: 0 var(--space-6); height: var(--control-h-md); display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn-navy:hover { background: var(--navy-900); color: #fff; }
.btn-navy:active { transform: translateY(1px); }

.btn-outline-navy {
  background: transparent; color: var(--navy-800); border: 1px solid var(--border-default);
  font-weight: var(--fw-semibold); border-radius: var(--radius-md);
  padding: 0 var(--space-6); height: var(--control-h-md); display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline-navy:hover { background: var(--navy-100); color: var(--navy-900); }

.btn-outline-light {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35);
  font-weight: var(--fw-semibold); border-radius: var(--radius-md);
  padding: 0 var(--space-6); height: var(--control-h-md); display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline-light:hover { background: rgba(255,255,255,.10); color: #fff; }

.btn-lg-mw { height: var(--control-h-lg); font-size: var(--fs-body-lg); padding-inline: var(--space-8); }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header .brand img { width: 44px; height: 44px; border-radius: 50%; }
.site-header .brand .n { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 18px; color: var(--navy-900); line-height: 1.1; }
.site-header .brand .l { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--text-muted); }
.site-nav { display: flex; align-items: center; gap: var(--space-6); }
.site-nav a { color: var(--text-body); font-weight: var(--fw-medium); }
.site-nav a:hover, .site-nav a.active { color: var(--navy-800); text-decoration: none; }
.lang-switch { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 4px 10px; background: transparent; }
.lang-switch:hover { color: var(--navy-800); border-color: var(--navy-500); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--grad-navy); color: #fff; overflow: hidden; padding-block: var(--space-32) var(--space-20); }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 12%, var(--navy-500), transparent 52%); opacity: .28; pointer-events: none; }
.hero h1 { position: relative; font-size: var(--fs-display-2); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); color: #fff; margin-bottom: var(--space-5); }
.hero h1 b { color: var(--gold-400); }
.hero p.lead { position: relative; font-size: var(--fs-body-lg); color: var(--navy-300); max-width: 620px; margin-bottom: var(--space-8); }
.hero .hero-actions { position: relative; display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* Stat strip */
.stat-strip { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); margin-top: var(--space-16); border-top: 1px solid rgba(255,255,255,.12); padding-top: var(--space-8); }
.stat-strip .v { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h1); color: #fff; }
.stat-strip .v b { color: var(--gold-400); font-weight: var(--fw-bold); }
.stat-strip .l { color: var(--navy-300); font-size: var(--fs-body-sm); }

/* ---------- Cards ---------- */
.mw-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--space-7, 28px); height: 100%; transition: transform var(--dur-med) var(--ease-standard), box-shadow var(--dur-med) var(--ease-standard); }
.mw-card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mw-card .ic { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; margin-bottom: var(--space-4); }
.mw-card h3 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); color: var(--navy-900); margin-bottom: var(--space-2); }
.mw-card p { color: var(--text-muted); font-size: var(--fs-body-sm); margin: 0; }
.mw-card--featured { border-top: var(--border-accent) solid var(--gold-500); }

/* Project card */
.project-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); height: 100%; transition: transform var(--dur-med) var(--ease-standard), box-shadow var(--dur-med) var(--ease-standard); }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.project-card .thumb { aspect-ratio: 16/10; background: var(--grad-navy); display: grid; place-items: center; color: var(--navy-300); position: relative; overflow: hidden; }
/* aspect-ratio on the img itself guarantees a uniform crop regardless of the source dimensions
   (a tall/square logo is cropped to 16/10 just like a wide photo). */
.project-card .thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.project-card .body { padding: var(--space-5); }
.project-card .cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); }
.project-card h3 { font-size: var(--fs-h4); color: var(--navy-900); margin: 6px 0; }
.project-card .meta { color: var(--text-muted); font-size: var(--fs-body-sm); }

/* Uniform cropped media — every image displays at a consistent size regardless
   of its source dimensions (excess is cropped, never stretched). */
.mw-media { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-alt, #eef1f4); border-radius: var(--radius-md); }
.mw-media--cover { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.mw-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); }

/* Partners — logos render in full colour at a generous size (no grayscale/fade). */
.partner-logo { height: 132px; min-width: 220px; display: grid; place-items: center; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #fff; color: var(--steel-600); font-weight: var(--fw-semibold); padding: var(--space-4); text-decoration: none; overflow: hidden; transition: border-color var(--dur-med) var(--ease-standard), box-shadow var(--dur-med) var(--ease-standard); }
.partner-logo img { max-height: 96px; max-width: 190px; object-fit: contain; transition: transform var(--dur-med) var(--ease-standard); }
.partner-logo:hover { border-color: var(--gold-400); box-shadow: var(--shadow-sm); }
.partner-logo:hover img { transform: scale(1.08); }

/* Partner marquee — a continuously scrolling strip. The track holds identical halves,
   shifting by exactly half its width for a seamless loop. Hover pauses the motion.
   Direction note: on RTL pages the track's NATURAL position is right-aligned (its left
   edge sits off-screen to the left), so the two directions need different keyframes —
   a single translateX(0 → -50%) would scroll the track completely out of view in RTL,
   leaving the section blank for most of the loop.
   RTL: 50% → 0 moves the logos right-to-left. LTR: -50% → 0 moves them left-to-right. */
.partner-marquee { overflow: hidden; width: 100%; }
.partner-marquee .track { display: flex; width: max-content; animation: mw-marquee-rtl 45s linear infinite; }
.partner-marquee .mset { display: flex; gap: var(--space-4); padding-inline-end: var(--space-4); }
.partner-marquee:hover .track { animation-play-state: paused; }
html[dir="ltr"] .partner-marquee .track { animation-name: mw-marquee-ltr; }
@keyframes mw-marquee-rtl { from { transform: translateX(50%); } to { transform: translateX(0); } }
@keyframes mw-marquee-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .partner-marquee .track { animation: none; flex-wrap: wrap; width: auto; }
  .partner-marquee .mset[aria-hidden="true"] { display: none; }
}

/* Social channel icons (footer, contact page) */
.social-icons { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.social-icons a { width: 42px; height: 42px; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,.18); color: inherit; display: grid; place-items: center; font-size: 19px; text-decoration: none; transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.social-icons a:hover { background: var(--gold-500); border-color: var(--gold-500); color: #1b1200; }
/* On light surfaces (e.g. contact page) the same block adapts automatically */
.section .social-icons a { border-color: var(--border-default); color: var(--navy-700); }
.section .social-icons a:hover { color: #1b1200; }

/* Floating WhatsApp button — bottom inline-end corner (left in RTL, right in LTR). */
.whatsapp-float {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff; font-size: 28px;
  display: grid; place-items: center; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.contact-tile .ci--whatsapp { background: #e7f9ee; color: #128c4a; font-size: 22px; }

/* Responsive map / video embeds (Google Maps, YouTube) */
.map-embed, .video-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm); }
.map-embed iframe { display: block; width: 100%; height: 380px; border: 0; }
.video-embed { aspect-ratio: 16 / 9; }
.video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Share buttons (project / service / news pages) */
.share-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.share-bar .share-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-inline-end: var(--space-2); }
.share-bar a, .share-bar button { width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: transparent; color: var(--navy-700); display: grid; place-items: center; font-size: 17px; text-decoration: none; cursor: pointer; transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.share-bar a:hover, .share-bar button:hover { background: var(--navy-100); color: var(--navy-900); }

/* Admin-authored rich text (Quill output) */
.rich-content { line-height: var(--lh-relaxed); }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { margin-top: var(--space-6); margin-bottom: var(--space-3); }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.rich-content blockquote { border-inline-start: 3px solid var(--gold-500); padding-inline-start: var(--space-4); color: var(--text-muted); }
.rich-content ul, .rich-content ol { padding-inline-start: var(--space-6); margin-bottom: var(--space-4); }
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-left { text-align: left; }
.rich-content .ql-align-justify { text-align: justify; }

/* Service feature checklist */
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--text-body); }
.feature-list li .fi { color: var(--gold-600); flex-shrink: 0; margin-top: 3px; }

/* FAQ accordion (homepage) */
.faq-accordion .accordion-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-3); overflow: hidden; }
.faq-accordion .accordion-button { font-weight: var(--fw-semibold); color: var(--navy-900); background: var(--surface-card); box-shadow: none; }
.faq-accordion .accordion-button:not(.collapsed) { background: var(--navy-100); color: var(--navy-900); }
.faq-accordion .accordion-body { color: var(--text-body); line-height: var(--lh-relaxed); }

/* Testimonial */
.testimonial { background: var(--surface-card); border: 1px solid var(--border-subtle); border-inline-start: var(--border-accent) solid var(--gold-500); border-radius: var(--radius-lg); padding: var(--space-8); box-shadow: var(--shadow-sm); }
.testimonial q { font-size: var(--fs-body-lg); color: var(--text-strong); line-height: var(--lh-relaxed); display: block; }
.testimonial .by { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-5); }
.testimonial .av { width: 44px; height: 44px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; font-weight: var(--fw-bold); }
.testimonial .n { font-weight: var(--fw-semibold); color: var(--navy-900); }
.testimonial .r { color: var(--text-muted); font-size: var(--fs-body-sm); }
/* Testimonial carousel — auto-cycles; indicators sit below the card as navy/gold dots.
   flex-wrap keeps a long list of dots on multiple rows on narrow screens. */
.testimonial-carousel .carousel-indicators { position: static; margin: var(--space-5) 0 0; flex-wrap: wrap; row-gap: 6px; }
.testimonial-carousel .carousel-indicators [data-bs-target] { width: 9px; height: 9px; border-radius: 50%; background: var(--navy-300); border: 0; margin-inline: 5px; opacity: .5; transition: background var(--dur-fast) var(--ease-standard), opacity var(--dur-fast) var(--ease-standard); }
.testimonial-carousel .carousel-indicators .active { background: var(--gold-500); opacity: 1; }

/* CTA band */
.cta-band { background: var(--grad-navy); color: #fff; border-radius: var(--radius-xl); padding: var(--space-16); position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 90% 20%, var(--gold-600), transparent 45%); opacity: .25; pointer-events: none; }
.cta-band h2 { color: #fff; position: relative; }

/* Contact tiles */
.contact-tile { display: flex; align-items: center; gap: var(--space-4); }
.contact-tile .ci { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; }
.contact-tile .cl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.contact-tile .cv { color: var(--navy-900); font-weight: var(--fw-medium); }

/* Forms */
.form-control, .form-select { border-radius: var(--radius-md); border-color: var(--border-default); min-height: var(--control-h-md); }
.form-control:focus, .form-select:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus); }
.form-label { font-weight: var(--fw-medium); color: var(--text-body); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--navy-300); padding-block: var(--space-16) var(--space-8); }
.site-footer h4 { color: #fff; font-size: var(--fs-body); margin-bottom: var(--space-4); }
.site-footer a { color: var(--navy-300); }
.site-footer a:hover { color: #fff; text-decoration: none; }
.site-footer .brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-4); }
.site-footer .brand-line img { width: 48px; height: 48px; border-radius: 50%; }
/* Use the brand body font (IBM Plex Sans Arabic) — the mono font is Latin-only and breaks Arabic
   (disconnected letters + letter-spacing), so the copyright/admin line stays on-brand in both scripts. */
.site-footer .copy { border-top: 1px solid rgba(255,255,255,.10); margin-top: var(--space-10); padding-top: var(--space-6); font-family: var(--font-body); font-size: 13px; color: var(--navy-400); }

/* ---------- Badges (quote status) ---------- */
.mw-badge { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill); display: inline-block; }
.mw-badge--new { background: var(--info-100); color: var(--info-500); }
.mw-badge--review { background: var(--warning-100); color: var(--warning-600); }
.mw-badge--quoted { background: var(--gold-100); color: var(--gold-700); }
.mw-badge--won { background: var(--success-100); color: var(--success-600); }
.mw-badge--closed { background: var(--steel-100); color: var(--steel-600); }

/* ---------- Scope of activities (نطاق أنشطتنا) ---------- */
.scope-lead { color: var(--text-muted); max-width: 720px; margin-bottom: var(--space-6); }
/* Multi-column so items flow top-to-bottom then to the next column (01..07 | 08..14),
   matching the source layout. In RTL the first column sits on the right automatically. */
.scope-grid { column-count: 2; column-gap: var(--space-6); }
.scope-item {
  break-inside: avoid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.scope-num {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: var(--navy-800);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-bold);
  border-radius: var(--radius-sm);
}
.scope-item:nth-child(even) .scope-num { background: var(--gold-500); }
.scope-text { color: var(--text-body); line-height: 1.55; padding-top: 2px; }

@media (max-width: 768px) {
  .hero h1 { font-size: var(--fs-h1); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .site-nav { gap: var(--space-4); }
  .scope-grid { column-count: 1; }
}
