* { box-sizing: border-box; }
body.news-first {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, #f8fbff 0%, #eef2f7 45%, #e9edf3 100%);
  color: #0f172a;
  font-family: "Tajawal", "Noto Naskh Arabic", "Segoe UI", Arial, sans-serif;
}

.nf-header {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-bottom: 1px solid #d6e2f2;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
}
.nf-header-inner {
  max-width: 1640px;
  margin: 0 auto;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nf-logo img { width: 188px; height: auto; display: block; }
.nf-nav { display: flex; gap: 10px; }
.nf-nav a {
  color: #10213f;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid #d6e2f2;
  border-radius: 999px;
  background: #fff;
}
.nf-nav a:hover {
  border-color: #adc4e3;
  background: #f3f8ff;
}

.nf-main {
  max-width: 1640px;
  margin: 18px auto;
  padding: 0 26px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: start;
  direction: ltr;
}

.nf-news, .nf-matches { direction: rtl; }

.nf-mobile-ticker { display: none; }

.nf-matches {
  background: #fbfdff;
  border: 1px solid #d8e4f5;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .05);
  overflow: hidden;
}
.nf-matches-head {
  padding: 12px;
  border-bottom: 1px solid #d7e3f3;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}
.nf-matches-head h2 {
  margin: 0;
  font-size: 16px;
  color: #10213f;
}
.nf-matches-scroll {
  max-height: none;
  overflow: visible;
  padding: 0;
}
.nf-match-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 9px 10px;
  border-bottom: 1px solid #e0eaf6;
  background: #f8fbff;
}
.nf-match-card:hover { background: #edf4ff; }
.nf-match-card .teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.nf-match-card .team { text-align: center; }
.nf-match-card .team img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d4e0f0;
  border-radius: 50%;
  padding: 4px;
}
.nf-match-card .team strong {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.nf-match-card .score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 96px;
}
.nf-match-card .score span {
  font-size: 22px;
  font-weight: 800;
  color: #0d6ec6;
  line-height: 1;
}
.nf-match-card .score em {
  font-style: normal;
  margin: 0;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fbbf24;
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
}
.nf-match-card .score.live em { background: #ef4444; color: #fff; }
.nf-match-card .score.ended em { background: #6b7280; color: #fff; }
.nf-match-card .score.upcoming em { background: #175ee6; color: #fff; }
.nf-match-card .meta {
  margin-top: 8px;
  text-align: center;
  color: #5f7088;
  font-size: 12px;
}
.nf-empty { padding: 16px; text-align: center; color: #64748b; }

.nf-news {
  min-width: 0;
}
.nf-title-row h1 {
  margin: 0 0 14px;
  color: #10213f;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -.4px;
}
.nf-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  align-items: stretch;
}
.nf-news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d7e3f3;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative;
  height: 100%;
  min-height: 248px;
}
.nf-news-card:nth-child(3n+1)::before {
  background: linear-gradient(90deg, #0f355d, #2563eb, #38bdf8);
}
.nf-news-card:nth-child(3n+2)::before {
  background: linear-gradient(90deg, #7c2d12, #f97316, #f59e0b);
}
.nf-news-card:nth-child(3n)::before {
  background: linear-gradient(90deg, #14532d, #22c55e, #84cc16);
}
.nf-news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, .14);
  border-color: #b8cde8;
}
.nf-news-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0f355d, #2b7abf, #f59e0b);
}
.nf-news-head {
  position: relative;
  aspect-ratio: 16 / 7.2;
  height: auto;
  background:
    linear-gradient(180deg, rgba(8, 37, 18, .12), rgba(8, 37, 18, .46)),
    url('/img/match-detail-stadium.jpg') center/cover no-repeat;
}
.nf-news-card:nth-child(4n+2) .nf-news-head {
  background:
    linear-gradient(180deg, rgba(16, 34, 64, .14), rgba(16, 34, 64, .5)),
    url('/img/match-detail-stadium.jpg') center/cover no-repeat;
}
.nf-news-card:nth-child(4n+3) .nf-news-head {
  background:
    linear-gradient(180deg, rgba(56, 21, 10, .14), rgba(56, 21, 10, .5)),
    url('/img/match-detail-stadium.jpg') center/cover no-repeat;
}
.nf-news-head img {
  position: absolute;
  top: 50%;
  width: 50px;
  height: 50px;
  transform: translateY(-50%);
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d7e3f3;
  padding: 4px;
}
.nf-news-head img.home { right: 12px; }
.nf-news-head img.away { left: 12px; }
.nf-news-head span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #f59e0b;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.85);
}
.nf-news-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.nf-news-body .meta {
  color: #64748b;
  font-size: 11px;
  margin-bottom: 6px;
  font-weight: 700;
}
.nf-news-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #0f1f35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-news-body p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #5a6d86;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.nf-news-load-wrap {
  margin-top: 14px;
  text-align: center;
}
.nf-news-load-btn {
  border: 1px solid #b8cde8;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: #10213f;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all .2s ease;
}
.nf-news-load-btn:hover {
  border-color: #8fb0db;
  background: #e6f0ff;
}
.nf-news-load-btn:disabled {
  opacity: .7;
  cursor: wait;
}
.nf-hidden {
  display: none !important;
}

.nf-footer {
  max-width: 1640px;
  margin: 18px auto 30px;
  padding: 10px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  color: #5f7088;
}
.nf-footer a {
  color: #1d3557;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 991px) {
  .nf-header-inner {
    padding: 10px 12px;
  }
  .nf-logo img { width: 160px; }
  .nf-main {
    grid-template-columns: 1fr;
    padding: 0 10px 16px;
    direction: rtl;
    gap: 10px;
  }
  .nf-mobile-ticker {
    display: block;
    order: 1;
    overflow: hidden;
    border: 1px solid #d7e3f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .07);
  }
  .nf-mobile-ticker-track {
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    padding: 8px 12px;
    animation: nfTicker 72s linear infinite;
  }
  .nf-mobile-ticker-card {
    width: 156px;
    min-width: 156px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #d9e5f4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(15,23,42,.08);
  }
  .nf-mobile-ticker-card .ticker-head {
    position: relative;
    aspect-ratio: 16 / 6;
    height: auto;
    background:
      linear-gradient(180deg, rgba(8,37,18,.12), rgba(8,37,18,.46)),
      url('/img/match-detail-stadium.jpg') center/cover no-repeat;
  }
  .nf-mobile-ticker-card .ticker-head img {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1px solid #d8e4f5;
    padding: 2px;
  }
  .nf-mobile-ticker-card .ticker-head img.home { right: 8px; }
  .nf-mobile-ticker-card .ticker-head img.away { left: 8px; }
  .nf-mobile-ticker-card .ticker-head span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #f59e0b;
    border-radius: 999px;
    padding: 2px 6px;
  }
  .nf-mobile-ticker-card .ticker-body {
    padding: 6px 8px 7px;
  }
  .nf-mobile-ticker-card .ticker-body small {
    display: block;
    color: #64748b;
    font-size: 9px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nf-mobile-ticker-card .ticker-body strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    color: #0f1f35;
  }
  .nf-matches {
    order: 2;
  }
  .nf-news {
    order: 3;
  }
  .nf-news-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .nf-news-card,
  .nf-news-card:nth-child(7n+4),
  .nf-news-card:nth-child(10n+5) {
    grid-column: auto;
  }
  .nf-news-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: stretch;
    border-radius: 14px;
    min-height: 102px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
  }
  .nf-news-head {
    aspect-ratio: auto;
    height: 100%;
    min-height: 102px;
  }
  .nf-news-head img {
    width: 30px;
    height: 30px;
  }
  .nf-news-head span {
    font-size: 10px;
    padding: 3px 8px;
  }
  .nf-news-body {
    padding: 8px 10px 9px;
  }
  .nf-news-body .meta {
    margin-bottom: 4px;
    font-size: 10px;
  }
  .nf-news-body h3 {
    font-size: 13px;
    line-height: 1.32;
    -webkit-line-clamp: 2;
  }
  .nf-news-body p {
    display: -webkit-box;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: #61758f;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .nf-title-row h1 { font-size: 24px; }
  .nf-news-load-wrap {
    margin-top: 10px;
  }
  .nf-news-load-btn {
    width: 100%;
    border-radius: 12px;
  }
}

@media (min-width: 992px) and (max-width: 1400px) {
  .nf-news-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
  .nf-news-card:nth-child(9n+2),
  .nf-news-card:nth-child(9n+7) {
    grid-column: span 2;
  }
  .nf-news-card:nth-child(6n+2) {
    transform: translateY(6px);
  }
  .nf-news-card:nth-child(6n+5) {
    transform: translateY(-4px);
  }
  .nf-news-card:nth-child(4n+1) {
    border-radius: 18px 14px 18px 14px;
  }
  .nf-news-card:nth-child(4n+3) {
    border-radius: 14px 18px 14px 18px;
  }
  .nf-news-card:hover {
    transform: translateY(-6px) rotate(0deg);
  }
  .nf-news-body {
    padding: 9px 10px 10px;
  }
  .nf-news-body h3 {
    font-size: 15px;
    -webkit-line-clamp: 2;
  }
  .nf-news-body p {
    font-size: 12px;
    -webkit-line-clamp: 3;
  }
}

@media (min-width: 1401px) {
  .nf-news-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
  .nf-news-card:nth-child(9n+2),
  .nf-news-card:nth-child(9n+7) {
    grid-column: span 2;
  }
  .nf-news-card:nth-child(6n+2) {
    transform: translateY(8px) rotate(.2deg);
  }
  .nf-news-card:nth-child(6n+5) {
    transform: translateY(-6px) rotate(-.2deg);
  }
  .nf-news-card:nth-child(4n+1) {
    border-radius: 18px 14px 18px 14px;
  }
  .nf-news-card:nth-child(4n+3) {
    border-radius: 14px 18px 14px 18px;
  }
  .nf-news-card:hover {
    transform: translateY(-6px) rotate(0deg);
  }
}

@keyframes nfTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}
