*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

main#main-content {
  width: 100%;
  overflow-x: hidden;
}


body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: linear-gradient(to bottom, #ffffff, #fafafa); /* Gradient from white to grey */
  color: #fff;
  overflow-x: hidden;
}

    header {
      text-align: center;
      padding-top: 1.5rem;
    }
    header img {
      height: 115px;
      max-width: 100%;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 1rem;
      padding: 1.2rem;
    }
    .grid-item {
      position: relative;
      border-radius: 1.9rem;
      overflow: hidden;
      min-height: 300px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      box-shadow: 0 0 10px rgba(200, 200, 200, 0.25);
      transition: box-shadow 0.3s ease;
    }
    .grid-item.cat-السعودية { background-color: #eef4ee; color: #000; }
    .grid-item.cat-الإمارات { background-color: #eceff7; color: #000; }
    .grid-item.cat-شركات-وأعمال { background-color: #f3f1df; color: #000; }
    .grid-item.cat-أسلوب-حياة { background-color: #f8f2fb; color: #000; }
    .grid-item.cat-رياضة { background-color: #e6f2f5; color: #000; }
    .grid-item.cat-إقتصاد { background-color: #f7ebeb; color: #000; }
    .grid-item.cat-منوعات { background-color: #ede8f7; color: #000; }
    .grid-item.cat-ثقافة-وفن { background-color: #f7ede6; color: #000; }
    .grid-item.cat-تكنولوجيا { background-color: #eff1f9; color: #000; }
    .grid-item.cat-بودكاست { background-color: #eceff7; color: #000; }
    .grid-item.cat-default { background-color: #000; color: #fff; }

.grid-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.grid-link:hover .grid-item {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.10);
}

.bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: 100%;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.05);
  will-change: transform, opacity;
  transform-origin: center center;
  transition: opacity 1.5s ease-in-out, transform 2s ease;
  z-index: 0;
  filter: blur(0px);
-webkit-mask-image: linear-gradient(
  to bottom,
  rgba(0, 0, 0, 1) 0%,
  rgba(0, 0, 0, 1) 35%,
  rgba(0, 0, 0, 0) 55%
);
mask-image: linear-gradient(
  to bottom,
  rgba(0, 0, 0, 1) 0%,
  rgba(0, 0, 0, 1) 35%,
  rgba(0, 0, 0, 0) 55%
);

}


    .bg-layer.show {
      opacity: 1;
      transform: scale(1);
    }
    .overlay {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background-color: #000;
      opacity:0;
      z-index: 1;
    }

.content {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.5s ease, transform 1.5s ease;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center horizontally */
  text-align: center;  /* Center text */
}

    .content.show {
      opacity: 1;
      transform: translateY(0);
    }
    .category, .title, .date {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 1s ease, transform 1s ease;
    }
    .content.show .category,
    .content.show .title,
    .content.show .date {
      opacity: 1;
      transform: translateY(0);
    }
    .category {
      padding: 0.2rem 0.8rem;
      border-radius: 999px;
      display: inline-block;
      margin-bottom: 0.5rem;
      font-size: 1rem;
    }
    .cat-السعودية { background-color: #cae3ca; color: #000; }
    .cat-الإمارات { background-color: #eceff7; color: #000; }
    .cat-شركات-وأعمال { background-color: #e8e0a7; color: #000; }
    .cat-أسلوب-حياة { background-color: #f5e3ff; color: #000; }
    .cat-رياضة { background-color: #bfe8f2; color: #000; }
    .cat-إقتصاد { background-color: #ffcfcf; color: #000; }
    .cat-منوعات { background-color: #e0d4ff; color: #000; }
    .cat-ثقافة-وفن { background-color: #ffdabf; color: #000; }
    .cat-تكنولوجيا { background-color: #dbe0ff; color: #000; }
    .cat-بودكاست { background-color: #eceff7; color: #000; }
    .cat-default { background-color: #000; color: #fff; }

    .title {
      font-size: 1.3rem;
      font-weight: 600;
      margin-bottom: 0.4rem;
      color: #000;
      text-decoration: none;
      display: block;
    }
    .date {
      font-size: 0.9rem;
      color: #000;
    }

    .spinner {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 30px;
      height: 30px;
      border: 4px solid rgba(255,255,255,0.2);
      border-top: 4px solid #fff;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      z-index: 4;
      display: none;
    }
    .spinner.show {
      display: block;
    }

    @keyframes spin {
      0% { transform: translate(-50%, -50%) rotate(0deg); }
      100% { transform: translate(-50%, -50%) rotate(360deg); }
    }

.live-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.09);
  color: #000;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem 0.15rem 0.7rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  margin-inline-start: 0.5rem;
  vertical-align: middle;
}


.live-dot {
  width: 6px;
  height: 6px;
  margin-left: 6px;
  background-color: black;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}


.site-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 1.5rem;
  gap: 1rem;
}

.site-header img {
  height: 115px;
  max-width: 100%;
  transition: opacity 0.3s ease;
}

.site-header input {
  position: absolute;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  opacity: 0;
  padding: 0.3rem 0.5rem;
  font-size: 1rem;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  border-radius: 20px;
  border: 1px solid #ccc;
  outline: none;
  transition: width 0.4s ease, opacity 0.3s ease;
}

.site-header input.open {
  width: 200px;
  opacity: 1;
}

.site-header button {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s;
}

.site-header button:hover {
  background: rgba(0, 0, 0, 0);
}

.grid-item.skeleton {
  background-color: #f0f0f0;
  position: relative;
  min-height: 300px;
  border-radius: 1.9rem;
  overflow: hidden;
  animation: pulse 1.5s infinite ease-in-out;
}

.grid-item.skeleton::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #eaeaea 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* categories tab */

/* Category tab container */
.category-tabs {
  display: flex;
  justify-content: center; /* Center on desktop */
  gap: 0.5rem;
  overflow-x: auto; /* Enable horizontal scrolling */
  padding: 0 1rem; /* Add some padding to avoid buttons touching the edges */
  margin-bottom: 1rem;
  flex-wrap: nowrap; /* Prevent wrapping */
  width: 100%; /* Ensure the container spans the full width of the screen */
  box-sizing: border-box; /* Ensure padding is included in total width */
}

/* Category button styles */
.category-tabs button {
  flex: none; /* Prevent buttons from stretching */
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #f6f6f6;
  color: #333;
  font-size: 0.95rem;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: background 0.3s;
  min-width: 100px; /* Ensure the buttons have a minimum width for clarity */
}

@media (max-width: 768px) {
  .category-tabs {
        justify-content: flex-start; /* Align to start on mobile */
  }
}

.category-tabs .skeleton-btn {
  flex: none;
  height: 36px;
  min-width: 100px;
  border-radius: 2rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #eaeaea 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: none;
}



.category-nav {
  display: flex;
  justify-content: center;    /* center all buttons */
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;            /* wrap on narrow screens */
}

.category-nav button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 1.5rem;
  background: white;
  color: #000;
  font-size: 1rem;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  cursor: pointer;
  transition: background 0.3s;
}

.category-nav button.active {
  background: #fff;
  color: #000;
}

.category-nav button:hover {
  background: white;
}

/* Footer Styles */
footer {
  background: transparent;
  color: #000;
  text-align: center;
  padding: 2rem 1rem;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.footer-container {
  max-width: 900px;
  margin: auto;
}

.footer-social a {
  margin-bottom: 15px;
  margin-inline-start: 0.7rem;
  display: inline-block;
  width: 35px;
  height: 35px;
  background-color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 35px;
  box-shadow: 0 0px 2px rgba(0, 0, 0, 0.1);
}

.footer-social i {
  font-size: 20px;
  color: #000;
  vertical-align: middle;
}

.footer-links a {
  color: #000;
  font-size: 14px;
  margin: 0 0.1rem;
  text-decoration: none;
}

@media (max-width: 768px) {
  .footer-links a {
  font-size: 12.5px;
  margin: 0 0.1rem;
}
}

.footer-note {
  color: #494949;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  margin-bottom: 1.1rem;
  min-height: 40px;
}

.footer-download img {
  height: 47px;
  margin-top: 0rem;
  margin-bottom: 1.3rem;
}

  /* Hide App Store button by default */
  #footer-appstore {
    display: none;
  }


/* NewsGrid Space */
#newsGrid {
  min-height: 650px; /* desktop */
  width: 100%;
}

@media (max-width: 600px) {
  /* Set a large min-height to cover typical stacked content height */
  #newsGrid {
    min-height: 2600px; /* or slightly less/more depending on average content length */
  }
}


