:root {
  --ink: #102033;
  --muted: #5b6778;
  --line: #dbe4ef;
  --soft: #f6f8fb;
  --paper: #ffffff;
  --navy: #0b2544;
  --blue: #145a8d;
  --red: #c8102e;
  --teal: #0b766e;
  --gold: #b7791f;
  --shadow: 0 18px 42px rgba(11, 37, 68, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fd 0%, #ffffff 46%, #f3f6fb 100%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

[dir="rtl"] body,
body[dir="rtl"] {
  font-family: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", Arial, sans-serif;
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 50;
}

.skip-link:focus { top: 12px; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topline {
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 18px;
  text-align: center;
}

.header {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.wrap {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  color: var(--navy);
  min-width: 0;
}

.brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.brand span {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.nav a {
  color: #233247;
}

.nav a:hover,
.nav a.active {
  background: #edf3fb;
  border-color: #d7e2f1;
  color: var(--navy);
}

.btn {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 22px rgba(11, 37, 68, .16);
}

.btn:hover { transform: translateY(-1px); }

.btn.red { background: var(--red); }
.btn.teal { background: var(--teal); }
.btn.light {
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
  box-shadow: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11, 37, 68, .96), rgba(20, 90, 141, .92)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 92px);
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 8px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--teal), #2f80ed);
}

.hero-inner {
  position: relative;
  padding: 70px 0 58px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (min-width: 920px) {
  .hero-inner {
    grid-template-columns: 1.2fr .8fr;
    align-items: end;
  }
}

.eyebrow {
  color: #ffd88d;
  font-weight: 900;
  margin-bottom: 10px;
}

h1 {
  font-size: 52px;
  line-height: 1.05;
  margin: 0;
}

@media (max-width: 720px) {
  h1 { font-size: 34px; }
}

.hero p {
  max-width: 760px;
  color: #e7f0fb;
  font-size: 18px;
  margin: 16px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.signal-board {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 18px;
}

.signal-board h2 {
  font-size: 18px;
  margin: 0 0 12px;
  color: #fff;
}

.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.signal {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.08);
}

.signal strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.signal span {
  display: block;
  color: #d7e7f8;
  font-size: 13px;
  margin-top: 4px;
}

.ticker {
  background: #0a1f39;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  padding: 10px 0;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}

.ticker-label {
  flex: 0 0 auto;
  background: var(--red);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 13px;
}

.ticker-track {
  flex: 1;
  position: relative;
  min-height: 48px;
  overflow: hidden;
}

.ticker-move {
  position: relative;
  min-height: 48px;
}

.ticker a {
  --tone: #145a8d;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 800;
  white-space: normal;
  opacity: 0;
  transform: translateY(14px);
  border: 1px solid rgba(255,255,255,.16);
  border-inline-start-color: var(--tone);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  animation: ticker-swap calc(var(--count) * 7.5s) ease-in-out infinite;
  animation-delay: calc(var(--i) * 7.5s);
}

.ticker a:nth-child(3n + 1) { --tone: var(--red); }
.ticker a:nth-child(3n + 2) { --tone: var(--teal); }
.ticker a:nth-child(3n + 3) { --tone: var(--gold); }

.ticker:hover a { animation-play-state: paused; }

.ticker a::before {
  content: "";
  display: inline-block;
  width: 4px;
  align-self: stretch;
  background: var(--tone);
  border-radius: 4px;
  margin-inline-end: 12px;
}

@keyframes ticker-swap {
  0% { opacity: 0; transform: translateY(14px); }
  7% { opacity: 1; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(0); }
  38% { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 0; transform: translateY(-14px); }
}

.section {
  padding: 58px 0;
}

.section.tight { padding-top: 36px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 30px;
  line-height: 1.15;
  margin: 0;
  color: var(--navy);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.event-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 860px) {
  .event-grid { grid-template-columns: repeat(3, 1fr); }
}

.event-card {
  position: relative;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.event-card::before {
  content: "";
  display: block;
  height: 7px;
  background: var(--blue);
}

.event-card.red::before { background: var(--red); }
.event-card.teal::before { background: var(--teal); }
.event-card.gold::before { background: var(--gold); }

.event-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  border-inline-start: 3px solid #8ca3bd;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.pill.upcoming {
  background: transparent;
  border-color: var(--teal);
  color: #085d55;
}

.pill.past {
  background: transparent;
  border-color: var(--red);
  color: #8a0f24;
}

.event-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.16;
  color: var(--navy);
  overflow-wrap: break-word;
}

.event-card .type {
  color: var(--gold);
  font-weight: 800;
  margin: 10px 0 0;
}

.event-card .summary {
  color: var(--muted);
  margin: 14px 0 0;
  overflow-wrap: break-word;
}

.event-facts {
  display: grid;
  gap: 8px;
  margin: 18px 0 20px;
  padding: 0;
  list-style: none;
}

.event-facts li {
  border-top: 1px solid #edf1f6;
  padding-top: 8px;
  color: #35445a;
  font-weight: 750;
}

.event-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.feature-band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pathway-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 760px) {
  .pathway-grid { grid-template-columns: repeat(3, 1fr); }
}

.pathway {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.pathway strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.pathway p {
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: break-word;
}

.footer {
  margin-top: auto;
  background: var(--navy);
  color: #e8f1fb;
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.footer a {
  color: #fff;
  font-weight: 800;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-body {
  background: #f3f6fb;
}

.admin-main {
  padding: 36px 0 70px;
}

.admin-panel,
.login-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-panel {
  width: min(460px, calc(100% - 36px));
  margin: 54px auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 980px) {
  .admin-grid { grid-template-columns: .72fr 1.28fr; }
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.stat-box strong {
  display: block;
  font-size: 26px;
  color: var(--navy);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 820px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: .5fr 1fr 1fr; }
}

label {
  display: block;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 5px;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.news-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fbfdff;
}

.inline-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.message {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #e7f7f4;
  border: 1px solid #bfe7df;
  color: #085d55;
  font-weight: 800;
}

.danger-note {
  color: #8a0f24;
  font-size: 13px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker a {
    animation: none;
    opacity: 0;
    transform: none;
  }
  .ticker a:first-child { opacity: 1; }
}

@media (max-width: 680px) {
  .wrap { width: min(100% - 24px, 1180px); }
  .topline { font-size: 13px; line-height: 1.5; }
  .header { position: static; }
  .header-inner { align-items: stretch; flex-direction: column; gap: 12px; padding: 12px 0; }
  .brand img { width: 62px; height: 62px; }
  .brand span { font-size: 17px; }
  .brand small { font-size: 11px; }
  .nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    width: 100%;
  }
  .nav a { min-height: 40px; padding: 9px 10px; }
  .hero-inner { padding: 46px 0 44px; }
  h1 { font-size: 30px; line-height: 1.14; }
  .hero p { font-size: 16px; }
  .hero-actions .btn { flex: 1 1 180px; }
  .ticker-inner { align-items: stretch; flex-direction: column; gap: 8px; padding: 4px 0; }
  .ticker-label { align-self: flex-start; }
  .ticker-track { min-height: 76px; }
  .ticker a { align-items: flex-start; line-height: 1.55; padding: 10px 12px; }
  .section-head { display: block; }
  .signal-grid { grid-template-columns: 1fr; }
  .event-card { min-height: auto; }
  .event-card-body { padding: 18px; }
  .event-card h3 { font-size: 21px; }
  .event-card .btn { width: 100%; }
  .section { padding: 42px 0; }
}
