/* === Global Reset & Base Styles === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #212121;
  background-color: #ffffff;
}

body {
  line-height: 1.6;
  background-color: #ffffff;
}

/* === Header === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f9f9;
  padding: 10px 20px;
  border-bottom: 2px solid #4caf50;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 50px;
}

.site-name,
.sitename {
  font-weight: 700;
  font-size: 24px;
  color: #4caf50;
  text-decoration: none;
}

.menu-icon {
  font-size: 28px;
  color: #4caf50;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

.top-btn {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.top-btn:hover {
  background-color: #388e3c;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 260px;
  background-color: #ffffff;
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  padding: 20px;
}

.sidebar.visible {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-links,
.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-links li,
.submenu li {
  margin-bottom: 10px;
}

.sidebar-links a,
.submenu a {
  text-decoration: none;
  color: #4caf50;
  font-weight: 600;
}

.submenu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.submenu.hidden {
  display: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.3);
  z-index: 1000;
}

.hidden {
  display: none;
}

/* === Main Content === */
.main-content {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 20px;
}

.featured-article img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
}

.featured-article .section {
  font-size: 14px;
  color: #4caf50;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 8px;
}

.featured-article .article-title {
  font-size: 28px;
  font-weight: 800;
  color: #212121;
  margin-top: 8px;
}

.featured-article .excerpt {
  font-size: 16px;
  color: #555;
  line-height: 1.5;
  margin-top: 8px;
}

/* === Articles Preview === */
.article-preview {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.article-preview img {
  width: 150px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.article-preview h4 {
  font-size: 18px;
  font-weight: 700;
  color: #212121;
}

.article-preview .section {
  font-size: 12px;
  color: #4caf50;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}

/* === Trending === */
.trending-articles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: start;
}

.trending-articles img {
  width: 48%;
  max-width: 480px;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.trending-articles img:hover {
  transform: scale(1.05);
}

/* === More Button === */
.more-btn {
  display: block;
  margin: 10px auto 40px;
  background-color: #4caf50;
  color: #fff;
  border: none;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.more-btn:hover {
  background-color: #388e3c;
}

/* === Footer === */
.main-footer {
  background-color: #f8f8f8;
  padding: 40px 20px 20px;
  color: #333;
  border-top: 1px solid #ddd;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h3 {
  color: #28a745;
  font-size: 1.6em;
  margin-bottom: 10px;
}

.footer-column h4 {
  font-size: 1.2em;
  margin-bottom: 8px;
  color: #333;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 8px;
}

.footer-column ul li a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column ul li a:hover {
  color: #28a745;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 0.95em;
  color: #777;
  border-top: 1px solid #ccc;
  margin-top: 30px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .article-preview {
    flex-direction: column;
  }

  .article-preview img,
  .trending-articles img {
    width: 100%;
    height: auto;
  }

  .site-name {
    display: none;
  }

a.sitename {
  text-decoration: none;
  color: #212121; /* اختياري لتحديد لون النص */
}
}

@media (min-width: 769px) {
  #menu-button,
  #sidebar,
  #overlay {
    display: none !important;
  }

  .left-group {
    margin-right: auto;
    gap: 10px;
  }

  .logo img {
    display: none;
  }

  .site-name {
    color: #4caf50;
    font-size: 26px;
    font-weight: 700;
  }

  .sitename {
    display: none;
  }

  .top-btn {
    margin-left: auto;
  }
}

/* === Utility === */
.article-title a {
  text-decoration: none;
  color: inherit;
}

.article-title a:hover {
  color: #28a745;
}
/* Desktop Nav (Top Center Navigation) */
.desktop-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 40px; /* ← هنا تتحكم في مقدار التحريك */
}


.nav-links {
  list-style: none;
  display: flex;
  gap: 25px;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  text-decoration: none;
  color: #212121;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #4caf50;
}

/* Dropdown menus */
.has-subnav .dropdown {
  display: none;
  position: absolute;
  background: #fff;
  top: 100%;
  left: 0;
  list-style: none;
  padding: 10px 0;
  border: 1px solid #ddd;
  min-width: 180px;
  z-index: 100;
}

.has-subnav:hover .dropdown {
  display: block;
}

.dropdown li {
  padding: 6px 16px;
}

.dropdown li a {
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

.dropdown li a:hover {
  color: #4caf50;
}

/* Show only on large screens */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
}
