/* =============================================================================
   Flow Status: the parents' page.
   Tokens are the school site's own (remake.sis.edu.sa resources/site/css/site/tokens.css):
   navy grounds, brand blue, gold, DIN Next Arabic / Mulish. Calm on purpose:
   there is no red anywhere, and nothing flashes.
   ========================================================================== */

@font-face { font-family: "DINNext"; src: url("/assets/fonts/DINNextLTArabic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DINNext"; src: url("/assets/fonts/DINNextLTArabic-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DINNext"; src: url("/assets/fonts/DINNextLTArabic-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Mulish"; src: url("/assets/fonts/Mulish-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mulish"; src: url("/assets/fonts/Mulish-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --brand: #2a5d91;
  --brand-soft: #3c70a3;
  --brand-tint: #c6e6fd;
  --gold: #e0b65d;
  --gold-soft: #f7ecd2;
  --navy: #0f2a45;
  --navy-deep: #0b2238;
  --surface: #eef8ff;
  --paper: #ffffff;
  --ground: #f4f8fc;
  --ink: #262b32;
  --heading: #343f52;
  --body: #60697b;
  --muted: #7d8696;
  --line: #e4e9f0;
  --success: #45c4a0;
  --success-ink: #2b7f68;
  --success-surface: #edf9f6;
  --shadow: 0 0 0 1px rgb(8 60 130 / 0.06), 0 5px 35px 0 rgb(30 34 40 / 0.07);
  --radius: 16px;
  --font-ar: "DINNext", "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Mulish", "DINNext", system-ui, -apple-system, "Segoe UI", sans-serif;

  --accent: var(--brand-soft);
  --accent-ink: var(--brand);
  --accent-surface: var(--surface);
}

body[data-state="normal"],
body[data-state="resolved"] {
  --accent: var(--success);
  --accent-ink: var(--success-ink);
  --accent-surface: var(--success-surface);
}

body[data-state="active"] {
  --accent: var(--brand);
  --accent-ink: var(--brand);
  --accent-surface: var(--surface);
}

body[data-state="offline"] {
  --accent: #98a1b0;
  --accent-ink: #586273;
  --accent-surface: #f1f3f6;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ar);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--body);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { font-family: var(--font-en); }

main { flex: 1 0 auto; }

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

a { color: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */

.top { background: var(--navy); }

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding-block: 10px;
}

.top__logo { flex: 0 1 auto; min-width: 0; }
.top__logo img { height: 50px; width: auto; }

.top__side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.top__label { color: #c9d6e6; font-size: 14px; font-weight: 500; }

.lang {
  appearance: none;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lang:hover { border-color: var(--gold); color: var(--gold); }
.lang[lang="en"] { font-family: var(--font-en); }
.lang[lang="ar"] { font-family: var(--font-ar); }

/* ── Status card ──────────────────────────────────────────────────────── */

.hero {
  padding-top: 28px;
  background:
    radial-gradient(520px 170px at 50% 0, rgb(60 112 163 / 0.5), transparent 75%) no-repeat,
    linear-gradient(var(--navy) 0 150px, transparent 150px) no-repeat;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.status {
  position: relative;
  padding: 40px 32px 32px;
  text-align: center;
  border-top: 4px solid var(--accent);
  transition: border-color 0.6s;
}

.status.is-new { animation: glow 1.8s ease-out; }

@keyframes glow {
  from { box-shadow: 0 0 0 6px rgb(224 182 93 / 0.45), var(--shadow); }
  to { box-shadow: 0 0 0 0 rgb(224 182 93 / 0), var(--shadow); }
}

.status__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-surface);
  color: var(--accent-ink);
  transition: background-color 0.6s, color 0.6s;
}

.status__icon .icon { display: none; width: 52px; height: 52px; }
body[data-state="loading"] .icon-normal,
body[data-state="normal"] .icon-normal,
body[data-state="active"] .icon-active,
body[data-state="resolved"] .icon-resolved,
body[data-state="offline"] .icon-offline { display: block; }
body[data-state="loading"] .status__icon { opacity: 0.55; }

/* A slow, soft halo while an event is in progress: "we are on it", not an alarm. */
body[data-state="active"] .status__icon::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.15; }
  50% { transform: scale(1.04); opacity: 0.6; }
}

.status__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--accent-surface);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.status__title {
  margin: 14px 0 8px;
  color: var(--heading);
  font-size: clamp(26px, 5.2vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  text-wrap: balance;
}

.status__lead {
  max-width: 600px;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(17px, 2.6vw, 20px);
  line-height: 1.85;
  white-space: pre-line;
  text-wrap: pretty;
}
.status__lead:empty { display: none; }

.drill {
  display: inline-block;
  margin: 18px auto 0;
  padding: 6px 16px;
  border: 1px solid #f1ddb2;
  border-radius: 8px;
  background: #fff8ee;
  color: #85662c;
  font-size: 15px;
  font-weight: 500;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  margin: 28px 0 0;
  padding: 22px 4px 0;
  border-top: 1px solid var(--line);
  text-align: start;
}

.fact { margin: 0; min-width: 0; }
.fact dt { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
.fact dd { margin: 0; color: var(--heading); font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.fact__sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

/* ── Updates ──────────────────────────────────────────────────────────── */

.section { margin-top: 30px; }

.section__title {
  margin: 0 0 14px;
  color: var(--heading);
  font-size: 20px;
  font-weight: 700;
}

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }

.timeline li { position: relative; padding-inline-start: 34px; padding-bottom: 16px; }

.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: 9px;
  top: 14px;
  bottom: -14px;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child::before { display: none; }

.timeline li::after {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 12px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--brand-tint);
  border-radius: 50%;
  background: var(--paper);
}
.timeline li.is-latest::after { border-color: var(--accent); }
.timeline li.kind-close::after { border-color: var(--success); background: var(--success-surface); }

.tl__card {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tl__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.tl__time { color: var(--heading); font-size: 14px; font-weight: 700; }

.tl__chip {
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-surface);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
}
.kind-close .tl__chip { background: var(--success-surface); color: var(--success-ink); }

.tl__text { margin: 0; color: var(--ink); font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }

/* ── Guidance ─────────────────────────────────────────────────────────── */

.guidance { padding: 24px 26px 22px; border-inline-start: 4px solid var(--gold); }

.guidance__title { margin: 0 0 12px; color: var(--heading); font-size: 18px; font-weight: 700; }

.guidance__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.guidance__list li { position: relative; padding-inline-start: 30px; color: var(--body); }

.guidance__list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a37a26' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.3 2.6 2.6L12 5.4'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.foot {
  margin-top: 44px;
  padding: 26px 0 calc(26px + env(safe-area-inset-bottom));
  background: var(--navy-deep);
  color: #c9d6e6;
  font-size: 14px;
}

.foot__inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

.foot__school { margin: 0; color: #fff; font-weight: 700; font-size: 15px; }

.foot__live { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.foot__contact { margin: 0; }
.foot a { color: #e3ebf4; text-decoration: none; }
.foot a:hover { color: var(--gold); }

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2.4s infinite;
}
body.is-retrying .pulse { background: var(--gold); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(69 196 160 / 0.55); }
  70% { box-shadow: 0 0 0 8px rgb(69 196 160 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(69 196 160 / 0); }
}

.noscript { margin: 16px; padding: 16px; border-radius: 12px; background: #fff; text-align: center; }

/* ── Small screens ────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .top__inner { min-height: 64px; }
  .top__logo img { height: 40px; }
  .top__label { display: none; }
  .hero { padding-top: 18px; background:
    radial-gradient(360px 140px at 50% 0, rgb(60 112 163 / 0.5), transparent 75%) no-repeat,
    linear-gradient(var(--navy) 0 120px, transparent 120px) no-repeat; }
  .status { padding: 30px 20px 24px; }
  .status__icon { width: 84px; height: 84px; }
  .status__icon .icon { width: 46px; height: 46px; }
  .facts { grid-template-columns: 1fr; gap: 12px; }
  .guidance { padding: 20px; }
}

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