/*
 * Amwag Samra Theme — assets/css/base.css
 *
 * Design System Foundation:
 * - CSS Custom Properties (Design Tokens).
 * - Font Face Declarations.
 * - CSS Reset.
 * - Base Typography.
 * - RTL Support via Logical Properties.
 *
 * @package AmwagSamra
 * @version 1.0.0
 */

/* ============================================================
   FONT FACE — IBM Plex Sans Arabic (Self-Hosted)
   ============================================================ */

@font-face {
	font-family: "IBM Plex Sans Arabic";
	src: url("../fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "IBM Plex Sans Arabic";
	src: url("../fonts/IBMPlexSansArabic-Medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "IBM Plex Sans Arabic";
	src: url("../fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "IBM Plex Sans Arabic";
	src: url("../fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ============================================================
   CSS CUSTOM PROPERTIES — Design Tokens
   ============================================================ */

:root {
	/* ── Colors ── */
	--color-ink:          #101820;
	--color-navy:         #0B1F33;
	--color-gold:         #D5B16F;
	--color-gold-dark:    #B98A3B;
	--color-ivory:        #F7F4EE;
	--color-surface:      #F1EFEA;
	--color-muted:        #667085;
	--color-white:        #FFFFFF;
	--color-success:      #19734A;
	--color-error:        #B42318;
	--color-border:       rgba(16, 24, 32, 0.12);
	--color-border-light: rgba(16, 24, 32, 0.06);

	/* ── Gold Variants ── */
	--color-gold-10:  rgba(213, 177, 111, 0.10);
	--color-gold-20:  rgba(213, 177, 111, 0.20);
	--color-gold-30:  rgba(213, 177, 111, 0.30);
	--color-gold-50:  rgba(213, 177, 111, 0.50);
	--color-gold-light: #F4E7CE;
	--color-gold-champagne: #EEDBBE;

	/* ── Luxury Gradients ── */
	--gradient-gold:          linear-gradient(135deg, #dfc185 0%, #d5b16f 50%, #b88b39 100%);
	--gradient-gold-hover:    linear-gradient(135deg, #ebd49f 0%, #dfc185 50%, #c49948 100%);
	--gradient-gold-subtle:   linear-gradient(135deg, rgba(223, 193, 133, 0.12) 0%, rgba(213, 177, 111, 0.04) 100%);
	--gradient-navy-mesh:     radial-gradient(circle at 15% 25%, rgba(19, 44, 70, 0.98) 0%, #071524 60%, #030a12 100%);
	--gradient-dark-card:     linear-gradient(145deg, #0f2438 0%, #081624 100%);
	--gradient-shimmer:       linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
	--gradient-border-gold:   linear-gradient(135deg, rgba(213, 177, 111, 0.6) 0%, rgba(213, 177, 111, 0.1) 100%);

	/* ── Glassmorphism ── */
	--glass-bg:               rgba(255, 255, 255, 0.85);
	--glass-bg-dark:          rgba(11, 31, 51, 0.75);
	--glass-border:           rgba(255, 255, 255, 0.2);
	--glass-border-gold:      rgba(213, 177, 111, 0.25);
	--glass-blur:             blur(16px);
	--glass-blur-lg:          blur(24px);

	/* ── Backward Compatible Aliases ── */
	--color-primary:         var(--color-navy);
	--color-primary-dark:    #071524;
	--color-primary-light:   #16375a;
	--color-text:            var(--color-ink);
	--color-text-muted:      var(--color-muted);
	--color-surface-alt:     #f8fafc;
	--color-gold-darker:     #9a6d1a;
	--gold-gradient:         var(--gradient-gold);
	--ams-color-ink:         var(--color-ink);
	--ams-color-navy:        var(--color-navy);
	--ams-color-gold:        var(--color-gold);
	--ams-color-gold-dark:   var(--color-gold-dark);
	--ams-color-surface:     var(--color-surface);
	--ams-color-surface-alt: #f8fafc;
	--ams-color-border:      var(--color-border);
	--ams-color-muted:       var(--color-muted);
	--ams-color-white:       var(--color-white);

	/* ── Typography ── */
	--font-primary: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
	--font-size-xs:   0.75rem;   /* 12px */
	--font-size-sm:   0.875rem;  /* 14px */
	--font-size-base: 1rem;      /* 16px */
	--font-size-md:   1.125rem;  /* 18px */
	--font-size-lg:   1.25rem;   /* 20px */
	--font-size-xl:   1.5rem;    /* 24px */
	--font-size-2xl:  1.875rem;  /* 30px */
	--font-size-3xl:  2.25rem;   /* 36px */
	--font-size-4xl:  3rem;      /* 48px */

	--font-size-h1: clamp(1.875rem, 4.5vw + 0.5rem, 3rem);
	--font-size-h2: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
	--font-size-h3: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
	--font-size-h4: clamp(1.125rem, 1.5vw + 0.25rem, 1.375rem);

	--line-height-tight:   1.2;
	--line-height-snug:    1.4;
	--line-height-normal:  1.6;
	--line-height-relaxed: 1.75;
	--line-height-loose:   1.9;

	--font-weight-normal:   400;
	--font-weight-medium:   500;
	--font-weight-semibold: 600;
	--font-weight-bold:     700;

	/* ── Spacing ── */
	--space-1:   0.25rem;  /* 4px */
	--space-2:   0.5rem;   /* 8px */
	--space-3:   0.75rem;  /* 12px */
	--space-4:   1rem;     /* 16px */
	--space-5:   1.25rem;  /* 20px */
	--space-6:   1.5rem;   /* 24px */
	--space-8:   2rem;     /* 32px */
	--space-10:  2.5rem;   /* 40px */
	--space-12:  3rem;     /* 48px */
	--space-16:  4rem;     /* 64px */
	--space-20:  5rem;     /* 80px */
	--space-24:  6rem;     /* 96px */
	--space-32:  8rem;     /* 128px */

	/* Section Spacing. */
	--section-spacing:    clamp(3rem, 8vw, 6rem);
	--section-spacing-sm: clamp(2rem, 5vw, 4rem);

	/* ── Layout — 90% Width for All Sections ── */
	--container-max:     90%;
	--container-article: min(90%, 860px);
	--container-narrow:  min(90%, 760px);
	--container-padding: clamp(0.75rem, 2vw, 1.75rem);

	--grid-columns: 12;
	--grid-gap:     clamp(1rem, 2vw, 1.5rem);

	/* ── Header ── */
	--header-height:        4.5rem;    /* 72px */
	--header-height-mobile: 3.75rem;  /* 60px */
	--top-bar-height:       2.5rem;   /* 40px */

	/* ── Border ── */
	--radius-sm:   4px;
	--radius-md:   8px;
	--radius-lg:   12px;
	--radius-xl:   16px;
	--radius-2xl:  24px;
	--radius-full: 9999px;

	/* ── Shadows ── */
	--shadow-sm:  0 1px 3px rgba(16, 24, 32, 0.08);
	--shadow-md:  0 4px 12px rgba(16, 24, 32, 0.10);
	--shadow-lg:  0 8px 24px rgba(16, 24, 32, 0.12);
	--shadow-xl:  0 16px 48px rgba(16, 24, 32, 0.14);
	--shadow-gold: 0 4px 16px rgba(213, 177, 111, 0.25);
	--shadow-luxury-card:  0 10px 30px -10px rgba(11, 31, 51, 0.08), 0 0 1px 1px rgba(16, 24, 32, 0.05);
	--shadow-luxury-hover: 0 22px 45px -12px rgba(11, 31, 51, 0.16), 0 0 1px 1px rgba(213, 177, 111, 0.35);
	--shadow-luxury-float: 0 30px 60px -15px rgba(11, 31, 51, 0.25), 0 0 0 1px rgba(213, 177, 111, 0.25);
	--shadow-glow-gold:    0 0 25px rgba(213, 177, 111, 0.35);
	--shadow-glow-emerald: 0 0 25px rgba(37, 211, 102, 0.4);

	/* ── Transitions ── */
	--transition-fast:   150ms ease;
	--transition-base:   250ms ease;
	--transition-slow:   400ms ease;
	--transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

	/* ── Z-index ── */
	--z-sticky-bar: 100;
	--z-drawer:     200;
	--z-header:     150;
	--z-overlay:    190;
	--z-modal:      300;
	--z-toast:      400;

	/* ── Sticky Bar ── */
	--sticky-bar-height: 3.5rem;

	/* ── Compatibility Aliases (--ams-*) ── */
	--ams-color-primary:     var(--color-navy);
	--ams-color-secondary:   var(--color-gold);
	--ams-color-text-main:   var(--color-ink);
	--ams-color-text-muted:  var(--color-muted);
	--ams-color-bg:          var(--color-ivory);
	--ams-color-surface:     var(--color-surface);
	--ams-space-1:           var(--space-1);
	--ams-space-2:           var(--space-2);
	--ams-space-3:           var(--space-3);
	--ams-space-4:           var(--space-4);
	--ams-space-5:           var(--space-5);
	--ams-space-6:           var(--space-6);
	--ams-space-8:           var(--space-8);
	--ams-radius-sm:         var(--radius-sm);
	--ams-radius-md:         var(--radius-md);
	--ams-radius-lg:         var(--radius-lg);
	--ams-radius-xl:         var(--radius-xl);
	--ams-radius-full:       var(--radius-full);
	--ams-text-xs:           var(--font-size-xs);
	--ams-text-sm:           var(--font-size-sm);
	--ams-text-base:         var(--font-size-base);
	--ams-text-lg:           var(--font-size-lg);
	--ams-text-xl:           var(--font-size-xl);
	--ams-leading-relaxed:   var(--line-height-relaxed);
	--ams-font-weight-medium: var(--font-weight-medium);
}

/* ============================================================
   CSS RESET
   ============================================================ */

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

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	font-family: var(--font-primary);
	font-size: var(--font-size-md);
	line-height: var(--line-height-relaxed);
	color: var(--color-ink);
	background-color: var(--color-ivory);
	direction: rtl;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* ── Padding Bottom للـ Sticky Bar على الجوال ── */
@media (max-width: 767px) {
	body {
		padding-bottom: calc(var(--sticky-bar-height) + env(safe-area-inset-bottom, 0px));
	}
}

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

svg:not(.ams-icon) {
	max-width: 100%;
	height: auto;
	display: block;
}

.ams-icon {
	width: 1.25rem;
	height: 1.25rem;
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
	fill: currentColor;
}


a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

ul,
ol {
	list-style: none;
}

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

input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--color-ink);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
	line-height: var(--line-height-relaxed);
}

p + p {
	margin-top: var(--space-4);
}

address {
	font-style: normal;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Skip Link */
.ams-skip-link {
	position: absolute;
	inset-inline-start: -9999px;
	top: var(--space-4);
	z-index: 9999;
	background: var(--color-gold);
	color: var(--color-ink);
	padding: var(--space-2) var(--space-6);
	border-radius: var(--radius-md);
	font-weight: var(--font-weight-semibold);
	text-decoration: none;
}

.ams-skip-link:focus {
	inset-inline-start: var(--space-4);
	outline: 2px solid var(--color-gold-dark);
	outline-offset: 2px;
}

/* Screen Reader Only */
.ams-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Focus Visible */
:focus-visible {
	outline: 2px solid var(--color-gold);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* ============================================================
   SELECTION
   ============================================================ */

::selection {
	background: var(--color-gold-20);
	color: var(--color-ink);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
	background: var(--color-gold-50);
	border-radius: var(--radius-full);
}

/* ============================================================
   LUXURY KEYFRAMES & MICRO-INTERACTIONS
   ============================================================ */

/* ── Light Shimmer Sweep ── */
@keyframes amsShimmer {
	0% {
		transform: translateX(-150%) skewX(-20deg);
	}
	100% {
		transform: translateX(250%) skewX(-20deg);
	}
}

/* ── Ambient Floating Glow ── */
@keyframes amsFloatGlow {
	0%, 100% {
		transform: translate(0, 0) scale(1);
		opacity: 0.45;
	}
	50% {
		transform: translate(25px, -30px) scale(1.15);
		opacity: 0.75;
	}
}

/* ── Gentle Float ── */
@keyframes amsGentleFloat {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-8px);
	}
}

/* ── Luxury Radar Wave Pulse ── */
@keyframes amsRadarPulse {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(213, 177, 111, 0.55);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 14px rgba(213, 177, 111, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(213, 177, 111, 0);
	}
}

@keyframes amsWhatsAppPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
	}
	70% {
		box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

/* ── Metallic Text Sheen ── */
@keyframes amsTextSheen {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS (Pure CSS + Vanilla JS)
   ============================================================ */

.ams-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
	            transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
}

.ams-reveal.ams-revealed {
	opacity: 1;
	transform: translateY(0);
}

.ams-reveal--zoom {
	opacity: 0;
	transform: scale(0.92) translateY(15px);
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
	            transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ams-reveal--zoom.ams-revealed {
	opacity: 1;
	transform: scale(1) translateY(0);
}

.ams-reveal--fade {
	opacity: 0;
	transform: none;
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ams-reveal--fade.ams-revealed {
	opacity: 1;
}

/* Stagger Delays */
.ams-delay-1 { transition-delay: 75ms; }
.ams-delay-2 { transition-delay: 150ms; }
.ams-delay-3 { transition-delay: 225ms; }
.ams-delay-4 { transition-delay: 300ms; }
.ams-delay-5 { transition-delay: 375ms; }
.ams-delay-6 { transition-delay: 450ms; }

/* ============================================================
   ACCESSIBILITY: PREFERS REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.ams-reveal,
	.ams-reveal--zoom,
	.ams-reveal--fade {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
