/* Newser - News Site Styles */
:root {
  --bg: #ffffff;
  --bg-card: #f8f9fa;
  --text: #1a1a2e;
  --text-secondary: #6c757d;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --header-bg: #1a1a2e;
  --header-text: #ffffff;
}

[data-theme="dark"] {
  --bg: #0f0f23;
  --bg-card: #1a1a3e;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --primary: #60a5fa;
  --primary-hover: #93bbfd;
  --border: #2d2d5e;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
  --header-bg: #1a1a3e;
  --header-text: #e5e7eb;
}

/* RTL Support */
[dir="rtl"] .article-content,
[dir="rtl"] .article-meta {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] .article-content,
[dir="ltr"] .article-meta {
  direction: ltr;
  text-align: left;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--header-text);
  text-decoration: none;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
}

.btn-lang {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--header-text);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-lang:hover {
  background: rgba(255,255,255,0.25);
}

.nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* Main */
.main {
  padding: 2rem 1rem;
  min-height: 70vh;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* News Card */
.news-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card-body {
  padding: 1rem;
}

.category-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.news-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--primary);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Article Page */
.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.article {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: 1.8rem;
  margin: 0.5rem 0;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.article-meta a {
  color: var(--primary);
  text-decoration: none;
}

.article-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.page-header p {
  color: var(--text-secondary);
}

/* About Page */
.about-page {
  max-width: 700px;
  margin: 0 auto;
}

.about-page h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.about-page h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--primary);
}

.about-page p {
  margin-bottom: 0.8rem;
  line-height: 1.7;
}

.about-page ul {
  padding-right: 1.5rem;
  margin-bottom: 0.8rem;
}

.about-page li {
  margin-bottom: 0.4rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.page-link:hover,
.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Footer */
.footer {
  background: var(--header-bg);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .article-header h1 {
    font-size: 1.4rem;
  }
  .nav {
    padding-bottom: 0.3rem;
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: 0.8rem 0;
  }
  .logo {
    font-size: 1.2rem;
  }
  .main {
    padding: 1rem 0.5rem;
  }
}
