/*
Theme Name: KooraLive
Author: Hamza
Version: 2.0.0
Text Domain: kooralive
*/

/* ==========================================================
   1. DESIGN TOKENS
   ========================================================== */
:root{
  --kl-primary:#af1d1d;
  --kl-slate:#273340;
  --kl-bg:#eceef2;
  --kl-block:#fff;
  --kl-card:#eceef2;
  --kl-text:#222;
  --kl-muted:#555;
  --kl-border:#ddd;
  --kl-border2:#d8dbe1;
  --kl-blue:#104783;
  --kl-orange:#af5100;
  --kl-sched:#263545;
  --kl-live:#d00000;
  --kl-livepill:#c81e1e;
  --kl-finished:#474747;
  --kl-soon:#0f6f37;
}

/* ==========================================================
   2. BASE / RESET
   ========================================================== */
*{box-sizing:border-box}
body{
  margin:0;
  background:var(--kl-bg);
  color:var(--kl-text);
  font-family:'Segoe UI',Tahoma,Arial,sans-serif;
  font-size:16px;
  direction:rtl;
}
a{color:inherit}
img{max-width:100%}

.kl-container{
  max-width:1024px;
  margin:0 auto;
  padding:0 12px;
}

/* ==========================================================
   3. HEADER
   ========================================================== */
.kl-header{
  background:#fff;
  margin-bottom:15px;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}
.kl-hwrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  gap:12px;
}

/* Logo */
.kl-logo{
  background:var(--kl-primary);
  color:#fff;
  border-radius:10px;
  padding:8px 24px;
  text-align:center;
  text-decoration:none;
  line-height:1.25;
}
.kl-logo b{display:block;font-size:30px}
.kl-logo span{font-size:19px}

/* Nav */
.kl-nav{display:flex;gap:6px}
.kl-nav a{
  font-size:17px;
  color:#222;
  text-decoration:none;
  padding:8px 10px;
}
.kl-nav a:hover{color:var(--kl-primary)}

/* Socials */
.kl-socials{display:flex;gap:8px;align-items:center}
.kl-soc{
  width:35px;
  height:35px;
  border-radius:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  text-decoration:none;
  font-size:16px;
}
.kl-soc.is-moon{background:#273340}
.kl-soc.is-x{background:#000}
.kl-soc.is-fb{background:#1877f2}
.kl-soc.is-yt{background:#cd201f}
.kl-soc.is-tg{background:#24a1de}

/* Hamburger (mobile) */
.kl-burger{display:none}

/* Timezone tab */
.kl-tz{
  display:inline-block;
  font-size:10px;
  color:#555;
  background:#fff;
  border:1px solid var(--kl-border);
  border-bottom:0;
  border-radius:6px 6px 0 0;
  padding:3px 10px;
  margin:0 12px -1px 0;
  position:relative;
  z-index:2;
}

/* ==========================================================
   4. FIXTURE BLOCK
   ========================================================== */
.kl-block{
  background:var(--kl-block);
  border-radius:8px;
  box-shadow:0 0 4px rgba(0,0,0,.3);
  margin-bottom:15px;
  overflow:hidden;
}
.kl-blockhead{
  background:var(--kl-bg);
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
h2.kl-pill{
  background:var(--kl-primary);
  color:#fff;
  font-size:16px;
  font-weight:700;
  border-radius:999px;
  padding:7px 20px;
  margin:0;
}

/* Day tabs */
.kl-days{display:flex;gap:8px}
a.kl-day{
  font-size:15px;
  font-weight:700;
  color:#fff;
  text-decoration:none;
  border-radius:999px;
  padding:7px 16px;
}
.kl-day.is-yesterday{background:var(--kl-blue)}
.kl-day.is-today{background:var(--kl-primary)}
.kl-day.is-tomorrow{background:var(--kl-orange)}
.kl-day.is-active{
  outline:2px solid #fff;
  outline-offset:-2px;
  box-shadow:0 0 0 2px currentColor;
}

/* ==========================================================
   5. MATCH CARDS
   ========================================================== */
.kl-cards{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.KL_Match{
  position:relative;
  background:var(--kl-card);
  border-radius:8px;
  overflow:hidden;
}
.KL_Row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 10px;
  gap:8px;
}
.KL_Team{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  text-align:center;
  min-width:0;
}
img.KL_Logo{
  width:70px;
  height:70px;
  border-radius:50%;
  object-fit:cover;
  background:#fff;
}
.KL_Name{font-size:16px;color:var(--kl-text)}
.KL_Center{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:110px;
}
.KL_LivePill{
  background:var(--kl-livepill);
  color:#fff;
  font-weight:700;
  font-size:11px;
  line-height:1;
  padding:4px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.KL_Time{font-size:16px}
.KL_Score{font-size:21px;font-weight:700}
.KL_Status{
  font-size:14px;
  color:#fff;
  height:25px;
  min-width:60px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 12px;
}
.KL_Match.is-scheduled .KL_Status{background:var(--kl-sched)}
.KL_Match.is-live .KL_Status{
  background:var(--kl-live);
  animation:klBlink .5s infinite alternate;
}
.KL_Match.is-finished .KL_Status{background:var(--kl-finished)}
.KL_Match.is-soon .KL_Status{background:var(--kl-soon)}

@keyframes klBlink{
  from{opacity:1}
  to{opacity:.5}
}

/* Info bar */
.KL_Info{display:flex;border-top:1px solid var(--kl-border)}
.KL_Info>span{
  flex:1;
  text-align:center;
  font-size:14px;
  color:var(--kl-muted);
  padding:9px 4px;
}
.KL_Info>span+span{border-inline-start:1px solid var(--kl-border)}

/* Card link + hover veil */
a.KL_Link{position:absolute;inset:0;z-index:3}
.KL_Veil{
  position:absolute;
  inset:0;
  z-index:2;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transition:opacity .2s;
  pointer-events:none;
}
.KL_Match:hover .KL_Veil{opacity:1}
.KL_Play{
  width:45px;
  height:45px;
  border-radius:50%;
  background:#fff;
  color:#222;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

/* ==========================================================
   6. NEWS
   ========================================================== */
.kl-news{
  background:var(--kl-block);
  border-radius:8px;
  box-shadow:0 0 4px rgba(0,0,0,.3);
  padding:12px;
  margin-bottom:15px;
}
.kl-newshead{
  display:flex;
  justify-content:flex-end;
  margin-bottom:12px;
}
h2.kl-pill2{
  background:var(--kl-slate);
  color:#fff;
  font-size:16px;
  font-weight:700;
  border-radius:999px;
  padding:7px 20px;
  margin:0;
}
.kl-newsgrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}
.kl-newscard{
  background:var(--kl-card);
  border-radius:8px;
  overflow:hidden;
}
.kl-newscard img{
  width:100%;
  height:160px;
  object-fit:cover;
  display:block;
}
.kl-newscard h3{
  font-size:15px;
  line-height:1.7;
  margin:0;
  padding:10px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.kl-newscard a{text-decoration:none;color:inherit}

/* ==========================================================
   7. SINGLE MATCH / PAGE CONTENT
   ========================================================== */
.kl-mhead{
  position:relative;
  border-radius:8px;
  overflow:hidden;
  background:#222 center/cover;
  min-height:280px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:15px;
}
.kl-mhead::before{
  content:'';
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.59);
}
.kl-mhead-in{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:28px;
}
.kl-mteam{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
img.kl-mcrest{
  width:90px;
  height:90px;
  border-radius:50%;
  object-fit:cover;
  background:#fff;
}
.kl-mname{color:#fff;font-size:18px}
.kl-vs{font-size:80px;font-weight:800;color:#fff}

.kl-h1{font-size:24px;text-align:right;margin:18px 4px}
h2.kl-h2{
  background:var(--kl-bg);
  border-radius:8px;
  font-size:18px;
  padding:10px 14px;
  margin:22px 0 10px;
}
.kl-content p{line-height:2}

/* Info table */
table.kl-info{
  width:100%;
  border-collapse:collapse;
  background:var(--kl-block);
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 0 4px rgba(0,0,0,.15);
}
table.kl-info th,
table.kl-info td{
  padding:12px;
  border-bottom:1px solid var(--kl-border2);
}
table.kl-info tr:last-child th,
table.kl-info tr:last-child td{border-bottom:0}
table.kl-info th{
  text-align:right;
  background:var(--kl-bg);
  width:32%;
  font-weight:700;
}
table.kl-info td{text-align:left}

/* Share buttons */
.kl-share{display:flex;gap:8px;margin:16px 0}
.kl-share a{
  width:38px;
  height:38px;
  border-radius:8px;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:16px;
}

/* ==========================================================
   8. FOOTER + PAGE CARD
   ========================================================== */
.kl-footer{
  background:var(--kl-bg);
  padding:16px 0;
  margin-top:10px;
}
.kl-footer a{
  color:var(--kl-text);
  font-size:14px;
  text-decoration:none;
}

.kl-pagecard{
  background:var(--kl-block);
  border-radius:8px;
  box-shadow:0 0 4px rgba(0,0,0,.3);
  padding:18px;
  margin-bottom:15px;
}

/* ==========================================================
   9. NIGHT MODE
   ========================================================== */
html.kl-night{
  --kl-bg:#0f172a;
  --kl-block:#1e293b;
  --kl-card:#273449;
  --kl-text:#f1f5f9;
  --kl-muted:#cbd5e1;
  --kl-border:#334155;
  --kl-border2:#334155;
}
html.kl-night .kl-header{background:#1e293b}
html.kl-night .kl-nav a{color:#f1f5f9}
html.kl-night img.KL_Logo{background:#0f172a}

/* ==========================================================
   10. RESPONSIVE
   ========================================================== */
@media(max-width:820px){
  .kl-newsgrid{grid-template-columns:repeat(2,1fr)}
  .kl-nav{display:none}
  .kl-burger{display:inline-flex}
}
@media(max-width:520px){
  .kl-newsgrid{grid-template-columns:1fr}
  .KL_Name{font-size:14px}
  .kl-vs{font-size:56px}
  img.kl-mcrest{width:70px;height:70px}
  .kl-h1{font-size:20px}
  .kl-socials .kl-soc.is-x,
  .kl-socials .kl-soc.is-fb,
  .kl-socials .kl-soc.is-yt,
  .kl-socials .kl-soc.is-tg{display:none}
}

/* ==========================================================
   11. REDUCED MOTION
   ========================================================== */
@media(prefers-reduced-motion:reduce){
  .KL_Match.is-live .KL_Status{animation:none}
}

/* ==========================================================
   12. CUSTOMIZER COMPONENTS (alert boxes, ads, logo image,
       article toggles, compact table, widgets)
   ========================================================== */
.kl-alert{margin:12px auto;padding:10px 14px;background:#fff8e1;border:1px solid #ecd27a;border-radius:8px;text-align:center;font-size:14px;color:#5a4a00}
.kl-ad{margin:12px auto;text-align:center;overflow:hidden;max-width:100%}
.kl-ad img{max-width:100%;height:auto}
.kl-logo.is-img img{max-height:64px;width:auto;display:block}
@media(min-width:769px){.kl-thumb.kl-hide-d{display:none!important}}
@media(max-width:768px){.kl-thumb.kl-hide-m{display:none!important}}
.kl-meta{display:flex;flex-wrap:wrap;gap:10px;font-size:13px;color:var(--kl-muted);margin:8px 0}
.kl-meta a{color:inherit;text-decoration:none}
.kl-tags{font-size:13px;color:var(--kl-muted);margin:12px 0}
.kl-related{margin-top:24px}
.kl-related .kl-pill{margin-bottom:12px}
.kl-compact .KL_Info{display:none!important}
.kl-widgets{padding:16px 0}
.kl-widgets .kl-container{display:flex;flex-wrap:wrap;gap:16px}
.kl-fwidget{flex:1 1 200px}
.kl-hide-widgets .kl-widgets{display:none!important}
.kl-copyright{display:block;font-size:13px;color:var(--kl-muted);margin-top:6px}
/* JS status mode: hide LIVE pill unless live; hide score until JS assigns */
.KL_Match:not(.is-live) .KL_LivePill{display:none}
.KL_Match.kl-js .KL_Score{display:none}
.KL_Match.kl-js.is-loading .KL_Status{min-width:60px}
