*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ===== Reset & Base ===== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #d7d6d6;
  color: #333;
}

.container {
  width: 95%;
  max-width: 1200px;
  margin: auto;
}

/* ===== Header ===== */
header {
  background: #2C6569;
  color: #fff;
  padding: 4px 0;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-logo {
  width: 55px;
  height: 55px;
  margin-top: 5px;
  object-fit: contain;
  border-radius: 100%;
}

.site-text {
  text-align: left;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-title {
  font-size: 1.8rem;
  margin: 0;
}

.site-tagline {
  margin: 0;
  color: #ffffff !important;
  font-weight: 500;
  text-shadow: 0 0 4px rgba(0,0,0,0.2);
  letter-spacing: 0.3px;
}

/* ===== Hamburger ===== */
.hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  cursor: pointer;
  margin-left: auto;
  padding-right: 10px;
}

.hamburger span {
  height: 3px;
  width: 20px;
  background: #fff;
  margin: 2px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hamburger animation */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Category Bar (Large Screens) ===== */
.category-bar {
  background: transparent;
  padding: 0 10px;
  white-space: nowrap;
  margin-left: 150px;
  position: relative;
  z-index: 1000;
  flex: 1;
}

.category-bar ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-bar ul li {
  margin-right: 20px;
}

.category-bar ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 12px 0;
  display: block;
  transition: all 0.3s ease;
}

.category-bar ul li a:hover {
  color: #ffd700;
  text-shadow: 0 0 3px rgba(0,0,0,0.3);
}

/* ===== Drawer Menu (Mobile) ===== */
.drawer-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 10%;
  right: -60%;
  width: 60%;
  background: #2C6569;
  z-index: 1002;
  transition: right 0.35s ease;
  box-shadow: -2px 0 15px rgba(0,0,0,0.25);
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;

  height: auto;          /* ⭐ key */
  max-height: 90vh;      /* ⭐ limit */
  overflow-y: auto;      /* scroll only if needed */
  padding-top: 20px;
}
/* Style bullets properly */
.drawer-menu ul li a {
  color: #ffffff;
  font-size: 1.1rem;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.drawer-menu ul li a::before {
  font-size: 1rem;
  margin-right: 12px;
  opacity: 0.85;
}

/* Individual symbols */
.drawer-menu a.home::before { content: "◉"; color: #dfe6ed; }
.drawer-menu a.pakistan::before { content: "☪"; color: #6fd19c; }
.drawer-menu a.afghanistan::before { content: "✦"; color: #e6c57a; }
.drawer-menu a.india::before { content: "☀"; color: #f4b860; }
.drawer-menu a.islam::before { content: "☪"; color: #4dd6a0; }
.drawer-menu a.international::before { content: "🌐"; color: #9ac8ff; }
.drawer-menu a.tech::before { content: "⚙"; color: #cfd8dc; }
.drawer-menu a.health::before { content: "✚"; color: #f28b82; }

/* Hover effect — subtle */
.drawer-menu ul li a:hover {
  background: rgba(255,255,255,0.08);
  padding-left: 26px;
}



.drawer-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-menu ul li {
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

.drawer-menu ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 15px 20px;
  display: block;
  transition: all 0.3s ease;
}

.drawer-menu ul li a:hover {
  background: rgba(255,255,255,0.1);
  padding-left: 25px;
}

/* Show drawer */
.drawer-menu.show {
  right: 0;
}

/* Overlay */
#drawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 1001;
}

#drawerOverlay.show {
  opacity: 1;
  visibility: visible;
}

/* Scrollbar styling */
.drawer-menu::-webkit-scrollbar {
  width: 6px;
}

.drawer-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

/* ===== Responsive (Mobile) ===== */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger {
    display: flex;
  }
  
  .site-title {
  font-size: 1.4rem;
  margin: 0;
}

  /* Hide large screen menu */
  .category-bar {
    display: none !important;
  }
}

/* ===== Layout ===== */
.main-grid {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

/* Smooth fade animation (if needed elsewhere) */
@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Page Title & Wrapper ===== */
.page-title { text-align: center; font-size: 2rem; margin: 20px 0; color: #1a73e8; }
.cat-wrapper {
  display: flex;
  gap: 20px;
  width: 96%;
  margin: 10px auto;
  max-width: 1400px;
  align-items: flex-start;
  overflow: visible;
  padding: 0;
}

/* ===== Left Column ===== */
.cat-posts {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* Left sidebar category items alternate background */
.cat-posts .cat-item:nth-child(odd) {
    background: #d9e3fe;
}

.cat-posts .cat-item:nth-child(even) {
    background: #e7fcd4;
}

/* Hover effect (same as right sidebar) */
.cat-posts .cat-item:hover {
    background: #eaf2ff;
    transform: translateY(-2px);
    transition: 0.2s ease;
}


/* Section Title */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #1a73e8;
  direction: rtl;       /* Urdu right-to-left */
  text-align: right;
  white-space: nowrap;  /* single line */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Single Category Item */
.cat-item {
  display: flex;
  gap: 15px;
  padding: 12px;
  border-radius: 8px;
  background: #ebfff3;
  margin-bottom: 16px;
  text-decoration: none;
  color: #333;
  align-items: flex-start;
}

/* Category Item Image */
.cat-item img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Text Wrapper */
.cat-text {
  min-width: 0;
}

/* Article Heading (h3) */
.cat-text h3.cat-title {
  font-size: 1rem;          /* smaller size for mobile and clean look */
  line-height: 1.2;
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;       /* single line */
  direction: rtl;            /* Urdu */
  text-align: right;
}

/* Article Description */
/* ===== Section Title & DB Headings ===== */
.section-title,
.cat-text h3.cat-title,
.cat-posts h1,
.cat-posts h1 * {
  all: unset;                /* reset browser styles */
  display: block;
  width: 100%;
  font-size: 1.4rem;           /* adjust size */
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl !important;    /* Urdu right-to-left */
  text-align: right !important; /* force alignment */
  
  /* Mobile wrapping fix */
  white-space: normal;          /* allow wrapping */
  display: -webkit-box;
  -webkit-line-clamp: 1;        /* single line on mobile */
  -webkit-box-orient: vertical;
}

/* ===== Article description ===== */
.cat-text p {
  display: -webkit-box;
  -webkit-line-clamp: 2;        /* two lines max */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  color: #555;
  direction: rtl;
  text-align: right;
}


.left-title{
    margin-top: -15px;
}



/* ===== Right Sidebar ===== */
.sidebar { flex: 0 0 330px; max-width: 380px; min-width: 300px; background: #fff; padding: 8px; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.05); }
.sidebar-title { font-size: 1.3rem; margin-bottom: 10px; color: #1a73e8; text-align: center; margin-top: -5px;}
.sidebar-list { width: 100%; }
.sidebar-item { display: block; text-decoration: none; color: #333; margin-bottom: 14px; border-radius: 8px; padding: 4px; direction: rtl; text-align: right; background: transparent; transition: background .25s, transform .2s; }
.sidebar-item img { width: 100%; height: 170px; object-fit: cover; border-radius: 6px; }
.sidebar-item span { display: block; margin-top: 6px; font-size: 1rem; line-height: 1.3; font-weight: 500; }
.sidebar-item:nth-child(odd) { background: #d9e3fe; }
.sidebar-item:nth-child(even) { background: #e7fcd4; }
.sidebar-item:hover { background: #eaf2ff; transform: translateY(-2px); }

/* ===== Footer Styling ===== */
footer {
  text-align: center;
  padding: 5px;
  background: #1a73e8;
  color: #fff;
  margin-top: 20px;
}

footer {
  background: #2C6569;
  padding-top: 10px;
  text-align: center;
  color: #ffffff;
  font-size: 0.9rem;
  border-top: 1px solid #ddd;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.25); /* subtle contrast glow */
  font-weight: 500;
}

/* Footer links */
.footer-links a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 6px;
  font-weight: 600;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
  transition: color 0.2s, text-shadow 0.2s;
}

.footer-links a:hover {
  color: #ffdd57; /* goldish hover effect */
  text-shadow: 0 0 6px rgba(255, 221, 87, 0.6);
}
/* ===== Desktop Adjustments ===== */
@media (min-width: 1200px) {
  .sidebar { flex: 0 0 380px; max-width: 420px; min-width: 320px; }
  .cat-wrapper { max-width: 1200px; }
  #mobileCatBar { display: none !important;  } /* hide bottom mobile categories on large screens */
}

/* ===== Mobile (max-width:768px) ===== */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  #categoryBar { display: none; flex-direction: column; background: #1558b0; width: 100%; }

  /* Hamburger toggled menu */
  .category-bar.show { display: flex !important; flex-direction: column; padding: 8px 0; animation: fadeIn 0.3s ease; }

  /* Vertical category links */
  .category-bar ul { flex-direction: column; width: 100%; list-style: none; margin: 0; padding: 0; }
  .category-bar ul li { margin-left: 0; border-bottom: 1px solid rgba(255,255,255,0.2); }
  .category-bar ul li a { padding: 12px 16px; font-size: 1.1rem; width: 100%; display: block; }

  /* Stack columns */
  .cat-wrapper { display: flex; flex-direction: column; width: 97%;
  }
  .cat-posts, .sidebar { width: 100%; max-width: 100%; flex: unset; min-width: 0; }

  .cat-item { flex-direction: column; gap: 5px; }
  .cat-item img { width: 100%; height: 180px; }

  /* Article description two lines */
  .cat-text h3 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
  .cat-text p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; line-height: 1.45; margin-bottom: 8px; }

  /* Mobile bottom categories (row wrap) */
  #mobileCatBar { display: block; background: #a7f2f6; padding: 10px; width: 100%; border-radius: 10px;}
  #mobileCatBar ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; row-gap: 16px; list-style: none; margin: 0; padding: 0; }
  #mobileCatBar a { padding: 8px 16px; background: #2C6569; color: #fff; text-decoration: none; font-size: 14px; border-radius: 5px; white-space: nowrap; }
}
