/* =========================================================
   نادي الكويت الرياضي — التنسيقات الرئيسية
   ========================================================= */

:root {
  --blue-900: #072B63;
  --blue-800: #0A3577;
  --blue-700: #0B3E8F;
  --blue-500: #1D66D6;
  --red: #D42B2B;
  --red-dark: #A81F1F;
  --gold: #C9A227;
  --paper: #F2F4F8;
  --line: #DDE3ED;
  --ink: #10161F;
  --muted: #5A6675;
  --white: #FFFFFF;

  --wrap: 1200px;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(7, 43, 99, .10);
  --font-head: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Almarai", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--blue-500); }

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.35;
  margin: 0 0 .6rem;
  font-weight: 800;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  background: var(--blue-900);
  color: #C3D2EA;
  font-size: 13px;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 40px;
}
.topbar a { color: #C3D2EA; }
.topbar a:hover { color: var(--white); }
.social { display: flex; gap: 14px; align-items: center; }
.social svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- الرأس ---------- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--blue-700);
  border-image: linear-gradient(to left, var(--blue-700) 55%, var(--red) 55%) 1;
  position: sticky; top: 0; z-index: 60;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand-text strong {
  display: block; font-family: var(--font-head); font-weight: 800;
  font-size: 19px; color: var(--blue-900); line-height: 1.2;
}
.brand-text span { font-size: 12.5px; color: var(--muted); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  font-family: var(--font-head); font-weight: 700; font-size: 15.5px;
  color: var(--blue-900); padding: 10px 13px; border-radius: 8px;
}
.nav a:hover { background: var(--paper); }
.nav a.active { color: var(--blue-700); box-shadow: inset 0 -3px 0 var(--gold); border-radius: 8px 8px 0 0; }

.nav-toggle {
  display: none; background: var(--blue-700); color: #fff; border: 0;
  width: 44px; height: 40px; border-radius: 8px; font-size: 20px; cursor: pointer;
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-block; font-family: var(--font-head); font-weight: 700;
  background: var(--blue-700); color: #fff; padding: 11px 22px;
  border-radius: 8px; border: 0; cursor: pointer; font-size: 15px;
  transition: background .18s ease;
}
.btn:hover { background: var(--blue-500); color: #fff; }
.btn-gold { background: var(--red); color: #fff; }
.btn-gold:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }

/* ---------- الواجهة (سلايدر) ---------- */
.hero { position: relative; background: var(--blue-900); overflow: hidden; }
.slides { position: relative; height: 520px; }
.slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease;
  background-size: cover; background-position: center;
}
.slide.on { opacity: 1; }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to left, rgba(7,43,99,.92) 0%, rgba(7,43,99,.80) 32%, rgba(7,43,99,.40) 68%, rgba(7,43,99,.15) 100%);
}
.slide-body {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center;
}
.slide-body .wrap { width: 100%; }
.slide-tag {
  display: inline-block; background: var(--gold); color: #241B00;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  padding: 5px 14px; border-radius: 4px; margin-bottom: 14px;
}
.slide-text h2 {
  color: #fff; font-size: clamp(28px, 4.8vw, 52px);
  max-width: 720px; margin-bottom: 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,.55), 0 4px 24px rgba(7,43,99,.75);
}
.slide-text p {
  color: #DCE7F7; max-width: 560px; font-size: 17px; margin: 0 0 22px;
  text-shadow: 0 1px 5px rgba(0,0,0,.6), 0 3px 16px rgba(7,43,99,.7);
}

.slide-dots {
  position: absolute; bottom: 22px; inset-inline-start: 0; width: 100%;
  z-index: 3; display: flex; gap: 9px; justify-content: center;
}
.slide-dots button {
  width: 34px; height: 5px; border: 0; border-radius: 3px;
  background: rgba(255,255,255,.35); cursor: pointer; padding: 0;
}
.slide-dots button[aria-current="true"] { background: var(--gold); }


/* ---------- واجهة الفيديو ---------- */
.hero-video { position: relative; background: var(--blue-900); overflow: hidden; height: 620px; }
.hero-video video, .hero-video .poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
.hero-video .poster { background-size: cover; background-position: center; }
.hero-video video { opacity: 0; transition: opacity .6s ease; }
.hero-video video.shown { opacity: 1; }
.hero-video::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to left, rgba(7,43,99,.88) 0%, rgba(7,43,99,.62) 30%, rgba(7,43,99,.18) 62%, rgba(7,43,99,.05) 100%),
              linear-gradient(to top, rgba(7,43,99,.85) 0%, rgba(7,43,99,0) 45%);
}
.hero-video .hero-inner {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center;
}
.hero-video .wrap { width: 100%; }

/* شريط قطري بألوان النادي */
.hero-stripes {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 46%;
  z-index: 2; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(115deg,
    transparent 0 46px,
    rgba(212,43,43,.16) 46px 60px,
    transparent 60px 106px,
    rgba(29,102,214,.16) 106px 120px);
  mask-image: linear-gradient(to left, #000 10%, transparent 85%);
  -webkit-mask-image: linear-gradient(to left, #000 10%, transparent 85%);
}

/* دخول العناصر بتتابع */
.rise { opacity: 0; transform: translateY(26px); }
.hero-ready .rise { animation: riseIn .75s cubic-bezier(.22,.9,.3,1) forwards; }
.hero-ready .d1 { animation-delay: .15s; }
.hero-ready .d2 { animation-delay: .35s; }
.hero-ready .d3 { animation-delay: .55s; }
.hero-ready .d4 { animation-delay: .75s; }
@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }

.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
  color: #fff; background: rgba(212,43,43,.92);
  padding: 6px 16px; border-radius: 4px; margin-bottom: 16px;
  border-inline-start: 3px solid #fff;
}
.kicker i { font-style: normal; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulseDot 1.6s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

h2.slide-text-h {
  color: #fff; font-size: clamp(30px, 5vw, 56px); max-width: 760px; margin-bottom: 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,.55), 0 4px 26px rgba(7,43,99,.8);
}
p.slide-text-p {
  color: #E4EDFA; max-width: 580px; font-size: 17.5px; margin: 0 0 24px;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}

/* ---------- لوح المباراة القادمة ---------- */
.matchbar { margin-top: -58px; position: relative; z-index: 20; }
.matchcard {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-700));
  border-inline-start: 5px solid var(--red);
  color: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; display: grid;
  grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center;
  border-top: 4px solid var(--gold);
}
.matchcard .team { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.matchcard .team.away { justify-content: flex-start; }
.matchcard .team img { width: 52px; height: 52px; object-fit: contain; }
.matchcard .team b { font-family: var(--font-head); font-size: 18px; }
.match-mid { text-align: center; min-width: 210px; }
.match-mid .comp { font-size: 12.5px; color: #A9C2E8; }
.match-mid .when { font-family: var(--font-head); font-weight: 800; font-size: 17px; }
.countdown { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.countdown div {
  background: rgba(255,255,255,.12); border-radius: 6px; padding: 5px 9px;
  min-width: 52px; text-align: center;
}
.countdown b { display: block; font-family: var(--font-head); font-size: 19px; line-height: 1.1; color: #FFD9D9; }
.countdown span { font-size: 10.5px; color: #B7CBE8; }

/* ---------- الأقسام ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--white); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.section-head h2 { font-size: 27px; color: var(--blue-900); margin: 0; position: relative; padding-inline-start: 14px; }
.section-head h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 6px; bottom: 6px;
  width: 5px; background: var(--gold); border-radius: 3px;
}
.section-head a { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; white-space: nowrap; }

/* ---------- بطاقات الأخبار ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--blue-900); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.card .cat { font-size: 12.5px; color: var(--red); font-family: var(--font-head); font-weight: 700; }
.card h3 { font-size: 18px; margin: 6px 0 8px; }
.card h3 a { color: var(--blue-900); }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.card .meta { margin-top: auto; font-size: 12.5px; color: var(--muted); }

/* ---------- النتائج ---------- */
.result-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 14px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.result-row + .result-row { margin-top: 12px; }
.result-row .t { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-family: var(--font-head); font-weight: 700; }
.result-row .t.away { justify-content: flex-start; }
.result-row .t img { width: 34px; height: 34px; object-fit: contain; }
.score {
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; font-family: var(--font-head); font-weight: 800;
  padding: 7px 16px; border-radius: 7px; font-size: 19px; letter-spacing: 2px; white-space: nowrap;
}
.score.pending { background: var(--paper); color: var(--blue-900); font-size: 14px; letter-spacing: 0; }
.result-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); text-align: center; padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 4px; }

/* ---------- اللاعبون ---------- */
.player {
  background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
  border-radius: var(--radius); overflow: hidden; color: #fff; position: relative;
}
.player .num {
  position: absolute; top: 10px; inset-inline-end: 14px; font-family: var(--font-head);
  font-weight: 800; font-size: 40px; color: rgba(255,255,255,.16); line-height: 1;
}
.player .ph { aspect-ratio: 3/3.4; overflow: hidden; }
.player .ph img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.player .info { padding: 12px 16px 16px; }
.player .info b { font-family: var(--font-head); font-size: 16.5px; display: block; }
.player .info span { font-size: 13px; color: #A9C2E8; }

/* ---------- البطولات ---------- */
.trophy {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; border-top: 4px solid var(--gold);
}
.trophy b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 38px; color: var(--red); line-height: 1.1; }
.trophy strong { display: block; font-family: var(--font-head); font-size: 16px; margin: 4px 0; color: var(--blue-900); }
.trophy span { font-size: 12.5px; color: var(--muted); }

/* ---------- الرعاة ---------- */
.sponsors { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.sponsor {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  min-width: 170px; height: 92px; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; font-family: var(--font-head); color: var(--muted); font-size: 14px;
}
.sponsor img { max-height: 62px; width: auto; object-fit: contain; }

/* ---------- صفحات داخلية ---------- */
.page-head {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff; padding: 42px 0;
}
.page-head h1 { color: #fff; font-size: clamp(24px, 4vw, 38px); margin: 0; }
.page-head p { color: #BDD0EC; margin: 6px 0 0; }
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.article-body { font-size: 16.5px; }
.article-body p { margin: 0 0 1.1em; }

/* ---------- النماذج ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-head); font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; font-family: var(--font-body); font-size: 15px; background: #fff;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.notice {
  padding: 14px 18px; border-radius: 8px; margin-bottom: 20px;
  font-family: var(--font-head); font-weight: 700;
}
.notice.ok { background: #E7F5EC; color: #17603A; border: 1px solid #BFE3CD; }
.notice.err { background: #FCEBEB; color: #8C1D1D; border: 1px solid #F0C6C6; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--blue-900); color: #B9CCE8; padding: 46px 0 0; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 16.5px; margin-bottom: 12px; }
.site-footer a { color: #B9CCE8; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: 14.5px; }
.footer-bottom {
  margin-top: 34px; border-top: 1px solid rgba(255,255,255,.12);
  padding: 16px 0; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.demo-flag {
  background: var(--gold); color: #241B00; text-align: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; padding: 7px 12px;
}

/* ---------- الاستجابة ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; inset-inline-start: 0; width: 100%;
    background: #fff; flex-direction: column; align-items: stretch; gap: 0;
    border-bottom: 3px solid var(--blue-700); padding: 8px 0;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 20px; border-radius: 0; }
  .site-header { position: relative; }
  .header-inner { position: relative; }
}

@media (max-width: 700px) {
  .slides { height: 430px; }
  .hero-video { height: 480px; }
  .hero-stripes { display: none; }
  .matchbar { margin-top: 18px; }
  .matchcard { grid-template-columns: 1fr; text-align: center; gap: 14px; padding: 20px 16px; }
  .matchcard .team, .matchcard .team.away { justify-content: center; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 14px 12px; }
  .result-row .t b { font-size: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
