@font-face {
  font-family: 'Tajawal';
  src: url(/fonts/Tajawal-medium.ttf);
}
@font-face {
  font-family: 'numfont';
  src: url(/fonts/Montserrat-Regular.ttf);
}

body {
  margin: 0;
  font-family: 'Tajawal', Tahoma, sans-serif;
  direction: rtl;
  background-color: #f7f9fb;
}
*, *::before, *::after {
  box-sizing: border-box;
}
a {
  text-decoration: none;
  color: #333;
}
header {
  background-color: #000;
  border-bottom: none;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
}

.container {
  max-width:1000px; margin:20px auto; padding:10px 15px; border-radius:12px; direction:rtl;
}
header .container { margin: 0 auto ; } /* prevent collapsing margin under sticky header */


.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: #fff;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
}

nav ul li {
  position: relative;
}

nav ul li a {
  color: #fff !important;
  font-weight: bold;
  font-size: 16px;
  padding: 10px;
  display: block;
  text-decoration: none;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.has-dropdown:hover .dropdown {
  display: block;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 150px;
  z-index: 1000;
  background-color: #000;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown li a {
  padding: 8px 12px;
  color: #fff !important;
}

.dropdown li a:hover {
  background-color: #333;
}

.opacity-min {
  opacity: 1;
}

.opacity-max {
  opacity: 0.4;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #ccc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  padding: 5px;
  flex: 1 1 calc(50% - 10px);
  min-width: 0;
}

.section-title {
  font-size: 18px;
  margin: 6px 0 10px;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}

.stats-table {
  width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
  border-collapse: collapse;
}

.stats-table th {
  background-color: #eee;
}

.stats-table td,
.stats-table th {
  text-align: center;
  padding: 5px;
  border-bottom: 1px solid #eee;
}

.stats-table td img {
  width: 30px;
  height: auto;
  max-width: 100%;
  border-radius: 50%;
  border: 1px solid #ccc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.news-slider {
  position: relative;
  overflow: hidden;
  margin-top: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  height: 450px;
  direction: rtl;
}

/* The transformed element must sit UNDER the arrows */
.news-track {
  display: flex;
  /* width: 500%;  <-- remove this (let flex size it dynamically) */
  height: 100%;
  transition: transform .6s ease-in-out;
  position: relative;
  z-index: 0;              /* behind the nav buttons */
}

.news-item { flex: 0 0 100%; max-width: 100%; height: 100%; position: relative; }

.news-item img {
  width: 100%;
  height: 100%;            /* fill the full 350px height */

  display: block;
}

.news-title {
  position: absolute; bottom: 0; width: 100%;
  background: #666;
  color: #fff; padding: 12px; font-size: 18px; font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  z-index: 1;
}

/* Arrows must be ABOVE the track */
.news-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.6); color: #fff; padding: 10px;
  font-size: 24px; border-radius: 50%; cursor: pointer;
  z-index: 2;                          /* higher than .news-track */
  display: flex; align-items: center; justify-content: center;
}
.news-nav.left  { right: 10px; }
.news-nav.right { left: 10px; }

.match-card.spaced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.team-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  text-align: center;
padding-top:10px;  
padding-bottom: 15px;
}

.stick-right {
  align-items: flex-end;
}

.stick-left {
  align-items: flex-start;
}

.team-flag {
  width: 50px;
  height: 33px;
  border-radius: 2px;
  border: 1px solid #000;
}

.tourflag {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #999;
  opacity: 0.85;
}

.tourtabs {
  border-bottom: 2px solid #ccc;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w3-black {
  background: #000;
  color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    background: #000;
    color: #fff;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    display: none;
    border-top: 1px solid #ddd;
  }

  nav ul li a {
    color: #fff;
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .row {
    flex-direction: column;
    width: 100%;
    flex-wrap: wrap;
    overflow-x: hidden;
  }

 .news-slider{ height: 220px; }           /* a bit shorter on phones */

  /* Stop cropping on phones */
  .news-item img{
    height: 100%;
    object-fit: contain;                   /* show full image (letterboxed) */
    background: #000;                      /* black bars look fine with photos */
  }

  /* Add a gradient overlay ABOVE the image but BELOW the title */
  .news-item{ position: relative; }
  .news-item::after{
    content:"";
    position:absolute; inset:0;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent 60%);
    z-index: 1;
    pointer-events: none;
  }

  /* Ensure the title is on top and readable */
  .news-title{
    font-size: 13px;
    line-height: 1.2;
    padding: 8px 10px;
    z-index: 2;                            /* above ::after and image */
    display: block !important;             /* in case any mobile CSS hides it */
    background: transparent;               /* gradient comes from ::after */
  }

  /* Tighter arrows on phones */
  .news-nav{
    font-size: 18px;
    padding: 8px;
    z-index: 3;                            /* always above everything */
  }
}
