/* =========================================================
   main.css
   سايتوتك في الإمارات الاستشاري
   القاعدة العامة: Reset، متغيرات الألوان، الطباعة، التخطيط الأساسي
   Mobile First — كل القواعد هنا مخصصة للهاتف أولًا
   ========================================================= */

/* ---------- Reset أساسي ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -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.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- متغيرات العلامة البصرية ---------- */
:root {
  --primary-blue: #04457c;
  --secondary-blue: #08669b;
  --medical-teal: #0987a7;
  --fresh-teal: #1fb19c;
  --leaf-green: #84c366;
  --light-background: #f5fafb;
  --border-color: #d2e4ea;
  --main-text: #1f2937;
  --muted-text: #64748b;
  --white: #ffffff;

  --danger-red: #c0392b;
  --danger-bg: #fdf1ef;
  --warning-bg: #fff7e6;
  --warning-border: #f0c987;

  --font-main: "Tajawal", "Cairo", Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 8px rgba(4, 69, 124, 0.06);
  --shadow-md: 0 8px 24px rgba(4, 69, 124, 0.09);

  --container-width: 1180px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
}

/* ---------- الطباعة العامة ---------- */
html,
body {
  font-family: var(--font-main);
  color: var(--main-text);
  background-color: var(--light-background);
  font-size: 16px;
  line-height: 1.75;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  direction: rtl;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary-blue);
}

h1 {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin-bottom: var(--space-3);
}

h2 {
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  margin-bottom: var(--space-2);
}

h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-1);
  color: var(--secondary-blue);
}

p {
  margin-bottom: var(--space-2);
  color: var(--main-text);
}

strong {
  color: var(--primary-blue);
}

.text-muted {
  color: var(--muted-text);
}

/* ---------- التخطيط العام ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-2);
}

main {
  display: block;
}

section {
  padding-block: var(--space-5);
}

.section-title-group {
  max-width: 760px;
  margin-bottom: var(--space-4);
}

.section-label {
  display: inline-block;
  color: var(--fresh-teal);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

.section-intro {
  color: var(--muted-text);
  font-size: 1.02rem;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  right: -9999px;
  top: 0;
  background: var(--primary-blue);
  color: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  z-index: 999;
  font-weight: 700;
}

.skip-link:focus {
  right: var(--space-2);
  top: var(--space-2);
}

/* ---------- حالات التركيز (Accessibility) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--fresh-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- عناصر مساعدة عامة ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

/* ---------- الجداول ---------- */
.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  width: 100%;
  min-width: 0;
}

@media (min-width: 701px) {
  .table-wrapper table {
    min-width: 480px;
  }
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.85rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.table-wrapper thead th {
  background-color: var(--primary-blue);
  color: var(--white);
  font-weight: 700;
}

.table-wrapper tbody tr:nth-child(even) {
  background-color: var(--light-background);
}

/* ---------- خط أفقي فاصل ---------- */
hr.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin-block: var(--space-4);
}
