/* =============================================================================
   BASE.CSS — CSS Custom Properties, Reset, Typography
   Ilahia Polytechnic College
============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700;800&display=swap');

/* ── Custom Properties ─────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --color-primary:        #1565C0;
  --color-primary-dark:   #0D47A1;
  --color-primary-light:  #1976D2;
  --color-accent:         #42A5F5;
  --color-accent-dark:    #1E88E5;
  --color-accent-light:   #90CAF9;

  --color-white:          #ffffff;
  --color-off-white:      #f8f9fa;
  --color-light-grey:     #e9ecef;
  --color-mid-grey:       #ced4da;
  --color-text:           #212529;
  --color-text-muted:     #6c757d;
  --color-text-light:     #adb5bd;

  --color-success:        #28a745;
  --color-error:          #dc3545;
  --color-warning:        #ffc107;

  --color-overlay:        rgba(13, 71, 161, 0.82);
  --color-card-shadow:    rgba(0, 0, 0, 0.08);
  --color-card-shadow-hover: rgba(0, 0, 0, 0.16);

  /* Typography */
  --font-body:            'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:         'Playfair Display', Georgia, serif;

  --fs-xs:    0.75rem;    /* 12px */
  --fs-sm:    0.875rem;   /* 14px */
  --fs-base:  1rem;       /* 16px */
  --fs-md:    1.125rem;   /* 18px */
  --fs-lg:    1.25rem;    /* 20px */
  --fs-xl:    1.5rem;     /* 24px */
  --fs-2xl:   1.875rem;   /* 30px */
  --fs-3xl:   2.25rem;    /* 36px */
  --fs-4xl:   3rem;       /* 48px */
  --fs-5xl:   3.75rem;    /* 60px */

  --fw-light:   300;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-extrabold:800;

  --lh-tight:   1.2;
  --lh-snug:    1.4;
  --lh-normal:  1.6;
  --lh-relaxed: 1.8;

  /* Spacing (8px grid) */
  --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 */

  /* Border Radius */
  --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(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.3s ease;
  --transition-slow:   0.5s ease;

  /* Layout */
  --container-max:  1200px;
  --container-wide: 1400px;
  --header-height:  72px;

  /* Z-index scale */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-overlay:  100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  color: var(--color-primary-dark);
}

h1 { font-size: var(--fs-4xl); font-weight: var(--fw-bold); }
h2 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); }
h3 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-xl);  font-weight: var(--fw-semibold); }
h5 { font-size: var(--fs-lg);  font-weight: var(--fw-medium); }
h6 { font-size: var(--fs-md);  font-weight: var(--fw-medium); }

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

strong { font-weight: var(--fw-semibold); }
em     { font-style: italic; }

/* ── Accessibility ──────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.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;
}

/* Skip to main content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  font-weight: var(--fw-medium);
}

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

/* ── Utility Classes ────────────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-white); }

.fw-medium   { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

.font-heading { font-family: var(--font-heading); }

.d-none   { display: none; }
.d-block  { display: block; }
.d-flex   { display: flex; }
.d-grid   { display: grid; }

.w-full   { width: 100%; }
.h-full   { height: 100%; }

.mt-auto  { margin-top: auto; }
.mb-auto  { margin-bottom: auto; }
.mx-auto  { margin-left: auto; margin-right: auto; }

.relative { position: relative; }
.absolute { position: absolute; }

.overflow-hidden { overflow: hidden; }
